語言

MultiResolutionImageReader 建構函式

定義

多載

名稱 Description
MultiResolutionImageReader(IntPtr, JniHandleOwnership)
MultiResolutionImageReader(ICollection<MultiResolutionStreamInfo>, Int32, Int32)

根據相機裝置回傳的一組相機串流屬性,建立一個新的多解析度讀取器。

MultiResolutionImageReader(ICollection<MultiResolutionStreamInfo>, ImageFormatType, Int32, Int64)

根據攝影機裝置回傳的一組攝影機串流屬性,以及所需的格式、最大緩衝區容量和消費者使用標誌,建立一個新的多解析度讀取器。

MultiResolutionImageReader(IntPtr, JniHandleOwnership)

protected MultiResolutionImageReader(IntPtr javaReference, Android.Runtime.JniHandleOwnership transfer);
new Android.Hardware.Camera2.MultiResolutionImageReader : nativeint * Android.Runtime.JniHandleOwnership -> Android.Hardware.Camera2.MultiResolutionImageReader

參數

javaReference
IntPtr

nativeint

適用於

MultiResolutionImageReader(ICollection<MultiResolutionStreamInfo>, Int32, Int32)

根據相機裝置回傳的一組相機串流屬性,建立一個新的多解析度讀取器。

[Android.Runtime.Register(".ctor", "(Ljava/util/Collection;II)V", "", ApiSince=31)]
public MultiResolutionImageReader(System.Collections.Generic.ICollection<Android.Hardware.Camera2.Params.MultiResolutionStreamInfo> streams, int format, int maxImages);
[<Android.Runtime.Register(".ctor", "(Ljava/util/Collection;II)V", "", ApiSince=31)>]
new Android.Hardware.Camera2.MultiResolutionImageReader : System.Collections.Generic.ICollection<Android.Hardware.Camera2.Params.MultiResolutionStreamInfo> * int * int -> Android.Hardware.Camera2.MultiResolutionImageReader

參數

streams
ICollection<MultiResolutionStreamInfo>

多解析度串流資訊的群組。

format
Int32

這台多解析度閱讀器將產生的影像格式。

maxImages
Int32

使用者同時想存取的最大圖片數量。

屬性

備註

根據相機裝置回傳的一組相機串流屬性,建立一個新的多解析度讀取器。

有效的尺寸和格式取決於相機特性。 MultiResolutionImageReader 對於影像格式,若該格式符合由回傳 android.hardware.camera2.params.MultiResolutionStreamConfigurationMap#getOutputFormats的多解析度輸出串流格式,則相機裝置也支援該格式。 若支援影像格式, MultiResolutionImageReader 物件可由 streams 返回 android.hardware.camera2.params.MultiResolutionStreamConfigurationMap#getOutputInfo。

參數maxImages決定了在 中每個 中可取得ImageImageReader的最大物件數量MultiResolutionImageReader。 然而,請求更多緩衝區會佔用更多記憶體,因此重要的是只使用必要的最小數量。 強烈建議應用程式只從所有內部 ImageReader 物件中取得超過 maxImages 影像的影像。 透過追蹤 MultiResolution ImageReader 所取得的影像數量,應用程式無需為每個回調回 ImageReader.OnImageAvailableListener#onImageAvailable onImageAvailable 傳的內部影像閱讀器做帳務。

與一般的 ImageReader 不同,MultiResolution ImageReader 的配置序列更為複雜。 與其將同一表面傳給 OutputConfiguration 和 CaptureRequest,不如用呼叫 android.hardware.camera2.params.OutputConfiguration#createInstancesForMultiResolutionOutput 建立 OutputConfigurations 來建立會話,然後 #getSurface 再用來取得 CaptureRequest.Builder#addTarget the target for CaptureRequest。

Java 文件 android.hardware.camera2.MultiResolutionImageReader.MultiResolutionImageReader(java.util.Collection<android.hardware.camera2.params.MultiResolutionStreamInfo>, int, int)。

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

適用於

MultiResolutionImageReader(ICollection<MultiResolutionStreamInfo>, ImageFormatType, Int32, Int64)

