remove old libtiff numeric defines
use the glib ones instead rather than depending on stdint etc.
This commit is contained in:
parent
33cca3ecbc
commit
1192d87acf
@ -279,8 +279,8 @@ static int rtiff_we_decompress[] = {
|
|||||||
* out as a separate thing.
|
* out as a separate thing.
|
||||||
*/
|
*/
|
||||||
typedef struct _RtiffHeader {
|
typedef struct _RtiffHeader {
|
||||||
uint32 width;
|
guint32 width;
|
||||||
uint32 height;
|
guint32 height;
|
||||||
int samples_per_pixel;
|
int samples_per_pixel;
|
||||||
int bits_per_sample;
|
int bits_per_sample;
|
||||||
int photometric_interpretation;
|
int photometric_interpretation;
|
||||||
@ -293,7 +293,7 @@ typedef struct _RtiffHeader {
|
|||||||
* unpremultiply with. -1 for no unpremultiplication.
|
* unpremultiply with. -1 for no unpremultiplication.
|
||||||
*/
|
*/
|
||||||
int alpha_band;
|
int alpha_band;
|
||||||
uint16 compression;
|
guint16 compression;
|
||||||
|
|
||||||
/* Is this directory tiled.
|
/* Is this directory tiled.
|
||||||
*/
|
*/
|
||||||
@ -301,14 +301,14 @@ typedef struct _RtiffHeader {
|
|||||||
|
|
||||||
/* Fields for tiled images, as returned by libtiff.
|
/* Fields for tiled images, as returned by libtiff.
|
||||||
*/
|
*/
|
||||||
uint32 tile_width;
|
guint32 tile_width;
|
||||||
uint32 tile_height;
|
guint32 tile_height;
|
||||||
tsize_t tile_size;
|
tsize_t tile_size;
|
||||||
tsize_t tile_row_size;
|
tsize_t tile_row_size;
|
||||||
|
|
||||||
/* Fields for strip images, as returned by libtiff.
|
/* Fields for strip images, as returned by libtiff.
|
||||||
*/
|
*/
|
||||||
uint32 rows_per_strip;
|
guint32 rows_per_strip;
|
||||||
tsize_t strip_size;
|
tsize_t strip_size;
|
||||||
tsize_t scanline_size;
|
tsize_t scanline_size;
|
||||||
int number_of_strips;
|
int number_of_strips;
|
||||||
@ -322,7 +322,7 @@ typedef struct _RtiffHeader {
|
|||||||
* or 1) and size of the buffer we read to (a scanline, or a strip in
|
* or 1) and size of the buffer we read to (a scanline, or a strip in
|
||||||
* size).
|
* size).
|
||||||
*/
|
*/
|
||||||
uint32 read_height;
|
guint32 read_height;
|
||||||
tsize_t read_size;
|
tsize_t read_size;
|
||||||
|
|
||||||
/* Scale factor to get absolute cd/m2 from XYZ.
|
/* Scale factor to get absolute cd/m2 from XYZ.
|
||||||
@ -413,7 +413,7 @@ typedef struct _Rtiff {
|
|||||||
static int
|
static int
|
||||||
tfexists( TIFF *tif, ttag_t tag )
|
tfexists( TIFF *tif, ttag_t tag )
|
||||||
{
|
{
|
||||||
uint32 a, b;
|
guint32 a, b;
|
||||||
|
|
||||||
if( TIFFGetField( tif, tag, &a, &b ) )
|
if( TIFFGetField( tif, tag, &a, &b ) )
|
||||||
return( 1 );
|
return( 1 );
|
||||||
@ -421,12 +421,12 @@ tfexists( TIFF *tif, ttag_t tag )
|
|||||||
return( 0 );
|
return( 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get a uint32 field.
|
/* Get a guint32 field.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
tfget32( TIFF *tif, ttag_t tag, uint32 *out )
|
tfget32( TIFF *tif, ttag_t tag, guint32 *out )
|
||||||
{
|
{
|
||||||
uint32 fld;
|
guint32 fld;
|
||||||
|
|
||||||
if( !TIFFGetFieldDefaulted( tif, tag, &fld ) ) {
|
if( !TIFFGetFieldDefaulted( tif, tag, &fld ) ) {
|
||||||
vips_error( "tiff2vips",
|
vips_error( "tiff2vips",
|
||||||
@ -439,12 +439,12 @@ tfget32( TIFF *tif, ttag_t tag, uint32 *out )
|
|||||||
return( 1 );
|
return( 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get a uint16 field.
|
/* Get a guint16 field.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
tfget16( TIFF *tif, ttag_t tag, int *out )
|
tfget16( TIFF *tif, ttag_t tag, int *out )
|
||||||
{
|
{
|
||||||
uint16 fld;
|
guint16 fld;
|
||||||
|
|
||||||
if( !TIFFGetFieldDefaulted( tif, tag, &fld ) ) {
|
if( !TIFFGetFieldDefaulted( tif, tag, &fld ) ) {
|
||||||
vips_error( "tiff2vips",
|
vips_error( "tiff2vips",
|
||||||
@ -512,7 +512,7 @@ static int
|
|||||||
get_sample_format( TIFF *tiff )
|
get_sample_format( TIFF *tiff )
|
||||||
{
|
{
|
||||||
int sample_format;
|
int sample_format;
|
||||||
uint16 v;
|
guint16 v;
|
||||||
|
|
||||||
sample_format = SAMPLEFORMAT_INT;
|
sample_format = SAMPLEFORMAT_INT;
|
||||||
|
|
||||||
@ -532,7 +532,7 @@ static int
|
|||||||
get_orientation( TIFF *tiff )
|
get_orientation( TIFF *tiff )
|
||||||
{
|
{
|
||||||
int orientation;
|
int orientation;
|
||||||
uint16 v;
|
guint16 v;
|
||||||
|
|
||||||
orientation = ORIENTATION_TOPLEFT;
|
orientation = ORIENTATION_TOPLEFT;
|
||||||
|
|
||||||
@ -686,7 +686,7 @@ rtiff_set_page( Rtiff *rtiff, int page )
|
|||||||
}
|
}
|
||||||
|
|
||||||
if( rtiff->subifd >= 0 ) {
|
if( rtiff->subifd >= 0 ) {
|
||||||
uint16 subifd_count;
|
guint16 subifd_count;
|
||||||
toff_t *subifd_offsets;
|
toff_t *subifd_offsets;
|
||||||
|
|
||||||
if( !TIFFGetField( rtiff->tiff, TIFFTAG_SUBIFD,
|
if( !TIFFGetField( rtiff->tiff, TIFFTAG_SUBIFD,
|
||||||
@ -1224,7 +1224,7 @@ rtiff_greyscale_line( Rtiff *rtiff,
|
|||||||
|
|
||||||
switch( format ) {
|
switch( format ) {
|
||||||
case VIPS_FORMAT_CHAR:
|
case VIPS_FORMAT_CHAR:
|
||||||
GREY_LOOP( guchar, 0 );
|
GREY_LOOP( gchar, 0 );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VIPS_FORMAT_UCHAR:
|
case VIPS_FORMAT_UCHAR:
|
||||||
@ -1646,7 +1646,7 @@ rtiff_pick_reader( Rtiff *rtiff )
|
|||||||
static int
|
static int
|
||||||
rtiff_set_header( Rtiff *rtiff, VipsImage *out )
|
rtiff_set_header( Rtiff *rtiff, VipsImage *out )
|
||||||
{
|
{
|
||||||
uint32 data_length;
|
guint32 data_length;
|
||||||
void *data;
|
void *data;
|
||||||
|
|
||||||
rtiff_set_decode_format( rtiff );
|
rtiff_set_decode_format( rtiff );
|
||||||
@ -2437,9 +2437,9 @@ static int
|
|||||||
rtiff_header_read( Rtiff *rtiff, RtiffHeader *header )
|
rtiff_header_read( Rtiff *rtiff, RtiffHeader *header )
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
uint16 extra_samples_count;
|
guint16 extra_samples_count;
|
||||||
uint16 *extra_samples_types;
|
guint16 *extra_samples_types;
|
||||||
uint16 subifd_count;
|
guint16 subifd_count;
|
||||||
toff_t *subifd_offsets;
|
toff_t *subifd_offsets;
|
||||||
char *image_description;
|
char *image_description;
|
||||||
|
|
||||||
@ -2489,7 +2489,7 @@ rtiff_header_read( Rtiff *rtiff, RtiffHeader *header )
|
|||||||
*
|
*
|
||||||
* tiffcp fails for images like this too.
|
* tiffcp fails for images like this too.
|
||||||
*/
|
*/
|
||||||
uint16 hsub, vsub;
|
guint16 hsub, vsub;
|
||||||
|
|
||||||
TIFFGetFieldDefaulted( rtiff->tiff,
|
TIFFGetFieldDefaulted( rtiff->tiff,
|
||||||
TIFFTAG_YCBCRSUBSAMPLING, &hsub, &vsub );
|
TIFFTAG_YCBCRSUBSAMPLING, &hsub, &vsub );
|
||||||
@ -2548,7 +2548,7 @@ rtiff_header_read( Rtiff *rtiff, RtiffHeader *header )
|
|||||||
header->separate = TRUE;
|
header->separate = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TIFFGetField needs a uint16 to write count to.
|
/* TIFFGetField needs a guint16 to write count to.
|
||||||
*/
|
*/
|
||||||
if( TIFFGetField( rtiff->tiff, TIFFTAG_SUBIFD,
|
if( TIFFGetField( rtiff->tiff, TIFFTAG_SUBIFD,
|
||||||
&subifd_count, &subifd_offsets ) )
|
&subifd_count, &subifd_offsets ) )
|
||||||
|
@ -810,7 +810,7 @@ wtiff_write_header( Wtiff *wtiff, Layer *layer )
|
|||||||
alpha_bands = VIPS_CLIP( 0,
|
alpha_bands = VIPS_CLIP( 0,
|
||||||
wtiff->ready->Bands - colour_bands, MAX_ALPHA );
|
wtiff->ready->Bands - colour_bands, MAX_ALPHA );
|
||||||
if( alpha_bands > 0 ) {
|
if( alpha_bands > 0 ) {
|
||||||
uint16 v[MAX_ALPHA];
|
guint16 v[MAX_ALPHA];
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* EXTRASAMPLE_UNASSALPHA means generic extra
|
/* EXTRASAMPLE_UNASSALPHA means generic extra
|
||||||
@ -1984,11 +1984,11 @@ wtiff_copy_tiles( Wtiff *wtiff, TIFF *out, TIFF *in )
|
|||||||
static int
|
static int
|
||||||
wtiff_copy_tiff( Wtiff *wtiff, TIFF *out, TIFF *in )
|
wtiff_copy_tiff( Wtiff *wtiff, TIFF *out, TIFF *in )
|
||||||
{
|
{
|
||||||
uint32 ui32;
|
guint32 ui32;
|
||||||
uint16 ui16;
|
guint16 ui16;
|
||||||
uint16 ui16_2;
|
guint16 ui16_2;
|
||||||
float f;
|
float f;
|
||||||
uint16 *a;
|
guint16 *a;
|
||||||
|
|
||||||
/* All the fields we might have set.
|
/* All the fields we might have set.
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user