Face SDK  1.13.0 Mozart release
Face Recognition Software Development Kit
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
com.tech5.FaceSDK.Image Class Reference
Inheritance diagram for com.tech5.FaceSDK.Image:

Public Member Functions

int getWidth ()
 
int getHeight ()
 
long getStride ()
 
byte [] getData ()
 
boolean equals (Object o)
 
int hashCode ()
 
void close () throws Exception
 

Static Public Member Functions

static Image loadImageFromFile (String fileName) throws FaceSDKException
 
static Image loadImageFromData (byte[] data) throws FaceSDKException
 
static Image makeImageFromData (byte[] data, int width, int height) throws FaceSDKException
 
static Image makeImageFromData (byte[] data, int width, int height, int stride) throws FaceSDKException
 

Protected Member Functions

void finalize () throws Throwable
 

Detailed Description

An image keeps bitmap data in 24bpp RBG format. Use loadImageFromData(byte[]), loadImageFromFile(String) and makeImageFromData(byte[], int, int) functions for instantiate the image.

Member Function Documentation

◆ getData()

byte [] com.tech5.FaceSDK.Image.getData ( )
inline

data array of bitmap.

Returns
a copy of data bitmap, where length is width*stride*height.

◆ getHeight()

int com.tech5.FaceSDK.Image.getHeight ( )
inline

image height in pixels.

Returns
height in pixels.

◆ getStride()

long com.tech5.FaceSDK.Image.getStride ( )
inline

bitmap row size in bytes.

Returns
row size in bytes.

◆ getWidth()

int com.tech5.FaceSDK.Image.getWidth ( )
inline

image width in pixels.

Returns
width in pixels.

◆ loadImageFromData()

static Image com.tech5.FaceSDK.Image.loadImageFromData ( byte []  data) throws FaceSDKException
inlinestatic

Decodes image from memory. Image must be in RBG or BRG channels order. Grayscale or images with alfa-channel not allowed.

Parameters
dataarray with encoded image.
Returns
the loaded image.
Exceptions
FaceSDKExceptionin case of an error in native code.
IllegalArgumentExceptionif data is null or empty.

◆ loadImageFromFile()

static Image com.tech5.FaceSDK.Image.loadImageFromFile ( String  fileName) throws FaceSDKException
inlinestatic

Decodes image from file. Image must be in RBG or BRG channels order. Grayscale or images with alfa-channel not allowed.

Parameters
fileNamePath to file with an encoded image.
Returns
the loaded image.
Exceptions
FaceSDKExceptionin case of an error in native code.
IllegalArgumentExceptionif fileName is null or empty.

◆ makeImageFromData() [1/2]

static Image com.tech5.FaceSDK.Image.makeImageFromData ( byte []  data,
int  width,
int  height 
) throws FaceSDKException
inlinestatic

Makes image object from bitmap. Bitmap must 24bpp RGB format. Assumes stride is width*3

Parameters
dataarray with bitmap.
widthbitmap width in pixels.
heightbitmap height in pixels.
Returns
the loaded image.
Exceptions
FaceSDKExceptionin case of an error in native code.
IllegalArgumentExceptionif data is null or empty.

◆ makeImageFromData() [2/2]

static Image com.tech5.FaceSDK.Image.makeImageFromData ( byte []  data,
int  width,
int  height,
int  stride 
) throws FaceSDKException
inlinestatic

Makes image object from bitmap with specified stride. Bitmap must 24bpp RGB format.

Parameters
dataarray with bitmap.
widthbitmap width in pixels.
heightbitmap height in pixels.
stridebitmap row size in bytes.
Returns
the loaded image.
Exceptions
FaceSDKExceptionin case of an error in native code.
IllegalArgumentExceptionif data is null or empty.

The documentation for this class was generated from the following file: