当前位置: 首页>>代码示例>>C++>>正文


C++ TIFFGetFieldDefaulted函数代码示例

本文整理汇总了C++中TIFFGetFieldDefaulted函数的典型用法代码示例。如果您正苦于以下问题:C++ TIFFGetFieldDefaulted函数的具体用法?C++ TIFFGetFieldDefaulted怎么用?C++ TIFFGetFieldDefaulted使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了TIFFGetFieldDefaulted函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: tmap_tiff

static int
tmap_tiff(			/* tone map SGILOG TIFF */
	char	*fname,
	TIFF	*tp
)
{
	float	xres, yres;
	uint16	orient, resunit, phot;
	int	xsiz, ysiz;
	uby8	*pix;
					/* check to make sure it's SGILOG */
	TIFFGetFieldDefaulted(tp, TIFFTAG_PHOTOMETRIC, &phot);
	if ((phot == PHOTOMETRIC_LOGL) | (phot == PHOTOMETRIC_MINISBLACK))
		flags |= TM_F_BW;
					/* read and tone map TIFF */
	if (tmMapTIFF(&pix, &xsiz, &ysiz, flags,
			rgbp, gamv, lddyn, ldmax, fname, tp) != TM_E_OK)
		return(-1);
					/* get relevant tags */
	TIFFGetFieldDefaulted(tp, TIFFTAG_RESOLUTIONUNIT, &resunit);
	TIFFGetFieldDefaulted(tp, TIFFTAG_XRESOLUTION, &xres);
	TIFFGetFieldDefaulted(tp, TIFFTAG_YRESOLUTION, &yres);
	TIFFGetFieldDefaulted(tp, TIFFTAG_ORIENTATION, &orient);
					/* put out our image */
	if (putimage(orient, (uint32)xsiz, (uint32)ysiz,
			xres, yres, resunit, pix) != 0)
		return(-1);
					/* free data and we're done */
	free((void *)pix);
	return(0);
}
开发者ID:Pizookies,项目名称:Radiance,代码行数:31,代码来源:normtiff.c

示例2: StripBasedXform

static
int StripBasedXform(cmsHTRANSFORM hXForm, TIFF* in, TIFF* out, int nPlanes)
{
    tsize_t BufSizeIn  = TIFFStripSize(in);
    tsize_t BufSizeOut = TIFFStripSize(out);
    unsigned char *BufferIn, *BufferOut;
    ttile_t i, StripCount = TIFFNumberOfStrips(in) / nPlanes;
    uint32 sw;
    uint32 sl;
    uint32 iml;
    int j;
    int PixelCount;

    TIFFGetFieldDefaulted(in, TIFFTAG_IMAGEWIDTH,  &sw);
    TIFFGetFieldDefaulted(in, TIFFTAG_ROWSPERSTRIP, &sl);
    TIFFGetFieldDefaulted(in, TIFFTAG_IMAGELENGTH, &iml);

   

    BufferIn = (unsigned char *) _TIFFmalloc(BufSizeIn * nPlanes);
    if (!BufferIn) OutOfMem(BufSizeIn * nPlanes);

    BufferOut = (unsigned char *) _TIFFmalloc(BufSizeOut * nPlanes);
    if (!BufferOut) OutOfMem(BufSizeOut * nPlanes);


    for (i = 0; i < StripCount; i++) {

        for (j=0; j < nPlanes; j++) {

            if (TIFFReadEncodedStrip(in, i + (j * StripCount), 
                                        BufferIn + (j * BufSizeIn), BufSizeIn) < 0)   goto cleanup;
        }

        PixelCount = (int) sw * (iml < sl ? iml : sl);
        iml -= sl;

        cmsDoTransform(hXForm, BufferIn, BufferOut, PixelCount);

        for (j=0; j < nPlanes; j++) {
            if (TIFFWriteEncodedStrip(out, i + (j * StripCount), 
                                     BufferOut + j * BufSizeOut, BufSizeOut) < 0) goto cleanup;
        }

    }

    _TIFFfree(BufferIn);
    _TIFFfree(BufferOut);
    return 1;


cleanup:

    _TIFFfree(BufferIn);
   _TIFFfree(BufferOut);
   return 0;
}
开发者ID:mworks-project,项目名称:mw_supporting,代码行数:57,代码来源:tifficc.c

