Sdílet prostřednictvím


YuvImage.CompressToJpegR(YuvImage, Int32, Stream) Method

Definition

Compress the HDR image into JPEG/R format.

[Android.Runtime.Register("compressToJpegR", "(Landroid/graphics/YuvImage;ILjava/io/OutputStream;)Z", "GetCompressToJpegR_Landroid_graphics_YuvImage_ILjava_io_OutputStream_Handler", ApiSince=34)]
public virtual bool CompressToJpegR (Android.Graphics.YuvImage sdr, int quality, System.IO.Stream stream);
[<Android.Runtime.Register("compressToJpegR", "(Landroid/graphics/YuvImage;ILjava/io/OutputStream;)Z", "GetCompressToJpegR_Landroid_graphics_YuvImage_ILjava_io_OutputStream_Handler", ApiSince=34)>]
abstract member CompressToJpegR : Android.Graphics.YuvImage * int * System.IO.Stream -> bool
override this.CompressToJpegR : Android.Graphics.YuvImage * int * System.IO.Stream -> bool

Parameters

sdr
YuvImage

The SDR image, only ImageFormat.YUV_420_888 is supported.

quality
Int32

Hint to the compressor, 0-100. 0 meaning compress for small size, 100 meaning compress for max quality.

stream
Stream

OutputStream to write the compressed data.

Returns

True if the compression is successful.

Attributes

Remarks

Compress the HDR image into JPEG/R format.

Sample usage: hdr_image.compressToJpegR(sdr_image, 90, stream);

For the SDR image, only YUV_420_888 image format is supported, and the following color spaces are supported: ColorSpace.Named.SRGB, ColorSpace.Named.DISPLAY_P3

For the HDR image, only YCBCR_P010 image format is supported, and the following color spaces are supported: ColorSpace.Named.BT2020_HLG, ColorSpace.Named.BT2020_PQ

Java documentation for android.graphics.YuvImage.compressToJpegR(android.graphics.YuvImage, int, java.io.OutputStream).

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