Package com.twilio.video
Class Rgba8888Buffer
- java.lang.Object
-
- com.twilio.video.Rgba8888Buffer
-
- All Implemented Interfaces:
RefCounted
,VideoFrame.Buffer
public class Rgba8888Buffer extends java.lang.Object implements VideoFrame.Buffer
A frame buffer that represents an image in the ARGB format with 8 bits of of precision.
-
-
Constructor Summary
Constructors Constructor Description Rgba8888Buffer(java.nio.ByteBuffer data, int width, int height)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description VideoFrame.Buffer
cropAndScale(int cropX, int cropY, int cropWidth, int cropHeight, int scaleWidth, int scaleHeight)
Crops a region defined by |cropx|, |cropY|, |cropWidth| and |cropHeight|.java.nio.ByteBuffer
getData()
Returns the raw frame buffer data.int
getHeight()
Returns the frame height.int
getWidth()
Returns the frame width.void
release()
Decreases ref count by one.void
retain()
Increases ref count by one.VideoFrame.I420Buffer
toI420()
Converts the buffer to aVideoFrame.I420Buffer
.
-
-
-
Method Detail
-
getData
public java.nio.ByteBuffer getData()
Returns the raw frame buffer data.
-
getWidth
public int getWidth()
Returns the frame width.- Specified by:
getWidth
in interfaceVideoFrame.Buffer
-
getHeight
public int getHeight()
Returns the frame height.- Specified by:
getHeight
in interfaceVideoFrame.Buffer
-
toI420
public VideoFrame.I420Buffer toI420()
Converts the buffer to aVideoFrame.I420Buffer
.- Specified by:
toI420
in interfaceVideoFrame.Buffer
- Returns:
- a copy of the original buffer converted to an I420 buffer.
-
retain
public void retain()
Description copied from interface:RefCounted
Increases ref count by one.- Specified by:
retain
in interfaceRefCounted
- Specified by:
retain
in interfaceVideoFrame.Buffer
-
release
public void release()
Description copied from interface:RefCounted
Decreases ref count by one. When the ref count reaches zero, resources related to the object will be freed.- Specified by:
release
in interfaceRefCounted
- Specified by:
release
in interfaceVideoFrame.Buffer
-
cropAndScale
public VideoFrame.Buffer cropAndScale(int cropX, int cropY, int cropWidth, int cropHeight, int scaleWidth, int scaleHeight)
Description copied from interface:VideoFrame.Buffer
Crops a region defined by |cropx|, |cropY|, |cropWidth| and |cropHeight|. Scales it to size |scaleWidth| x |scaleHeight|.- Specified by:
cropAndScale
in interfaceVideoFrame.Buffer
-
-