示例3: TileBasedXform

static
int TileBasedXform(cmsHTRANSFORM hXForm, TIFF* in, TIFF* out, int nPlanes)
{
    tsize_t BufSizeIn  = TIFFTileSize(in);
    tsize_t BufSizeOut = TIFFTileSize(out);
    unsigned char *BufferIn, *BufferOut;
    ttile_t i, TileCount = TIFFNumberOfTiles(in) / nPlanes;
    uint32 tw, tl;
    int PixelCount, j;


    TIFFGetFieldDefaulted(in, TIFFTAG_TILEWIDTH,  &tw);
    TIFFGetFieldDefaulted(in, TIFFTAG_TILELENGTH, &tl);

     PixelCount = (int) tw * tl;

     BufferIn = (unsigned char *) _TIFFmalloc(BufSizeIn * nPlanes);
    if (!BufferIn) OutOfMem(BufSizeIn * nPlanes);

    BufferOut = (unsigned char *) _TIFFmalloc(BufSizeOut * nPlanes);
    if (!BufferOut) OutOfMem(BufSizeOut * nPlanes);


    for (i = 0; i < TileCount; i++) {

        for (j=0; j < nPlanes; j++) {

            if (TIFFReadEncodedTile(in, i + (j* TileCount), 
                                    BufferIn + (j*BufSizeIn), BufSizeIn) < 0)   goto cleanup;
        }

      cmsDoTransform(hXForm, BufferIn, BufferOut, PixelCount);

      for (j=0; j < nPlanes; j++) {

             if (TIFFWriteEncodedTile(out, i + (j*TileCount),
                                    BufferOut + (j*BufSizeOut), BufSizeOut) < 0) goto cleanup;
      }

    }

    _TIFFfree(BufferIn);
    _TIFFfree(BufferOut);
    return 1;


cleanup:

    _TIFFfree(BufferIn);
   _TIFFfree(BufferOut);
   return 0;
}
开发者ID:mworks-project,项目名称:mw_supporting,代码行数:52,代码来源:tifficc.c

示例4: getTIFFtype

/* figure out what kind of TIFF we have and if we can tone-map it */
static int
getTIFFtype(TIFF *tif)
{
	uint16	comp, phot, pconf;
	uint16	samp_fmt, bits_samp;
	
	TIFFGetFieldDefaulted(tif, TIFFTAG_PLANARCONFIG, &pconf);
	if (pconf != PLANARCONFIG_CONTIG)
		return(0);
	TIFFGetFieldDefaulted(tif, TIFFTAG_PHOTOMETRIC, &phot);
	TIFFGetFieldDefaulted(tif, TIFFTAG_COMPRESSION, &comp);
	TIFFGetFieldDefaulted(tif, TIFFTAG_SAMPLEFORMAT, &samp_fmt);
	TIFFGetFieldDefaulted(tif, TIFFTAG_BITSPERSAMPLE, &bits_samp);
	switch (phot) {
	case PHOTOMETRIC_LOGLUV:
		if (comp == COMPRESSION_SGILOG)
			return(TC_LOGLUV32);
		if (comp == COMPRESSION_SGILOG24)
			return(TC_LOGLUV24);
		return(0);
	case PHOTOMETRIC_LOGL:
		if (comp == COMPRESSION_SGILOG)
			return(TC_LOGL16);
		return(0);
	case PHOTOMETRIC_MINISBLACK:
		if (samp_fmt == SAMPLEFORMAT_UINT) {
			if (bits_samp == 16)
				return(TC_GRYSHORT);
			return(0);
		}
		if (samp_fmt == SAMPLEFORMAT_IEEEFP) {
			if (bits_samp == 8*sizeof(float))
				return(TC_GRYFLOAT);
			return(0);
		}
		return(0);
	case PHOTOMETRIC_RGB:
		if (samp_fmt == SAMPLEFORMAT_UINT) {
			if (bits_samp == 16)
				return(TC_RGBSHORT);
			return(0);
		}
		if (samp_fmt == SAMPLEFORMAT_IEEEFP) {
			if (bits_samp == 8*sizeof(float))
				return(TC_RGBFLOAT);
			return(0);
		}
		return(0);
	}
	return(0);
}
开发者ID:Pizookies,项目名称:Radiance,代码行数:52,代码来源:tmaptiff.c