根據攝影機裝置回傳的一組攝影機串流屬性,以及所需的格式、最大緩衝區容量和消費者使用標誌,建立一個新的多解析度讀取器。

[Android.Runtime.Register(".ctor", "(Ljava/util/Collection;IIJ)V", "", ApiSince=36)]
public MultiResolutionImageReader(System.Collections.Generic.ICollection<Android.Hardware.Camera2.Params.MultiResolutionStreamInfo> streams, Android.Graphics.ImageFormatType format, int maxImages, long usage);
[<Android.Runtime.Register(".ctor", "(Ljava/util/Collection;IIJ)V", "", ApiSince=36)>]
new Android.Hardware.Camera2.MultiResolutionImageReader : System.Collections.Generic.ICollection<Android.Hardware.Camera2.Params.MultiResolutionStreamInfo> * Android.Graphics.ImageFormatType * int * int64 -> Android.Hardware.Camera2.MultiResolutionImageReader

參數

streams
ICollection<MultiResolutionStreamInfo>

多解析度串流資訊組,用於建立包含多個 ImageReader 物件的多解析度讀取器。 每個 ImageReader 物件代表群組中的一個多解析度串流。

format
ImageFormatType

這台多解析度閱讀器將產生的影像格式。 這必須是 android.graphics.ImageFormat 其中一個或 android.graphics.PixelFormat 常數。 請注意,並非所有格式都支援,例如 ImageFormat.NV21。 支援的多解析度讀取器格式可透過 android.hardware.camera2.params.MultiResolutionStreamConfigurationMap#getOutputFormats查詢。

maxImages
Int32

使用者同時想存取的最大圖片數量。 這個數字應該盡量縮小,以減少記憶體的使用。 一旦使用者從任一內部 ImageReader 取得 maxImages,必須先釋出其中一張,才能透過 ImageReader ImageReader#acquireLatestImage()ImageReader#acquireNextImage()或 。 必須大於 0。

usage
Int64

內部影像閱讀器產生影像的預期用途。 請參閱 on 的 HardwareBuffer 使用情況列表,裡面有有效的使用位元清單。 另 HardwareBuffer#isSupported(int, int, int, int, long) 請參閱檢查組合是否支援。 如果不支援,這會觸發一個 IllegalArgumentException。

屬性

備註

根據攝影機裝置回傳的一組攝影機串流屬性,以及所需的格式、最大緩衝區容量和消費者使用標誌,建立一個新的多解析度讀取器。

有效的尺寸和格式取決於相機特性。 MultiResolutionImageReader 對於影像格式,若該格式符合由回傳 android.hardware.camera2.params.MultiResolutionStreamConfigurationMap#getOutputFormats的多解析度輸出串流格式,則相機裝置也支援該格式。 若支援影像格式, MultiResolutionImageReader 物件可由 streams 返回 android.hardware.camera2.params.MultiResolutionStreamConfigurationMap#getOutputInfo。

參數maxImages決定了在 中每個 中可取得ImageImageReader的最大物件數量MultiResolutionImageReader。 然而,請求更多緩衝區會佔用更多記憶體,因此重要的是只使用必要的最小數量。 強烈建議應用程式只從所有內部 ImageReader 物件中取得超過 maxImages 影像的影像。 透過追蹤 MultiResolution ImageReader 所取得的影像數量,應用程式無需為每個回調回 ImageReader.OnImageAvailableListener#onImageAvailable onImageAvailable 傳的內部影像閱讀器做帳務。

與一般的 ImageReader 不同,MultiResolution ImageReader 的配置序列更為複雜。 與其將同一表面傳給 OutputConfiguration 和 CaptureRequest,不如用呼叫 android.hardware.camera2.params.OutputConfiguration#createInstancesForMultiResolutionOutput 建立 OutputConfigurations 來建立會話,然後 #getSurface 再用來取得 CaptureRequest.Builder#addTarget the target for CaptureRequest。

Java 文件 android.hardware.camera2.MultiResolutionImageReader.MultiResolutionImageReader(java.util.Collection<android.hardware.camera2.params.MultiResolutionStreamInfo>, int, int, long)。

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

適用於