次の方法で共有


ImageFormat.Yv12 Field

Definition

Caution

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

Android YUV format.

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

Field Value

Value = 842094169
Attributes

Remarks

Android YUV format.

This format is exposed to software decoders and applications.

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 <ul> <li>an even width</li> <li>an even height</li> <li>a horizontal stride multiple of 16 pixels</li> <li>a vertical stride equal to the height</li> </ul>

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

For the android.hardware.camera2 API, the #YUV_420_888 format is recommended for YUV output instead.

For the older camera API, this format is guaranteed to be supported for android.hardware.Camera preview images since API level 12; for earlier API versions, check android.hardware.Camera.Parameters#getSupportedPreviewFormats().

Note that for camera preview callback use (see android.hardware.Camera#setPreviewCallback), the <var>stride</var> value is the smallest possible; that is, it is equal to:

stride = ALIGN(width, 16)

Java documentation for android.graphics.ImageFormat.YV12.

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

  • <xref:Android.Hardware.Camera.SetPreviewCallback(.IPreviewCallback)>