示例5: gtStripContig

/*
 * Get a strip-organized image that has
 *	PlanarConfiguration contiguous if SamplesPerPixel > 1
 * or
 *	SamplesPerPixel == 1
 */	
static int
gtStripContig(TIFFImageIter* img, void *udata, uint32 w, uint32 h)
{
    TIFF* tif = img->tif;
    ImageIterTileContigRoutine callback = img->callback.contig;
    uint16 orientation;
    uint32 row, nrow;
    u_char* buf;
    uint32 rowsperstrip;
    uint32 imagewidth = img->width;
    tsize_t scanline;
    int32 fromskew;

    buf = (u_char*) _TIFFmalloc(TIFFStripSize(tif));
    if (buf == 0) {
	TIFFError(TIFFFileName(tif), "No space for strip buffer");
	return (0);
    }
    orientation = img->orientation;
    TIFFGetFieldDefaulted(tif, TIFFTAG_ROWSPERSTRIP, &rowsperstrip);
    scanline = TIFFScanlineSize(tif);
    fromskew = (w < imagewidth ? imagewidth - w : 0);
    for (row = 0; row < h; row += rowsperstrip) {
	nrow = (row + rowsperstrip > h ? h - row : rowsperstrip);
	if (TIFFReadEncodedStrip(tif, TIFFComputeStrip(tif, row, 0),
	    buf, nrow*scanline) < 0 && img->stoponerr)
		break;
	(*callback)(img, udata, 0, row, w, nrow, fromskew, buf);
    }
    _TIFFfree(buf);
    return (1);
}
开发者ID:Rambonuaa,项目名称:BoundCheck4,代码行数:38,代码来源:tif_imageiter.c

示例6: TIFFGetFieldDefaulted

void PLTIFFDecoder::GetImage (PLBmpBase & Bmp)
{
  uint16  BitsPerSample;
  uint16  SamplePerPixel;

  // get tagged image parameters
  TIFFGetFieldDefaulted(m_pTif, TIFFTAG_BITSPERSAMPLE, &BitsPerSample);
  TIFFGetFieldDefaulted(m_pTif, TIFFTAG_SAMPLESPERPIXEL, &SamplePerPixel);

  if ((SamplePerPixel == 1 || SamplePerPixel == 2) && BitsPerSample <= 16
      &&  !TIFFIsTiled(m_pTif))
    doLoColor(m_pTif, &Bmp);
  else
    // complicated decoding; use higher-level API
    // it will promote all images to 32bpp, though
    doHiColor(m_pTif, &Bmp, SamplePerPixel);
}
开发者ID:artcom,项目名称:y60,代码行数:17,代码来源:pltiffdec.cpp

示例7: TIFFScanlineSize64

/*
 * Return the number of bytes to read/write in a call to
 * one of the scanline-oriented i/o routines.  Note that
 * this number may be 1/samples-per-pixel if data is
 * stored as separate planes.
 * The ScanlineSize in case of YCbCrSubsampling is defined as the
 * strip size divided by the strip height, i.e. the size of a pack of vertical
 * subsampling lines divided by vertical subsampling. It should thus make
 * sense when multiplied by a multiple of vertical subsampling.
 */
