Revert "add ARGB coding"
This reverts commit 78b5ad5883
.
Conflicts:
libvips/colour/im_rad2float.c
This commit is contained in:
parent
e8b83aa96e
commit
0231cdf134
@ -4,8 +4,6 @@
|
|||||||
- nearest-neighbor interpolation rounds coordinates to nearest instead of
|
- nearest-neighbor interpolation rounds coordinates to nearest instead of
|
||||||
rounding down (thanks Nicolas)
|
rounding down (thanks Nicolas)
|
||||||
- add dzsave, save in deep zoom format
|
- add dzsave, save in deep zoom format
|
||||||
- add VIPS_CODING_ARGB
|
|
||||||
- openslideload output tagged as ARGB
|
|
||||||
|
|
||||||
13/3/12 started 7.28.2
|
13/3/12 started 7.28.2
|
||||||
- xres/yres tiffsave args were broken
|
- xres/yres tiffsave args were broken
|
||||||
|
24
TODO
24
TODO
@ -1,15 +1,3 @@
|
|||||||
- can we do CMC(2:1) by warping UCS space?
|
|
||||||
|
|
||||||
- add a simple wrapping of im_affinei_all() to the po db, perhaps the name of
|
|
||||||
the interpolator as a string?
|
|
||||||
|
|
||||||
- dzsave should maybe write some xml as well, see the Python dz writer?
|
|
||||||
|
|
||||||
- the operation cache needs to detect invalidate
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
blocking bugs
|
blocking bugs
|
||||||
=============
|
=============
|
||||||
|
|
||||||
@ -52,10 +40,18 @@ foreign
|
|||||||
ppm.c
|
ppm.c
|
||||||
radiance.c
|
radiance.c
|
||||||
|
|
||||||
- should there be some way to set the seq cache size?
|
- is the tif reader deadlocking sometimes?
|
||||||
|
|
||||||
|
is it when we get a non-seq error?
|
||||||
|
|
||||||
|
should there be some way to set the seq cache size?
|
||||||
|
|
||||||
- foreign docs come up as "VipsForeignSave", annoying, why?
|
- foreign docs come up as "VipsForeignSave", annoying, why?
|
||||||
|
|
||||||
|
- make an argb coding type, add to nip2 and known coding
|
||||||
|
|
||||||
|
see openslide
|
||||||
|
|
||||||
- add nifti support
|
- add nifti support
|
||||||
|
|
||||||
http://niftilib.sourceforge.net/
|
http://niftilib.sourceforge.net/
|
||||||
@ -88,8 +84,6 @@ packaging
|
|||||||
- do we bundle "convert" in the OS X / win32 builds? if we don't we
|
- do we bundle "convert" in the OS X / win32 builds? if we don't we
|
||||||
should
|
should
|
||||||
|
|
||||||
- goffice on OS X seems to be broken?
|
|
||||||
|
|
||||||
|
|
||||||
convolution
|
convolution
|
||||||
===========
|
===========
|
||||||
|
@ -791,19 +791,6 @@ vips_rad2float( VipsImage *in, VipsImage **out, ... )
|
|||||||
return( result );
|
return( result );
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
|
||||||
vips_argb2rgba( VipsImage *in, VipsImage **out, ... )
|
|
||||||
{
|
|
||||||
va_list ap;
|
|
||||||
int result;
|
|
||||||
|
|
||||||
va_start( ap, out );
|
|
||||||
result = vips_call_split( "im_argb2rgba", ap, in, out );
|
|
||||||
va_end( ap );
|
|
||||||
|
|
||||||
return( result );
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
int
|
||||||
vips_float2rad( VipsImage *in, VipsImage **out, ... )
|
vips_float2rad( VipsImage *in, VipsImage **out, ... )
|
||||||
{
|
{
|
||||||
|
@ -88,8 +88,14 @@ im_argb2rgba( VipsImage *in, IMAGE *out )
|
|||||||
{
|
{
|
||||||
guint32 bg;
|
guint32 bg;
|
||||||
|
|
||||||
if( vips_check_coding_argb( "argb2rgba", in ) ||
|
/* check for RAD coding
|
||||||
im_cp_desc( out, in ) )
|
if( in->Coding != IM_CODING_RAD ) {
|
||||||
|
im_error( "im_rad2float", "%s", _( "not a RAD image" ) );
|
||||||
|
return( -1 );
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
if( im_cp_desc( out, in ) )
|
||||||
return( -1 );
|
return( -1 );
|
||||||
out->Coding = IM_CODING_NONE;
|
out->Coding = IM_CODING_NONE;
|
||||||
|
|
||||||
|
@ -185,7 +185,7 @@ im_rad2float( IMAGE *in, IMAGE *out )
|
|||||||
return( -1 );
|
return( -1 );
|
||||||
out->Bands = 3;
|
out->Bands = 3;
|
||||||
out->BandFmt = IM_BANDFMT_FLOAT;
|
out->BandFmt = IM_BANDFMT_FLOAT;
|
||||||
out->Coding = VIPS_CODING_NONE;
|
out->Coding = IM_CODING_NONE;
|
||||||
|
|
||||||
if( im_wrapone( in, out,
|
if( im_wrapone( in, out,
|
||||||
(im_wrapone_fn) rad2float, NULL, NULL ) )
|
(im_wrapone_fn) rad2float, NULL, NULL ) )
|
||||||
|
@ -293,7 +293,6 @@ static const char *im_Coding[] = {
|
|||||||
"RGB_COMPRESSED",
|
"RGB_COMPRESSED",
|
||||||
"LUM_COMPRESSED",
|
"LUM_COMPRESSED",
|
||||||
"IM_CODING_RAD",
|
"IM_CODING_RAD",
|
||||||
"VIPS_CODING_ARGB",
|
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1138,20 +1138,6 @@ vips_foreign_convert_saveable( VipsForeignSave *save )
|
|||||||
in = out;
|
in = out;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If this is a ARGB, we go to png-style RGBA.
|
|
||||||
*/
|
|
||||||
if( in->Coding == VIPS_CODING_ARGB ) {
|
|
||||||
VipsImage *out;
|
|
||||||
|
|
||||||
if( vips_argb2rgba( in, &out, NULL ) ) {
|
|
||||||
g_object_unref( in );
|
|
||||||
return( -1 );
|
|
||||||
}
|
|
||||||
g_object_unref( in );
|
|
||||||
|
|
||||||
in = out;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Get the bands right.
|
/* Get the bands right.
|
||||||
*/
|
*/
|
||||||
if( in->Coding == VIPS_CODING_NONE ) {
|
if( in->Coding == VIPS_CODING_NONE ) {
|
||||||
@ -2068,7 +2054,7 @@ vips_openexrload( const char *filename, VipsImage **out, ... )
|
|||||||
*
|
*
|
||||||
* Optional arguments:
|
* Optional arguments:
|
||||||
*
|
*
|
||||||
* @level: load this level of the pyramid
|
* @layer: load this layer
|
||||||
* @associated: load this associated image
|
* @associated: load this associated image
|
||||||
*
|
*
|
||||||
* Read a virtual slide supported by the OpenSlide library into a VIPS image.
|
* Read a virtual slide supported by the OpenSlide library into a VIPS image.
|
||||||
@ -2076,9 +2062,10 @@ vips_openexrload( const char *filename, VipsImage **out, ... )
|
|||||||
* and Trestle formats.
|
* and Trestle formats.
|
||||||
*
|
*
|
||||||
* To facilitate zooming, virtual slide formats include multiple scaled-down
|
* To facilitate zooming, virtual slide formats include multiple scaled-down
|
||||||
* versions of the high-resolution image.
|
* versions of the high-resolution image. These are typically called
|
||||||
|
* "levels", though OpenSlide and im_openslide2vips() call them "layers".
|
||||||
* By default, vips_openslideload() reads the highest-resolution layer
|
* By default, vips_openslideload() reads the highest-resolution layer
|
||||||
* (level 0). Set @level to the level number you want.
|
* (layer 0). Set @layer to the layer number you want.
|
||||||
*
|
*
|
||||||
* In addition to the slide image itself, virtual slide formats sometimes
|
* In addition to the slide image itself, virtual slide formats sometimes
|
||||||
* include additional images, such as a scan of the slide's barcode.
|
* include additional images, such as a scan of the slide's barcode.
|
||||||
@ -2087,10 +2074,10 @@ vips_openexrload( const char *filename, VipsImage **out, ... )
|
|||||||
* A slide's associated images are listed in the
|
* A slide's associated images are listed in the
|
||||||
* "slide-associated-images" metadata item.
|
* "slide-associated-images" metadata item.
|
||||||
*
|
*
|
||||||
* The output of this operator is in Cairo-style pre-multipled ARGB format.
|
* The output of this operator is in pre-multipled ARGB format. Use
|
||||||
* Use vips_argb2rgba() to decode to png-style RGBA.
|
* im_argb2rgba() to decode to png-style RGBA.
|
||||||
*
|
*
|
||||||
* See also: vips_argb2rgba(), vips_image_new_from_file().
|
* See also: vips_image_new_from_file().
|
||||||
*
|
*
|
||||||
* Returns: 0 on success, -1 on error.
|
* Returns: 0 on success, -1 on error.
|
||||||
*/
|
*/
|
||||||
|
@ -211,7 +211,7 @@ readslide_new( const char *filename, VipsImage *out,
|
|||||||
}
|
}
|
||||||
|
|
||||||
vips_image_init_fields( out, w, h, 4, VIPS_FORMAT_UCHAR,
|
vips_image_init_fields( out, w, h, 4, VIPS_FORMAT_UCHAR,
|
||||||
VIPS_CODING_ARGB, VIPS_INTERPRETATION_RGB, 1.0, 1.0 );
|
VIPS_CODING_NONE, VIPS_INTERPRETATION_RGB, 1.0, 1.0 );
|
||||||
|
|
||||||
for( properties = openslide_get_property_names( rslide->osr );
|
for( properties = openslide_get_property_names( rslide->osr );
|
||||||
*properties != NULL; properties++ )
|
*properties != NULL; properties++ )
|
||||||
|
@ -4,8 +4,6 @@
|
|||||||
* - from openslideload.c
|
* - from openslideload.c
|
||||||
* 28/2/12
|
* 28/2/12
|
||||||
* - convert "layer" to "level" where externally visible
|
* - convert "layer" to "level" where externally visible
|
||||||
* 2/4/12
|
|
||||||
* - output images coded as ARGB
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -51,8 +51,6 @@ int vips_rad2float( VipsImage *in, VipsImage **out, ... )
|
|||||||
__attribute__((sentinel));
|
__attribute__((sentinel));
|
||||||
int vips_float2rad( VipsImage *in, VipsImage **out, ... )
|
int vips_float2rad( VipsImage *in, VipsImage **out, ... )
|
||||||
__attribute__((sentinel));
|
__attribute__((sentinel));
|
||||||
int vips_argb2rgba( VipsImage *in, VipsImage **out, ... )
|
|
||||||
__attribute__((sentinel));
|
|
||||||
int vips_LabS2LabQ( VipsImage *in, VipsImage **out, ... )
|
int vips_LabS2LabQ( VipsImage *in, VipsImage **out, ... )
|
||||||
__attribute__((sentinel));
|
__attribute__((sentinel));
|
||||||
int vips_LabQ2Lab( VipsImage *in, VipsImage **out, ... )
|
int vips_LabQ2Lab( VipsImage *in, VipsImage **out, ... )
|
||||||
|
@ -59,7 +59,6 @@ int vips_check_uncoded( const char *domain, VipsImage *im );
|
|||||||
int vips_check_coding_known( const char *domain, VipsImage *im );
|
int vips_check_coding_known( const char *domain, VipsImage *im );
|
||||||
int vips_check_coding_labq( const char *domain, VipsImage *im );
|
int vips_check_coding_labq( const char *domain, VipsImage *im );
|
||||||
int vips_check_coding_rad( const char *domain, VipsImage *im );
|
int vips_check_coding_rad( const char *domain, VipsImage *im );
|
||||||
int vips_check_coding_argb( const char *domain, VipsImage *im );
|
|
||||||
int vips_check_coding_noneorlabq( const char *domain, VipsImage *im );
|
int vips_check_coding_noneorlabq( const char *domain, VipsImage *im );
|
||||||
int vips_check_coding_same( const char *domain, VipsImage *im1, VipsImage *im2 );
|
int vips_check_coding_same( const char *domain, VipsImage *im1, VipsImage *im2 );
|
||||||
int vips_check_mono( const char *domain, VipsImage *im );
|
int vips_check_mono( const char *domain, VipsImage *im );
|
||||||
|
@ -198,12 +198,11 @@ typedef enum {
|
|||||||
* @VIPS_CODING_NONE: pixels are not coded
|
* @VIPS_CODING_NONE: pixels are not coded
|
||||||
* @VIPS_CODING_LABQ: pixels encode 3 float CIELAB values as 4 uchar
|
* @VIPS_CODING_LABQ: pixels encode 3 float CIELAB values as 4 uchar
|
||||||
* @VIPS_CODING_RAD: pixels encode 3 float RGB as 4 uchar (Radiance coding)
|
* @VIPS_CODING_RAD: pixels encode 3 float RGB as 4 uchar (Radiance coding)
|
||||||
* @VIPS_CODING_ARGB: Cairo-style pre-multiplied ARGB
|
|
||||||
*
|
*
|
||||||
* How pixels are coded.
|
* How pixels are coded.
|
||||||
*
|
*
|
||||||
* Normally, pixels are uncoded and can be manipulated as you would expect.
|
* Normally, pixels are uncoded and can be manipulated as you would expect.
|
||||||
* However some file formats code pixels for storage, and sometimes it's
|
* However some file formats code pixels for compression, and sometimes it's
|
||||||
* useful to be able to manipulate images in the coded format.
|
* useful to be able to manipulate images in the coded format.
|
||||||
*
|
*
|
||||||
* The gaps in the numbering are historical and must be maintained. Allocate
|
* The gaps in the numbering are historical and must be maintained. Allocate
|
||||||
@ -214,8 +213,7 @@ typedef enum {
|
|||||||
VIPS_CODING_NONE = 0,
|
VIPS_CODING_NONE = 0,
|
||||||
VIPS_CODING_LABQ = 2,
|
VIPS_CODING_LABQ = 2,
|
||||||
VIPS_CODING_RAD = 6,
|
VIPS_CODING_RAD = 6,
|
||||||
VIPS_CODING_ARGB = 7,
|
VIPS_CODING_LAST = 7
|
||||||
VIPS_CODING_LAST = 8
|
|
||||||
} VipsCoding;
|
} VipsCoding;
|
||||||
|
|
||||||
/* Struct we keep a record of execution time in. Passed to eval signal so
|
/* Struct we keep a record of execution time in. Passed to eval signal so
|
||||||
|
@ -483,7 +483,6 @@ vips_coding_get_type( void )
|
|||||||
{VIPS_CODING_NONE, "VIPS_CODING_NONE", "none"},
|
{VIPS_CODING_NONE, "VIPS_CODING_NONE", "none"},
|
||||||
{VIPS_CODING_LABQ, "VIPS_CODING_LABQ", "labq"},
|
{VIPS_CODING_LABQ, "VIPS_CODING_LABQ", "labq"},
|
||||||
{VIPS_CODING_RAD, "VIPS_CODING_RAD", "rad"},
|
{VIPS_CODING_RAD, "VIPS_CODING_RAD", "rad"},
|
||||||
{VIPS_CODING_ARGB, "VIPS_CODING_ARGB", "argb"},
|
|
||||||
{VIPS_CODING_LAST, "VIPS_CODING_LAST", "last"},
|
{VIPS_CODING_LAST, "VIPS_CODING_LAST", "last"},
|
||||||
{0, NULL, NULL}
|
{0, NULL, NULL}
|
||||||
};
|
};
|
||||||
|
@ -496,8 +496,7 @@ vips_check_coding_known( const char *domain, VipsImage *im )
|
|||||||
*/
|
*/
|
||||||
if( im->Coding != VIPS_CODING_NONE &&
|
if( im->Coding != VIPS_CODING_NONE &&
|
||||||
im->Coding != VIPS_CODING_LABQ &&
|
im->Coding != VIPS_CODING_LABQ &&
|
||||||
im->Coding != VIPS_CODING_RAD &&
|
im->Coding != VIPS_CODING_RAD ) {
|
||||||
im->Coding != VIPS_CODING_ARGB ) {
|
|
||||||
vips_error( domain, "%s", _( "unknown image coding" ) );
|
vips_error( domain, "%s", _( "unknown image coding" ) );
|
||||||
return( -1 );
|
return( -1 );
|
||||||
}
|
}
|
||||||
@ -531,32 +530,6 @@ vips_check_coding_rad( const char *domain, VipsImage *im )
|
|||||||
return( 0 );
|
return( 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* vips_check_coding_argb:
|
|
||||||
* @domain: the originating domain for the error message
|
|
||||||
* @im: image to check
|
|
||||||
*
|
|
||||||
* Check that the image is in ARGB coding.
|
|
||||||
* If not, set an error message
|
|
||||||
* and return non-zero.
|
|
||||||
*
|
|
||||||
* See also: vips_error().
|
|
||||||
*
|
|
||||||
* Returns: 0 on OK, or -1 on error.
|
|
||||||
*/
|
|
||||||
int
|
|
||||||
vips_check_coding_argb( const char *domain, VipsImage *im )
|
|
||||||
{
|
|
||||||
if( im->Coding != VIPS_CODING_ARGB ||
|
|
||||||
im->BandFmt != VIPS_FORMAT_UCHAR ||
|
|
||||||
im->Bands != 4 ) {
|
|
||||||
vips_error( domain, "%s", _( "ARGB coding only" ) );
|
|
||||||
return( -1 );
|
|
||||||
}
|
|
||||||
|
|
||||||
return( 0 );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* vips_check_coding_labq:
|
* vips_check_coding_labq:
|
||||||
* @domain: the originating domain for the error message
|
* @domain: the originating domain for the error message
|
||||||
|
@ -456,8 +456,7 @@ vips_image_sanity( VipsObject *object, VipsBuf *buf )
|
|||||||
(image->Coding != -1 &&
|
(image->Coding != -1 &&
|
||||||
image->Coding != VIPS_CODING_NONE &&
|
image->Coding != VIPS_CODING_NONE &&
|
||||||
image->Coding != VIPS_CODING_LABQ &&
|
image->Coding != VIPS_CODING_LABQ &&
|
||||||
image->Coding != VIPS_CODING_RAD &&
|
image->Coding != VIPS_CODING_RAD) ||
|
||||||
image->Coding != VIPS_CODING_ARGB) ||
|
|
||||||
image->Type > VIPS_INTERPRETATION_ARRAY ||
|
image->Type > VIPS_INTERPRETATION_ARRAY ||
|
||||||
image->dtype > VIPS_IMAGE_PARTIAL ||
|
image->dtype > VIPS_IMAGE_PARTIAL ||
|
||||||
image->dhint > VIPS_DEMAND_STYLE_ANY )
|
image->dhint > VIPS_DEMAND_STYLE_ANY )
|
||||||
|
@ -188,7 +188,6 @@ image_pixel_length( VipsImage *image )
|
|||||||
switch( image->Coding ) {
|
switch( image->Coding ) {
|
||||||
case VIPS_CODING_LABQ:
|
case VIPS_CODING_LABQ:
|
||||||
case VIPS_CODING_RAD:
|
case VIPS_CODING_RAD:
|
||||||
case VIPS_CODING_ARGB:
|
|
||||||
case VIPS_CODING_NONE:
|
case VIPS_CODING_NONE:
|
||||||
psize = VIPS_IMAGE_SIZEOF_IMAGE( image );
|
psize = VIPS_IMAGE_SIZEOF_IMAGE( image );
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user