summaryrefslogtreecommitdiffstats
path: root/graphics
diff options
context:
space:
mode:
authorChia-I Wu <olv@google.com>2017-04-18 13:36:37 -0700
committerSteven Moreland <smoreland@google.com>2017-04-27 16:41:08 +0000
commit841468ad6aad6da69a4a70cf54554e27ee3194d4 (patch)
tree8bb5406646f0cfef68922d5fc04c878967589a3a /graphics
parent3242e248c4c5f07c309baa9d41260aee065737d4 (diff)
downloadandroid_hardware_interfaces-841468ad6aad6da69a4a70cf54554e27ee3194d4.tar.gz
android_hardware_interfaces-841468ad6aad6da69a4a70cf54554e27ee3194d4.tar.bz2
android_hardware_interfaces-841468ad6aad6da69a4a70cf54554e27ee3194d4.zip
graphics: reorder PixelFormat
Sort the enum values in their numerical order. There is no other change. Note, current.txt change (as opposed to addition) is only allowed because this is an unreleased interface. Bug: 32593292 Test: builds Change-Id: I47914a7971f922f5602f982b41dd7602842e853b
Diffstat (limited to 'graphics')
-rw-r--r--graphics/common/1.0/types.hal386
1 files changed, 193 insertions, 193 deletions
diff --git a/graphics/common/1.0/types.hal b/graphics/common/1.0/types.hal
index 3bd1ec174..7fd15c49d 100644
--- a/graphics/common/1.0/types.hal
+++ b/graphics/common/1.0/types.hal
@@ -37,15 +37,10 @@ enum PixelFormat : int32_t {
RGB_565 = 4,
BGRA_8888 = 5,
- /**
- * The following formats use 10bit integers for R, G, and B and
- * 2 bits for alpha. This is used to improve color precision on
- * wide-color devices, e.g. Display-P3 or scRGB.
- *
- * When used with ANativeWindow, the dataSpace field describes the color
- * space of the buffer.
- */
- RGBA_1010102 = 0x2B,
+ /** Legacy formats (deprecated), used by ImageFormat.java */
+ YCBCR_422_SP = 0x10, // NV16
+ YCRCB_420_SP = 0x11, // NV21
+ YCBCR_422_I = 0x14, // YUY2
/**
* The following formats use a 16bit float per color component.
@@ -56,124 +51,125 @@ enum PixelFormat : int32_t {
RGBA_FP16 = 0x16,
/**
- * 0x101 - 0x1FF
+ * Android RAW sensor format:
*
- * This range is reserved for pixel formats that are specific to the HAL
- * implementation. Implementations can use any value in this range to
- * communicate video pixel formats between their HAL modules. These formats
- * must not have an alpha channel. Additionally, an EGLimage created from a
- * gralloc buffer of one of these formats must be supported for use with the
- * GL_OES_EGL_image_external OpenGL ES extension.
- */
-
- /**
- * Android YUV format:
+ * This format is exposed outside of the camera HAL to applications.
*
- * This format is exposed outside of the HAL to software decoders and
- * applications. EGLImageKHR must support it in conjunction with the
- * OES_EGL_image_external extension.
+ * RAW16 is a single-channel, 16-bit, little endian format, typically
+ * representing raw Bayer-pattern images from an image sensor, with minimal
+ * processing.
*
- * YV12 is a 4:2:0 YCrCb planar format comprised of a WxH Y plane followed
- * by (W/2) x (H/2) Cr and Cb planes.
+ * The exact pixel layout of the data in the buffer is sensor-dependent, and
+ * needs to be queried from the camera device.
+ *
+ * Generally, not all 16 bits are used; more common values are 10 or 12
+ * bits. If not all bits are used, the lower-order bits are filled first.
+ * All parameters to interpret the raw data (black and white points,
+ * color space, etc) must be queried from the camera device.
*
* This format assumes
* - an even width
* - an even height
* - a horizontal stride multiple of 16 pixels
* - a vertical stride equal to the height
+ * - strides are specified in pixels, not in bytes
*
- * y_size = stride * height
- * c_stride = ALIGN(stride/2, 16)
- * c_size = c_stride * height/2
- * size = y_size + c_size * 2
- * cr_offset = y_size
- * cb_offset = y_size + c_size
+ * size = stride * height * 2
*
- * When used with ANativeWindow, the dataSpace field describes the color
- * space of the buffer.
+ * This format must be accepted by the gralloc module when used with the
+ * following usage flags:
+ * - GRALLOC_USAGE_HW_CAMERA_*
+ * - GRALLOC_USAGE_SW_*
+ * - GRALLOC_USAGE_RENDERSCRIPT
+ *
+ * When used with ANativeWindow, the mapping of the dataSpace field to
+ * buffer contents for RAW16 is as follows:
+ *
+ * dataSpace value | Buffer contents
+ * -------------------------------+-----------------------------------------
+ * HAL_DATASPACE_ARBITRARY | Raw image sensor data, layout is as
+ * | defined above.
+ * HAL_DATASPACE_DEPTH | Unprocessed implementation-dependent raw
+ * | depth measurements, opaque with 16 bit
+ * | samples.
+ * Other | Unsupported
*/
- YV12 = 0x32315659, // YCrCb 4:2:0 Planar
-
+ RAW16 = 0x20,
/**
- * Android Y8 format:
+ * Android binary blob graphics buffer format:
*
- * This format is exposed outside of the HAL to the framework.
- * The expected gralloc usage flags are SW_* and HW_CAMERA_*,
- * and no other HW_ flags will be used.
+ * This format is used to carry task-specific data which does not have a
+ * standard image structure. The details of the format are left to the two
+ * endpoints.
*
- * Y8 is a YUV planar format comprised of a WxH Y plane,
- * with each pixel being represented by 8 bits.
+ * A typical use case is for transporting JPEG-compressed images from the
+ * Camera HAL to the framework or to applications.
*
- * It is equivalent to just the Y plane from YV12.
+ * Buffers of this format must have a height of 1, and width equal to their
+ * size in bytes.
*
- * This format assumes
- * - an even width
- * - an even height
- * - a horizontal stride multiple of 16 pixels
- * - a vertical stride equal to the height
+ * When used with ANativeWindow, the mapping of the dataSpace field to
+ * buffer contents for BLOB is as follows:
*
- * size = stride * height
+ * dataSpace value | Buffer contents
+ * -------------------------------+-----------------------------------------
+ * HAL_DATASPACE_JFIF | An encoded JPEG image
+ * HAL_DATASPACE_DEPTH | An android_depth_points buffer
+ * HAL_DATASPACE_SENSOR | Sensor event data.
+ * Other | Unsupported
+ *
+ */
+ BLOB = 0x21,
+
+ /**
+ * Android format indicating that the choice of format is entirely up to the
+ * device-specific Gralloc implementation.
+ *
+ * The Gralloc implementation should examine the usage bits passed in when
+ * allocating a buffer with this format, and it should derive the pixel
+ * format from those usage flags. This format will never be used with any
+ * of the GRALLOC_USAGE_SW_* usage flags.
+ *
+ * If a buffer of this format is to be used as an OpenGL ES texture, the
+ * framework will assume that sampling the texture will always return an
+ * alpha value of 1.0 (i.e. the buffer contains only opaque pixel values).
*
* When used with ANativeWindow, the dataSpace field describes the color
* space of the buffer.
*/
- Y8 = 0x20203859,
+ IMPLEMENTATION_DEFINED = 0x22,
/**
- * Android Y16 format:
- *
- * This format is exposed outside of the HAL to the framework.
- * The expected gralloc usage flags are SW_* and HW_CAMERA_*,
- * and no other HW_ flags will be used.
+ * Android flexible YCbCr 4:2:0 formats
*
- * Y16 is a YUV planar format comprised of a WxH Y plane,
- * with each pixel being represented by 16 bits.
+ * This format allows platforms to use an efficient YCbCr/YCrCb 4:2:0
+ * buffer layout, while still describing the general format in a
+ * layout-independent manner. While called YCbCr, it can be
+ * used to describe formats with either chromatic ordering, as well as
+ * whole planar or semiplanar layouts.
*
- * It is just like Y8, but has double the bits per pixel (little endian).
+ * struct android_ycbcr (below) is the the struct used to describe it.
*
- * This format assumes
- * - an even width
- * - an even height
- * - a horizontal stride multiple of 16 pixels
- * - a vertical stride equal to the height
- * - strides are specified in pixels, not in bytes
+ * This format must be accepted by the gralloc module when
+ * USAGE_SW_WRITE_* or USAGE_SW_READ_* are set.
*
- * size = stride * height * 2
+ * This format is locked for use by gralloc's (*lock_ycbcr) method, and
+ * locking with the (*lock) method will return an error.
*
* When used with ANativeWindow, the dataSpace field describes the color
- * space of the buffer, except that dataSpace field
- * HAL_DATASPACE_DEPTH indicates that this buffer contains a depth
- * image where each sample is a distance value measured by a depth camera,
- * plus an associated confidence value.
+ * space of the buffer.
*/
- Y16 = 0x20363159,
+ YCBCR_420_888 = 0x23,
/**
- * Android RAW sensor format:
+ * Android opaque RAW format:
*
* This format is exposed outside of the camera HAL to applications.
*
- * RAW16 is a single-channel, 16-bit, little endian format, typically
- * representing raw Bayer-pattern images from an image sensor, with minimal
- * processing.
- *
- * The exact pixel layout of the data in the buffer is sensor-dependent, and
- * needs to be queried from the camera device.
- *
- * Generally, not all 16 bits are used; more common values are 10 or 12
- * bits. If not all bits are used, the lower-order bits are filled first.
- * All parameters to interpret the raw data (black and white points,
- * color space, etc) must be queried from the camera device.
- *
- * This format assumes
- * - an even width
- * - an even height
- * - a horizontal stride multiple of 16 pixels
- * - a vertical stride equal to the height
- * - strides are specified in pixels, not in bytes
- *
- * size = stride * height * 2
+ * RAW_OPAQUE is a format for unprocessed raw image buffers coming from an
+ * image sensor. The actual structure of buffers of this format is
+ * implementation-dependent.
*
* This format must be accepted by the gralloc module when used with the
* following usage flags:
@@ -181,19 +177,11 @@ enum PixelFormat : int32_t {
* - GRALLOC_USAGE_SW_*
* - GRALLOC_USAGE_RENDERSCRIPT
*
- * When used with ANativeWindow, the mapping of the dataSpace field to
- * buffer contents for RAW16 is as follows:
- *
- * dataSpace value | Buffer contents
- * -------------------------------+-----------------------------------------
- * HAL_DATASPACE_ARBITRARY | Raw image sensor data, layout is as
- * | defined above.
- * HAL_DATASPACE_DEPTH | Unprocessed implementation-dependent raw
- * | depth measurements, opaque with 16 bit
- * | samples.
- * Other | Unsupported
+ * When used with ANativeWindow, the dataSpace field should be
+ * HAL_DATASPACE_ARBITRARY, as raw image sensor buffers require substantial
+ * extra metadata to define.
*/
- RAW16 = 0x20,
+ RAW_OPAQUE = 0x24,
/**
* Android RAW10 format:
@@ -300,93 +288,6 @@ enum PixelFormat : int32_t {
RAW12 = 0x26,
/**
- * Android opaque RAW format:
- *
- * This format is exposed outside of the camera HAL to applications.
- *
- * RAW_OPAQUE is a format for unprocessed raw image buffers coming from an
- * image sensor. The actual structure of buffers of this format is
- * implementation-dependent.
- *
- * This format must be accepted by the gralloc module when used with the
- * following usage flags:
- * - GRALLOC_USAGE_HW_CAMERA_*
- * - GRALLOC_USAGE_SW_*
- * - GRALLOC_USAGE_RENDERSCRIPT
- *
- * When used with ANativeWindow, the dataSpace field should be
- * HAL_DATASPACE_ARBITRARY, as raw image sensor buffers require substantial
- * extra metadata to define.
- */
- RAW_OPAQUE = 0x24,
-
- /**
- * Android binary blob graphics buffer format:
- *
- * This format is used to carry task-specific data which does not have a
- * standard image structure. The details of the format are left to the two
- * endpoints.
- *
- * A typical use case is for transporting JPEG-compressed images from the
- * Camera HAL to the framework or to applications.
- *
- * Buffers of this format must have a height of 1, and width equal to their
- * size in bytes.
- *
- * When used with ANativeWindow, the mapping of the dataSpace field to
- * buffer contents for BLOB is as follows:
- *
- * dataSpace value | Buffer contents
- * -------------------------------+-----------------------------------------
- * HAL_DATASPACE_JFIF | An encoded JPEG image
- * HAL_DATASPACE_DEPTH | An android_depth_points buffer
- * HAL_DATASPACE_SENSOR | Sensor event data.
- * Other | Unsupported
- *
- */
- BLOB = 0x21,
-
- /**
- * Android format indicating that the choice of format is entirely up to the
- * device-specific Gralloc implementation.
- *
- * The Gralloc implementation should examine the usage bits passed in when
- * allocating a buffer with this format, and it should derive the pixel
- * format from those usage flags. This format will never be used with any
- * of the GRALLOC_USAGE_SW_* usage flags.
- *
- * If a buffer of this format is to be used as an OpenGL ES texture, the
- * framework will assume that sampling the texture will always return an
- * alpha value of 1.0 (i.e. the buffer contains only opaque pixel values).
- *
- * When used with ANativeWindow, the dataSpace field describes the color
- * space of the buffer.
- */
- IMPLEMENTATION_DEFINED = 0x22,
-
- /**
- * Android flexible YCbCr 4:2:0 formats
- *
- * This format allows platforms to use an efficient YCbCr/YCrCb 4:2:0
- * buffer layout, while still describing the general format in a
- * layout-independent manner. While called YCbCr, it can be
- * used to describe formats with either chromatic ordering, as well as
- * whole planar or semiplanar layouts.
- *
- * struct android_ycbcr (below) is the the struct used to describe it.
- *
- * This format must be accepted by the gralloc module when
- * USAGE_SW_WRITE_* or USAGE_SW_READ_* are set.
- *
- * This format is locked for use by gralloc's (*lock_ycbcr) method, and
- * locking with the (*lock) method will return an error.
- *
- * When used with ANativeWindow, the dataSpace field describes the color
- * space of the buffer.
- */
- YCBCR_420_888 = 0x23,
-
- /**
* Android flexible YCbCr 4:2:2 formats
*
* This format allows platforms to use an efficient YCbCr/YCrCb 4:2:2
@@ -442,11 +343,110 @@ enum PixelFormat : int32_t {
*/
FLEX_RGBA_8888 = 0x2A,
- /** Legacy formats (deprecated), used by ImageFormat.java */
- YCBCR_422_SP = 0x10, // NV16
- YCRCB_420_SP = 0x11, // NV21
- YCBCR_422_I = 0x14, // YUY2
+ /**
+ * The following formats use 10bit integers for R, G, and B and
+ * 2 bits for alpha. This is used to improve color precision on
+ * wide-color devices, e.g. Display-P3 or scRGB.
+ *
+ * When used with ANativeWindow, the dataSpace field describes the color
+ * space of the buffer.
+ */
+ RGBA_1010102 = 0x2B,
+
JPEG = 0x100,
+
+ /**
+ * 0x101 - 0x1FF
+ *
+ * This range is reserved for pixel formats that are specific to the HAL
+ * implementation. Implementations can use any value in this range to
+ * communicate video pixel formats between their HAL modules. These formats
+ * must not have an alpha channel. Additionally, an EGLimage created from a
+ * gralloc buffer of one of these formats must be supported for use with the
+ * GL_OES_EGL_image_external OpenGL ES extension.
+ */
+
+ /**
+ * Android Y8 format:
+ *
+ * This format is exposed outside of the HAL to the framework.
+ * The expected gralloc usage flags are SW_* and HW_CAMERA_*,
+ * and no other HW_ flags will be used.
+ *
+ * Y8 is a YUV planar format comprised of a WxH Y plane,
+ * with each pixel being represented by 8 bits.
+ *
+ * It is equivalent to just the Y plane from YV12.
+ *
+ * This format assumes
+ * - an even width
+ * - an even height
+ * - a horizontal stride multiple of 16 pixels
+ * - a vertical stride equal to the height
+ *
+ * size = stride * height
+ *
+ * When used with ANativeWindow, the dataSpace field describes the color
+ * space of the buffer.
+ */
+ Y8 = 0x20203859,
+
+ /**
+ * Android Y16 format:
+ *
+ * This format is exposed outside of the HAL to the framework.
+ * The expected gralloc usage flags are SW_* and HW_CAMERA_*,
+ * and no other HW_ flags will be used.
+ *
+ * Y16 is a YUV planar format comprised of a WxH Y plane,
+ * with each pixel being represented by 16 bits.
+ *
+ * It is just like Y8, but has double the bits per pixel (little endian).
+ *
+ * This format assumes
+ * - an even width
+ * - an even height
+ * - a horizontal stride multiple of 16 pixels
+ * - a vertical stride equal to the height
+ * - strides are specified in pixels, not in bytes
+ *
+ * size = stride * height * 2
+ *
+ * When used with ANativeWindow, the dataSpace field describes the color
+ * space of the buffer, except that dataSpace field
+ * HAL_DATASPACE_DEPTH indicates that this buffer contains a depth
+ * image where each sample is a distance value measured by a depth camera,
+ * plus an associated confidence value.
+ */
+ Y16 = 0x20363159,
+
+ /**
+ * Android YUV format:
+ *
+ * This format is exposed outside of the HAL to software decoders and
+ * applications. EGLImageKHR must support it in conjunction with the
+ * OES_EGL_image_external extension.
+ *
+ * YV12 is a 4:2:0 YCrCb planar format comprised of a WxH Y plane followed
+ * by (W/2) x (H/2) Cr and Cb planes.
+ *
+ * This format assumes
+ * - an even width
+ * - an even height
+ * - a horizontal stride multiple of 16 pixels
+ * - a vertical stride equal to the height
+ *
+ * y_size = stride * height
+ * c_stride = ALIGN(stride/2, 16)
+ * c_size = c_stride * height/2
+ * size = y_size + c_size * 2
+ * cr_offset = y_size
+ * cb_offset = y_size + c_size
+ *
+ * When used with ANativeWindow, the dataSpace field describes the color
+ * space of the buffer.
+ */
+ YV12 = 0x32315659, // YCrCb 4:2:0 Planar
};
/**