uint64
TIFFScanlineSize64(TIFF* tif)
{
	static const char module[] = "TIFFScanlineSize64";
	TIFFDirectory *td = &tif->tif_dir;
	uint64 scanline_size;
	if (td->td_planarconfig==PLANARCONFIG_CONTIG)
	{
		if ((td->td_photometric==PHOTOMETRIC_YCBCR)&&
		    (td->td_samplesperpixel==3)&&
		    (!isUpSampled(tif)))
		{
			uint16 ycbcrsubsampling[2];
			uint16 samplingblock_samples;
			uint32 samplingblocks_hor;
			uint64 samplingrow_samples;
			uint64 samplingrow_size;
			if(td->td_samplesperpixel!=3)
			{
                            TIFFErrorExt(tif->tif_clientdata,module,
                                         "Invalid td_samplesperpixel value");
                            return 0;
			}
			TIFFGetFieldDefaulted(tif,TIFFTAG_YCBCRSUBSAMPLING,
                                              ycbcrsubsampling+0,
                                              ycbcrsubsampling+1);
			if (((ycbcrsubsampling[0]!=1)&&(ycbcrsubsampling[0]!=2)&&(ycbcrsubsampling[0]!=4)) ||
			    ((ycbcrsubsampling[1]!=1)&&(ycbcrsubsampling[1]!=2)&&(ycbcrsubsampling[1]!=4)))
			{
                            TIFFErrorExt(tif->tif_clientdata,module,
                                         "Invalid YCbCr subsampling");
                            return 0;
			}
			samplingblock_samples = ycbcrsubsampling[0]*ycbcrsubsampling[1]+2;
			samplingblocks_hor = TIFFhowmany_32(td->td_imagewidth,ycbcrsubsampling[0]);
			samplingrow_samples = _TIFFMultiply64(tif,samplingblocks_hor,samplingblock_samples,module);
			samplingrow_size = TIFFhowmany_64(_TIFFMultiply64(tif,samplingrow_samples,td->td_bitspersample,module),8);
/* IMLIB			scanline_size = (samplingrow_size/ycbcrsubsampling[1]);   See tif_jpeg.c */
			scanline_size = samplingrow_size;
		}
		else
		{
			uint64 scanline_samples;
			scanline_samples=_TIFFMultiply64(tif,td->td_imagewidth,td->td_samplesperpixel,module);
			scanline_size=TIFFhowmany_64(_TIFFMultiply64(tif,scanline_samples,td->td_bitspersample,module),8);
		}
	}
	else
        {
		scanline_size=TIFFhowmany_64(_TIFFMultiply64(tif,td->td_imagewidth,td->td_bitspersample,module),8);
        }
        if (scanline_size == 0)
        {
                TIFFErrorExt(tif->tif_clientdata,module,"Computed scanline size is zero");
                return 0;
        }
	return(scanline_size);
}
开发者ID:Vulcanior,项目名称:IUP,代码行数:68,代码来源:tif_strip.c

示例8: get_tiff_info

static void get_tiff_info(struct tiff_info *t, TIFF *tif)
{
	TIFFGetFieldDefaulted(tif, TIFFTAG_IMAGEWIDTH,      &t->w);
	TIFFGetFieldDefaulted(tif, TIFFTAG_IMAGELENGTH,     &t->h);
	TIFFGetFieldDefaulted(tif, TIFFTAG_SAMPLESPERPIXEL, &t->spp);
	TIFFGetFieldDefaulted(tif, TIFFTAG_BITSPERSAMPLE,   &t->bps);
	TIFFGetFieldDefaulted(tif, TIFFTAG_SAMPLEFORMAT,    &t->fmt);

	uint16_t planarity, compression;
	TIFFGetFieldDefaulted(tif, TIFFTAG_PLANARCONFIG,    &planarity);
	TIFFGetFieldDefaulted(tif, TIFFTAG_COMPRESSION,     &compression);
	t->broken = planarity != PLANARCONFIG_CONTIG;
	t->compressed = compression != COMPRESSION_NONE;
	t->packed = 0 != t->bps % 8;
	t->tiled = TIFFIsTiled(tif);

	if (t->tiled) {
		TIFFGetField(tif, TIFFTAG_TILEWIDTH,  &t->tw);
		TIFFGetField(tif, TIFFTAG_TILELENGTH, &t->th);
		t->ta = how_many(t->w, t->tw);
		t->td = how_many(t->h, t->th);
		t->ntiles = TIFFNumberOfTiles(tif);
		assert(t->ta * t->td == t->ntiles);
	} else {
		t->ta = t->td = 1;
		t->tw = t->w;
		t->th = t->h;
		t->ntiles = 1;
	}
}
开发者ID:cpalmann,项目名称:s2p,代码行数:30,代码来源:tiff_octaves_rw.c

