dmIC(3dm) dmIC(3dm)
dmICChooseConverter - return an image converter that matches specified
image parameters
#include <dmedia/dm_imageconvert.h>
int dmICChooseConverter(DMparams* src, DMparams *dst, DMparams *conv);
dmICChooseConverter returns the index of an image converter which
performs the conversion of image data described by src to that described
by dst using the conversion control parameters in conv. The number
returned is for use in dmICGetDescription and dmICCreate.
If no converter could be found, -1 will be returned and an error will be
set (see dmSetError(3dm)).
If the function succeeds, src, dst and conv can then be used in
dmICSetSrcParams, dmICSetDstParams and dmICSetConvParams respectively.
In order for dmICChooseConverter to work correctly, src, dst and conv
must be set with their respective required parameters. In addition, one
of the following requirements must be met.
DM_IC_ID and DM_IC_CODE_DIRECTION set in conv [Toc] [Back]
In this case, the converter with the matching ID and code direction
that satisfies the requirements in src, dst and conv is chosen.
DM_IMAGE_COMPRESSION set in src and dst [Toc] [Back]
In this case, the converter that matches the compression
requirements in src, dst and conv will be chosen.
Currently there is no provision for choosing a realtime over a nonrealtime
converter , and vice-versa . Extra code needs to be written to
do so. The following code fragment shows how to to find a realtime JPEG
decoder.
DMimageconverter ic;
DMparams *p;
int n = dmICGetNum();
while (n--) {
dmParamsCreate(&p);
if (dmICGetDescription(n, p) == DM_SUCCESS
dmParamsGetInt(p, DM_IC_ID) == 'jpeg' &&
dmParamsGetEnum(p, DM_IC_SPEED) == DM_IC_SPEED_REALTIME &&
dmParamsGetEnum(p, DM_IC_CODE_DIRECTION) ==
DM_IC_CODE_DIRECTION_DECODE) {
dmParamsDestroy(p);
break;
}
Page 1
dmIC(3dm) dmIC(3dm)
dmParamsDestroy(p);
}
dmICCreate(n, &ic);
dmICCreate(3dm), dmICSetSrcParams(3dm), dmICSetDstParams(3dm),
dmICSetConvParams(3dm), dmParams(3dm), dmSetImageDefaults(3dm),
dmGetError(3dm).
PPPPaaaaggggeeee 2222 [ Back ]
|