Package com.banuba.sdk.frame
Class FramePixelBuffer
- java.lang.Object
-
- com.banuba.sdk.frame.FramePixelBuffer
-
public class FramePixelBuffer extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description FramePixelBuffer(java.nio.ByteBuffer data, int[] planeOffset, int[] bytesPerRow, int[] bytesPerPixel, int width, int height, FramePixelBufferFormat format)
Create a new FramePixelBuffer
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.nio.ByteBuffer
getBuffer()
Get buffer with image data.int
getBytesPerPixel()
Get pixel stride of the zero plane.int
getBytesPerPixelOfPlane(int planeNumber)
Get pixel stride for plane.int
getBytesPerRow()
Get row stride of the zero plane.int
getBytesPerRowOfPlane(int planeNumber)
Get row stride for plane.FramePixelBufferFormat
getFormat()
Get format of the imageint
getHeight()
Get the height of the image.int
getHeightOfPlane(int planeNumber)
Get the height of the plane.int
getNumberOfPlanes()
Get the number of planes.int
getOffsetOfPlane(int planeNumber)
Get offset from the start of the buffer to the start of the plane's subbuffer.java.nio.ByteBuffer
getPlane(int planeNumber)
Get the subbuffer of the plane.int
getWidth()
Get the width of the image.int
getWidthOfPlane(int planeNumber)
Get the width of the plane.
-
-
-
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 pixelsplaneOffset
- offsets to planesbytesPerRow
- strides for each planebytesPerPixel
- strides for pixels for each planewidth
- width of imageheight
- height of imageformat
- the format of the stored image (bpc8 - 1 plane; or yuv - 3 planes)
-
-
Method Detail
-
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:
Information about the number of planes for each format
-
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:
Information about the number of planes for each format
-
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:
Information about the number of planes for each format
-
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
-
-