示例9: PLASSERT

void PLTIFFDecoder::Open (PLDataSource * pDataSrc)
{
  PLASSERT (m_pTif == 0);
  m_pTif = TIFFOpenMem (pDataSrc->ReadEverything(), pDataSrc->GetFileSize(), 
                        NULL);
  if (!m_pTif)
    raiseError (PL_ERRWRONG_SIGNATURE, m_szLastErr);

  uint16  BitsPerSample;
  uint16  SamplesPerPixel;
  uint32  ImageHeight;
  uint32  ImageWidth;

  // get tagged image parameters
  TIFFGetFieldDefaulted(m_pTif, TIFFTAG_IMAGEWIDTH, &ImageWidth);
  TIFFGetFieldDefaulted(m_pTif, TIFFTAG_IMAGELENGTH, &ImageHeight);
  TIFFGetFieldDefaulted(m_pTif, TIFFTAG_BITSPERSAMPLE, &BitsPerSample);
  TIFFGetFieldDefaulted(m_pTif, TIFFTAG_SAMPLESPERPIXEL, &SamplesPerPixel);

  int16  PhotometricInterpretation;
  TIFFGetFieldDefaulted(m_pTif, TIFFTAG_PHOTOMETRIC, &PhotometricInterpretation);
  PLPixelFormat pf = PLPixelFormat::X8R8G8B8;
  if (!TIFFIsTiled(m_pTif))
  { 
    if (SamplesPerPixel == 1 && BitsPerSample ==1)
      pf = PLPixelFormat::L1;
    else if (SamplesPerPixel < 3 && BitsPerSample <= 8)
      if (PhotometricInterpretation == PHOTOMETRIC_MINISWHITE ||
          PhotometricInterpretation == PHOTOMETRIC_MINISBLACK)
        pf = PLPixelFormat::L8;
      else
        pf = PLPixelFormat::I8;
    else if (SamplesPerPixel < 3 && BitsPerSample <= 16)
        pf = PLPixelFormat::L16;
  }
  if (SamplesPerPixel == 4 && 
      (PhotometricInterpretation == PHOTOMETRIC_MINISWHITE ||
       PhotometricInterpretation == PHOTOMETRIC_MINISBLACK || 
       PhotometricInterpretation == PHOTOMETRIC_RGB || 
       PhotometricInterpretation == PHOTOMETRIC_PALETTE))
    pf = PLPixelFormat::A8R8G8B8;
  
  SetBmpInfo (PLPoint (ImageWidth, ImageHeight), getResolution (m_pTif), pf);

}
开发者ID:artcom,项目名称:y60,代码行数:45,代码来源:pltiffdec.cpp

示例10: initYCbCrConversion

static tileContigRoutine
initYCbCrConversion(TIFFRGBAImage* img)
{
    uint16 hs, vs;

    if (img->ycbcr == NULL) {
    img->ycbcr = (TIFFYCbCrToRGB*) _TIFFmalloc(
      TIFFroundup(sizeof (TIFFYCbCrToRGB), sizeof (long))
    + 4*256*sizeof (TIFFRGBValue)
    + 2*256*sizeof (int)
    + 2*256*sizeof (int32)
    );
    if (img->ycbcr == NULL) {
    TIFFError(TIFFFileName(img->tif),
    "No space for YCbCr->RGB conversion state");
    return (NULL);
    }
    TIFFYCbCrToRGBInit(img->ycbcr, img->tif);
    } else {
    float* coeffs;

    TIFFGetFieldDefaulted(img->tif, TIFFTAG_YCBCRCOEFFICIENTS, &coeffs);
    if (_TIFFmemcmp(coeffs, img->ycbcr->coeffs, 3*sizeof (float)) != 0)
    TIFFYCbCrToRGBInit(img->ycbcr, img->tif);
    }
    /*
     * The 6.0 spec says that subsampling must be
     * one of 1, 2, or 4, and that vertical subsampling
     * must always be <= horizontal subsampling; so
     * there are only a few possibilities and we just
     * enumerate the cases.
     */
    TIFFGetFieldDefaulted(img->tif, TIFFTAG_YCBCRSUBSAMPLING, &hs, &vs);
    switch ((hs<<4)|vs) {
    case 0x44: return (putcontig8bitYCbCr44tile);
    case 0x42: return (putcontig8bitYCbCr42tile);
    case 0x41: return (putcontig8bitYCbCr41tile);
    case 0x22: return (putcontig8bitYCbCr22tile);
    case 0x21: return (putcontig8bitYCbCr21tile);
    case 0x11: return (putcontig8bitYCbCr11tile);
    }
    return (NULL);
}
开发者ID:OS2World,项目名称:DEV-UTIL-MGL,代码行数:43,代码来源:tif_getimage.c

示例11: imb_read_tiff_resolution

static void imb_read_tiff_resolution(ImBuf *ibuf, TIFF *image)
{
	uint16 unit;
	float xres;
	float yres;

	TIFFGetFieldDefaulted(image, TIFFTAG_RESOLUTIONUNIT, &unit);
	TIFFGetFieldDefaulted(image, TIFFTAG_XRESOLUTION, &xres);
	TIFFGetFieldDefaulted(image, TIFFTAG_YRESOLUTION, &yres);

	if (unit == RESUNIT_CENTIMETER) {
		ibuf->ppm[0] = (double)xres * 100.0;
		ibuf->ppm[1] = (double)yres * 100.0;
	}
	else {
		ibuf->ppm[0] = (double)xres / 0.0254;
		ibuf->ppm[1] = (double)yres / 0.0254;
	}
}
开发者ID:JasonWilkins,项目名称:blender-wayland,代码行数:19,代码来源:tiff.c

示例12: gtStripSeparate

/*
 * Get a strip-organized image with
 *   SamplesPerPixel > 1
 *   PlanarConfiguration separated
 * We assume that all such images are RGB.
 */
static int
gtStripSeparate(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
{
    TIFF* tif = img->tif;
    tileSeparateRoutine put = img->put.separate;
    uint16 orientation;
    u_char *buf;
    u_char *r, *g, *b, *a;
    uint32 row, y, nrow;
    tsize_t scanline;
    uint32 rowsperstrip;
    uint32 imagewidth = img->width;
    tsize_t stripsize;
    int32 fromskew, toskew;
    int alpha = img->alpha;

    stripsize = TIFFStripSize(tif);
    r = buf = (u_char *)_TIFFmalloc(4*stripsize);
    if (buf == 0) {
    TIFFError(TIFFFileName(tif), "No space for tile buffer");
    return (0);
    }
    g = r + stripsize;
    b = g + stripsize;
    a = b + stripsize;
    if (!alpha)
    memset(a, 0xff, stripsize);
    y = setorientation(img, h);
    orientation = img->orientation;
    toskew = -(int32) (orientation == ORIENTATION_TOPLEFT ? w+w : w-w);
    TIFFGetFieldDefaulted(tif, TIFFTAG_ROWSPERSTRIP, &rowsperstrip);
    scanline = TIFFScanlineSize(tif);
    fromskew = (w < imagewidth ? imagewidth - w : 0);
    for (row = 0; row < h; row += rowsperstrip) {
    nrow = (row + rowsperstrip > h ? h - row : rowsperstrip);
    if (TIFFReadEncodedStrip(tif, TIFFComputeStrip(tif, row, 0),
    r, nrow*scanline) < 0 && img->stoponerr)
    break;
    if (TIFFReadEncodedStrip(tif, TIFFComputeStrip(tif, row, 1),
    g, nrow*scanline) < 0 && img->stoponerr)
    break;
    if (TIFFReadEncodedStrip(tif, TIFFComputeStrip(tif, row, 2),
    b, nrow*scanline) < 0 && img->stoponerr)
    break;
    if (alpha &&
    (TIFFReadEncodedStrip(tif, TIFFComputeStrip(tif, row, 3),
    a, nrow*scanline) < 0 && img->stoponerr))
    break;
    (*put)(img, raster+y*w, 0, y, w, nrow, fromskew, toskew, r, g, b, a);
    y += (orientation == ORIENTATION_TOPLEFT ?
    -(int32) nrow : (int32) nrow);
    }
    _TIFFfree(buf);
    return (1);
}
开发者ID:OS2World,项目名称:DEV-UTIL-MGL,代码行数:61,代码来源:tif_getimage.c

示例13: get_property

    bool get_property( typename Property::type& value  )
    {
        if ( TIFFGetFieldDefaulted( _tiff_file.get()
                                    , Property::tag
                                    , &value ) == 1 )
        {
            return true;
        }

        return false;
    }
开发者ID:antithing,项目名称:uniclop,代码行数:11,代码来源:device.hpp

示例14: get_field_defaulted

 int get_field_defaulted( uint16_t*& red
                          , uint16_t*& green
                          , uint16_t*& blue
                        )
 {
     return TIFFGetFieldDefaulted( _tiff_file.get()
                                   , TIFFTAG_COLORMAP
                                   , &red
                                   , &green
                                   , &blue
                                 );
 }
开发者ID:antithing,项目名称:uniclop,代码行数:12,代码来源:device.hpp

示例15: TIFFVStripSize64

/*
 * Compute the # bytes in a variable height, row-aligned strip.
 */
uint64
TIFFVStripSize64(TIFF* tif, uint32 nrows)
{
	static const char module[] = "TIFFVStripSize64";
	TIFFDirectory *td = &tif->tif_dir;
	if (nrows==(uint32)(-1))
		nrows=td->td_imagelength;
	if ((td->td_planarconfig==PLANARCONFIG_CONTIG)&&
	    (td->td_photometric == PHOTOMETRIC_YCBCR)&&
	    (!isUpSampled(tif)))
	{
		/*
		 * Packed YCbCr data contain one Cb+Cr for every
		 * HorizontalSampling*VerticalSampling Y values.
		 * Must also roundup width and height when calculating
		 * since images that are not a multiple of the
		 * horizontal/vertical subsampling area include
		 * YCbCr data for the extended image.
		 */
		uint16 ycbcrsubsampling[2];
		uint16 samplingblock_samples;
		uint32 samplingblocks_hor;
		uint32 samplingblocks_ver;
		uint64 samplingrow_samples;
		uint64 samplingrow_size;
		if(td->td_samplesperpixel!=3)
		{
			TIFFErrorExt(tif->tif_clientdata,module,
			    "Invalid td_samplesperpixel value");
			return 0;
		}
		TIFFGetFieldDefaulted(tif,TIFFTAG_YCBCRSUBSAMPLING,ycbcrsubsampling+0,
		    ycbcrsubsampling+1);
		if ((ycbcrsubsampling[0] != 1 && ycbcrsubsampling[0] != 2 && ycbcrsubsampling[0] != 4)
		    ||(ycbcrsubsampling[1] != 1 && ycbcrsubsampling[1] != 2 && ycbcrsubsampling[1] != 4))
		{
			TIFFErrorExt(tif->tif_clientdata,module,
				     "Invalid YCbCr subsampling (%dx%d)",
				     ycbcrsubsampling[0],
				     ycbcrsubsampling[1] );
			return 0;
		}
		samplingblock_samples=ycbcrsubsampling[0]*ycbcrsubsampling[1]+2;
		samplingblocks_hor=TIFFhowmany_32(td->td_imagewidth,ycbcrsubsampling[0]);
		samplingblocks_ver=TIFFhowmany_32(nrows,ycbcrsubsampling[1]);
		samplingrow_samples=_TIFFMultiply64(tif,samplingblocks_hor,samplingblock_samples,module);
		samplingrow_size=TIFFhowmany8_64(_TIFFMultiply64(tif,samplingrow_samples,td->td_bitspersample,module));
		return(_TIFFMultiply64(tif,samplingrow_size,samplingblocks_ver,module));
	}
	else
		return(_TIFFMultiply64(tif,nrows,TIFFScanlineSize64(tif),module));
}
开发者ID:hjmjohnson,项目名称:vxl,代码行数:55,代码来源:tif_strip.c


注:本文中的TIFFGetFieldDefaulted函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。