DocumentImage.fromRawBuffer Method¶
Module: DocumentImage
Definition¶
Creates an Image from the specified raw data buffer.
@staticmethod
from_raw_buffer(pixels: bytearray, width: int, height: int, stride: int, src_pixel_format: PixelFormat, dst_pixel_format: PixelFormat) -> DocumentImage
Parameters
pixelsbytearrayin A buffer that contains image pixels.widthintin The width, in pixels, of the image.heightintin The height, in pixels, of the image.strideintin The stride, in pixels, of the image.src_pixel_formatPixelFormatin The pixel format of the input image.dst_pixel_formatPixelFormatin The pixel format into which to convert the input image.
Returns
The newly created document image.
Exceptions
An error has occurred during Document Library execution.
static DocumentImage fromRawBuffer(Uint8List? pixels, int width, int height, int stride, PixelFormat srcPixelFormat, PixelFormat dstPixelFormat)
Parameters
pixelsUint8Listin A buffer that contains image pixels.widthintin The width, in pixels, of the image.heightintin The height, in pixels, of the image.strideintin The stride, in pixels, of the image.srcPixelFormatPixelFormatin The pixel format of the input image.dstPixelFormatPixelFormatin The pixel format into which to convert the input image.
Returns
The newly created document image.
Exceptions
An error has occurred during Document Library execution.
public static DocumentImage FromRawBuffer(byte[] pixels, int width, int height, int stride, PixelFormat srcPixelFormat, PixelFormat dstPixelFormat)
Parameters
pixelsbyte[]in A buffer that contains image pixels.widthintin The width, in pixels, of the image.heightintin The height, in pixels, of the image.strideintin The stride, in pixels, of the image.srcPixelFormatPixelFormatin The pixel format of the input image.dstPixelFormatPixelFormatin The pixel format into which to convert the input image.
Returns
The newly created document image.
Exceptions
An error has occurred during Document Library execution.
public static DocumentImage fromRawBuffer(byte[] pixels, int width, int height, int stride, PixelFormat srcPixelFormat, PixelFormat dstPixelFormat) throws DocumentException
Parameters
pixelsbyte[]in A buffer that contains image pixels.widthintin The width, in pixels, of the image.heightintin The height, in pixels, of the image.strideintin The stride, in pixels, of the image.srcPixelFormatPixelFormatin The pixel format of the input image.dstPixelFormatPixelFormatin The pixel format into which to convert the input image.
Returns
The newly created document image.
Exceptions
An error has occurred during Document Library execution.
public static func fromRawBuffer(pixels: [UInt8], width: Int32, height: Int32, stride: Int32, srcPixelFormat: PixelFormat, dstPixelFormat: PixelFormat) throws -> DocumentImage
Parameters
pixels[UInt8]in A buffer that contains image pixels.widthInt32in The width, in pixels, of the image.heightInt32in The height, in pixels, of the image.strideInt32in The stride, in pixels, of the image.srcPixelFormatPixelFormatin The pixel format of the input image.dstPixelFormatPixelFormatin The pixel format into which to convert the input image.
Returns
The newly created document image.
Exceptions
An error has occurred during Document Library execution.
int id3DocumentImage_FromRawBuffer (
ID3_DOCUMENT_IMAGE hDocumentImage,
unsigned char * pixels,
int pixelsSize,
int width,
int height,
int stride,
id3DocumentPixelFormat eSrcPixelFormat,
id3DocumentPixelFormat eDstPixelFormat)
Parameters
hDocumentImageID3_DOCUMENT_IMAGEin Handle to the DocumentImage object.pixelsunsigned char *in A buffer that contains image pixels.pixelsSizeintin Size of the ‘pixels’ buffer.widthintin The width, in pixels, of the image.heightintin The height, in pixels, of the image.strideintin The stride, in pixels, of the image.eSrcPixelFormatid3DocumentPixelFormatin The pixel format of the input image.eDstPixelFormatid3DocumentPixelFormatin The pixel format into which to convert the input image.
Returns