xp_comm_proj/build3d_2/build3d_2.c
/*------------------------------------------------------------------------------
 * checks the image files to ensure that they exist and are all of the same type
 */
checks the image files to ensure that they exist and are all of the same type
checks the image files to ensure that they exist and are all of the same type
static int FUNCcheck_image_formats(const char *filename, int start, int end, int format)
{
  char filename_buf[AVS_PATH_MAX];
  int i, from_format;
  OMpush_status_range(0, 10);
  OMstatus_check(0, "Checking Image files", NULL);
  for (i=start; i<=end; i++) {
    sprintf(filename_buf, filename, i);
    from_format = FUNCget_image_format(filename_buf);
    if (from_format==DV_IMAGE_FORMAT_NOFILE) {
      ERRerror("Build3D_2_Core", 1, ERR_ORIG, "Cannot open file: %s", filename_buf);
      format = DV_IMAGE_FORMAT_NOFILE;
      break;
    }
    else if (from_format==DV_IMAGE_FORMAT_UNKNOWN) {
      ERRerror("Build3D_2_Core", 1, ERR_ORIG, "File is of unknown format: %s", filename_buf);
      format = DV_IMAGE_FORMAT_UNKNOWN;
      break;
    }
    if (format == DV_IMAGE_FORMAT_AUTO) {
      format = from_format;
    }
    else if (format != from_format) {
      ERRerror("Build3D_2_Core", 1, ERR_ORIG, "File is of differing type: %s", filename_buf);
      format = DV_IMAGE_FORMAT_MISMATCH;
      break;
    }
  }
  OMstatus_check(100, "Checking Image files", NULL);
  OMpop_status_range();
  return(format);
}
static int FUNCcheck_image_formats ( const char * filename , int start , int end , int format ) { char filename_buf [ AVS_PATH_MAX ] ; int i , from_format ; OMpush_status_range ( 0 , 10 ) ; OMstatus_check ( 0 , " " , NULL ) ; for ( i = start ; i <= end ; i ++ ) { sprintf ( filename_buf , filename , i ) ; from_format = FUNCget_image_format ( filename_buf ) ; if ( from_format == DV_IMAGE_FORMAT_NOFILE ) { ERRerror ( " " , 1 , ERR_ORIG , " " , filename_buf ) ; format = DV_IMAGE_FORMAT_NOFILE ; break ; } else if ( from_format == DV_IMAGE_FORMAT_UNKNOWN ) { ERRerror ( " " , 1 , ERR_ORIG , " " , filename_buf ) ; format = DV_IMAGE_FORMAT_UNKNOWN ; break ; } if ( format == DV_IMAGE_FORMAT_AUTO ) { format = from_format ; } else if ( format != from_format ) { ERRerror ( " " , 1 , ERR_ORIG , " " , filename_buf ) ; format = DV_IMAGE_FORMAT_MISMATCH ; break ; } } OMstatus_check ( 100 , " " , NULL ) ; OMpop_status_range ( ) ; return ( format ) ; }
checks the image files to ensure that they exist and are all of the same type
checks the image files to ensure that they exist and are all of the same type
/* Loop through all specified files */ /* Get format from file */ /* Exit early if file doesn't exist or can't be identified */ /* If we are automatically selecting a format assume all files are of the type read from the first file. */ /* else exit early if this file doesn't match the format of the previous files. */