Class ImageData

java.lang.Object
com.digimarc.capture.camera.ImageData

public class ImageData extends Object
Container for image data. In most cases the data can be either array of bytes or array of Planes but not both.
  • Field Details

    • mImageData

      public final Object mImageData
      Type of image data
    • mWidth

      public final int mWidth
      Width of image data
    • mHeight

      public final int mHeight
      Height of image data
    • mRowBytes

      public final int mRowBytes
      Bytes per row of image data
    • mImageFormat

      public final HelperCaptureFormat mImageFormat
      HelperCaptureFormat of image data
    • mIsBitmap

      public final boolean mIsBitmap
      Is image data a formatted Bitmap ?
    • mCaptureMeta

      @Nullable public android.hardware.camera2.CaptureResult mCaptureMeta
      Camera2 device meta data. Only required for raw-sensor processing.
    • mGains

      @Nullable public float[] mGains
      Meta-data gains and color correction data. For Internal use or file-based testing only.
    • mTransform

      @Nullable public float[] mTransform
      Meta-data color correction data. For Internal use or file-based testing only.
  • Constructor Details

    • ImageData

      public ImageData(@NonNull Object data, int _width, int _height, int _rowBytes, @NonNull HelperCaptureFormat _imageFormat, boolean _isBitmap)
    • ImageData

      public ImageData(@NonNull Object data, @NonNull ImageData source)
  • Method Details

    • attachToImage

      @NonNull public static ImageData attachToImage(@NonNull android.media.Image image)
      Creates an ImageData object and initializes it with the contents of a Camera2 Image buffer. The data within the Image is used as it stands - new buffers or copies of the data are not created. The image will become invalid once Image.close() is called.
      Parameters:
      image - Camera2 Image buffer
      Returns:
      An ImageData object that wraps the passed in image.
    • isRepackageRequired

      public boolean isRepackageRequired()
      The internal readers within DMSDK require ImageData with a BufferType of ImagePlane[]. The ImagePlanes also need to have their buffers allocated as direct buffers. This method checks the content of the image to determine whether it will need to be repackaged before being passed to the readers.
      Returns:
      True if the image needs repackaging, false otherwise.
    • getImageBufferSize

      public int getImageBufferSize()
      Get the image buffer size needed to create a copy of this image. For images that are holding a byte[] this will be the size of the array. For images holding an ImagePlane[] it will be the size of the buffer in the first plane.
      Returns:
      Size needed to copy this image.