half-way through adding tiled read
This commit is contained in:
parent
64d02a7a15
commit
80e8c3f496
|
@ -1366,11 +1366,6 @@ rtiff_fill_region( VipsRegion *out, void *seq, void *a, void *b, gboolean *stop
|
||||||
int tile_height = rtiff->header.tile_height;
|
int tile_height = rtiff->header.tile_height;
|
||||||
VipsRect *r = &out->valid;
|
VipsRect *r = &out->valid;
|
||||||
|
|
||||||
/* Find top left of tiles we need.
|
|
||||||
*/
|
|
||||||
int xs = (r->left / tile_width) * tile_width;
|
|
||||||
int ys = (r->top / tile_height) * tile_height;
|
|
||||||
|
|
||||||
/* Sizeof a line of bytes in the TIFF tile.
|
/* Sizeof a line of bytes in the TIFF tile.
|
||||||
*/
|
*/
|
||||||
int tls = rtiff_tile_size( rtiff ) / tile_height;
|
int tls = rtiff_tile_size( rtiff ) / tile_height;
|
||||||
|
@ -1387,8 +1382,12 @@ rtiff_fill_region( VipsRegion *out, void *seq, void *a, void *b, gboolean *stop
|
||||||
|
|
||||||
/* Special case: we are filling a single tile exactly sized to match
|
/* Special case: we are filling a single tile exactly sized to match
|
||||||
* the tiff tile and we have no repacking to do for this format.
|
* the tiff tile and we have no repacking to do for this format.
|
||||||
|
*
|
||||||
|
* This will also only work for single-page read. If we are reading
|
||||||
|
* from a many-page TIFF, all our tile alignment will break.
|
||||||
*/
|
*/
|
||||||
if( rtiff->memcpy &&
|
if( rtiff->memcpy &&
|
||||||
|
rtiff->n == 1 &&
|
||||||
r->left % tile_width == 0 &&
|
r->left % tile_width == 0 &&
|
||||||
r->top % tile_height == 0 &&
|
r->top % tile_height == 0 &&
|
||||||
r->width == tile_width &&
|
r->width == tile_width &&
|
||||||
|
@ -1398,8 +1397,10 @@ rtiff_fill_region( VipsRegion *out, void *seq, void *a, void *b, gboolean *stop
|
||||||
|
|
||||||
VIPS_GATE_START( "rtiff_fill_region: work" );
|
VIPS_GATE_START( "rtiff_fill_region: work" );
|
||||||
|
|
||||||
for( y = ys; y < VIPS_RECT_BOTTOM( r ); y += tile_height )
|
y = 0;
|
||||||
for( x = xs; x < VIPS_RECT_RIGHT( r ); x += tile_width ) {
|
while( y < r->height ) {
|
||||||
|
x = 0;
|
||||||
|
while( x < r->width ) {
|
||||||
VipsRect tile;
|
VipsRect tile;
|
||||||
VipsRect hit;
|
VipsRect hit;
|
||||||
|
|
||||||
|
@ -1434,8 +1435,13 @@ rtiff_fill_region( VipsRegion *out, void *seq, void *a, void *b, gboolean *stop
|
||||||
rtiff->sfn( rtiff,
|
rtiff->sfn( rtiff,
|
||||||
q, p, hit.width, rtiff->client );
|
q, p, hit.width, rtiff->client );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
x += tile_width;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
y += tile_height;
|
||||||
|
}
|
||||||
|
|
||||||
VIPS_GATE_STOP( "rtiff_fill_region: work" );
|
VIPS_GATE_STOP( "rtiff_fill_region: work" );
|
||||||
|
|
||||||
return( 0 );
|
return( 0 );
|
||||||
|
|
Loading…
Reference in New Issue