dmicchoose(3dm)
dmICChooseConverter - return an image converter that matches specified image parameters
As shipped in IRIX 6.5.15. Unchanged since IRIX 6.5.
NAME dmICChooseConverter - return an image converter that matches specified image parameters SYNOPSIS #include <dmedia/dm_imageconvert.h> int dmICChooseConverter(DMparams* src, DMparams *dst, DMparams *conv); DESCRIPTION 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 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 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 non- realtime 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; } dmParamsDestroy(p); } dmICCreate(n, &ic); SEE ALSO dmICCreate(3dm), dmICSetSrcParams(3dm), dmICSetDstParams(3dm), dmICSetConvParams(3dm), dmParams(3dm), dmSetImageDefaults(3dm), dmGetError(3dm).