MXVK Vulkan Framework 0.35.0
C++20 Vulkan rendering framework for practical 2D and 3D application development with SDL3.
Loading...
Searching...
No Matches
mxvk_wrap.media.Camera Class Reference

Public Member Functions

None __init__ (self, int|str|Path source=0)
 Optional OpenCV camera or video reader.
None close (self)
object|None frame (self, *, bool flip_y=False)

Public Attributes

 native = mxvk.Capture()
 Open camera index or video-file source.

Detailed Description

Definition at line 57 of file media.py.

Constructor & Destructor Documentation

◆ __init__()

None mxvk_wrap.media.Camera.__init__ ( self,
int | str | Path source = 0 )

Optional OpenCV camera or video reader.

Definition at line 60 of file media.py.

60 def __init__(self, source: int | str | Path = 0) -> None:
61 ## @brief Open camera index or video-file @p source.
62 if not getattr(mxvk, "has_cv", False):
63 raise RuntimeError("MXVK was built without CV support")
64 self.native = mxvk.Capture()
65 if isinstance(source, int):
66 self.native.open_camera(source)
67 else:
68 self.native.open(str(source))
69

Member Function Documentation

◆ close()

None mxvk_wrap.media.Camera.close ( self)

Definition at line 74 of file media.py.

74 def close(self) -> None:
75 ## @brief Close the camera or video file.
76 if self.native is not None:
77 self.native.close()
78 self.native = None

◆ frame()

object | None mxvk_wrap.media.Camera.frame ( self,
* ,
bool flip_y = False )

Definition at line 70 of file media.py.

70 def frame(self, *, flip_y: bool = False) -> object | None:
71 ## @brief Read the next RGBA NumPy frame, or @c None at end of stream.
72 return self.native.read_rgba(flip_y)
73

Member Data Documentation

◆ native

mxvk_wrap.media.Camera.native = mxvk.Capture()

Open camera index or video-file source.

Definition at line 64 of file media.py.


The documentation for this class was generated from the following file: