xp_comm_proj/ReadGeoTiff/libtiff/tif_getimage.c
/*
 * Select the appropriate conversion routine for packed data.
 */
Select the appropriate conversion routine for packed data.
Select the appropriate conversion routine for packed data .
static int
pickTileContigCase(TIFFRGBAImage* img)
{
    tileContigRoutine put = 0;
    if (buildMap(img)) {
	switch (img->photometric) {
	case PHOTOMETRIC_RGB:
	    switch (img->bitspersample) {
	    case 8:
		if (!img->Map) {
		    if (img->alpha == EXTRASAMPLE_ASSOCALPHA)
			put = putRGBAAcontig8bittile;
		    else if (img->alpha == EXTRASAMPLE_UNASSALPHA)
			put = putRGBUAcontig8bittile;
		    else
			put = putRGBcontig8bittile;
		} else
		    put = putRGBcontig8bitMaptile;
		break;
	    case 16:
		put = putRGBcontig16bittile;
		if (!img->Map) {
		    if (img->alpha == EXTRASAMPLE_ASSOCALPHA)
			put = putRGBAAcontig16bittile;
		    else if (img->alpha == EXTRASAMPLE_UNASSALPHA)
			put = putRGBUAcontig16bittile;
		}
		break;
	    }
	    break;
	case PHOTOMETRIC_SEPARATED:
	    if (img->bitspersample == 8) {
		if (!img->Map)
		    put = putRGBcontig8bitCMYKtile;
		else
		    put = putRGBcontig8bitCMYKMaptile;
	    }
	    break;
	case PHOTOMETRIC_PALETTE:
	    switch (img->bitspersample) {
	    case 8:	put = put8bitcmaptile; break;
	    case 4: put = put4bitcmaptile; break;
	    case 2: put = put2bitcmaptile; break;
	    case 1: put = put1bitcmaptile; break;
	    }
	    break;
	case PHOTOMETRIC_MINISWHITE:
	case PHOTOMETRIC_MINISBLACK:
	    switch (img->bitspersample) {
	    case 8:	put = putgreytile; break;
	    case 4: put = put4bitbwtile; break;
	    case 2: put = put2bitbwtile; break;
	    case 1: put = put1bitbwtile; break;
	    }
	    break;
	case PHOTOMETRIC_YCBCR:
	    if (img->bitspersample == 8)
		put = initYCbCrConversion(img);
	    break;
	}
    }
    return ((img->put.contig = put) != 0);
}
static int pickTileContigCase ( TIFFRGBAImage * img ) { tileContigRoutine put = 0 ; if ( buildMap ( img ) ) { switch ( img -> photometric ) { case PHOTOMETRIC_RGB : switch ( img -> bitspersample ) { case 8 : if ( ! img -> Map ) { if ( img -> alpha == EXTRASAMPLE_ASSOCALPHA ) put = putRGBAAcontig8bittile ; else if ( img -> alpha == EXTRASAMPLE_UNASSALPHA ) put = putRGBUAcontig8bittile ; else put = putRGBcontig8bittile ; } else put = putRGBcontig8bitMaptile ; break ; case 16 : put = putRGBcontig16bittile ; if ( ! img -> Map ) { if ( img -> alpha == EXTRASAMPLE_ASSOCALPHA ) put = putRGBAAcontig16bittile ; else if ( img -> alpha == EXTRASAMPLE_UNASSALPHA ) put = putRGBUAcontig16bittile ; } break ; } break ; case PHOTOMETRIC_SEPARATED : if ( img -> bitspersample == 8 ) { if ( ! img -> Map ) put = putRGBcontig8bitCMYKtile ; else put = putRGBcontig8bitCMYKMaptile ; } break ; case PHOTOMETRIC_PALETTE : switch ( img -> bitspersample ) { case 8 : put = put8bitcmaptile ; break ; case 4 : put = put4bitcmaptile ; break ; case 2 : put = put2bitcmaptile ; break ; case 1 : put = put1bitcmaptile ; break ; } break ; case PHOTOMETRIC_MINISWHITE : case PHOTOMETRIC_MINISBLACK : switch ( img -> bitspersample ) { case 8 : put = putgreytile ; break ; case 4 : put = put4bitbwtile ; break ; case 2 : put = put2bitbwtile ; break ; case 1 : put = put1bitbwtile ; break ; } break ; case PHOTOMETRIC_YCBCR : if ( img -> bitspersample == 8 ) put = initYCbCrConversion ( img ) ; break ; } } return ( ( img -> put . contig = put ) != 0 ) ; }
Select the appropriate conversion routine for packed data.
Select the appropriate conversion routine for packed data .