Visualization Library 2.0.0-b5

A lightweight C++ OpenGL middleware for 2D/3D graphics

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
Macros | Functions | Variables
tif_getimage.c File Reference
#include "tiffiop.h"
#include <stdio.h>

Go to the source code of this file.

Macros

#define FLIP_VERTICALLY   0x01
 
#define FLIP_HORIZONTALLY   0x02
 
#define REPEAT8(op)   REPEAT4(op); REPEAT4(op)
 
#define REPEAT4(op)   REPEAT2(op); REPEAT2(op)
 
#define REPEAT2(op)   op; op
 
#define CASE8(x, op)
 
#define CASE4(x, op)   switch (x) { case 3: op; case 2: op; case 1: op; }
 
#define NOP
 
#define UNROLL8(w, op1, op2)
 
#define UNROLL4(w, op1, op2)
 
#define UNROLL2(w, op1, op2)
 
#define SKEW(r, g, b, skew)   { r += skew; g += skew; b += skew; }
 
#define SKEW4(r, g, b, a, skew)   { r += skew; g += skew; b += skew; a+= skew; }
 
#define A1   (((uint32)0xffL)<<24)
 
#define PACK(r, g, b)   ((uint32)(r)|((uint32)(g)<<8)|((uint32)(b)<<16)|A1)
 
#define PACK4(r, g, b, a)   ((uint32)(r)|((uint32)(g)<<8)|((uint32)(b)<<16)|((uint32)(a)<<24))
 
#define W2B(v)   (((v)>>8)&0xff)
 
#define PACKW(r, g, b)   ((uint32)W2B(r)|((uint32)W2B(g)<<8)|((uint32)W2B(b)<<16)|A1)
 
#define PACKW4(r, g, b, a)   ((uint32)W2B(r)|((uint32)W2B(g)<<8)|((uint32)W2B(b)<<16)|((uint32)W2B(a)<<24))
 
#define DECLAREContigPutFunc(name)
 
#define DECLARESepPutFunc(name)
 
#define YCbCrtoRGB(dst, Y)
 
#define GREY(x)   c = Map[x]; *p++ = PACK(c,c,c);
 
#define CVT(x)   ((uint16)((x)>>8))
 
#define CMAP(x)   c = (TIFFRGBValue) x; *p++ = PACK(r[c]&0xff, g[c]&0xff, b[c]&0xff);
 

Functions

int TIFFRGBAImageOK (TIFF *tif, char emsg[1024])
 
void TIFFRGBAImageEnd (TIFFRGBAImage *img)
 
int TIFFRGBAImageBegin (TIFFRGBAImage *img, TIFF *tif, int stop, char emsg[1024])
 
int TIFFRGBAImageGet (TIFFRGBAImage *img, uint32 *raster, uint32 w, uint32 h)
 
int TIFFReadRGBAImageOriented (TIFF *tif, uint32 rwidth, uint32 rheight, uint32 *raster, int orientation, int stop)
 
int TIFFReadRGBAImage (TIFF *tif, uint32 rwidth, uint32 rheight, uint32 *raster, int stop)
 
 DECLAREContigPutFunc (put8bitcmaptile)
 
 DECLAREContigPutFunc (put4bitcmaptile)
 
 DECLAREContigPutFunc (put2bitcmaptile)
 
 DECLAREContigPutFunc (put1bitcmaptile)
 
 DECLAREContigPutFunc (putgreytile)
 
 DECLAREContigPutFunc (put16bitbwtile)
 
 DECLAREContigPutFunc (put1bitbwtile)
 
 DECLAREContigPutFunc (put2bitbwtile)
 
 DECLAREContigPutFunc (put4bitbwtile)
 
 DECLAREContigPutFunc (putRGBcontig8bittile)
 
 DECLAREContigPutFunc (putRGBcontig8bitMaptile)
 
 DECLAREContigPutFunc (putRGBAAcontig8bittile)
 
 DECLAREContigPutFunc (putRGBUAcontig8bittile)
 
 DECLAREContigPutFunc (putRGBcontig16bittile)
 
 DECLAREContigPutFunc (putRGBAAcontig16bittile)
 
 DECLAREContigPutFunc (putRGBUAcontig16bittile)
 
 DECLAREContigPutFunc (putRGBcontig8bitCMYKtile)
 
 DECLAREContigPutFunc (putRGBcontig8bitCMYKMaptile)
 
 DECLARESepPutFunc (putRGBseparate8bittile)
 
 DECLARESepPutFunc (putRGBseparate8bitMaptile)
 
 DECLARESepPutFunc (putRGBAAseparate8bittile)
 
 DECLARESepPutFunc (putRGBUAseparate8bittile)
 
 DECLARESepPutFunc (putRGBseparate16bittile)
 
 DECLARESepPutFunc (putRGBAAseparate16bittile)
 
 DECLARESepPutFunc (putRGBUAseparate16bittile)
 
 DECLAREContigPutFunc (putcontig8bitCIELab)
 
 DECLAREContigPutFunc (putcontig8bitYCbCr44tile)
 
 DECLAREContigPutFunc (putcontig8bitYCbCr42tile)
 
 DECLAREContigPutFunc (putcontig8bitYCbCr41tile)
 
 DECLAREContigPutFunc (putcontig8bitYCbCr22tile)
 
 DECLAREContigPutFunc (putcontig8bitYCbCr21tile)
 
 DECLAREContigPutFunc (putcontig8bitYCbCr11tile)
 
