◆ ApplyMatTransformations()
static Mat OpenCVForUnity.UnityUtils.Helper.Source2MatHelperUtils.ApplyMatTransformations |
( |
Mat | inputMat, |
|
|
Mat | rotated90Mat, |
|
|
bool | flipVertical, |
|
|
bool | flipHorizontal ) |
|
static |
Apply Mat transformations based on IMatTransformationProvider settings.
- Parameters
-
inputMat | Input mat to transform. |
rotated90Mat | The rotated Mat output. If null, no rotation will be performed. If not null, must have the same CVType as inputMat and dimensions swapped (width=height, height=width). |
flipVertical | Whether to flip vertically. |
flipHorizontal | Whether to flip horizontally. |
- Returns
- Transformed mat.
The rotated90Mat parameter must be pre-allocated with the correct dimensions and CVType to prevent any memory allocation during rotation. If rotated90Mat is null, the method will return inputMat without rotation.
◆ Channels()
Gets the number of channels for the specified color format.
- Parameters
-
- Returns
- Number of channels. Returns 1 for GRAY, 3 for RGB/BGR, 4 for RGBA/BGRA. Returns 4 for unknown formats.
Channel counts for each color format:
- GRAY: 1 channel
- RGB/BGR: 3 channels
- RGBA/BGRA: 4 channels
◆ ColorConversionCodes()
Gets the OpenCV color conversion code needed for converting between two color formats.
- Parameters
-
srcType | The source color format |
dstType | The destination color format |
- Returns
- OpenCV color conversion code. Returns -1 if conversion is not possible.
Supported color format conversions:
- GRAY ⇔ RGB/BGR/RGBA/BGRA
- RGB ⇔ GRAY/BGR/RGBA/BGRA
- BGR ⇔ GRAY/RGB/RGBA/BGRA
- RGBA ⇔ GRAY/RGB/BGR/BGRA
- BGRA ⇔ GRAY/RGB/BGR/RGBA
The documentation for this class was generated from the following file: