class PixelFormat
Defined at line 29 of file ../../src/graphics/display/lib/api-types/cpp/pixel-format.h
Equivalent to the FIDL type [`fuchsia.images2/PixelFormat`].
See `::fuchsia_images2::wire::PixelFormat` for references.
Instances are guaranteed to represent values supported by the display stack.
This is a value type. Instances can be stored in containers. Copying, moving
and destruction are trivial.
Public Members
static PixelFormat kR8G8B8A8
static PixelFormat kB8G8R8A8
static PixelFormat kI420
static PixelFormat kNv12
static PixelFormat kYuy2
static PixelFormat kYv12
static PixelFormat kB8G8R8
static PixelFormat kR5G6B5
static PixelFormat kR3G3B2
static PixelFormat kL8
static PixelFormat kR8
static PixelFormat kA2R10G10B10
static PixelFormat kA2B10G10R10
static PixelFormat kP010
static PixelFormat kR8G8B8
Public Methods
std::string_view ToString ()
Returns a developer-facing string representation.
Defined at line 23 of file ../../src/graphics/display/lib/api-types/cpp/pixel-format.cc
void PixelFormat (const PixelFormat & )
Defined at line 38 of file ../../src/graphics/display/lib/api-types/cpp/pixel-format.h
void PixelFormat (PixelFormat && )
Defined at line 39 of file ../../src/graphics/display/lib/api-types/cpp/pixel-format.h
PixelFormat & operator= (const PixelFormat & )
Defined at line 40 of file ../../src/graphics/display/lib/api-types/cpp/pixel-format.h
PixelFormat & operator= (PixelFormat && )
Defined at line 41 of file ../../src/graphics/display/lib/api-types/cpp/pixel-format.h
void ~PixelFormat ()
Defined at line 42 of file ../../src/graphics/display/lib/api-types/cpp/pixel-format.h
bool IsSupported (fuchsia_images2::wire::PixelFormat fidl_pixel_format)
True iff `fidl_pixel_format` is convertible to a valid PixelFormat.
Defined at line 107 of file ../../src/graphics/display/lib/api-types/cpp/pixel-format.h
void PixelFormat (fuchsia_images2::wire::PixelFormat fidl_pixel_format)
`fidl_pixel_format` must be a format supported by the display stack.
Defined at line 132 of file ../../src/graphics/display/lib/api-types/cpp/pixel-format.h
fuchsia_images2::wire::PixelFormat ToFidl ()
Defined at line 143 of file ../../src/graphics/display/lib/api-types/cpp/pixel-format.h
uint32_t ValueForLogging ()
Raw numerical value of the equivalent FIDL value.
This is intended to be used for developer-facing output, such as logging
and Inspect. The values have the same stability guarantees as the
equivalent FIDL type.
Defined at line 145 of file ../../src/graphics/display/lib/api-types/cpp/pixel-format.h
int PlaneCount ()
The number of planes used by this format.
Defined at line 147 of file ../../src/graphics/display/lib/api-types/cpp/pixel-format.h
int EncodingSize ()
The number of bytes it takes to encode one pixel using this format.
At the moment, the return value is not defined for pixel formats that have
multiple planes.
Defined at line 178 of file ../../src/graphics/display/lib/api-types/cpp/pixel-format.h
AlphaLayout GetAlphaLayout ()
Where a pixel encoded using this format stores its alpha channel.
Defined at line 208 of file ../../src/graphics/display/lib/api-types/cpp/pixel-format.h
Enumerations
enum class AlphaLayout
| Name | Value | Comments |
|---|---|---|
| kNone | 0 |
The format has no alpha channel. Its pixels are opaque. |
| k8BitsInByte3 | 1 |
The alpha channel is byte 3. 0xff is opaque. |
| k2BitsAtTopOfByte3 | 2 |
The alpha channel is the two most significant bits of byte 3. 0b11 is |
Where a pixel encoded using a format stores its alpha channel.
Byte offsets count from the start of the pixel's encoding.
Defined at line 68 of file ../../src/graphics/display/lib/api-types/cpp/pixel-format.h
Friends
bool PixelFormat (const PixelFormat & lhs, const PixelFormat & rhs)
bool PixelFormat (const PixelFormat & lhsconst PixelFormat & rhs)