int TIFFReadRGBAStrip (TIFF *tif, uint32 row, uint32 *raster)
 
int TIFFReadRGBATile (TIFF *tif, uint32 col, uint32 row, uint32 *raster)
 

Variables

TIFFDisplay display_sRGB
 

Macro Definition Documentation

◆ A1

#define A1   (((uint32)0xffL)<<24)

◆ CASE4

#define CASE4 (   x,
  op 
)    switch (x) { case 3: op; case 2: op; case 1: op; }

Definition at line 979 of file tif_getimage.c.

◆ CASE8

#define CASE8 (   x,
  op 
)
Value:
switch (x) { \
case 7: op; case 6: op; case 5: op; \
case 4: op; case 3: op; case 2: op; \
case 1: op; \
}
GLint GLint GLint GLint GLint x

Definition at line 973 of file tif_getimage.c.

◆ CMAP

#define CMAP (   x)    c = (TIFFRGBValue) x; *p++ = PACK(r[c]&0xff, g[c]&0xff, b[c]&0xff);

◆ CVT

#define CVT (   x)    ((uint16)((x)>>8))

◆ DECLAREContigPutFunc

#define DECLAREContigPutFunc (   name)
Value:
static void name(\
uint32* cp, \
int32 fromskew, int32 toskew, \
unsigned char* pp \
)
GLint GLint GLint GLint GLint GLint y
GLint GLvoid * img
GLfloat GLfloat GLfloat GLfloat h
GLint GLint GLint GLint GLint x
GLuint const GLchar * name
unsigned long uint32
Definition: md5.h:41
GLubyte GLubyte GLubyte GLubyte w

Definition at line 1030 of file tif_getimage.c.

◆ DECLARESepPutFunc

#define DECLARESepPutFunc (   name)
Value:
static void name(\
uint32* cp,\
int32 fromskew, int32 toskew,\
unsigned char* r, unsigned char* g, unsigned char* b, unsigned char* a\
)
GLboolean GLboolean GLboolean GLboolean a
GLint GLint GLint GLint GLint GLint y
GLint GLvoid * img
GLfloat GLfloat GLfloat GLfloat h
GLint GLint GLint GLint GLint x
GLboolean GLboolean GLboolean b
GLdouble GLdouble GLdouble r
GLuint const GLchar * name
unsigned long uint32
Definition: md5.h:41
GLubyte GLubyte GLubyte GLubyte w
GLboolean GLboolean g

Definition at line 1416 of file tif_getimage.c.

◆ FLIP_HORIZONTALLY

#define FLIP_HORIZONTALLY   0x02

Definition at line 48 of file tif_getimage.c.

◆ FLIP_VERTICALLY

#define FLIP_VERTICALLY   0x01

Definition at line 47 of file tif_getimage.c.

◆ GREY

#define GREY (   x)    c = Map[x]; *p++ = PACK(c,c,c);

◆ NOP

#define NOP

Definition at line 980 of file tif_getimage.c.

Referenced by DECLAREContigPutFunc(), and DECLARESepPutFunc().

◆ PACK

#define PACK (   r,
  g,
  b 
)    ((uint32)(r)|((uint32)(g)<<8)|((uint32)(b)<<16)|A1)

Definition at line 1020 of file tif_getimage.c.

Referenced by DECLAREContigPutFunc(), and DECLARESepPutFunc().

◆ PACK4

#define PACK4 (   r,
  g,
  b,
  a 
)    ((uint32)(r)|((uint32)(g)<<8)|((uint32)(b)<<16)|((uint32)(a)<<24))

Definition at line 1022 of file tif_getimage.c.

Referenced by DECLAREContigPutFunc(), and DECLARESepPutFunc().

◆ PACKW

