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 | Enumerations | Functions
tif_fax3.c File Reference
#include "tiffiop.h"
#include "tif_fax3.h"
#include "t4.h"
#include <stdio.h>

Go to the source code of this file.

Macros

#define G3CODES
 
#define Fax3State(tif)   ((Fax3BaseState*) (tif)->tif_data)
 
#define DecoderState(tif)   ((Fax3CodecState*) Fax3State(tif))
 
#define EncoderState(tif)   ((Fax3CodecState*) Fax3State(tif))
 
#define is2DEncoding(sp)   (sp->b.groupoptions & GROUP3OPT_2DENCODING)
 
#define isAligned(p, t)   ((((unsigned long)(p)) & (sizeof (t)-1)) == 0)
 
#define DECLARE_STATE(tif, sp, mod)
 
#define DECLARE_STATE_2D(tif, sp, mod)
 
#define CACHE_STATE(tif, sp)
 
#define UNCACHE_STATE(tif, sp)
 
#define unexpected(table, a0)   Fax3Unexpected(module, tif, line, a0)
 
#define extension(a0)   Fax3Extension(module, tif, line, a0)
 
#define badlength(a0, lastx)   Fax3BadLength(module, tif, line, a0, lastx)
 
#define prematureEOF(a0)   Fax3PrematureEOF(module, tif, line, a0)
 
#define Nop
 
#define SWAP(t, a, b)   { t x; x = (a); (a) = (b); (b) = x; }
 
#define FILL(n, cp)
 
#define ZERO(n, cp)
 
#define Fax3FlushBits(tif, sp)
 
#define _FlushBits(tif)
 
#define _PutBits(tif, bits, length)
 
#define putcode(tif, te)   Fax3PutBits(tif, (te)->code, (te)->length)
 
#define finddiff(_cp, _bs, _be, _color)   (_bs + (_color ? find1span(_cp,_bs,_be) : find0span(_cp,_bs,_be)))
 
#define finddiff2(_cp, _bs, _be, _color)   (_bs < _be ? finddiff(_cp,_bs,_be,_color) : _be)
 
#define PIXEL(buf, ix)   ((((buf)[(ix)>>3]) >> (7-((ix)&7))) & 1)
 
#define FIELD_BADFAXLINES   (FIELD_CODEC+0)
 
#define FIELD_CLEANFAXDATA   (FIELD_CODEC+1)
 
#define FIELD_BADFAXRUN   (FIELD_CODEC+2)
 
#define FIELD_RECVPARAMS   (FIELD_CODEC+3)
 
#define FIELD_SUBADDRESS   (FIELD_CODEC+4)
 
#define FIELD_RECVTIME   (FIELD_CODEC+5)
 
#define FIELD_FAXDCS   (FIELD_CODEC+6)
 
#define FIELD_OPTIONS   (FIELD_CODEC+7)
 
#define N(a)   (sizeof (a) / sizeof (a[0]))
 
#define SWAP(t, a, b)   { t x; x = (a); (a) = (b); (b) = x; }
 

Enumerations

enum  Ttag { G3_1D, G3_2D }
 

Functions

void _TIFFFax3fillruns (unsigned char *buf, uint32 *runs, uint32 *erun, uint32 lastx)
 
int TIFFInitCCITTFax3 (TIFF *tif, int scheme)
 
int TIFFInitCCITTFax4 (TIFF *tif, int scheme)
 
int TIFFInitCCITTRLE (TIFF *tif, int scheme)
 
int TIFFInitCCITTRLEW (TIFF *tif, int scheme)
 

Macro Definition Documentation

◆ _FlushBits

#define _FlushBits (   tif)
Value:
{ \
if ((tif)->tif_rawcc >= (tif)->tif_rawdatasize) \
(void) TIFFFlushData1(tif); \
*(tif)->tif_rawcp++ = (tidataval_t) data; \
(tif)->tif_rawcc++; \
data = 0, bit = 8; \
}
typedef void(APIENTRY *GLDEBUGPROCARB)(GLenum source
GLsizei GLsizei GLenum GLenum const GLvoid * data
unsigned char tidataval_t
Definition: tiffiop.h:83
int TIFFFlushData1(TIFF *tif)
Definition: tif_write.c:696

Definition at line 545 of file tif_fax3.c.

◆ _PutBits

#define _PutBits (   tif,
  bits,
  length 
)
Value:
{ \
while (length > bit) { \
data |= bits >> (length - bit); \
length -= bit; \
_FlushBits(tif); \
} \
data |= (bits & _msbmask[length]) << (bit - length); \
bit -= length; \
if (bit == 0) \
_FlushBits(tif); \
}
GLenum GLuint GLenum GLsizei length
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits

Definition at line 554 of file tif_fax3.c.

◆ badlength

#define badlength (   a0,
  lastx 
)    Fax3BadLength(module, tif, line, a0, lastx)

Definition at line 210 of file tif_fax3.c.

