LJp2FileFormat::ReadMemory

#include "ltwrappr.h"

L_INT LJp2FileFormat::ReadMemory(pBuffer, uBufferSize, pBitmap, nBitsPerPixel, nOrder, pLoadOptions, pFileInfo, pReadCallBack, pUserData)

Loads a JPEG 2000 file from memory.

Parameters

L_UINT8 * pBuffer

Pointer to the file in memory to be loaded.

L_SIZE_T uBufferSize

Size of the file in memory (in bytes)

pBITMAPHANDLE pBitmap

Pointer to the bitmap handle referencing the bitmap to be filled with image data.

L_INT nBitsPerPixel

Resulting bitmap pixel depth. If zero [0], the bitmap will have the original files pixel depth (do not convert).

L_INT nOrder

The desired color order. Possible values are:

Value Meaning
ORDER_RGB [0] Read-green-blue order.
ORDER_BGR [1] Blue green-red order.
ORDER_GRAY [2] 12 or 16-bit grayscale image. 12 and 16-bit grayscale images are supported in Document/Medical imaging products only.
0 The data is 8 bits per pixel or less.
ORDER_RGBORGRAY [3] Load the image as red, green, blue, OR as a 12 or 16-bit grayscale image. 12 and 16-bit grayscale images are supported in Document/Medical imaging products only.
ORDER_BGRORGRAY [4] Load the image as blue, green, red, OR as a 12 or 16-bit grayscale image. 12 and 16-bit grayscale images are supported in Document/Medical imaging products only.
ORDER_ROMM [5] ROMM order. ROMM only supports 24 and 48-bit images.
ORDER_BGRORGRAYORROMM [6] Load the image as blue, green, red, OR as a 12 or 16-bit grayscale image OR as ROMM. 12 and 16-bit grayscale images are supported in Document/Medical imaging products only.

pLOADFILEOPTION pLoadOptions

Pointer to optional extended load options. Pass NULL to use the default load options.

pFILEINFO pFileInfo

Pointer to a FILEINFO structure. If nothing is known about the file pass NULL.

LFile::LoadFileCallBack pReadCallBack

Optional callback function for additional processing.

If you do not provide a callback function, pass NULL.

If you do provide a callback function, use the function pointer as the value of this parameter.

The callback function must adhere to the function prototype described in the LFile::LoadFileCallBack function.

L_VOID * pUserData

Void pointer that you can use to pass one or more additional parameters used by the callback function.

Returns

Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.

Comments

LJp2FileFormat::ReadMemory loads a JPEG 2000 file from memory. If the file contains multiple images, only the first image is returned. To load all images use either LJp2FileFormat::ReadListMemory or LJp2FileFormat::ReadCompositeMemory. To load a specific frame or frames, use LJp2FileFormat::ReadFramesMemory. pLoadOptions is used for loading code streams such as J2K code streams. All of the engines boxes will be reset and updated with the new loaded boxes only.

Required DLLs and Libraries

Platforms

Win32, x64.

See Also

Functions

Topics

Example

For an example, refer to LJp2FileFormat::SaveMemory.

Help Version 21.0.2021.7.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C++ Class Library Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.