#define PACKW (   r,
  g,
  b 
)    ((uint32)W2B(r)|((uint32)W2B(g)<<8)|((uint32)W2B(b)<<16)|A1)

Definition at line 1025 of file tif_getimage.c.

Referenced by DECLAREContigPutFunc(), and DECLARESepPutFunc().

◆ PACKW4

#define PACKW4 (   r,
  g,
  b,
  a 
)    ((uint32)W2B(r)|((uint32)W2B(g)<<8)|((uint32)W2B(b)<<16)|((uint32)W2B(a)<<24))

Definition at line 1027 of file tif_getimage.c.

Referenced by DECLAREContigPutFunc(), and DECLARESepPutFunc().

◆ REPEAT2

#define REPEAT2 (   op)    op; op

Definition at line 972 of file tif_getimage.c.

◆ REPEAT4

#define REPEAT4 (   op)    REPEAT2(op); REPEAT2(op)

Definition at line 971 of file tif_getimage.c.

◆ REPEAT8

#define REPEAT8 (   op)    REPEAT4(op); REPEAT4(op)

Definition at line 970 of file tif_getimage.c.

◆ SKEW

#define SKEW (   r,
  g,
  b,
  skew 
)    { r += skew; g += skew; b += skew; }

Definition at line 1016 of file tif_getimage.c.

Referenced by DECLARESepPutFunc().

◆ SKEW4

#define SKEW4 (   r,
  g,
  b,
  a,
  skew 
)    { r += skew; g += skew; b += skew; a+= skew; }

Definition at line 1017 of file tif_getimage.c.

Referenced by DECLARESepPutFunc().

◆ UNROLL2

#define UNROLL2 (   w,
  op1,
  op2 
)
Value:
{ \
uint32 _x; \
for (_x = w; _x >= 2; _x -= 2) { \
op1; \
REPEAT2(op2); \
} \
if (_x) { \
op1; \
op2; \
} \
}
GLubyte GLubyte GLubyte GLubyte w

Definition at line 1004 of file tif_getimage.c.

Referenced by DECLAREContigPutFunc().

◆ UNROLL4

#define UNROLL4 (   w,
  op1,
  op2 
)
Value:
{ \
uint32 _x; \
for (_x = w; _x >= 4; _x -= 4) { \
op1; \
REPEAT4(op2); \
} \
if (_x > 0) { \
op1; \
CASE4(_x,op2); \
} \
}
GLubyte GLubyte GLubyte GLubyte w

Definition at line 993 of file tif_getimage.c.

Referenced by DECLAREContigPutFunc().

◆ UNROLL8

#define UNROLL8 (   w,
  op1,
  op2 
)
Value:
{ \
uint32 _x; \
for (_x = w; _x >= 8; _x -= 8) { \
op1; \
REPEAT8(op2); \
} \
if (_x > 0) { \
op1; \
CASE8(_x,op2); \
} \
}
GLubyte GLubyte GLubyte GLubyte w

Definition at line 982 of file tif_getimage.c.

Referenced by DECLAREContigPutFunc(), and DECLARESepPutFunc().

◆ W2B

#define W2B (   v)    (((v)>>8)&0xff)

Definition at line 1024 of file tif_getimage.c.

◆ YCbCrtoRGB

#define YCbCrtoRGB (   dst,
 
)
Value:
{ \
uint32 r, g, b; \
TIFFYCbCrtoRGB(img->ycbcr, (Y), Cb, Cr, &r, &g, &b); \
dst = PACK(r, g, b); \
}
GLint GLvoid * img
GLboolean GLboolean GLboolean b
#define PACK(r, g, b)
GLdouble GLdouble GLdouble r
GLboolean GLboolean g

Definition at line 1587 of file tif_getimage.c.

Referenced by DECLAREContigPutFunc().

Function Documentation

◆ DECLAREContigPutFunc() [1/25]

DECLAREContigPutFunc ( put8bitcmaptile  )

Definition at line 1043 of file tif_getimage.c.

References _TIFFRGBAImage::PALmap, _TIFFRGBAImage::samplesperpixel, and void().

◆ DECLAREContigPutFunc() [2/25]

DECLAREContigPutFunc ( put4bitcmaptile  )

Definition at line 1063 of file tif_getimage.c.

References _TIFFRGBAImage::PALmap, UNROLL2, and void().

◆ DECLAREContigPutFunc() [3/25]

DECLAREContigPutFunc ( put2bitcmaptile  )

Definition at line 1080 of file tif_getimage.c.

References _TIFFRGBAImage::PALmap, UNROLL4, and void().

◆ DECLAREContigPutFunc() [4/25]

DECLAREContigPutFunc ( put1bitcmaptile  )

