toBufferObject method

void toBufferObject(
  1. ImageFormat imageFormat,
  2. double compressionLevel,
  3. ImageBuffer buffer
)

Copies the image to a buffer in the specified format. 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.

param imageFormat The output image format. param compressionLevel The compression level to be applied. param buffer The image buffer that receives the image data. throws FaceException An error has occurred during Face Library execution.

Implementation

void toBufferObject(ImageFormat imageFormat, double compressionLevel, ImageBuffer buffer) {
  var err = faceSDK.id3FaceImage_ToBufferObject(_pHandle.value, imageFormat.value, compressionLevel, buffer.handle);
  if (err != FaceError.success.value) {
    throw FaceException(err);
  }
}