Class FramePixelBuffer


  • public class FramePixelBuffer
    extends java.lang.Object
    Stores a pixel array data buffer, image sizes, and format. Used for both input IInput and output IOutput data in the Player.
    • Constructor Detail

      • FramePixelBuffer

        public FramePixelBuffer​(java.nio.ByteBuffer data,
                                int[] planeOffset,
                                int[] bytesPerRow,
                                int[] bytesPerPixel,
                                int width,
                                int height,
                                FramePixelBufferFormat format)
        Create a new FramePixelBuffer
        Parameters:
        data - array of pixels
        planeOffset - offsets to planes
        bytesPerRow - strides for each plane
        bytesPerPixel - strides for pixels for each plane
        width - width of image
        height - height of image
        format - the format of the stored image (bpc8 - 1 plane; or yuv - 3 planes)
    • Method Detail

      • getWidth

        public int getWidth()
        Get the width of the image.
        Returns:
        width
      • getHeight

        public int getHeight()
        Get the height of the image.
        Returns:
        height
      • getBytesPerPixel

        public int getBytesPerPixel()
        Get pixel stride of the zero plane.
        Returns:
        pixel stride
        See Also:
        Information about the formats
      • getBytesPerPixelOfPlane

        public int getBytesPerPixelOfPlane​(int planeNumber)
        Get pixel stride for plane.
        Parameters:
        planeNumber - number of plane
        Returns:
        pixel stride
        See Also:
        Information about the formats
      • getBytesPerRow

        public int getBytesPerRow()
        Get row stride of the zero plane.
        Returns:
        row stride
      • getBytesPerRowOfPlane

        public int getBytesPerRowOfPlane​(int planeNumber)
        Get row stride for plane.
        Parameters:
        planeNumber - number of plane
        Returns:
        row stride
      • getOffsetOfPlane

        public int getOffsetOfPlane​(int planeNumber)
        Get offset from the start of the buffer to the start of the plane's subbuffer.
        Parameters:
        planeNumber - number of plane
        Returns:
        offset in bytes
      • getBuffer

        public java.nio.ByteBuffer getBuffer()
        Get buffer with image data.
        Returns:
        buffer
      • getPlane

        public java.nio.ByteBuffer getPlane​(int planeNumber)
        Get the subbuffer of the plane.
        Parameters:
        planeNumber - number of plane
        Returns:
        buffer