Share via


ImageFormat.Raw10 Field

Definition

Caution

This constant will be removed in the future version. Use Android.Graphics.ImageFormatType enum directly instead of this field.

Android 10-bit raw format

[Android.Runtime.Register("RAW10")]
[System.Obsolete("This constant will be removed in the future version. Use Android.Graphics.ImageFormatType enum directly instead of this field.", true)]
public const Android.Graphics.ImageFormatType Raw10 = 37;
[<Android.Runtime.Register("RAW10")>]
[<System.Obsolete("This constant will be removed in the future version. Use Android.Graphics.ImageFormatType enum directly instead of this field.", true)>]
val mutable Raw10 : Android.Graphics.ImageFormatType

Field Value

Value = 37
Attributes

Remarks

Android 10-bit raw format

This is a single-plane, 10-bit per pixel, densely packed (in each row), unprocessed format, usually representing raw Bayer-pattern images coming from an image sensor.

In an image buffer with this format, starting from the first pixel of each row, each 4 consecutive pixels are packed into 5 bytes (40 bits). Each one of the first 4 bytes contains the top 8 bits of each pixel, The fifth byte contains the 2 least significant bits of the 4 pixels, the exact layout data for each 4 consecutive pixels is illustrated below (Pi[j] stands for the jth bit of the ith pixel):

<table> <thead> <tr> <th align="center"></th> <th align="center">bit 7</th> <th align="center">bit 6</th> <th align="center">bit 5</th> <th align="center">bit 4</th> <th align="center">bit 3</th> <th align="center">bit 2</th> <th align="center">bit 1</th> <th align="center">bit 0</th> </tr> </thead> <tbody> <tr> <td align="center">Byte 0:</td> <td align="center">P0[9]</td> <td align="center">P0[8]</td> <td align="center">P0[7]</td> <td align="center">P0[6]</td> <td align="center">P0[5]</td> <td align="center">P0[4]</td> <td align="center">P0[3]</td> <td align="center">P0[2]</td> </tr> <tr> <td align="center">Byte 1:</td> <td align="center">P1[9]</td> <td align="center">P1[8]</td> <td align="center">P1[7]</td> <td align="center">P1[6]</td> <td align="center">P1[5]</td> <td align="center">P1[4]</td> <td align="center">P1[3]</td> <td align="center">P1[2]</td> </tr> <tr> <td align="center">Byte 2:</td> <td align="center">P2[9]</td> <td align="center">P2[8]</td> <td align="center">P2[7]</td> <td align="center">P2[6]</td> <td align="center">P2[5]</td> <td align="center">P2[4]</td> <td align="center">P2[3]</td> <td align="center">P2[2]</td> </tr> <tr> <td align="center">Byte 3:</td> <td align="center">P3[9]</td> <td align="center">P3[8]</td> <td align="center">P3[7]</td> <td align="center">P3[6]</td> <td align="center">P3[5]</td> <td align="center">P3[4]</td> <td align="center">P3[3]</td> <td align="center">P3[2]</td> </tr> <tr> <td align="center">Byte 4:</td> <td align="center">P3[1]</td> <td align="center">P3[0]</td> <td align="center">P2[1]</td> <td align="center">P2[0]</td> <td align="center">P1[1]</td> <td align="center">P1[0]</td> <td align="center">P0[1]</td> <td align="center">P0[0]</td> </tr> </tbody> </table>

This format assumes <ul> <li>a width multiple of 4 pixels</li> <li>an even height</li> </ul>

size = row stride * height

where the row stride is in <em>bytes</em>, not pixels.

Since this is a densely packed format, the pixel stride is always 0. The application must use the pixel data layout defined in above table to access each row data. When row stride is equal to width * (10 / 8), there will be no padding bytes at the end of each row, the entire image data is densely packed. When stride is larger than width * (10 / 8), padding bytes will be present at the end of each row.

For example, the android.media.Image object can provide data in this format from a android.hardware.camera2.CameraDevice (if supported) through a android.media.ImageReader object. The android.media.Image#getPlanes() Image#getPlanes() will return a single plane containing the pixel data. The pixel stride is always 0 in android.media.Image.Plane#getPixelStride(), and the android.media.Image.Plane#getRowStride() describes the vertical neighboring pixel distance (in bytes) between adjacent rows.

Java documentation for android.graphics.ImageFormat.RAW10.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

See also