PixelFormat enum
Supported pixel formats in the XVision library.
Defines the color space, channel order, bit depth, and memory layout (packed or planar/semi-planar) used to interpret raw image buffers.
- Inheritance
- Available extensions
Values
- rgb888 → const PixelFormat
-
Packed Red-Green-Blue format.
- Channels: 3 (Red, Green, Blue)
- Bit depth: 8 bits per channel (24 bits total per pixel)
- Layout: Packed sequentially in memory:
[R0, G0, B0, R1, G1, B1, ...] - Typical use cases: Standard web and desktop image processing.
- rgba8888 → const PixelFormat
-
Packed Red-Green-Blue-Alpha format.
- Channels: 4 (Red, Green, Blue, Alpha)
- Bit depth: 8 bits per channel (32 bits total per pixel)
- Layout: Packed sequentially in memory:
[R0, G0, B0, A0, R1, G1, B1, A1, ...] - Typical use cases: Images with transparency support, PNG structures, UI overlays.
- bgra8888 → const PixelFormat
-
Packed Blue-Green-Red-Alpha format.
- Channels: 4 (Blue, Green, Red, Alpha)
- Bit depth: 8 bits per channel (32 bits total per pixel)
- Layout: Packed sequentially in memory:
[B0, G0, R0, A0, B1, G1, R1, A1, ...] - Typical use cases: Windows GDI layouts, standard camera frames on certain systems.
- argb8888 → const PixelFormat
-
Packed Alpha-Red-Green-Blue format.
- Channels: 4 (Alpha, Red, Green, Blue)
- Bit depth: 8 bits per channel (32 bits total per pixel)
- Layout: Packed sequentially in memory:
[A0, R0, G0, B0, A1, R1, G1, B1, ...] - Typical use cases: Legacy formats, specific GPU textures.
- gray8 → const PixelFormat
-
8-bit single-channel grayscale format.
- Channels: 1 (Luminance)
- Bit depth: 8 bits per pixel
- Layout: Single byte per pixel:
[Y0, Y1, Y2, ...] - Typical use cases: Edge detection, morphological operations, high-performance algorithms.
- gray16 → const PixelFormat
-
16-bit single-channel grayscale format.
- Channels: 1 (High-bit-depth Luminance)
- Bit depth: 16 bits per pixel
- Layout: Two bytes per pixel (unsigned short):
[Y0_low, Y0_high, Y1_low, Y1_high, ...] - Typical use cases: Medical imaging, raw camera sensors, depth maps.
- float32 → const PixelFormat
-
32-bit single-channel floating-point format.
- Channels: 1 (Luminance)
- Bit depth: 32 bits per pixel (float32)
- Layout: Four bytes per pixel (IEEE 754 float):
[F0, F1, F2, ...] - Typical use cases: Machine learning model input preprocessing, HDR processing.
- yuv420 → const PixelFormat
-
Planar YUV 4:2:0 format.
- Channels: 3 (Y: Luminance, U/V: Chroma)
- Chroma subsampling: 4:2:0 (horizontal and vertical subsampling by 2)
- Layout: Planar. All Y values first, followed by all U values, followed by all V values.
- Average bits per pixel: 12 bits (1.5 bytes)
- Typical use cases: Video codecs, compression pipelines.
- nv21 → const PixelFormat
-
Semi-planar YUV 4:2:0 format (NV21).
- Channels: 3 (Y: Luminance, U/V: Chroma)
- Chroma subsampling: 4:2:0
- Layout: Semi-planar. A contiguous Y plane followed by an interleaved V/U plane:
[Y0, Y1, ... V0, U0, V1, U1, ...] - Average bits per pixel: 12 bits (1.5 bytes)
- Typical use cases: Default camera preview format on Android OS.
- nv12 → const PixelFormat
-
Semi-planar YUV 4:2:0 format (NV12).
- Channels: 3 (Y: Luminance, U/V: Chroma)
- Chroma subsampling: 4:2:0
- Layout: Semi-planar. A contiguous Y plane followed by an interleaved U/V plane:
[Y0, Y1, ... U0, V0, U1, V1, ...] - Average bits per pixel: 12 bits (1.5 bytes)
- Typical use cases: iOS camera output, video hardware acceleration.
Properties
- bytesPerPixel → double
-
Available on PixelFormat, provided by the PixelFormatProperties extension
Average number of bytes occupied by a single pixel.no setter - channels → int
-
Available on PixelFormat, provided by the PixelFormatProperties extension
Number of logical color/luminance channels present in the format.no setter - hashCode → int
-
The hash code for this object.
no setterinherited
- index → int
-
A numeric identifier for the enumerated value.
no setterinherited
- isPacked → bool
-
Available on PixelFormat, provided by the PixelFormatProperties extension
True if pixel values are packed sequentially in memory (e.g. RGB RGB RGB).no setter - isYuv → bool
-
Available on PixelFormat, provided by the PixelFormatProperties extension
Returns true if the format is planar or semi-planar YUV 4:2:0.no setter - name → String
-
Available on Enum, provided by the EnumName extension
The name of the enum value.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
-
values
→ const List<
PixelFormat> - A constant List of the values in this enum, in order of their declaration.