Class FrameFormat
- java.lang.Object
-
- com.azure.android.ai.vision.common.FrameFormat
-
- All Implemented Interfaces:
AutoCloseable
public final class FrameFormat extends Object implements AutoCloseable
FrameFormat class Note: close() must be called in order to release underlying resources held by the object.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Explicitly frees any external resource attached to the objectstatic FrameFormat
createFourCCFormat(char ch1, char ch2, char ch3, char ch4, int width, int height, int stride)
Creates FrameFormat instance from FourCCFormatstatic FrameFormat
createRGBFormat(int bitsPerPixel, int width, int height, int stride)
Creates FrameFormat instance from RGB formatint
getBitsPerPixel()
Gets the image format's bits per pixel value.int
getFourCCAsInt()
Gets the image format's FOURCC as integer valueString
getFourCCAsString()
Gets the image format's FOURCC as ASCII stringSafeHandle
getHandle()
Gets the internal native handle.int
getHeight()
Gets the image format's pixel height.PropertyCollection
getProperties()
Gets the collection of additional FrameFormat propertiesint
getStride()
Gets the image format's pixel stride.int
getWidth()
Gets the image format's pixel width.void
setBitsPerPixel(int value)
Sets the image format's bits per pixel value.
-
-
-
Method Detail
-
createFourCCFormat
public static FrameFormat createFourCCFormat(char ch1, char ch2, char ch3, char ch4, int width, int height, int stride)
Creates FrameFormat instance from FourCCFormat- Parameters:
ch1
- First character of the FourCCch2
- Second character of the FourCCch3
- Third character of the FourCCch4
- Fourth character of the FourCCwidth
- Width of the frame, in pixelsheight
- Height of the frame, in pixelsstride
- Width of the frame, in bytes- Returns:
- A FrameFormat instance
-
createRGBFormat
public static FrameFormat createRGBFormat(int bitsPerPixel, int width, int height, int stride)
Creates FrameFormat instance from RGB format- Parameters:
bitsPerPixel
- Number of bits describing each pixelwidth
- Width of the frame, in pixelsheight
- Height of the frame, in pixelsstride
- Width of the frame, in bytes- Returns:
- A FrameFormat instance
-
getFourCCAsString
public String getFourCCAsString()
Gets the image format's FOURCC as ASCII string- Returns:
- The FOURCC format code as ASCII string
-
getFourCCAsInt
public int getFourCCAsInt()
Gets the image format's FOURCC as integer value- Returns:
- The FOURCC format code as a integer
-
getHeight
public int getHeight()
Gets the image format's pixel height.- Returns:
- The image pixel height.
-
getWidth
public int getWidth()
Gets the image format's pixel width.- Returns:
- The image pixel width.
-
getStride
public int getStride()
Gets the image format's pixel stride.- Returns:
- The image pixel stride.
-
getBitsPerPixel
public int getBitsPerPixel()
Gets the image format's bits per pixel value.- Returns:
- The image's bits per pixel value.
-
setBitsPerPixel
public void setBitsPerPixel(int value)
Sets the image format's bits per pixel value.- Parameters:
value
- The image's bits per pixel value.
-
getProperties
public PropertyCollection getProperties()
Gets the collection of additional FrameFormat properties- Returns:
- A property collection instance
-
getHandle
public SafeHandle getHandle()
Gets the internal native handle. TODO This is internal use only- Returns:
- A SafeHandle instance
-
close
public void close()
Explicitly frees any external resource attached to the object- Specified by:
close
in interfaceAutoCloseable
-
-