public class YuvImage
YuvImage contains YUV data and provides a method that compresses a region of
the YUV data to a Jpeg. The YUV data should be provided as a single byte
array irrespective of the number of image planes in it.
Currently only ImageFormat.NV21 and ImageFormat.YUY2 are supported.
To compress a rectangle region in the YUV data, users have to specify the
region by left, top, width and height.
|Constructor and Description
Construct an YuvImage.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public YuvImage(byte yuv,
Construct an YuvImage.
yuv - The YUV data. In the case of more than one image plane, all the planes must be
concatenated into a single byte array.
format - The YUV data format as defined in
width - The width of the YuvImage.
height - The height of the YuvImage.
strides - (Optional) Row bytes of each image plane. If yuv contains padding, the stride
of each image must be provided. If strides is null, the method assumes no
padding and derives the row bytes by format and width itself.
IllegalArgumentException - if format is not support; width or height <= 0; or yuv is
public boolean compressToJpeg(Rect rectangle,
Compress a rectangle region in the YuvImage to a jpeg.
Only ImageFormat.NV21 and ImageFormat.YUY2
are supported for now.
rectangle - The rectangle region to be compressed. The medthod checks if rectangle is
inside the image. Also, the method modifies rectangle if the chroma pixels
in it are not matched with the luma pixels in it.
quality - Hint to the compressor, 0-100. 0 meaning compress for
small size, 100 meaning compress for max quality.
stream - OutputStream to write the compressed data.
- True if the compression is successful.
IllegalArgumentException - if rectangle is invalid; quality is not within [0,
100]; or stream is null.
public int getWidth()
- the width of the image.
public int getHeight()
- the height of the image.
Java Enterprise Edition (EE)
Java Standard Edition (SE)
RFC (standard status)
RFC (proposed standard status)
RFC (draft standard status)
RFC (informational status)
RFC (experimental status)
RFC (best current practice status)
RFC (historic status)
RFC (unknown status)
All information of this service is derived from the free sources and is provided solely in the form of quotations.
This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 155 / 158662411. Delta: 0.06569 с