From 41ccd93d2ddb191b7041c1229d97888a9e0ba248 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Fri, 28 Jan 2011 11:37:52 +0000 Subject: [PATCH] add im_fits2vips() to the operation database the fits reader, im_fits2vips(), was in VipsFormat but not in the operation database --- ChangeLog | 1 + libvips/format/format_dispatch.c | 27 +++++++++++++++++++++++++++ libvips/include/vips/format.h | 2 ++ 3 files changed, 30 insertions(+) diff --git a/ChangeLog b/ChangeLog index c219caf2..ff0174ad 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,6 +13,7 @@ - lr/tbmosaic() work for any mix of image formats / bands - removed ancient balance stuff from im_lr/tbmosaic() - gtk-doc for mosaicing +- add im_fits2vips() to the operation database 30/11/10 started 7.24.0 - bump for new stable diff --git a/libvips/format/format_dispatch.c b/libvips/format/format_dispatch.c index e5778f7a..40d2ec09 100644 --- a/libvips/format/format_dispatch.c +++ b/libvips/format/format_dispatch.c @@ -389,10 +389,37 @@ static im_function vips2ppm_desc = { vips2ppm_arg_types /* Arg list */ }; +static int +fits2vips_vec( im_object *argv ) +{ + char *in = argv[0]; + IMAGE *out = argv[1]; + + if( im_fits2vips( in, out ) ) + return( -1 ); + + return( 0 ); +} + +static im_arg_desc fits2vips_args[] = { + IM_INPUT_STRING( "in" ), + IM_OUTPUT_IMAGE( "out" ) +}; + +static im_function fits2vips_desc = { + "im_fits2vips", /* Name */ + "convert from fits", /* Description */ + 0, /* Flags */ + fits2vips_vec, /* Dispatch function */ + IM_NUMBER( fits2vips_args ), /* Size of arg list */ + fits2vips_args /* Arg list */ +}; + /* Package up all these functions. */ static im_function *list[] = { &csv2vips_desc, + &fits2vips_desc, &jpeg2vips_desc, &magick2vips_desc, &png2vips_desc, diff --git a/libvips/include/vips/format.h b/libvips/include/vips/format.h index 39cc9da1..57bc7cad 100644 --- a/libvips/include/vips/format.h +++ b/libvips/include/vips/format.h @@ -157,6 +157,8 @@ int im_mat2vips( const char *filename, IMAGE *out ); int im_rad2vips( const char *filename, IMAGE *out ); int im_vips2rad( IMAGE *in, const char *filename ); +int im_fits2vips( const char *filename, IMAGE *out ); + #ifdef __cplusplus } #endif /*__cplusplus*/