LEADTOOLS Raster Imaging C++ Class Library Help > Classes and Member Functions > LMarker > LMarker Member Functions > LMarker::GetMarker |
#include "ltwrappr.h"
virtual L_INT LMarker::GetMarker(uIndex, puMarker, puMarkerSize, pMarkerData)
L_UINT uIndex; |
/* marker index */ |
L_UINT* puMarker; |
/* marker type */ |
L_UINT* puMarkerSize; |
/* marker size */ |
L_UCHAR* pMarkerData; |
/* marker data */ |
Gets the specified marker in the collection.
Parameter |
Description |
uIndex |
Index of the marker to retrieve. |
puMarker |
Pointer to a variable to be updated with a value that represents the type (ID) of marker to get. Recommended values are between 0xE0 and 0xFE. Other values are possible, but before using other values, study the JPEG specs to determine which markers are allowed. |
puMarkerSize |
Pointer to a variable to be updated with the marker size if pMarkerData is not NULL. The variable should be filled, by the user, with the size of the pMarkerData buffer. |
pMarkerData |
Pointer to a buffer to be updated with the marker data. |
Returns
SUCCESS |
The function was successful. |
< 1 |
An error occurred. Refer to Return Codes. |
Comments
This function lets you get access to each individual marker without the use of a callback function.
This function is not as efficient as LMarker::Enum because the data for each marker is copied to your buffer.
To get the size of the specified marker, call this function with pMarkerData set to NULL. puMarkerSize will be filled with the size of the marker data.
If pMarkerData is not NULL, then puMarkerSize should be filled with the size of pMarkerData. If the size is not large enough to hold the marker, the function will fail and return ERROR_BUFFER_TOO_SMALL.
If uIndex is larger than the number of markers present in hMarkers, the function will fail and return ERROR_MARKER_INDEX.
Typically, you would call this function twice:
Call it the first time with pMarkerData set to NULL, to find out the size of the marker.
Call it the second time with the pMarkerData set to the buffer you have allocated.
You can also allocate a buffer of 0xFFFD bytes and use it to hold any marker. You can do this because the size of a marker is limited to 0xFFFD (65533) bytes.
Required DLLs and Libraries
LTFIL For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application. |
Win32, x64.
See Also
Functions: |
LMarker::Load, LMarker::Create, LMarker::Insert, LMarker::Enum, LMarker::GetCount |
Topics: |
|
|
Example