◆ CACHE_STATE

#define CACHE_STATE (   tif,
  sp 
)
Value:
do { \
BitAcc = sp->data; \
BitsAvail = sp->bit; \
EOLcnt = sp->EOLcnt; \
cp = (unsigned char*) tif->tif_rawcp; \
ep = cp + tif->tif_rawcc; \
} while (0)

Definition at line 126 of file tif_fax3.c.

◆ DECLARE_STATE

#define DECLARE_STATE (   tif,
  sp,
  mod 
)
Value:
static const char module[] = mod; \
Fax3CodecState* sp = DecoderState(tif); \
int a0; /* reference element */ \
int lastx = sp->b.rowpixels; /* last element in row */ \
uint32 BitAcc; /* bit accumulator */ \
int BitsAvail; /* # valid bits in BitAcc */ \
int RunLength; /* length of current run */ \
unsigned char* cp; /* next byte of input data */ \
unsigned char* ep; /* end of input data */ \
uint32* pa; /* place to stuff next run */ \
uint32* thisrun; /* current row's run array */ \
int EOLcnt; /* # EOL codes recognized */ \
const unsigned char* bitmap = sp->bitmap; /* input data bit reverser */ \
const TIFFFaxTabEnt* TabEnt
#define DecoderState(tif)
Definition: tif_fax3.c:89
T mod(T a, T b)
Definition: glsl_math.hpp:929

Definition at line 104 of file tif_fax3.c.

◆ DECLARE_STATE_2D

#define DECLARE_STATE_2D (   tif,
  sp,
  mod 
)
Value:
DECLARE_STATE(tif, sp, mod); \
int b1; /* next change on prev line */ \
uint32* pb /* next run in reference line */\
/*
* Load any state that may be changed during decoding.
*/
T mod(T a, T b)
Definition: glsl_math.hpp:929
#define DECLARE_STATE(tif, sp, mod)
Definition: tif_fax3.c:104

Definition at line 119 of file tif_fax3.c.

◆ DecoderState

#define DecoderState (   tif)    ((Fax3CodecState*) Fax3State(tif))

Definition at line 89 of file tif_fax3.c.

◆ EncoderState

#define EncoderState (   tif)    ((Fax3CodecState*) Fax3State(tif))

Definition at line 90 of file tif_fax3.c.

◆ extension

#define extension (   a0)    Fax3Extension(module, tif, line, a0)

Definition at line 198 of file tif_fax3.c.

◆ Fax3FlushBits

#define Fax3FlushBits (   tif,
  sp 
)
Value:
{ \
if ((tif)->tif_rawcc >= (tif)->tif_rawdatasize) \
(void) TIFFFlushData1(tif); \
*(tif)->tif_rawcp++ = (tidataval_t) (sp)->data; \
(tif)->tif_rawcc++; \
(sp)->data = 0, (sp)->bit = 8; \
}
typedef void(APIENTRY *GLDEBUGPROCARB)(GLenum source
GLsizei GLsizei GLenum GLenum const GLvoid * data
unsigned char tidataval_t
Definition: tiffiop.h:83
int TIFFFlushData1(TIFF *tif)
Definition: tif_write.c:696

Definition at line 538 of file tif_fax3.c.

◆ Fax3State

#define Fax3State (   tif)    ((Fax3BaseState*) (tif)->tif_data)

Definition at line 67 of file tif_fax3.c.

◆ FIELD_BADFAXLINES

#define FIELD_BADFAXLINES   (FIELD_CODEC+0)

Definition at line 1091 of file tif_fax3.c.

◆ FIELD_BADFAXRUN

#define FIELD_BADFAXRUN   (FIELD_CODEC+2)

Definition at line 1093 of file tif_fax3.c.

◆ FIELD_CLEANFAXDATA

#define FIELD_CLEANFAXDATA   (FIELD_CODEC+1)

Definition at line 1092 of file tif_fax3.c.

◆ FIELD_FAXDCS

#define FIELD_FAXDCS   (FIELD_CODEC+6)

Definition at line 1097 of file tif_fax3.c.

◆ FIELD_OPTIONS

#define FIELD_OPTIONS   (FIELD_CODEC+7)

Definition at line 1099 of file tif_fax3.c.

◆ FIELD_RECVPARAMS

#define FIELD_RECVPARAMS   (FIELD_CODEC+3)

Definition at line 1094 of file tif_fax3.c.

◆ FIELD_RECVTIME

#define FIELD_RECVTIME   (FIELD_CODEC+5)

Definition at line 1096 of file tif_fax3.c.

◆ FIELD_SUBADDRESS

#define FIELD_SUBADDRESS   (FIELD_CODEC+4)

Definition at line 1095 of file tif_fax3.c.

◆ FILL

#define FILL (   n,
  cp 
)
Value:
switch (n) { \
case 7: (cp)[6] = 0xff; case 6: (cp)[5] = 0xff; case 5: (cp)[4] = 0xff; \
case 4: (cp)[3] = 0xff; case 3: (cp)[2] = 0xff; case 2: (cp)[1] = 0xff; \
case 1: (cp)[0] = 0xff; (cp) += (n); case 0: ; \
}
GLdouble n

