dmSetImageDefaults(3dm) dmSetImageDefaults(3dm)
dmSetImageDefaults, dmImageFrameSize - parameters for digital-media
images
#include <dmedia/dm_image.h>
DMstatus dmSetImageDefaults [Toc] [Back]
( DMparams* params,
int width,
int height,
DMpacking packing )
size_t dmImageFrameSize( DMparams* params )
dmSetImageDefaults sets up a parameter list with all of the necessary
parameters to describe an image for the digital-media libraries. The
parameters that are set and their values are: DM_MEDIUM = DM_IMAGE,
DM_IMAGE_WIDTH = width, DM_IMAGE_HEIGHT = height, DM_IMAGE_RATE = 15.0,
DM_IMAGE_COMPRESSION = DM_IMAGE_UNCOMPRESSED, DM_IMAGE_INTERLACING =
DM_IMAGE_NONINTERLEAVED, DM_IMAGE_PACKING = packing, DM_IMAGE_ORIENTATION
= DM_BOTTOM_TO_TOP, DM_IMAGE_PIXEL_ASPECT = 1.0.
dmSetImageDefaults returns DM_SUCCESS if there was enough memory
available to set up the parameters, and DM_FAILURE if not.
dmImageFrameSize takes an image parameter list and returns the number of
bytes needed to store an uncompressed image in that format.
DMparams* imageParams;
if ( dmParamsCreate( &imageParams ) != DM_SUCCESS ) {
printf( "Out of memory.\n" );
exit( 1 );
}
if ( dmSetImageDefaults( imageParams,
320, /* width */
240, /* height */
DM_PACKING_RGBX ) != DM_SUCCESS ) {
printf( "Out of memory.\n" );
exit( 1 );
}
printf( "%d bytes per image.\n",
dmImageFrameSize( imageParams ) );
dmParamsDestroy( imageParams );
Page 1
dmSetImageDefaults(3dm) dmSetImageDefaults(3dm)
dmParams(3dm), dmSetAudioDefaults(3dm).
PPPPaaaaggggeeee 2222 [ Back ]
|