__init__.pyi 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513
  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, dst: GpuMat | None = ...) -> GpuMat: ...
  144. @_typing.overload
  145. def convertTo(self, rtype: int, stream: Stream, dst: GpuMat | None = ...) -> GpuMat: ...
  146. @_typing.overload
  147. def convertTo(self, rtype: int, dst: GpuMat | None = ..., alpha: float = ..., beta: float = ...) -> GpuMat: ...
  148. @_typing.overload
  149. def convertTo(self, rtype: int, alpha: float, beta: float, stream: Stream, dst: GpuMat | None = ...) -> GpuMat: ...
  150. def assignTo(self, m: GpuMat, type: int = ...) -> None: ...
  151. def row(self, y: int) -> GpuMat: ...
  152. def col(self, x: int) -> GpuMat: ...
  153. @_typing.overload
  154. def rowRange(self, startrow: int, endrow: int) -> GpuMat: ...
  155. @_typing.overload
  156. def rowRange(self, r: cv2.typing.Range) -> GpuMat: ...
  157. @_typing.overload
  158. def colRange(self, startcol: int, endcol: int) -> GpuMat: ...
  159. @_typing.overload
  160. def colRange(self, r: cv2.typing.Range) -> GpuMat: ...
  161. def reshape(self, cn: int, rows: int = ...) -> GpuMat: ...
  162. def locateROI(self, wholeSize: cv2.typing.Size, ofs: cv2.typing.Point) -> None: ...
  163. def adjustROI(self, dtop: int, dbottom: int, dleft: int, dright: int) -> GpuMat: ...
  164. def isContinuous(self) -> bool: ...
  165. def elemSize(self) -> int: ...
  166. def elemSize1(self) -> int: ...
  167. def type(self) -> int: ...
  168. def depth(self) -> int: ...
  169. def channels(self) -> int: ...
  170. def step1(self) -> int: ...
  171. def size(self) -> cv2.typing.Size: ...
  172. def empty(self) -> bool: ...
  173. def cudaPtr(self) -> cv2.typing.IntPointer: ...
  174. def updateContinuityFlag(self) -> None: ...
  175. class GpuData:
  176. ...
  177. class GpuMatND:
  178. ...
  179. class BufferPool:
  180. # Functions
  181. def __init__(self, stream: Stream) -> None: ...
  182. @_typing.overload
  183. def getBuffer(self, rows: int, cols: int, type: int) -> GpuMat: ...
  184. @_typing.overload
  185. def getBuffer(self, size: cv2.typing.Size, type: int) -> GpuMat: ...
  186. def getAllocator(self) -> GpuMat.Allocator: ...
  187. class HostMem:
  188. @property
  189. def step(self) -> int: ...
  190. # Functions
  191. @_typing.overload
  192. def __init__(self, alloc_type: HostMem_AllocType = ...) -> None: ...
  193. @_typing.overload
  194. def __init__(self, rows: int, cols: int, type: int, alloc_type: HostMem_AllocType = ...) -> None: ...
  195. @_typing.overload
  196. def __init__(self, size: cv2.typing.Size, type: int, alloc_type: HostMem_AllocType = ...) -> None: ...
  197. @_typing.overload
  198. def __init__(self, arr: cv2.typing.MatLike, alloc_type: HostMem_AllocType = ...) -> None: ...
  199. @_typing.overload
  200. def __init__(self, arr: GpuMat, alloc_type: HostMem_AllocType = ...) -> None: ...
  201. @_typing.overload
  202. def __init__(self, arr: cv2.UMat, alloc_type: HostMem_AllocType = ...) -> None: ...
  203. def swap(self, b: HostMem) -> None: ...
  204. def clone(self) -> HostMem: ...
  205. def create(self, rows: int, cols: int, type: int) -> None: ...
  206. def reshape(self, cn: int, rows: int = ...) -> HostMem: ...
  207. def createMatHeader(self) -> cv2.typing.MatLike: ...
  208. def isContinuous(self) -> bool: ...
  209. def elemSize(self) -> int: ...
  210. def elemSize1(self) -> int: ...
  211. def type(self) -> int: ...
  212. def depth(self) -> int: ...
  213. def channels(self) -> int: ...
  214. def step1(self) -> int: ...
  215. def size(self) -> cv2.typing.Size: ...
  216. def empty(self) -> bool: ...
  217. class Stream:
  218. # Functions
  219. @_typing.overload
  220. def __init__(self) -> None: ...
  221. @_typing.overload
  222. def __init__(self, allocator: GpuMat.Allocator) -> None: ...
  223. @_typing.overload
  224. def __init__(self, cudaFlags: int) -> None: ...
  225. def queryIfComplete(self) -> bool: ...
  226. def waitForCompletion(self) -> None: ...
  227. def waitEvent(self, event: Event) -> None: ...
  228. @classmethod
  229. def Null(cls) -> Stream: ...
  230. def cudaPtr(self) -> cv2.typing.IntPointer: ...
  231. class Event:
  232. # Functions
  233. def __init__(self, flags: Event_CreateFlags = ...) -> None: ...
  234. def record(self, stream: Stream = ...) -> None: ...
  235. def queryIfComplete(self) -> bool: ...
  236. def waitForCompletion(self) -> None: ...
  237. @staticmethod
  238. def elapsedTime(start: Event, end: Event) -> float: ...
  239. class TargetArchs:
  240. # Functions
  241. @staticmethod
  242. def has(major: int, minor: int) -> bool: ...
  243. @staticmethod
  244. def hasPtx(major: int, minor: int) -> bool: ...
  245. @staticmethod
  246. def hasBin(major: int, minor: int) -> bool: ...
  247. @staticmethod
  248. def hasEqualOrLessPtx(major: int, minor: int) -> bool: ...
  249. @staticmethod
  250. def hasEqualOrGreater(major: int, minor: int) -> bool: ...
  251. @staticmethod
  252. def hasEqualOrGreaterPtx(major: int, minor: int) -> bool: ...
  253. @staticmethod
  254. def hasEqualOrGreaterBin(major: int, minor: int) -> bool: ...
  255. class DeviceInfo:
  256. # Functions
  257. @_typing.overload
  258. def __init__(self) -> None: ...
  259. @_typing.overload
  260. def __init__(self, device_id: int) -> None: ...
  261. def deviceID(self) -> int: ...
  262. def totalGlobalMem(self) -> int: ...
  263. def sharedMemPerBlock(self) -> int: ...
  264. def regsPerBlock(self) -> int: ...
  265. def warpSize(self) -> int: ...
  266. def memPitch(self) -> int: ...
  267. def maxThreadsPerBlock(self) -> int: ...
  268. def maxThreadsDim(self) -> cv2.typing.Vec3i: ...
  269. def maxGridSize(self) -> cv2.typing.Vec3i: ...
  270. def clockRate(self) -> int: ...
  271. def totalConstMem(self) -> int: ...
  272. def majorVersion(self) -> int: ...
  273. def minorVersion(self) -> int: ...
  274. def textureAlignment(self) -> int: ...
  275. def texturePitchAlignment(self) -> int: ...
  276. def multiProcessorCount(self) -> int: ...
  277. def kernelExecTimeoutEnabled(self) -> bool: ...
  278. def integrated(self) -> bool: ...
  279. def canMapHostMemory(self) -> bool: ...
  280. def computeMode(self) -> DeviceInfo_ComputeMode: ...
  281. def maxTexture1D(self) -> int: ...
  282. def maxTexture1DMipmap(self) -> int: ...
  283. def maxTexture1DLinear(self) -> int: ...
  284. def maxTexture2D(self) -> cv2.typing.Vec2i: ...
  285. def maxTexture2DMipmap(self) -> cv2.typing.Vec2i: ...
  286. def maxTexture2DLinear(self) -> cv2.typing.Vec3i: ...
  287. def maxTexture2DGather(self) -> cv2.typing.Vec2i: ...
  288. def maxTexture3D(self) -> cv2.typing.Vec3i: ...
  289. def maxTextureCubemap(self) -> int: ...
  290. def maxTexture1DLayered(self) -> cv2.typing.Vec2i: ...
  291. def maxTexture2DLayered(self) -> cv2.typing.Vec3i: ...
  292. def maxTextureCubemapLayered(self) -> cv2.typing.Vec2i: ...
  293. def maxSurface1D(self) -> int: ...
  294. def maxSurface2D(self) -> cv2.typing.Vec2i: ...
  295. def maxSurface3D(self) -> cv2.typing.Vec3i: ...
  296. def maxSurface1DLayered(self) -> cv2.typing.Vec2i: ...
  297. def maxSurface2DLayered(self) -> cv2.typing.Vec3i: ...
  298. def maxSurfaceCubemap(self) -> int: ...
  299. def maxSurfaceCubemapLayered(self) -> cv2.typing.Vec2i: ...
  300. def surfaceAlignment(self) -> int: ...
  301. def concurrentKernels(self) -> bool: ...
  302. def ECCEnabled(self) -> bool: ...
  303. def pciBusID(self) -> int: ...
  304. def pciDeviceID(self) -> int: ...
  305. def pciDomainID(self) -> int: ...
  306. def tccDriver(self) -> bool: ...
  307. def asyncEngineCount(self) -> int: ...
  308. def unifiedAddressing(self) -> bool: ...
  309. def memoryClockRate(self) -> int: ...
  310. def memoryBusWidth(self) -> int: ...
  311. def l2CacheSize(self) -> int: ...
  312. def maxThreadsPerMultiProcessor(self) -> int: ...
  313. def queryMemory(self, totalMemory: int, freeMemory: int) -> None: ...
  314. def freeMemory(self) -> int: ...
  315. def totalMemory(self) -> int: ...
  316. def isCompatible(self) -> bool: ...
  317. # Functions
  318. @_typing.overload
  319. def createContinuous(rows: int, cols: int, type: int, arr: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
  320. @_typing.overload
  321. def createContinuous(rows: int, cols: int, type: int, arr: GpuMat | None = ...) -> GpuMat: ...
  322. @_typing.overload
  323. def createContinuous(rows: int, cols: int, type: int, arr: cv2.UMat | None = ...) -> cv2.UMat: ...
  324. @_typing.overload
  325. def createGpuMatFromCudaMemory(rows: int, cols: int, type: int, cudaMemoryAddress: int, step: int = ...) -> GpuMat: ...
  326. @_typing.overload
  327. def createGpuMatFromCudaMemory(size: cv2.typing.Size, type: int, cudaMemoryAddress: int, step: int = ...) -> GpuMat: ...
  328. @_typing.overload
  329. def ensureSizeIsEnough(rows: int, cols: int, type: int, arr: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
  330. @_typing.overload
  331. def ensureSizeIsEnough(rows: int, cols: int, type: int, arr: GpuMat | None = ...) -> GpuMat: ...
  332. @_typing.overload
  333. def ensureSizeIsEnough(rows: int, cols: int, type: int, arr: cv2.UMat | None = ...) -> cv2.UMat: ...
  334. def fastNlMeansDenoising(src: GpuMat, h: float, dst: GpuMat | None = ..., search_window: int = ..., block_size: int = ..., stream: Stream = ...) -> GpuMat: ...
  335. def fastNlMeansDenoisingColored(src: GpuMat, h_luminance: float, photo_render: float, dst: GpuMat | None = ..., search_window: int = ..., block_size: int = ..., stream: Stream = ...) -> GpuMat: ...
  336. def getCudaEnabledDeviceCount() -> int: ...
  337. def getDevice() -> int: ...
  338. def nonLocalMeans(src: GpuMat, h: float, dst: GpuMat | None = ..., search_window: int = ..., block_size: int = ..., borderMode: int = ..., stream: Stream = ...) -> GpuMat: ...
  339. def printCudaDeviceInfo(device: int) -> None: ...
  340. def printShortCudaDeviceInfo(device: int) -> None: ...
  341. def registerPageLocked(m: cv2.typing.MatLike) -> None: ...
  342. def resetDevice() -> None: ...
  343. def setBufferPoolConfig(deviceId: int, stackSize: int, stackCount: int) -> None: ...
  344. def setBufferPoolUsage(on: bool) -> None: ...
  345. def setDevice(device: int) -> None: ...
  346. def unregisterPageLocked(m: cv2.typing.MatLike) -> None: ...
  347. def wrapStream(cudaStreamMemoryAddress: int) -> Stream: ...