xp_comm_proj/ReadGeoTiff/libtiff/tif_aux.c
/*
 * Compute how many tiles are in an image.
 */
Compute how many tiles are in an image.
Compute how many tiles are in an image .
ttile_t
TIFFNumberOfTiles(TIFF* tif)
{
	TIFFDirectory *td = &tif->tif_dir;
	uint32 dx = td->td_tilewidth;
	uint32 dy = td->td_tilelength;
	uint32 dz = td->td_tiledepth;
	ttile_t ntiles;
	if (dx == (uint32) -1)
		dx = td->td_imagewidth;
	if (dy == (uint32) -1)
		dy = td->td_imagelength;
	if (dz == (uint32) -1)
		dz = td->td_imagedepth;
	ntiles = (dx == 0 || dy == 0 || dz == 0) ? 0 :
	    (TIFFhowmany(td->td_imagewidth, dx) *
	     TIFFhowmany(td->td_imagelength, dy) *
	     TIFFhowmany(td->td_imagedepth, dz));
	if (td->td_planarconfig == PLANARCONFIG_SEPARATE)
		ntiles *= td->td_samplesperpixel;
	return (ntiles);
}
ttile_t TIFFNumberOfTiles ( TIFF * tif ) { TIFFDirectory * td = & tif -> tif_dir ; uint32 dx = td -> td_tilewidth ; uint32 dy = td -> td_tilelength ; uint32 dz = td -> td_tiledepth ; ttile_t ntiles ; if ( dx == ( uint32 ) - 1 ) dx = td -> td_imagewidth ; if ( dy == ( uint32 ) - 1 ) dy = td -> td_imagelength ; if ( dz == ( uint32 ) - 1 ) dz = td -> td_imagedepth ; ntiles = ( dx == 0 || dy == 0 || dz == 0 ) ? 0 : ( TIFFhowmany ( td -> td_imagewidth , dx ) * TIFFhowmany ( td -> td_imagelength , dy ) * TIFFhowmany ( td -> td_imagedepth , dz ) ) ; if ( td -> td_planarconfig == PLANARCONFIG_SEPARATE ) ntiles *= td -> td_samplesperpixel ; return ( ntiles ) ; }
Compute how many tiles are in an image.
Compute how many tiles are in an image .