語言

ImageFormat.Yv12 欄位

定義

警告

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

Android YUV 格式。

[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

欄位值

Value = 842094169
屬性

備註

Android YUV 格式。

此格式會暴露給軟體解碼器和應用程式使用。

YV12 是一個 4:2:0 的 YCrCb 平面格式,由 WxH Y 平面接著 (W/2) x (H/2) Cr 和 Cb 平面組成。

此格式假設 ul>li 寬度為偶<數/li<>li>高度為偶<數 /li<>li>為 16 像素<的水平步幅倍數/li<>li 為>垂直步幅,等於高度</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

對於 android.hardware.camera2 API 來說,建議將此 #YUV_420_888 格式用於 YUV 輸出。

對於較舊的相機 API,此格式自 API 等級 12 起保證支援 android.hardware.Camera 預覽影像;對於較早的 API 版本,請檢查 android.hardware.Camera.Parameters#getSupportedPreviewFormats()。

請注意,對於攝影機預覽回調的使用(參見 android.hardware.Camera#setPreviewCallback), <var>步幅</var> 值是最小的;也就是說,它等於:

stride = ALIGN(width, 16)

Java 文件 android.graphics.ImageFormat.YV12。

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於

另請參閱

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