Package com.banuba.sdk.frame
Class FramePixelBuffer
java.lang.Object
com.banuba.sdk.frame.FramePixelBuffer
-
Constructor Summary
ConstructorDescriptionFramePixelBuffer
(ByteBuffer data, int[] planeOffset, int[] bytesPerRow, int[] bytesPerPixel, int width, int height, FramePixelBufferFormat format) Create a new FramePixelBuffer -
Method Summary
Modifier and TypeMethodDescriptionGet buffer with image data.int
Get pixel stride of the zero plane.int
getBytesPerPixelOfPlane
(int planeNumber) Get pixel stride for plane.int
Get row stride of the zero plane.int
getBytesPerRowOfPlane
(int planeNumber) Get row stride for plane.Get format of the imageint
Get the height of the image.int
getHeightOfPlane
(int planeNumber) Get the height of the plane.int
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.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 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 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 Details
-
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
Get buffer with image data.- Returns:
- buffer
-
getPlane
Get the subbuffer of the plane.- Parameters:
planeNumber
- number of plane- Returns:
- buffer
-