Definition at line 1097 of file tif_getimage.c.

References _TIFFRGBAImage::PALmap, UNROLL8, and void().

◆ DECLAREContigPutFunc() [5/25]

DECLAREContigPutFunc ( putgreytile  )

Definition at line 1114 of file tif_getimage.c.

References _TIFFRGBAImage::BWmap, _TIFFRGBAImage::samplesperpixel, and void().

◆ DECLAREContigPutFunc() [6/25]

DECLAREContigPutFunc ( put16bitbwtile  )

Definition at line 1134 of file tif_getimage.c.

References _TIFFRGBAImage::BWmap, _TIFFRGBAImage::samplesperpixel, and void().

◆ DECLAREContigPutFunc() [7/25]

DECLAREContigPutFunc ( put1bitbwtile  )

Definition at line 1159 of file tif_getimage.c.

References _TIFFRGBAImage::BWmap, UNROLL8, and void().

◆ DECLAREContigPutFunc() [8/25]

DECLAREContigPutFunc ( put2bitbwtile  )

Definition at line 1176 of file tif_getimage.c.

References _TIFFRGBAImage::BWmap, UNROLL4, and void().

◆ DECLAREContigPutFunc() [9/25]

DECLAREContigPutFunc ( put4bitbwtile  )

Definition at line 1193 of file tif_getimage.c.

References _TIFFRGBAImage::BWmap, UNROLL2, and void().

◆ DECLAREContigPutFunc() [10/25]

DECLAREContigPutFunc ( putRGBcontig8bittile  )

Definition at line 1210 of file tif_getimage.c.

References NOP, PACK, _TIFFRGBAImage::samplesperpixel, UNROLL8, and void().

◆ DECLAREContigPutFunc() [11/25]

DECLAREContigPutFunc ( putRGBcontig8bitMaptile  )

Definition at line 1228 of file tif_getimage.c.

References _TIFFRGBAImage::Map, PACK, _TIFFRGBAImage::samplesperpixel, and void().

◆ DECLAREContigPutFunc() [12/25]

DECLAREContigPutFunc ( putRGBAAcontig8bittile  )

Definition at line 1249 of file tif_getimage.c.

References NOP, PACK4, _TIFFRGBAImage::samplesperpixel, UNROLL8, and void().

◆ DECLAREContigPutFunc() [13/25]

DECLAREContigPutFunc ( putRGBUAcontig8bittile  )

Definition at line 1268 of file tif_getimage.c.

References PACK4, _TIFFRGBAImage::samplesperpixel, and void().

◆ DECLAREContigPutFunc() [14/25]

DECLAREContigPutFunc ( putRGBcontig16bittile  )

Definition at line 1292 of file tif_getimage.c.

References PACKW, _TIFFRGBAImage::samplesperpixel, and void().

◆ DECLAREContigPutFunc() [15/25]

DECLAREContigPutFunc ( putRGBAAcontig16bittile  )

Definition at line 1313 of file tif_getimage.c.

References PACKW4, _TIFFRGBAImage::samplesperpixel, and void().

◆ DECLAREContigPutFunc() [16/25]

DECLAREContigPutFunc ( putRGBUAcontig16bittile  )

Definition at line 1334 of file tif_getimage.c.

References PACK4, _TIFFRGBAImage::samplesperpixel, and void().

◆ DECLAREContigPutFunc() [17/25]

DECLAREContigPutFunc ( putRGBcontig8bitCMYKtile  )

Definition at line 1369 of file tif_getimage.c.

References NOP, PACK, _TIFFRGBAImage::samplesperpixel, UNROLL8, and void().

◆ DECLAREContigPutFunc() [18/25]

DECLAREContigPutFunc ( putRGBcontig8bitCMYKMaptile  )

Definition at line 1394 of file tif_getimage.c.

References _TIFFRGBAImage::Map, PACK, _TIFFRGBAImage::samplesperpixel, and void().

◆ DECLAREContigPutFunc() [19/25]

DECLAREContigPutFunc ( putcontig8bitCIELab  )

Definition at line 1561 of file tif_getimage.c.

References _TIFFRGBAImage::cielab, PACK, TIFFCIELabToXYZ(), TIFFXYZToRGB(), and void().

◆ DECLAREContigPutFunc() [20/25]

DECLAREContigPutFunc ( putcontig8bitYCbCr44tile  )

Definition at line 1672 of file tif_getimage.c.

References void(), and YCbCrtoRGB.

◆ DECLAREContigPutFunc() [21/25]

DECLAREContigPutFunc ( putcontig8bitYCbCr42tile  )

