__init__.pyi 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511
  1. __all__: list[str] = []
  2. import cv2
  3. import cv2.typing
  4. import typing as _typing
  5. # Enumerations
  6. FEATURE_SET_COMPUTE_10: int
  7. FEATURE_SET_COMPUTE_11: int
  8. FEATURE_SET_COMPUTE_12: int
  9. FEATURE_SET_COMPUTE_13: int
  10. FEATURE_SET_COMPUTE_20: int
  11. FEATURE_SET_COMPUTE_21: int
  12. FEATURE_SET_COMPUTE_30: int
  13. FEATURE_SET_COMPUTE_32: int
  14. FEATURE_SET_COMPUTE_35: int
  15. FEATURE_SET_COMPUTE_50: int
  16. GLOBAL_ATOMICS: int
  17. SHARED_ATOMICS: int
  18. NATIVE_DOUBLE: int
  19. WARP_SHUFFLE_FUNCTIONS: int
  20. DYNAMIC_PARALLELISM: int
  21. FeatureSet = int
  22. """One of [FEATURE_SET_COMPUTE_10, FEATURE_SET_COMPUTE_11, FEATURE_SET_COMPUTE_12, FEATURE_SET_COMPUTE_13, FEATURE_SET_COMPUTE_20, FEATURE_SET_COMPUTE_21, FEATURE_SET_COMPUTE_30, FEATURE_SET_COMPUTE_32, FEATURE_SET_COMPUTE_35, FEATURE_SET_COMPUTE_50, GLOBAL_ATOMICS, SHARED_ATOMICS, NATIVE_DOUBLE, WARP_SHUFFLE_FUNCTIONS, DYNAMIC_PARALLELISM]"""
  23. HostMem_PAGE_LOCKED: int
  24. HOST_MEM_PAGE_LOCKED: int
  25. HostMem_SHARED: int
  26. HOST_MEM_SHARED: int
  27. HostMem_WRITE_COMBINED: int
  28. HOST_MEM_WRITE_COMBINED: int
  29. HostMem_AllocType = int
  30. """One of [HostMem_PAGE_LOCKED, HOST_MEM_PAGE_LOCKED, HostMem_SHARED, HOST_MEM_SHARED, HostMem_WRITE_COMBINED, HOST_MEM_WRITE_COMBINED]"""
  31. Event_DEFAULT: int
  32. EVENT_DEFAULT: int
  33. Event_BLOCKING_SYNC: int
  34. EVENT_BLOCKING_SYNC: int
  35. Event_DISABLE_TIMING: int
  36. EVENT_DISABLE_TIMING: int
  37. Event_INTERPROCESS: int
  38. EVENT_INTERPROCESS: int
  39. Event_CreateFlags = int
  40. """One of [Event_DEFAULT, EVENT_DEFAULT, Event_BLOCKING_SYNC, EVENT_BLOCKING_SYNC, Event_DISABLE_TIMING, EVENT_DISABLE_TIMING, Event_INTERPROCESS, EVENT_INTERPROCESS]"""
  41. DeviceInfo_ComputeModeDefault: int
  42. DEVICE_INFO_COMPUTE_MODE_DEFAULT: int
  43. DeviceInfo_ComputeModeExclusive: int
  44. DEVICE_INFO_COMPUTE_MODE_EXCLUSIVE: int
  45. DeviceInfo_ComputeModeProhibited: int
  46. DEVICE_INFO_COMPUTE_MODE_PROHIBITED: int
  47. DeviceInfo_ComputeModeExclusiveProcess: int
  48. DEVICE_INFO_COMPUTE_MODE_EXCLUSIVE_PROCESS: int
  49. DeviceInfo_ComputeMode = int
  50. """One of [DeviceInfo_ComputeModeDefault, DEVICE_INFO_COMPUTE_MODE_DEFAULT, DeviceInfo_ComputeModeExclusive, DEVICE_INFO_COMPUTE_MODE_EXCLUSIVE, DeviceInfo_ComputeModeProhibited, DEVICE_INFO_COMPUTE_MODE_PROHIBITED, DeviceInfo_ComputeModeExclusiveProcess, DEVICE_INFO_COMPUTE_MODE_EXCLUSIVE_PROCESS]"""
  51. # Classes
  52. class GpuMat:
  53. @property
  54. def step(self) -> int: ...
  55. # Classes
  56. class Allocator:
  57. ...
  58. # Functions
  59. @_typing.overload
  60. def __init__(self, allocator: GpuMat.Allocator = ...) -> None: ...
  61. @_typing.overload
  62. def __init__(self, rows: int, cols: int, type: int, allocator: GpuMat.Allocator = ...) -> None: ...
  63. @_typing.overload
  64. def __init__(self, size: cv2.typing.Size, type: int, allocator: GpuMat.Allocator = ...) -> None: ...
  65. @_typing.overload
  66. def __init__(self, rows: int, cols: int, type: int, s: cv2.typing.Scalar, allocator: GpuMat.Allocator = ...) -> None: ...
  67. @_typing.overload
  68. def __init__(self, size: cv2.typing.Size, type: int, s: cv2.typing.Scalar, allocator: GpuMat.Allocator = ...) -> None: ...
  69. @_typing.overload
  70. def __init__(self, m: GpuMat) -> None: ...
  71. @_typing.overload
  72. def __init__(self, m: GpuMat, rowRange: cv2.typing.Range, colRange: cv2.typing.Range) -> None: ...
  73. @_typing.overload
  74. def __init__(self, m: GpuMat, roi: cv2.typing.Rect) -> None: ...
  75. @_typing.overload
  76. def __init__(self, arr: cv2.typing.MatLike, allocator: GpuMat.Allocator = ...) -> None: ...
  77. @_typing.overload
  78. def __init__(self, arr: GpuMat, allocator: GpuMat.Allocator = ...) -> None: ...
  79. @_typing.overload
  80. def __init__(self, arr: cv2.UMat, allocator: GpuMat.Allocator = ...) -> None: ...
  81. @staticmethod
  82. def defaultAllocator() -> GpuMat.Allocator: ...
  83. @staticmethod
  84. def setDefaultAllocator(allocator: GpuMat.Allocator) -> None: ...
  85. @staticmethod
  86. def getStdAllocator() -> GpuMat.Allocator: ...
  87. @_typing.overload
  88. def create(self, rows: int, cols: int, type: int) -> None: ...
  89. @_typing.overload
  90. def create(self, size: cv2.typing.Size, type: int) -> None: ...
  91. def release(self) -> None: ...
  92. def swap(self, mat: GpuMat) -> None: ...
  93. @_typing.overload
  94. def upload(self, arr: cv2.typing.MatLike) -> None: ...
  95. @_typing.overload
  96. def upload(self, arr: GpuMat) -> None: ...
  97. @_typing.overload
  98. def upload(self, arr: cv2.UMat) -> None: ...
  99. @_typing.overload
  100. def upload(self, arr: cv2.typing.MatLike, stream: Stream) -> None: ...
  101. @_typing.overload
  102. def upload(self, arr: GpuMat, stream: Stream) -> None: ...
  103. @_typing.overload
  104. def upload(self, arr: cv2.UMat, stream: Stream) -> None: ...
  105. @_typing.overload
  106. def download(self, dst: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
  107. @_typing.overload
  108. def download(self, dst: GpuMat | None = ...) -> GpuMat: ...
  109. @_typing.overload
  110. def download(self, dst: cv2.UMat | None = ...) -> cv2.UMat: ...
  111. @_typing.overload
  112. def download(self, stream: Stream, dst: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
  113. @_typing.overload
  114. def download(self, stream: Stream, dst: GpuMat | None = ...) -> GpuMat: ...
  115. @_typing.overload
  116. def download(self, stream: Stream, dst: cv2.UMat | None = ...) -> cv2.UMat: ...
  117. def clone(self) -> GpuMat: ...
  118. @_typing.overload
  119. def copyTo(self, dst: GpuMat | None = ...) -> GpuMat: ...
  120. @_typing.overload
  121. def copyTo(self, stream: Stream, dst: GpuMat | None = ...) -> GpuMat: ...
  122. @_typing.overload
  123. def copyTo(self, mask: GpuMat, dst: GpuMat | None = ...) -> GpuMat: ...
  124. @_typing.overload
  125. def copyTo(self, mask: GpuMat, stream: Stream, dst: GpuMat | None = ...) -> GpuMat: ...
  126. @_typing.overload
  127. def setTo(self, s: cv2.typing.Scalar) -> GpuMat: ...
  128. @_typing.overload
  129. def setTo(self, s: cv2.typing.Scalar, stream: Stream) -> GpuMat: ...
  130. @_typing.overload
  131. def setTo(self, s: cv2.typing.Scalar, mask: cv2.typing.MatLike) -> GpuMat: ...
  132. @_typing.overload
  133. def setTo(self, s: cv2.typing.Scalar, mask: GpuMat) -> GpuMat: ...
  134. @_typing.overload
  135. def setTo(self, s: cv2.typing.Scalar, mask: cv2.UMat) -> GpuMat: ...
  136. @_typing.overload
  137. def setTo(self, s: cv2.typing.Scalar, mask: cv2.typing.MatLike, stream: Stream) -> GpuMat: ...
  138. @_typing.overload
  139. def setTo(self, s: cv2.typing.Scalar, mask: GpuMat, stream: Stream) -> GpuMat: ...
  140. @_typing.overload
  141. def setTo(self, s: cv2.typing.Scalar, mask: cv2.UMat, stream: Stream) -> GpuMat: ...
  142. @_typing.overload
  143. def convertTo(self, rtype: int, stream: Stream, dst: GpuMat | None = ...) -> GpuMat: ...
  144. @_typing.overload
  145. def convertTo(self, rtype: int, dst: GpuMat | None = ..., alpha: float = ..., beta: float = ...) -> GpuMat: ...
  146. @_typing.overload
  147. def convertTo(self, rtype: int, alpha: float, beta: float, stream: Stream, dst: GpuMat | None = ...) -> GpuMat: ...
  148. def assignTo(self, m: GpuMat, type: int = ...) -> None: ...
  149. def row(self, y: int) -> GpuMat: ...
  150. def col(self, x: int) -> GpuMat: ...
  151. @_typing.overload
  152. def rowRange(self, startrow: int, endrow: int) -> GpuMat: ...
  153. @_typing.overload
  154. def rowRange(self, r: cv2.typing.Range) -> GpuMat: ...
  155. @_typing.overload
  156. def colRange(self, startcol: int, endcol: int) -> GpuMat: ...
  157. @_typing.overload
  158. def colRange(self, r: cv2.typing.Range) -> GpuMat: ...
  159. def reshape(self, cn: int, rows: int = ...) -> GpuMat: ...
  160. def locateROI(self, wholeSize: cv2.typing.Size, ofs: cv2.typing.Point) -> None: ...
  161. def adjustROI(self, dtop: int, dbottom: int, dleft: int, dright: int) -> GpuMat: ...
  162. def isContinuous(self) -> bool: ...
  163. def elemSize(self) -> int: ...
  164. def elemSize1(self) -> int: ...
  165. def type(self) -> int: ...
  166. def depth(self) -> int: ...
  167. def channels(self) -> int: ...
  168. def step1(self) -> int: ...
  169. def size(self) -> cv2.typing.Size: ...
  170. def empty(self) -> bool: ...
  171. def cudaPtr(self) -> cv2.typing.IntPointer: ...
  172. def updateContinuityFlag(self) -> None: ...
  173. class GpuData:
  174. ...
  175. class GpuMatND:
  176. ...
  177. class BufferPool:
  178. # Functions
  179. def __init__(self, stream: Stream) -> None: ...
  180. @_typing.overload
  181. def getBuffer(self, rows: int, cols: int, type: int) -> GpuMat: ...
  182. @_typing.overload
  183. def getBuffer(self, size: cv2.typing.Size, type: int) -> GpuMat: ...
  184. def getAllocator(self) -> GpuMat.Allocator: ...
  185. class HostMem:
  186. @property
  187. def step(self) -> int: ...
  188. # Functions
  189. @_typing.overload
  190. def __init__(self, alloc_type: HostMem_AllocType = ...) -> None: ...
  191. @_typing.overload
  192. def __init__(self, rows: int, cols: int, type: int, alloc_type: HostMem_AllocType = ...) -> None: ...
  193. @_typing.overload
  194. def __init__(self, size: cv2.typing.Size, type: int, alloc_type: HostMem_AllocType = ...) -> None: ...
  195. @_typing.overload
  196. def __init__(self, arr: cv2.typing.MatLike, alloc_type: HostMem_AllocType = ...) -> None: ...
  197. @_typing.overload
  198. def __init__(self, arr: GpuMat, alloc_type: HostMem_AllocType = ...) -> None: ...
  199. @_typing.overload
  200. def __init__(self, arr: cv2.UMat, alloc_type: HostMem_AllocType = ...) -> None: ...
  201. def swap(self, b: HostMem) -> None: ...
  202. def clone(self) -> HostMem: ...
  203. def create(self, rows: int, cols: int, type: int) -> None: ...
  204. def reshape(self, cn: int, rows: int = ...) -> HostMem: ...
  205. def createMatHeader(self) -> cv2.typing.MatLike: ...
  206. def isContinuous(self) -> bool: ...
  207. def elemSize(self) -> int: ...
  208. def elemSize1(self) -> int: ...
  209. def type(self) -> int: ...
  210. def depth(self) -> int: ...
  211. def channels(self) -> int: ...
  212. def step1(self) -> int: ...
  213. def size(self) -> cv2.typing.Size: ...
  214. def empty(self) -> bool: ...
  215. class Stream:
  216. # Functions
  217. @_typing.overload
  218. def __init__(self) -> None: ...
  219. @_typing.overload
  220. def __init__(self, allocator: GpuMat.Allocator) -> None: ...
  221. @_typing.overload
  222. def __init__(self, cudaFlags: int) -> None: ...
  223. def queryIfComplete(self) -> bool: ...
  224. def waitForCompletion(self) -> None: ...
  225. def waitEvent(self, event: Event) -> None: ...
  226. @classmethod
  227. def Null(cls) -> Stream: ...
  228. def cudaPtr(self) -> cv2.typing.IntPointer: ...
  229. class Event:
  230. # Functions
  231. def __init__(self, flags: Event_CreateFlags = ...) -> None: ...
  232. def record(self, stream: Stream = ...) -> None: ...
  233. def queryIfComplete(self) -> bool: ...
  234. def waitForCompletion(self) -> None: ...
  235. @staticmethod
  236. def elapsedTime(start: Event, end: Event) -> float: ...
  237. class TargetArchs:
  238. # Functions
  239. @staticmethod
  240. def has(major: int, minor: int) -> bool: ...
  241. @staticmethod
  242. def hasPtx(major: int, minor: int) -> bool: ...
  243. @staticmethod
  244. def hasBin(major: int, minor: int) -> bool: ...
  245. @staticmethod
  246. def hasEqualOrLessPtx(major: int, minor: int) -> bool: ...
  247. @staticmethod
  248. def hasEqualOrGreater(major: int, minor: int) -> bool: ...
  249. @staticmethod
  250. def hasEqualOrGreaterPtx(major: int, minor: int) -> bool: ...
  251. @staticmethod
  252. def hasEqualOrGreaterBin(major: int, minor: int) -> bool: ...
  253. class DeviceInfo:
  254. # Functions
  255. @_typing.overload
  256. def __init__(self) -> None: ...
  257. @_typing.overload
  258. def __init__(self, device_id: int) -> None: ...
  259. def deviceID(self) -> int: ...
  260. def totalGlobalMem(self) -> int: ...
  261. def sharedMemPerBlock(self) -> int: ...
  262. def regsPerBlock(self) -> int: ...
  263. def warpSize(self) -> int: ...
  264. def memPitch(self) -> int: ...
  265. def maxThreadsPerBlock(self) -> int: ...
  266. def maxThreadsDim(self) -> cv2.typing.Vec3i: ...
  267. def maxGridSize(self) -> cv2.typing.Vec3i: ...
  268. def clockRate(self) -> int: ...
  269. def totalConstMem(self) -> int: ...
  270. def majorVersion(self) -> int: ...
  271. def minorVersion(self) -> int: ...
  272. def textureAlignment(self) -> int: ...
  273. def texturePitchAlignment(self) -> int: ...
  274. def multiProcessorCount(self) -> int: ...
  275. def kernelExecTimeoutEnabled(self) -> bool: ...
  276. def integrated(self) -> bool: ...
  277. def canMapHostMemory(self) -> bool: ...
  278. def computeMode(self) -> DeviceInfo_ComputeMode: ...
  279. def maxTexture1D(self) -> int: ...
  280. def maxTexture1DMipmap(self) -> int: ...
  281. def maxTexture1DLinear(self) -> int: ...
  282. def maxTexture2D(self) -> cv2.typing.Vec2i: ...
  283. def maxTexture2DMipmap(self) -> cv2.typing.Vec2i: ...
  284. def maxTexture2DLinear(self) -> cv2.typing.Vec3i: ...
  285. def maxTexture2DGather(self) -> cv2.typing.Vec2i: ...
  286. def maxTexture3D(self) -> cv2.typing.Vec3i: ...
  287. def maxTextureCubemap(self) -> int: ...
  288. def maxTexture1DLayered(self) -> cv2.typing.Vec2i: ...
  289. def maxTexture2DLayered(self) -> cv2.typing.Vec3i: ...
  290. def maxTextureCubemapLayered(self) -> cv2.typing.Vec2i: ...
  291. def maxSurface1D(self) -> int: ...
  292. def maxSurface2D(self) -> cv2.typing.Vec2i: ...
  293. def maxSurface3D(self) -> cv2.typing.Vec3i: ...
  294. def maxSurface1DLayered(self) -> cv2.typing.Vec2i: ...
  295. def maxSurface2DLayered(self) -> cv2.typing.Vec3i: ...
  296. def maxSurfaceCubemap(self) -> int: ...
  297. def maxSurfaceCubemapLayered(self) -> cv2.typing.Vec2i: ...
  298. def surfaceAlignment(self) -> int: ...
  299. def concurrentKernels(self) -> bool: ...
  300. def ECCEnabled(self) -> bool: ...
  301. def pciBusID(self) -> int: ...
  302. def pciDeviceID(self) -> int: ...
  303. def pciDomainID(self) -> int: ...
  304. def tccDriver(self) -> bool: ...
  305. def asyncEngineCount(self) -> int: ...
  306. def unifiedAddressing(self) -> bool: ...
  307. def memoryClockRate(self) -> int: ...
  308. def memoryBusWidth(self) -> int: ...
  309. def l2CacheSize(self) -> int: ...
  310. def maxThreadsPerMultiProcessor(self) -> int: ...
  311. def queryMemory(self, totalMemory: int, freeMemory: int) -> None: ...
  312. def freeMemory(self) -> int: ...
  313. def totalMemory(self) -> int: ...
  314. def isCompatible(self) -> bool: ...
  315. # Functions
  316. @_typing.overload
  317. def createContinuous(rows: int, cols: int, type: int, arr: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
  318. @_typing.overload
  319. def createContinuous(rows: int, cols: int, type: int, arr: GpuMat | None = ...) -> GpuMat: ...
  320. @_typing.overload
  321. def createContinuous(rows: int, cols: int, type: int, arr: cv2.UMat | None = ...) -> cv2.UMat: ...
  322. @_typing.overload
  323. def createGpuMatFromCudaMemory(rows: int, cols: int, type: int, cudaMemoryAddress: int, step: int = ...) -> GpuMat: ...
  324. @_typing.overload
  325. def createGpuMatFromCudaMemory(size: cv2.typing.Size, type: int, cudaMemoryAddress: int, step: int = ...) -> GpuMat: ...
  326. @_typing.overload
  327. def ensureSizeIsEnough(rows: int, cols: int, type: int, arr: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
  328. @_typing.overload
  329. def ensureSizeIsEnough(rows: int, cols: int, type: int, arr: GpuMat | None = ...) -> GpuMat: ...
  330. @_typing.overload
  331. def ensureSizeIsEnough(rows: int, cols: int, type: int, arr: cv2.UMat | None = ...) -> cv2.UMat: ...
  332. def fastNlMeansDenoising(src: GpuMat, h: float, dst: GpuMat | None = ..., search_window: int = ..., block_size: int = ..., stream: Stream = ...) -> GpuMat: ...
  333. def fastNlMeansDenoisingColored(src: GpuMat, h_luminance: float, photo_render: float, dst: GpuMat | None = ..., search_window: int = ..., block_size: int = ..., stream: Stream = ...) -> GpuMat: ...
  334. def getCudaEnabledDeviceCount() -> int: ...
  335. def getDevice() -> int: ...
  336. def nonLocalMeans(src: GpuMat, h: float, dst: GpuMat | None = ..., search_window: int = ..., block_size: int = ..., borderMode: int = ..., stream: Stream = ...) -> GpuMat: ...
  337. def printCudaDeviceInfo(device: int) -> None: ...
  338. def printShortCudaDeviceInfo(device: int) -> None: ...
  339. def registerPageLocked(m: cv2.typing.MatLike) -> None: ...
  340. def resetDevice() -> None: ...
  341. def setBufferPoolConfig(deviceId: int, stackSize: int, stackCount: int) -> None: ...
  342. def setBufferPoolUsage(on: bool) -> None: ...
  343. def setDevice(device: int) -> None: ...
  344. def unregisterPageLocked(m: cv2.typing.MatLike) -> None: ...
  345. def wrapStream(cudaStreamMemoryAddress: int) -> Stream: ...