Definition at line 345 of file tif_fax3.c.

Referenced by _TIFFFax3fillruns().

◆ finddiff

#define finddiff (   _cp,
  _bs,
  _be,
  _color 
)    (_bs + (_color ? find1span(_cp,_bs,_be) : find0span(_cp,_bs,_be)))

Definition at line 900 of file tif_fax3.c.

◆ finddiff2

#define finddiff2 (   _cp,
  _bs,
  _be,
  _color 
)    (_bs < _be ? finddiff(_cp,_bs,_be,_color) : _be)

Definition at line 906 of file tif_fax3.c.

◆ G3CODES

#define G3CODES

Definition at line 42 of file tif_fax3.c.

◆ is2DEncoding

#define is2DEncoding (   sp)    (sp->b.groupoptions & GROUP3OPT_2DENCODING)

Definition at line 92 of file tif_fax3.c.

◆ isAligned

#define isAligned (   p,
  t 
)    ((((unsigned long)(p)) & (sizeof (t)-1)) == 0)

Definition at line 94 of file tif_fax3.c.

Referenced by _TIFFFax3fillruns().

◆ N

#define N (   a)    (sizeof (a) / sizeof (a[0]))

◆ Nop

#define Nop

Definition at line 223 of file tif_fax3.c.

◆ PIXEL

#define PIXEL (   buf,
  ix 
)    ((((buf)[(ix)>>3]) >> (7-((ix)&7))) & 1)

◆ prematureEOF

#define prematureEOF (   a0)    Fax3PrematureEOF(module, tif, line, a0)

Definition at line 221 of file tif_fax3.c.

◆ putcode

#define putcode (   tif,
  te 
)    Fax3PutBits(tif, (te)->code, (te)->length)

Definition at line 587 of file tif_fax3.c.

◆ SWAP [1/2]

#define SWAP (   t,
  a,
  b 
)    { t x; x = (a); (a) = (b); (b) = x; }

Definition at line 1373 of file tif_fax3.c.

◆ SWAP [2/2]

#define SWAP (   t,
  a,
  b 
)    { t x; x = (a); (a) = (b); (b) = x; }

Definition at line 1373 of file tif_fax3.c.

◆ UNCACHE_STATE

#define UNCACHE_STATE (   tif,
  sp 
)
Value:
do { \
sp->bit = BitsAvail; \
sp->data = BitAcc; \
sp->EOLcnt = EOLcnt; \
tif->tif_rawcc -= (tidata_t) cp - tif->tif_rawcp; \
tif->tif_rawcp = (tidata_t) cp; \
} while (0)
tidataval_t * tidata_t
Definition: tiffiop.h:84

Definition at line 136 of file tif_fax3.c.

◆ unexpected

#define unexpected (   table,
  a0 
)    Fax3Unexpected(module, tif, line, a0)

Definition at line 187 of file tif_fax3.c.

◆ ZERO

#define ZERO (   n,
  cp 
)
Value:
switch (n) { \
case 7: (cp)[6] = 0; case 6: (cp)[5] = 0; case 5: (cp)[4] = 0; \
case 4: (cp)[3] = 0; case 3: (cp)[2] = 0; case 2: (cp)[1] = 0; \
case 1: (cp)[0] = 0; (cp) += (n); case 0: ; \
}
GLdouble n

Definition at line 351 of file tif_fax3.c.

Referenced by _TIFFFax3fillruns().

Enumeration Type Documentation

◆ Ttag

enum Ttag
Enumerator
G3_1D 
G3_2D 

Definition at line 69 of file tif_fax3.c.

Function Documentation

◆ _TIFFFax3fillruns()

void _TIFFFax3fillruns ( unsigned char *  buf,
uint32 runs,
uint32 erun,
uint32  lastx 
)

Definition at line 364 of file tif_fax3.c.

References FILL, isAligned, long(), and ZERO.

◆ TIFFInitCCITTFax3()

int TIFFInitCCITTFax3 ( TIFF tif,
int  scheme 
)

Definition at line 1354 of file tif_fax3.c.

References void().

◆ TIFFInitCCITTFax4()

int TIFFInitCCITTFax4 ( TIFF tif,
int  scheme 
)

Definition at line 1456 of file tif_fax3.c.

References void().

◆ TIFFInitCCITTRLE()

int TIFFInitCCITTRLE ( TIFF tif,
int  scheme 
)

Definition at line 1532 of file tif_fax3.c.

References void().

◆ TIFFInitCCITTRLEW()

int TIFFInitCCITTRLEW ( TIFF tif,
int  scheme 
)

Definition at line 1549 of file tif_fax3.c.

References void().