Definition at line 1769 of file tif_getimage.c.

References void(), and YCbCrtoRGB.

◆ DECLAREContigPutFunc() [22/25]

DECLAREContigPutFunc ( putcontig8bitYCbCr41tile  )

Definition at line 1847 of file tif_getimage.c.

References void(), and YCbCrtoRGB.

◆ DECLAREContigPutFunc() [23/25]

DECLAREContigPutFunc ( putcontig8bitYCbCr22tile  )

Definition at line 1891 of file tif_getimage.c.

References void(), and YCbCrtoRGB.

◆ DECLAREContigPutFunc() [24/25]

DECLAREContigPutFunc ( putcontig8bitYCbCr21tile  )

Definition at line 1955 of file tif_getimage.c.

References void(), and YCbCrtoRGB.

◆ DECLAREContigPutFunc() [25/25]

DECLAREContigPutFunc ( putcontig8bitYCbCr11tile  )

Definition at line 1991 of file tif_getimage.c.

References void(), and YCbCrtoRGB.

◆ DECLARESepPutFunc() [1/7]

DECLARESepPutFunc ( putRGBseparate8bittile  )

Definition at line 1429 of file tif_getimage.c.

References NOP, PACK, SKEW, UNROLL8, and void().

◆ DECLARESepPutFunc() [2/7]

DECLARESepPutFunc ( putRGBseparate8bitMaptile  )

Definition at line 1442 of file tif_getimage.c.

References _TIFFRGBAImage::Map, PACK, SKEW, and void().

◆ DECLARESepPutFunc() [3/7]

DECLARESepPutFunc ( putRGBAAseparate8bittile  )

Definition at line 1458 of file tif_getimage.c.

References NOP, PACK4, SKEW4, UNROLL8, and void().

◆ DECLARESepPutFunc() [4/7]

DECLARESepPutFunc ( putRGBUAseparate8bittile  )

Definition at line 1471 of file tif_getimage.c.

References PACK4, SKEW4, and void().

◆ DECLARESepPutFunc() [5/7]

DECLARESepPutFunc ( putRGBseparate16bittile  )

Definition at line 1491 of file tif_getimage.c.

References PACKW, SKEW, and void().

◆ DECLARESepPutFunc() [6/7]

DECLARESepPutFunc ( putRGBAAseparate16bittile  )

Definition at line 1509 of file tif_getimage.c.

References PACKW4, SKEW4, and void().

◆ DECLARESepPutFunc() [7/7]

DECLARESepPutFunc ( putRGBUAseparate16bittile  )

Definition at line 1528 of file tif_getimage.c.

References PACK4, SKEW4, and void().

◆ TIFFReadRGBAImage()

int TIFFReadRGBAImage ( TIFF tif,
uint32  rwidth,
uint32  rheight,
uint32 raster,
int  stop 
)

Definition at line 487 of file tif_getimage.c.

References ORIENTATION_BOTLEFT, and TIFFReadRGBAImageOriented().

Referenced by vl::loadTIFF().

◆ TIFFReadRGBAImageOriented()

int TIFFReadRGBAImageOriented ( TIFF tif,
uint32  rwidth,
uint32  rheight,
uint32 raster,
int  orientation,
int  stop 
)

◆ TIFFReadRGBAStrip()

int TIFFReadRGBAStrip ( TIFF tif,
uint32  row,
uint32 raster 
)

◆ TIFFReadRGBATile()

int TIFFReadRGBATile ( TIFF tif,
uint32  col,
uint32  row,
uint32 raster 
)

◆ TIFFRGBAImageBegin()

int TIFFRGBAImageBegin ( TIFFRGBAImage img,
TIFF tif,
int  stop,
char  emsg[1024] 
)

◆ TIFFRGBAImageEnd()

void TIFFRGBAImageEnd ( TIFFRGBAImage img)

◆ TIFFRGBAImageGet()

int TIFFRGBAImageGet ( TIFFRGBAImage img,
uint32 raster,
uint32  w,
uint32  h 
)

◆ TIFFRGBAImageOK()

int TIFFRGBAImageOK ( TIFF tif,
char  emsg[1024] 
)

Variable Documentation

◆ display_sRGB

TIFFDisplay display_sRGB
Initial value:
= {
{
{ 3.2410F, -1.5374F, -0.4986F },
{ -0.9692F, 1.8760F, 0.0416F },
{ 0.0556F, -0.2040F, 1.0570F }
},
100.0F, 100.0F, 100.0F,
255, 255, 255,
1.0F, 1.0F, 1.0F,
2.4F, 2.4F, 2.4F,
}

Definition at line 54 of file tif_getimage.c.