ImageFormat.Raw12 字段

定义

注意

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

Android 12 位原始格式

[Android.Runtime.Register("RAW12", ApiSince=23)]
[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 Raw12 = 38;
[<Android.Runtime.Register("RAW12", ApiSince=23)>]
[<System.Obsolete("This constant will be removed in the future version. Use Android.Graphics.ImageFormatType enum directly instead of this field.", true)>]
val mutable Raw12 : Android.Graphics.ImageFormatType

字段值

Value = 38
属性

注解

Android 12 位原始格式

这是一个单平面,每像素 12 位,密集打包(每行),未处理的格式,通常表示来自图像传感器的原始拜耶模式图像。

在采用此格式的图像缓冲区中,从每行的第一个像素开始,每两个连续像素打包成 3 个字节(24 位)。 第一个和第二个字节包含第一和第二个像素的前 8 位。 第三个字节包含两个像素的 4 个最小有效位,下面显示了每两个连续像素的确切布局数据(Pi[j] 代表 ith 像素的第 j 位):

<table><thead><tr><th align=“center”/><th align=“center”><>bit 7</><th align=“center”>bit 6</<>th align=“center”>bit 5</th<>align=“center”>bit 4<></th align=“center”>bit 3</><th align=“center”>bit 2</<>th align=“center>”bit 1</<>th align=“center”>bit 0</th></tr></thead tbody><tr><td align=“center”>Byte 0:</td td><align=“center”>P0[11]</td<>align=“center”>P0[10]</td td td><align=“center”>P0[ 9]</td<>td align=“center”>P0[ 8]</td td><align=“center”>P0[ 7]</td<>align=“center”>P0[ 6]</td<>align=“center”>P0[ 5]</td><td align=”><center“>P0[ 4]</td/tr><<>td<> align=”center“>Byte 1:</td><td td align=”center“>P1[11]</td><td align=”center“>P1[10]</td><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><align=”center“>P1[ 5]</td td align=“center”>P1[ 4]</td/tr<>tr><td>< align=“center”>Byte 2:</td><td td align=“center”>P1[ 3]</td td<>align=“center”>P1[ 2]</td td><align=“center”>P1[ 1]</td td<>align=“center”>P1[ 0]</td td align<>=“center”>P0[ 3]</td><td align=“center”>P0[ 2]/<><td><td align=“center”>P0[ 1]</td td><align=“center”>P0[ 0]</td></tr></tbody></table>

此格式假定 <ul><li>的宽度倍数为 4 像素</li><>a 偶高</li></ul>

size = row stride * height

其中行步幅以 <em>字节</em> 为单位,而不是像素。

由于这是一种密集打包的格式,因此像素步幅始终为 0。 应用程序必须使用上表中定义的像素数据布局来访问每行数据。 当行步幅等于 width * (12 / 8)时,每行末尾不会有填充字节,整个图像数据会密集打包。 当步幅大于 width * (12 / 8)时,填充字节将出现在每一行的末尾。

例如,该 android.media.Image 对象可以通过对象提供此格式 android.hardware.camera2.CameraDevice 的数据(如果受支持 android.media.ImageReader )。 这将 android.media.Image#getPlanes() Image#getPlanes() 返回包含像素数据的单个平面。 像素步幅始终为 0, android.media.Image.Plane#getPixelStride()描述 android.media.Image.Plane#getRowStride() 相邻行之间的垂直相邻像素距离(以字节为单位)。

适用于 . 的 android.graphics.ImageFormat.RAW12Java 文档

本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。

适用于