Image.toBuffer Method¶
Module: Image
Definition¶
Exports the image to a buffer.
The compression level meaning depends on the algorithm used:
For JPEG compression, the value is the expected quality and may vary from 1 to 100.
For JPEG2000 compression, the value is the compression rate and may vary from 1 to 512.
For PNG compression, the value is the compression rate and may vary from 1 to 10.
For all other formats, the value is ignored.
to_buffer(self, image_format: ImageFormat, compression_level: float) -> bytearray
Parameters
image_formatImageFormatin The image format to export the image to.compression_levelfloatin The compression level to be applied.
Returns
bytearrayBuffer that receives the image data.
Exceptions
An error has occurred during Face Library execution.
Uint8List toBuffer(ImageFormat imageFormat, double compressionLevel)
Parameters
imageFormatImageFormatin The image format to export the image to.compressionLeveldoublein The compression level to be applied.
Returns
Uint8ListBuffer that receives the image data.
Exceptions
An error has occurred during Face Library execution.
public byte[] ToBuffer(ImageFormat imageFormat, float compressionLevel)
Parameters
imageFormatImageFormatin The image format to export the image to.compressionLevelfloatin The compression level to be applied.
Returns
byte[]Buffer that receives the image data.
Exceptions
An error has occurred during Face Library execution.
public byte[] toBuffer(ImageFormat imageFormat, float compressionLevel) throws FaceException
Parameters
imageFormatImageFormatin The image format to export the image to.compressionLevelfloatin The compression level to be applied.
Returns
byte[]Buffer that receives the image data.
Exceptions
An error has occurred during Face Library execution.
public func toBuffer(imageFormat: ImageFormat, compressionLevel: Float) throws -> [UInt8]
Parameters
imageFormatImageFormatin The image format to export the image to.compressionLevelFloatin The compression level to be applied.
Returns
[UInt8]Buffer that receives the image data.
Exceptions
An error has occurred during Face Library execution.
int id3FaceImage_ToBuffer (
ID3_FACE_IMAGE hImage,
id3FaceImageFormat eImageFormat,
float compressionLevel,
unsigned char * data,
int * dataSize)
Parameters
hImageID3_FACE_IMAGEin Handle to the Image object.eImageFormatid3FaceImageFormatin The image format to export the image to.compressionLevelfloatin The compression level to be applied.dataunsigned char *out Buffer that receives the image data.dataSizeint *in Size of the ‘data’ buffer. Receives the number of elements in the ‘data’ array.
Returns