1
/* Read Radiance (.hdr) files
9
This file is part of VIPS.
11
VIPS is free software; you can redistribute it and/or modify
12
it under the terms of the GNU Lesser General Public License as published by
13
the Free Software Foundation; either version 2 of the License, or
14
(at your option) any later version.
16
This program is distributed in the hope that it will be useful,
17
but WITHOUT ANY WARRANTY; without even the implied warranty of
18
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
GNU Lesser General Public License for more details.
21
You should have received a copy of the GNU Lesser General Public License
22
along with this program; if not, write to the Free Software
23
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29
These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk
35
#endif /*HAVE_CONFIG_H*/
36
#include <vips/intl.h>
38
#include <vips/vips.h>
41
im_rad2vips( const char *filename, IMAGE *out )
45
if( vips_radload( filename, &t, NULL ) )
47
if( vips_image_write( t, out ) ) {
57
israd( const char *filename )
59
return( vips_foreign_is_a( "radload", filename ) );
63
im_vips2rad( IMAGE *in, const char *filename )
65
return( vips_radsave( in, filename, NULL ) );
68
static const char *rad_suffs[] = { ".hdr", NULL };
70
typedef VipsFormat VipsFormatRad;
71
typedef VipsFormatClass VipsFormatRadClass;
74
vips_format_rad_class_init( VipsFormatRadClass *class )
76
VipsObjectClass *object_class = (VipsObjectClass *) class;
77
VipsFormatClass *format_class = (VipsFormatClass *) class;
79
object_class->nickname = "rad";
80
object_class->description = _( "Radiance" );
82
format_class->is_a = israd;
83
format_class->load = im_rad2vips;
84
format_class->save = im_vips2rad;
85
format_class->suffs = rad_suffs;
89
vips_format_rad_init( VipsFormatRad *object )
93
G_DEFINE_TYPE( VipsFormatRad, vips_format_rad, VIPS_TYPE_FORMAT );