Class FramePixelBuffer

java.lang.Object
com.banuba.sdk.frame.FramePixelBuffer

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

    • FramePixelBuffer

      public FramePixelBuffer(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 Details

    • getFormat

      public FramePixelBufferFormat getFormat()
      Get format of the image
      Returns:
      FramePixelBufferFormat
    • getNumberOfPlanes

      public int getNumberOfPlanes()
      Get the number of planes.
      Returns:
      number of planes
      See Also:
    • getWidth

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

      public int getWidthOfPlane(int planeNumber)
      Get the width of the plane.
      Parameters:
      planeNumber - number of plane
      Returns:
      width of plane
      See Also:
    • getHeight

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

      public int getHeightOfPlane(int planeNumber)
      Get the height of the plane.
      Parameters:
      planeNumber - number of plane
      Returns:
      height of plane
      See Also:
    • getBytesPerPixel

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

      public int getBytesPerPixelOfPlane(int planeNumber)
      Get pixel stride for plane.
      Parameters:
      planeNumber - number of plane
      Returns:
      pixel stride
      See Also:
    • 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 ByteBuffer getBuffer()
      Get buffer with image data.
      Returns:
      buffer
    • getPlane

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