Package com.avpkit.core
Class IPixelFormat
- java.lang.Object
-
- com.avpkit.ferry.RefCounted
-
- com.avpkit.core.IPixelFormat
-
public class IPixelFormat extends RefCounted
Information about how video data is formatted in an {IVideoPicture} object.
This specifies the color space and how many bits pixel data takes. It also
includes some utility methods for dealing with {Type#YUV420P} data; the
most common type of encoding used in video files I've run across.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classIPixelFormat.TypePixel format.static classIPixelFormat.YUVColorComponent
-
Field Summary
-
Fields inherited from class com.avpkit.ferry.RefCounted
swigCMemOwn
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedIPixelFormat(long cPtr, boolean cMemoryOwn)Internal Only.protectedIPixelFormat(long cPtr, boolean cMemoryOwn, java.util.concurrent.atomic.AtomicLong ref)Internal Only.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description IPixelFormatcopyReference()Create a new IPixelFormat object that is actually referring to the exact same underlying native object.booleanequals(java.lang.Object obj)Compares two values, returning true if the underlying objects in native code are the same object.static longgetCPtr(IPixelFormat obj)Internal Only.longgetMyCPtr()Internal Only.static shortgetYUV420PPixel(IVideoPicture frame, int x, int y, IPixelFormat.YUVColorComponent c)Returns the byte for the coordinates at x and y for the color component c.
static intgetYUV420PPixelOffset(IVideoPicture frame, int x, int y, IPixelFormat.YUVColorComponent c)For a given x and y in a frame, and a given color components, this method
tells you how far into the actual data you'd have to go to find the byte that
represents that color/coordinate combination.
inthashCode()Get a hashable value for this object.static voidsetYUV420PPixel(IVideoPicture frame, int x, int y, IPixelFormat.YUVColorComponent c, short value)Sets the value of the color component c at the coordinates x and y in the given frame.
-
Methods inherited from class com.avpkit.ferry.RefCounted
acquire, delete, getCPtr, getCurrentRefCount, getJavaRefCount, release
-
-
-
-
Constructor Detail
-
IPixelFormat
protected IPixelFormat(long cPtr, boolean cMemoryOwn)
Internal Only.
-
IPixelFormat
protected IPixelFormat(long cPtr, boolean cMemoryOwn, java.util.concurrent.atomic.AtomicLong ref)
Internal Only.
-
-
Method Detail
-
getCPtr
public static long getCPtr(IPixelFormat obj)
Internal Only. Not part of public API. Get the raw value of the native object that obj is proxying for.- Parameters:
obj- The java proxy object for a native object.- Returns:
- The raw pointer obj is proxying for.
-
getMyCPtr
public long getMyCPtr()
Internal Only. Not part of public API. Get the raw value of the native object that we're proxying for.- Overrides:
getMyCPtrin classRefCounted- Returns:
- The raw pointer we're proxying for.
-
copyReference
public IPixelFormat copyReference()
Create a new IPixelFormat object that is actually referring to the exact same underlying native object.- Overrides:
copyReferencein classRefCounted- Returns:
- the new Java object.
-
equals
public boolean equals(java.lang.Object obj)
Compares two values, returning true if the underlying objects in native code are the same object. That means you can have two different Java objects, but when you do a comparison, you'll find out they are the EXACT same object.- Overrides:
equalsin classjava.lang.Object- Returns:
- True if the underlying native object is the same. False otherwise.
-
hashCode
public int hashCode()
Get a hashable value for this object.- Overrides:
hashCodein classjava.lang.Object- Returns:
- the hashable value.
-
getYUV420PPixel
public static short getYUV420PPixel(IVideoPicture frame, int x, int y, IPixelFormat.YUVColorComponent c)
Returns the byte for the coordinates at x and y for the color component c.
- Parameters:
frame- The frame to get the byte fromx- X coordinate in pixels, where 0 is the left hand edge of the image.y- Y coordinate in pixels, where 0 is the top edge of the image.c- YUVColor component
- Returns:
- the pixel byte for that x, y, c combination
-
setYUV420PPixel
public static void setYUV420PPixel(IVideoPicture frame, int x, int y, IPixelFormat.YUVColorComponent c, short value)
Sets the value of the color component c at the coordinates x and y in the given frame.
- Parameters:
frame- The frame to set the byte inx- X coordinate in pixels, where 0 is the left hand edge of the image.y- Y coordinate in pixels, where 0 is the top edge of the image.c- YUVColor component to setvalue- The new value of that pixel color component
-
getYUV420PPixelOffset
public static int getYUV420PPixelOffset(IVideoPicture frame, int x, int y, IPixelFormat.YUVColorComponent c)
For a given x and y in a frame, and a given color components, this method
tells you how far into the actual data you'd have to go to find the byte that
represents that color/coordinate combination.
- Parameters:
frame- The frame to get the byte fromx- X coordinate in pixels, where 0 is the left hand edge of the image.y- Y coordinate in pixels, where 0 is the top edge of the image.c- YUVColor component
- Returns:
- the offset in bytes, starting from the start of the frame data, where
the data for this pixel resides.
-
-