#include "l_bitmap.h"
L_LTFIL_API L_SSIZE_T L_GetPreLoadFilters(pszFilters, uSize, pnFixedFilters, pnCachedFilters);
Retrieves the current preloaded filters list.
Pointer to a character string to be updated with the current preloaded filters list.
The size in bytes of the buffer pointed to by pszFilters
.
Pointer to a variable to be updated with the number of filters that should stay loaded in memory at all times. Pass NULL if it is not required.
Pointer to a variable to be updated with the number of filters that should be loaded. Pass NULL if it is not required.
Value | Meaning |
---|---|
>=0 | The size in bytes of the preloaded filters list. |
In case the current preloaded filters list should be changed, call this function before calling the L_PreLoadFilters function.
The preload filters list contains the list of fixed and cached filters. For more information, refer to L_PreLoadFilters.
To retrieve the preloaded filters list, the user should do the following:
pszFilters
as NULL and uSize as 0 to retrieve the size required for the filters list as returned value.
Required DLLs and Libraries
Win32, x64, Linux.
L_INT GetPreLoadFiltersExample(L_VOID)
{
L_TCHAR * pszList = NULL;
L_INT nFixed;
L_INT nCached;
L_SIZE_T nRet;
BITMAPHANDLE Bitmap;
L_TCHAR buf[80];
/* get the original filters list */
nRet = L_GetPreLoadFilters(NULL, 0, NULL, NULL);
pszList = (L_TCHAR *)malloc(nRet*sizeof(L_TCHAR));
nRet =L_GetPreLoadFilters(pszList, nRet, &nFixed, &nCached);
if(nRet < SUCCESS)
return (L_INT)nRet;
MessageBox(NULL, pszList, TEXT("TEST"), MB_OK);
free(pszList);
wsprintf(buf, TEXT("fixed: %ld, cached: %ld"), nFixed, nCached);
MessageBox(NULL, buf, TEXT("TEST"), MB_OK);
/* change the preload filters */
/* This example preloads the CMP, PCX and TIF filters */
/* and allows 1 filter to be cached, while always */
/* keeping 2 loaded. */
nRet =L_PreLoadFilters( 2, 1, TEXT("CMP,PCX,TIF"));
if(nRet !=SUCCESS)
return (L_INT)nRet;
/* get the new filters list */
nRet = L_GetPreLoadFilters(NULL, 0, NULL, NULL);
pszList = (L_TCHAR *)malloc(nRet*sizeof(L_TCHAR));
nRet =L_GetPreLoadFilters(pszList, nRet, &nFixed, &nCached);
if(nRet < SUCCESS)
return (L_INT)nRet;
MessageBox(NULL, pszList, TEXT("TEST"), MB_OK);
free(pszList);
wsprintf(buf, TEXT("fixed: %ld, cached: %ld"), nFixed, nCached);
MessageBox(NULL, buf, TEXT("TEST"), MB_OK);
/* try to load CMP */
nRet = L_LoadBitmap(MAKE_IMAGE_PATH(TEXT("image1.cmp")), &Bitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
if(nRet != SUCCESS)
{
if(nRet == ERROR_FILE_FORMAT)
MessageBox(NULL, TEXT("CMP ignored"), TEXT("TEST"), MB_OK);
return (L_INT)nRet;
}
if(Bitmap.Flags.Allocated)
L_FreeBitmap(&Bitmap);
return SUCCESS;
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document