Class ImageUtils


  • public class ImageUtils
    extends Object
    • Method Detail

      • getTransformationMatrix

        public static Matrix getTransformationMatrix​(int srcWidth,
                                                     int srcHeight,
                                                     int dstWidth,
                                                     int dstHeight,
                                                     int applyRotation,
                                                     boolean maintainAspectRatio)
        Returns a transformation matrix from one reference frame into another. Handles cropping (if maintaining aspect ratio is desired) and rotation.
        Parameters:
        srcWidth - Width of source frame.
        srcHeight - Height of source frame.
        dstWidth - Width of destination frame.
        dstHeight - Height of destination frame.
        applyRotation - Amount of rotation to apply from one frame to another. Must be a multiple of 90.
        maintainAspectRatio - If true, will ensure that scaling in x and y remains constant, cropping the image if necessary.
        Returns:
        The transformation fulfilling the desired requirements.
      • convertYUV420ToARGB8888

        public static void convertYUV420ToARGB8888​(byte[] yData,
                                                   byte[] uData,
                                                   byte[] vData,
                                                   int width,
                                                   int height,
                                                   int yRowStride,
                                                   int uvRowStride,
                                                   int uvPixelStride,
                                                   int[] out)