xp_comm_proj/build3d_2/build3d_2.c
/*----------------------------------------------------------------------
 * gets width and height from specified image
 */
gets width and height from specified image
gets width and height from specified image
static int FUNCread_image_dims(char *filename, int *width, int *height)
{
  int w, h;
  void *priv = NULL;
  *width = *height = 0;
  if (!filename || strlen(filename) == 0)
    return(0);
  if (!(priv = (*funcOpen)(filename, DV_IMAGE_FILE_ACCESS_READ)))
    return(FUNCread_wrapup("Cannot open file", priv));
  (*funcGetWidth)(priv, &w);
  (*funcGetHeight)(priv, &h);
  *width = w;  *height = h;
  (*funcClose)(priv);
  return(1);
}
static int FUNCread_image_dims ( char * filename , int * width , int * height ) { int w , h ; void * priv = NULL ; * width = * height = 0 ; if ( ! filename || strlen ( filename ) == 0 ) return ( 0 ) ; if ( ! ( priv = ( * funcOpen ) ( filename , DV_IMAGE_FILE_ACCESS_READ ) ) ) return ( FUNCread_wrapup ( " " , priv ) ) ; ( * funcGetWidth ) ( priv , & w ) ; ( * funcGetHeight ) ( priv , & h ) ; * width = w ; * height = h ; ( * funcClose ) ( priv ) ; return ( 1 ) ; }
gets width and height from specified image
gets width and height from specified image
/* open the file */ /* get the width */ /* get the height */ /* store the dimensions */ /* close the file */