Class RawImageData


  • public class RawImageData
    extends Object
    • Constructor Detail

      • RawImageData

        public RawImageData​(byte[] data,
                            int width,
                            int height)
    • Method Detail

      • getData

        public byte[] getData()
      • getWidth

        public int getWidth()
      • getHeight

        public int getHeight()
      • cropAndScale

        public RawImageData cropAndScale​(Rect cropRect,
                                         int scale)
      • rotateCameraPreview

        public RawImageData rotateCameraPreview​(int cameraRotation)
      • rotateCW

        public static byte[] rotateCW​(byte[] data,
                                      int imageWidth,
                                      int imageHeight)
        Rotate an image by 90 degrees CW.
        Parameters:
        data - the image data, in with the first width * height bytes being the luminance data.
        imageWidth - the width of the image
        imageHeight - the height of the image
        Returns:
        the rotated bytes
      • rotate180

        public static byte[] rotate180​(byte[] data,
                                       int imageWidth,
                                       int imageHeight)
        Rotate an image by 180 degrees.
        Parameters:
        data - the image data, in with the first width * height bytes being the luminance data.
        imageWidth - the width of the image
        imageHeight - the height of the image
        Returns:
        the rotated bytes
      • rotateCCW

        public static byte[] rotateCCW​(byte[] data,
                                       int imageWidth,
                                       int imageHeight)
        Rotate an image by 90 degrees CCW.
        Parameters:
        data - the image data, in with the first width * height bytes being the luminance data.
        imageWidth - the width of the image
        imageHeight - the height of the image
        Returns:
        the rotated bytes