static int vips_fits_set_header( VipsFits *fits, VipsImage *in ) { int status; int bitpix; int i; status = 0; fits->naxis = 3; fits->naxes[0] = in->Xsize; fits->naxes[1] = in->Ysize; fits->naxes[2] = in->Bands; for( i = 0; i < VIPS_NUMBER( fits2vips_formats ); i++ ) if( fits2vips_formats[i][1] == in->BandFmt ) break; if( i == VIPS_NUMBER( fits2vips_formats ) ) { im_error( "fits", _( "unsupported BandFmt %d\n" ), in->BandFmt ); return( -1 ); } bitpix = fits2vips_formats[i][0]; fits->datatype = fits2vips_formats[i][2]; #ifdef VIPS_DEBUG VIPS_DEBUG_MSG( "naxis = %d\n", fits->naxis ); for( i = 0; i < fits->naxis; i++ ) VIPS_DEBUG_MSG( "%d) %lld\n", i, fits->naxes[i] ); VIPS_DEBUG_MSG( "bitpix = %d\n", bitpix ); #endif /*VIPS_DEBUG*/ if( fits_create_imgll( fits->fptr, bitpix, fits->naxis, fits->naxes, &status ) ) { vips_fits_error( status ); return( -1 ); } if( im_header_map( in, (im_header_map_fn) vips_fits_write_meta, fits ) ) return( -1 ); return( 0 ); }
static void imageheader_refresh( Imageheader *imageheader ) { gtk_list_store_clear( imageheader->store ); if( imageheader->iimage && imageheader->iimage->value.ii ) { Imageinfo *ii = imageheader->iimage->value.ii; IMAGE *im = imageinfo_get( FALSE, ii ); im_header_map( im, (im_header_map_fn) imageheader_add_item, imageheader ); gtk_text_buffer_set_text( gtk_text_view_get_buffer( GTK_TEXT_VIEW( imageheader->history ) ), im_history_get( im ), -1 ); } else { gtk_editable_delete_text( GTK_EDITABLE( imageheader->history ), 0, -1 ); } }
void im_printdesc( IMAGE *image ) { if( !image ) { printf( "NULL descriptor\n" ); return; } printf( "IMAGE* %p\n", image ); if( im_isMSBfirst( image ) ) printf( "SPARC (MSB first) " ); else printf( "Intel (LSB first) " ); printf( "byte order image, on a " ); if( im_amiMSBfirst() ) printf( "SPARC (MSB first) " ); else printf( "Intel (LSB first) " ); printf( "byte order machine\n" ); (void) im_header_map( image, (im_header_map_fn) print_field_fn, NULL ); printf( "Hist: %s", im_history_get( image ) ); /* Print other (non-header) fields. */ if( image->generate ) printf( "generate function attached\n" ); if( image->closefns ) printf( "close callbacks attached\n" ); if( image->evalfns ) printf( "eval callbacks attached\n" ); if( image->evalendfns ) printf( "evalend callbacks attached\n" ); if( image->evalstartfns ) printf( "evalstart callbacks attached\n" ); if( image->preclosefns ) printf( "preclose callbacks attached\n" ); if( image->invalidatefns ) printf( "invalidate callbacks attached\n" ); if( image->regions ) { printf( "%d regions present\n", g_slist_length( image->regions ) ); im_slist_map2( image->regions, (VSListMap2Fn) print_region, NULL, NULL ); } if( image->kill ) printf( "kill flag set\n" ); if( image->closing ) printf( "closing flag set\n" ); if( image->close_pending ) printf( "close_pending flag set\n" ); #ifdef DEBUG /* Can't get these with im_header_get(), so only show for debugging. */ printf( "dhint: %s\n", im_dhint2char( image->dhint ) ); printf( "dtype: %s\n", im_dtype2char( image->dtype ) ); #endif /*DEBUG*/ }