STRUCTS
RectU
Defined in fuchsia.images2/math.fidl
An integral, rectangular, axis-aligned region in a 2D cartesian space, with unsigned location and distance fields.
This type does not specify units. Protocols that use this type should specify the characteristics of the vector space, including orientation and units.
Field | Type | Description | Default |
---|---|---|---|
x |
uint32
|
The location of the origin of the rectangle in the x-axis. |
No default |
y |
uint32
|
The location of the origin of the rectangle in the y-axis. |
No default |
width |
uint32
|
The distance along the x-axis. The region includes x values starting at |
No default |
height |
uint32
|
The distance along the y-axis. The region includes y values starting at |
No default |
ENUMS
ColorSpace flexible
Type: uint32
Defined in fuchsia.images2/image_format.fidl
Expresses the color space used to interpret video pixel values.
This list has a separate entry for each variant of a color space standard.
For this reason, should we ever add support for the RGB variant of 709, for example, we'd add a separate entry to this list for that variant. Similarly for the RGB variants of 2020 or 2100. Similarly for the YcCbcCrc variant of 2020. Similarly for the ICtCp variant of 2100.
See ImageFormatIsSupportedColorSpaceForPixelFormat() for whether a
combination of PixelFormat
and ColorSpace
is potentially supported.
Generally, a ColorSpace
is not supported for any PixelFormat
whose
bits-per-sample isn't compatible with the color space's spec, nor for any
PixelFormat
which is a mismatch in terms of RGB vs. YUV.
The "limited range" in comments below refers to where black and white are defined to be (and simimlar for chroma), but should not be interpreted as guaranteeing that there won't be values outside the nominal "limited range". In other words, "limited range" doesn't necessarily mean there won't be any values below black or above white, or outside the "limited" chroma range. For "full range", black is 0 and white is the max possible/permitted numeric value (and similar for chroma).
Name | Value | Description |
---|---|---|
INVALID |
0 |
Not a valid color space type. |
SRGB |
1 |
sRGB, gamma transfer function and full range, per spec |
REC601_NTSC |
2 |
601 NTSC ("525 line") YCbCr primaries, limited range |
REC601_NTSC_FULL_RANGE |
3 |
601 NTSC ("525 line") YCbCr primaries, full range |
REC601_PAL |
4 |
601 PAL ("625 line") YCbCr primaries, limited range |
REC601_PAL_FULL_RANGE |
5 |
601 PAL ("625 line") YCbCr primaries, full range |
REC709 |
6 |
709 YCbCr (not RGB), limited range |
REC2020 |
7 |
2020 YCbCr (not RGB, not YcCbcCrc), 10 or 12 bit according to
|
REC2100 |
8 |
2100 YCbCr (not RGB, not ICtCp), 10 or 12 bit according to
|
PASSTHROUGH |
9 |
Either the pixel format doesn't represent a color, or it's in an application-specific colorspace that isn't describable by another entry in this enum. |
DO_NOT_CARE |
4294967294 |
A client is explicitly indicating that the client does not care which color space is chosen / used. |
PixelFormat flexible
Type: uint32
Defined in fuchsia.images2/image_format.fidl
Expresses the manner in which video pixels are encoded.
The ordering of the channels in the format name reflects the actual layout of the channel.
Each of these values is opinionated re. the color spaces that should be contained within (in contrast with Vulkan).
Name | Value | Description |
---|---|---|
INVALID |
0 |
|
R8G8B8A8 |
1 |
RGB only, 8 bits per each of R/G/B/A sample If A is actually X (not set to meaningful values), that can be specified by settting ['fuchsia.sysemm2.ImageFormatConstraints.is_alpha_present'] to false. If A is known to be set to meaningful values, that can be specified by setting ['fuchsia.sysemm2.ImageFormatConstraints.is_alpha_present'] to true. Compatible with VK_FORMAT_R8G8B8A8_UNORM. |
R8G8B8X8 |
119 |
RGB only, 8 bits per each of R/G/B/X sample Compatible with VK_FORMAT_R8G8B8A8_UNORM, when treated as opaque. Deprecated. Use Deprecated: 24 Added: 12
|
B8G8R8A8 |
101 |
32bpp BGRA, 1 plane. RGB only, 8 bits per each of B/G/R/A sample. Compatible with VK_FORMAT_B8G8R8A8_UNORM. If A is actually X (not set to meaningful values), that can be specified by settting ['fuchsia.sysemm2.ImageFormatConstraints.is_alpha_present'] to false. If A is known to be set to meaningful values, that can be specified by setting ['fuchsia.sysemm2.ImageFormatConstraints.is_alpha_present'] to true. In sysmem(1), this is BGRA32. |
B8G8R8X8 |
120 |
32bpp BGRA, 1 plane. RGB only, 8 bits per each of B/G/R/X sample. Compatible with VK_FORMAT_B8G8R8A8_UNORM, when treated as opaque. Deprecated. Use Deprecated: 24 Added: 12
|
I420 |
102 |
YUV only, 8 bits per Y sample Compatible with VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM. |
M420 |
103 |
YUV only, 8 bits per Y sample Not compatible with any vulkan format. |
NV12 |
104 |
YUV only, 8 bits per Y sample Compatible with VK_FORMAT_G8_B8R8_2PLANE_420_UNORM. |
YUY2 |
105 |
YUV only, 8 bits per Y sample Compatible with VK_FORMAT_G8B8G8R8_422_UNORM. |
MJPEG |
106 |
This value is reserved, and not currently used. |
YV12 |
107 |
YUV only, 8 bits per Y sample Compatible with VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM. The U plane may be located in either
the B or R plane for the image (and likewise for the V plane); the ordering may be
determined by looking at the members of
|
B8G8R8 |
108 |
24bpp BGR, 1 plane. RGB only, 8 bits per each of B/G/R sample Compatible with VK_FORMAT_B8G8R8_UNORM. In sysmem(1), this is BGR24. |
R5G6B5 |
109 |
16bpp RGB, 1 plane. 5 bits R, 6 bits G, 5 bits B Compatible with VK_FORMAT_R5G6B5_UNORM_PACK16. In sysmem(1), this is RGB565. |
R3G3B2 |
110 |
8bpp RGB, 1 plane. 3 bits R, 3 bits G, 2 bits B Not compatible with any vulkan format. In sysmem(1), this is RGB332. |
R2G2B2X2 |
111 |
8bpp RGB, 1 plane. 2 bits R, 2 bits G, 2 bits B Not compatible with any vulkan format. If X is actually X (not set to meaningful values), that can be specified by settting ['fuchsia.sysemm2.ImageFormatConstraints.is_alpha_present'] to false. If X is known to be set to meaningful values, that can be specified by setting ['fuchsia.sysemm2.ImageFormatConstraints.is_alpha_present'] to true. In sysmem(1), this is RGB2220. |
L8 |
112 |
8bpp, Luminance-only (red, green and blue have identical values.) Compatible with VK_FORMAT_R8_UNORM. Most clients will prefer to use R8 instead. |
R8 |
113 |
8bpp, Red-only (Green and Blue are to be interpreted as 0). Compatible with VK_FORMAT_R8_UNORM. |
R8G8 |
114 |
16bpp RG, 1 plane. 8 bits R, 8 bits G. Compatible with VK_FORMAT_R8G8_UNORM. |
A2R10G10B10 |
115 |
32bpp RGBA, 1 plane. 2 bits A, 10 bits R/G/B. If A is actually X (not set to meaningful values), that can be specified by settting ['fuchsia.sysemm2.ImageFormatConstraints.is_alpha_present'] to false. If A is known to be set to meaningful values, that can be specified by setting ['fuchsia.sysemm2.ImageFormatConstraints.is_alpha_present'] to true. Compatible with VK_FORMAT_A2R10G10B10_UNORM_PACK32. |
A2B10G10R10 |
116 |
32bpp BGRA, 1 plane. 2 bits A, 10 bits R/G/B. If A is actually X (not set to meaningful values), that can be specified by settting ['fuchsia.sysemm2.ImageFormatConstraints.is_alpha_present'] to false. If A is known to be set to meaningful values, that can be specified by setting ['fuchsia.sysemm2.ImageFormatConstraints.is_alpha_present'] to true. Compatible with VK_FORMAT_A2B10G10R10_UNORM_PACK32. |
P010 |
117 |
YUV only, 16 bits per Y sample This is like NV12 but with 16 bit samples that have the bottom 6 bits of each sample set to zero and/or ignored. The endianess of each 16 bit sample is host endian-ness (LE on LE system, BE on BE system). The CbCr plane has 16 bit Cb first, then 16 bit Cr, interleaved Cb Cr Cb Cr etc. Compatible with VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16. |
R8G8B8 |
118 |
24bpp RGB, 1 plane. RGB only, 8 bits per each of R/G/B sample Compatible with VK_FORMAT_R8G8B8_UNORM. |
DO_NOT_CARE |
4294967294 |
A client is explicitly indicating that the client does not care which
pixel format is chosen / used. When setting this value, the client must
not set |
PixelFormatModifier flexible
Type: uint64
Defined in fuchsia.images2/format_modifier.fidl
The upper 8 bits are a vendor code. The lower 56 bits are vendor-defined.
The defined PixelFormatModifier
values are specific, complete, and valid
values (except for INVALID
and DO_NOT_CARE
which have their own
meanings).
Some other valid or potentially-valid pixel_format_modifier
values are not
defined as a PixelFormatModifier
value, typically because the value isn't
used in practice (or potentially is newly used but not yet defined in
PixelFormatModifier
). It is permitted to specify such a value as a
PixelFormatModifier
value in a pixel_format_modifier
field, despite the
lack of corresponding defined PixelFormatModifier
value. If such a value
is used outside test code, please consider adding it as a defined value in
PixelFormatModifier
. All such values must conform to the upper 8 bits
vendor code (don't define/use values outside the/an appropriate vendor
code).
The separately-defined FORMATMODIFIER*
uint64 values are vendor-specific
bit field values, not complete valid values on their own. These uint64
values can be used to help create or interpret a PixelFormatModifier
value
in terms of vendor-specific bitfields.
When the pixel_format_modifier
is set to a supported value (excluding
DO_NOT_CARE
, INVALID
, LINEAR
), the arrangement of pixel data otherwise
specified by the pixel_format
field is "modified", typically to allow for
some combination of tiling, compression (typically lossless, typically for
memory bandwidth reduction not framebuffer size reduction), transaction
elimination, dirt tracking, but typically not modifying the bit depth of the
pixel_format
. In some cases there's a per-image or per-tile header
involved, or similar. The pixel_format
field often still needs to be set
to a valid supported value that works in combination with the
pixel_format_modifier
, and that pixel_format
value can also contribute
to the overall meaning of the ImageFormat
. In other words, the "modifier"
part of the name is more accurate than "override" would be.
Name | Value | Description |
---|---|---|
DO_NOT_CARE |
72057594037927934 |
|
INVALID |
72057594037927935 |
|
LINEAR |
0 |
|
INTEL_I915_X_TILED |
72057594037927937 |
|
INTEL_I915_Y_TILED |
72057594037927938 |
|
INTEL_I915_YF_TILED |
72057594037927939 |
|
INTEL_I915_Y_TILED_CCS |
72057594054705154 |
|
INTEL_I915_YF_TILED_CCS |
72057594054705155 |
|
ARM_AFBC_16X16 |
576460752303423489 |
|
ARM_AFBC_32X8 |
576460752303423490 |
|
ARM_LINEAR_TE |
576460752303427584 |
|
ARM_AFBC_16X16_TE |
576460752303427585 |
|
ARM_AFBC_32X8_TE |
576460752303427586 |
|
ARM_AFBC_16X16_YUV_TILED_HEADER |
576460752303431697 |
|
ARM_AFBC_16X16_SPLIT_BLOCK_SPARSE_YUV |
576460752303423601 |
|
ARM_AFBC_16X16_SPLIT_BLOCK_SPARSE_YUV_TE |
576460752303427697 |
|
ARM_AFBC_16X16_SPLIT_BLOCK_SPARSE_YUV_TILED_HEADER |
576460752303431793 |
|
ARM_AFBC_16X16_SPLIT_BLOCK_SPARSE_YUV_TE_TILED_HEADER |
576460752303435889 |
|
GOOGLE_GOLDFISH_OPTIMAL |
7421932185906577409 |
TABLES
ImageFormat
Defined in fuchsia.images2/image_format.fidl
Describes the format of images.
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
pixel_format |
PixelFormat
|
Describes the manner in which pixels are encoded. |
2 |
pixel_format_modifier |
PixelFormatModifier
|
Vendor-specific pixel format modifier. See format_modifier.fidl. |
3 |
color_space |
ColorSpace
|
Indicates the color space used to interpret pixel values. |
4 |
size |
fuchsia.math/SizeU
|
The size of the image in pixels. See also Not all of the addressable pixel positions in the buffer are necessarily
populated with valid pixel data. See The right and bottom of the image may have some valid pixels which are
not to be displayed. See |
5 |
bytes_per_row |
uint32
|
Number of bytes per row. For multi-plane YUV formats, this is the number of bytes per row in the Y plane. When this field is not set, there is no padding at the end of each row
of pixels. In other words, when not set, the stride is equal to the
"stride bytes per width pixel" times the When set, the value in this field must be >= the "stride bytes per width
pixel" times the This is also known as the "stride", "line to line offset", "row to row offset", and other names. As a specific example, it's not uncommon (but also not always required)
for BGR24 (3 bytes per pixel) to have some padding at the end of each
row so that each row of pixels starts at a 4 byte aligned offset from
the start of the image (the upper left pixel). That padding's size is
not necessarily divisible by the size in bytes of a pixel ("stride bytes
per width pixel"), so we indicate the padding using this field rather
than trying to incorporate the padding as a larger "fake"
|
6 |
display_rect |
fuchsia.math/RectU
|
The rect within a frame that's for display. This is the location and size in pixels of the rectangle of pixels that should be displayed, when displaying the "whole image" in a UI display sense. The For output from a video decoder, pixels outside the display_rect are
never to be displayed (outside of test programs), but must be preserved
for correct decoder function. The Downstream texture filtering operations should avoid letting any pixel outside of display_rect influence the visual appearance of any displayed pixel, to avoid the potential for the right or bottom edge leaking in arbitrary pixels defined by the decode process but not intended for display. Behavior when this field is not set is protocol-specific. In some
protocols, fallback to WARNING: fuchsia.sysmem.Images2 (V1) doesn't handle non-zero x, y, so any non-zero x, y here (V2) will prevent conversion to V1. Due to the rarity of non-zero x, y in practice, even components that have moved to V2 may in some cases still assume both x and y are 0, until there's a practical reason to implment and test handling of non-zero x, y. The symptom of sending non-zero x, y to a downstream render and/or display pipeline that assumes 0, 0 will be incorrect display, but not a crash, since assuming 0, 0 for x, y does not cause reading out of buffer bounds. Added: 18
|
7 |
valid_size |
fuchsia.math/SizeU
|
The size of a frame in terms of the number of pixels that have valid pixel data in terms of video decoding, but not in terms of which pixels are intended for display. To convert valid_size into a rect that's directly comparable to
In the case of a video decoder, |
8 |
pixel_aspect_ratio |
fuchsia.math/SizeU
|
Aspect ratio of a single pixel as the video is intended to be displayed. For YUV formats, this is the pixel aspect ratio (AKA sample aspect ratio aka SAR) for the luma (AKA Y) samples. Producers should ensure the width and height values are relatively prime by reducing the fraction (dividing both by GCF) if necessary. A consumer should interpret this field being un-set as an unknown pixel aspect ratio. A default of 1:1 can be appropriate in some cases, but a consumer may determine the actual pixel aspect ratio by OOB means. |
CONSTANTS
Name | Value | Type | Description |
---|---|---|---|
FORMAT_MODIFIER_ARM_BCH_BIT |
2048
|
uint64 |
|
FORMAT_MODIFIER_ARM_SPARSE_BIT |
64
|
uint64 |
|
FORMAT_MODIFIER_ARM_SPLIT_BLOCK_BIT |
32
|
uint64 |
|
FORMAT_MODIFIER_ARM_TE_BIT |
4096
|
uint64 |
|
FORMAT_MODIFIER_ARM_TILED_HEADER_BIT |
8192
|
uint64 |
|
FORMAT_MODIFIER_ARM_YUV_BIT |
16
|
uint64 |
|
FORMAT_MODIFIER_INTEL_CCS_BIT |
16777216
|
uint64 |
Format has a color control surface after the tile data |
FORMAT_MODIFIER_VENDOR_ALLWINNER |
648518346341351424
|
uint64 |
Added: 19
|
FORMAT_MODIFIER_VENDOR_AMD |
144115188075855872
|
uint64 |
Added: 19
|
FORMAT_MODIFIER_VENDOR_AMLOGIC |
720575940379279360
|
uint64 |
Added: 19
|
FORMAT_MODIFIER_VENDOR_ARM |
576460752303423488
|
uint64 |
Added: 19
|
FORMAT_MODIFIER_VENDOR_BROADCOM |
504403158265495552
|
uint64 |
Added: 19
|
FORMAT_MODIFIER_VENDOR_GOOGLE |
7421932185906577408
|
uint64 |
Added: 19
|
FORMAT_MODIFIER_VENDOR_INTEL |
72057594037927936
|
uint64 |
Added: 19
|
FORMAT_MODIFIER_VENDOR_NVIDIA |
216172782113783808
|
uint64 |
Added: 19
|
FORMAT_MODIFIER_VENDOR_QCOM |
360287970189639680
|
uint64 |
Added: 19
|
FORMAT_MODIFIER_VENDOR_SAMSUNG |
288230376151711744
|
uint64 |
Added: 19
|
FORMAT_MODIFIER_VENDOR_VIVANTE |
432345564227567616
|
uint64 |
Added: 19
|