Doc.loadRawImageFromMem

Loads an image which has raw image format from buffer.

This function loads the data without any conversion. So it is usually faster than the other functions. The formats that loadRawImageFromMem() can load is the same as loadRawImageFromFile()

class Doc
Image
loadRawImageFromMem
(
ubyte* buf
,
uint width
,
uint height
,
ColorSpace colorSpace
,)

Parameters

buf ubyte*

The pointer to the image data.

width uint

The width of an image file.

height uint

The height of an image file.

colorSpace ColorSpace

the ColorSpace. deviceGrey, deviceRGB or deviceCMYK are allowed.

bitsPerComponent uint

The bit size of each color component. The valid value is either 1, 2, 4, 8.

Return Value

Type: Image

When loadRawImageFromMem() succeeds, it returns an instance of a Image object. Otherwise, it returns null and error-handler is called.

Meta