tag Radiance images as scRGB

They aren't always, but scRGB is also 0-1 range, so conveniently this
now works:

	vips copy car-stack-eighth.hdr x.jpg
This commit is contained in:
John Cupitt 2012-12-13 12:21:02 +00:00
parent 89ff89ebf8
commit c5a600b286
4 changed files with 11 additions and 3 deletions

2
TODO
View File

@ -1,3 +1,5 @@
- does radiance import give 0-1 RGB images? we could tag them as scRGB
- now we've removed round-to-nearest from NN, we need something extra in the - now we've removed round-to-nearest from NN, we need something extra in the
affine transform to displace the input cods affine transform to displace the input cods

View File

@ -1,10 +1,13 @@
/* Convert Radiance 32bit packed format to float. /* Convert Radiance 32bit packed format to float.
*
* 3/3/09 * 3/3/09
* - from LabQ2Lab and Radiance sources * - from LabQ2Lab and Radiance sources
* 2/11/09 * 2/11/09
* - gtkdoc * - gtkdoc
* 20/9/12 * 20/9/12
* redo as a class * - redo as a class
* 13/12/12
* - tag output as scRGB, since it'll be 0-1
*/ */
/* /*
@ -196,7 +199,7 @@ vips_rad2float_init( VipsRad2float *rad2float )
VipsColourCode *code = VIPS_COLOUR_CODE( rad2float ); VipsColourCode *code = VIPS_COLOUR_CODE( rad2float );
colour->coding = VIPS_CODING_NONE; colour->coding = VIPS_CODING_NONE;
colour->interpretation = VIPS_INTERPRETATION_sRGB; colour->interpretation = VIPS_INTERPRETATION_scRGB;
colour->format = VIPS_FORMAT_FLOAT; colour->format = VIPS_FORMAT_FLOAT;
colour->bands = 3; colour->bands = 3;

View File

@ -6,6 +6,8 @@
* - add radiance write * - add radiance write
* 20/12/11 * 20/12/11
* - reworked as some fns ready for new-style classes * - reworked as some fns ready for new-style classes
* 13/12/12
* - tag RGB rad images as scRGB
*/ */
/* /*
@ -900,7 +902,7 @@ rad2vips_get_header( Read *read, FILE *fin, VipsImage *out )
vips_image_set_string( out, "rad-format", read->format ); vips_image_set_string( out, "rad-format", read->format );
if( strcmp( read->format, COLRFMT ) == 0 ) if( strcmp( read->format, COLRFMT ) == 0 )
out->Type = VIPS_INTERPRETATION_RGB; out->Type = VIPS_INTERPRETATION_scRGB;
else if( strcmp( read->format, CIEFMT ) == 0 ) else if( strcmp( read->format, CIEFMT ) == 0 )
out->Type = VIPS_INTERPRETATION_XYZ; out->Type = VIPS_INTERPRETATION_XYZ;
else else

View File

@ -441,6 +441,7 @@ vips_image_guess_interpretation( const VipsImage *image )
case VIPS_INTERPRETATION_CMC: case VIPS_INTERPRETATION_CMC:
case VIPS_INTERPRETATION_LCH: case VIPS_INTERPRETATION_LCH:
case VIPS_INTERPRETATION_sRGB: case VIPS_INTERPRETATION_sRGB:
case VIPS_INTERPRETATION_scRGB:
case VIPS_INTERPRETATION_YXY: case VIPS_INTERPRETATION_YXY:
if( image->Bands < 3 ) if( image->Bands < 3 )
sane = FALSE; sane = FALSE;