ReactOS 0.4.15-dev-8235-gcd88a97
tif_swab.c File Reference
#include <precomp.h>
Include dependency graph for tif_swab.c:

Go to the source code of this file.

Functions

void TIFFSwabShort (uint16 *wp)
 
void TIFFSwabLong (uint32 *lp)
 
void TIFFSwabLong8 (uint64 *lp)
 
void TIFFSwabArrayOfShort (register uint16 *wp, tmsize_t n)
 
void TIFFSwabArrayOfTriples (register uint8 *tp, tmsize_t n)
 
void TIFFSwabArrayOfLong (register uint32 *lp, tmsize_t n)
 
void TIFFSwabArrayOfLong8 (register uint64 *lp, tmsize_t n)
 
void TIFFSwabFloat (float *fp)
 
void TIFFSwabArrayOfFloat (register float *fp, tmsize_t n)
 
void TIFFSwabDouble (double *dp)
 
void TIFFSwabArrayOfDouble (double *dp, tmsize_t n)
 
const unsigned charTIFFGetBitRevTable (int reversed)
 
void TIFFReverseBits (uint8 *cp, tmsize_t n)
 

Variables

static const unsigned char TIFFBitRevTable [256]
 
static const unsigned char TIFFNoBitRevTable [256]
 

Function Documentation

◆ TIFFGetBitRevTable()

const unsigned char * TIFFGetBitRevTable ( int  reversed)

Definition at line 278 of file tif_swab.c.

279{
280 return (reversed ? TIFFBitRevTable : TIFFNoBitRevTable);
281}
static const unsigned char TIFFBitRevTable[256]
Definition: tif_swab.c:208
static const unsigned char TIFFNoBitRevTable[256]
Definition: tif_swab.c:242

◆ TIFFReverseBits()

void TIFFReverseBits ( uint8 cp,
tmsize_t  n 
)

Definition at line 284 of file tif_swab.c.

285{
286 for (; n > 8; n -= 8) {
287 cp[0] = TIFFBitRevTable[cp[0]];
288 cp[1] = TIFFBitRevTable[cp[1]];
289 cp[2] = TIFFBitRevTable[cp[2]];
290 cp[3] = TIFFBitRevTable[cp[3]];
291 cp[4] = TIFFBitRevTable[cp[4]];
292 cp[5] = TIFFBitRevTable[cp[5]];
293 cp[6] = TIFFBitRevTable[cp[6]];
294 cp[7] = TIFFBitRevTable[cp[7]];
295 cp += 8;
296 }
297 while (n-- > 0) {
298 *cp = TIFFBitRevTable[*cp];
299 cp++;
300 }
301}
GLdouble n
Definition: glext.h:7729
POINT cp
Definition: magnifier.c:59

Referenced by TIFFFillStrip(), TIFFFillStripPartial(), TIFFFillTile(), TIFFFlushData1(), TIFFReadEncodedStrip(), TIFFReadEncodedTile(), TIFFReadFromUserBuffer(), TIFFWriteEncodedStrip(), and TIFFWriteEncodedTile().

◆ TIFFSwabArrayOfDouble()

void TIFFSwabArrayOfDouble ( double dp,
tmsize_t  n 
)

Definition at line 182 of file tif_swab.c.

183{
184 register unsigned char *cp;
185 register unsigned char t;
186 assert(sizeof(double)==8);
187 /* XXX unroll loop some */
188 while (n-- > 0) {
189 cp = (unsigned char *)dp;
190 t = cp[7]; cp[7] = cp[0]; cp[0] = t;
191 t = cp[6]; cp[6] = cp[1]; cp[1] = t;
192 t = cp[5]; cp[5] = cp[2]; cp[2] = t;
193 t = cp[4]; cp[4] = cp[3]; cp[3] = t;
194 dp++;
195 }
196}
#define assert(x)
Definition: debug.h:53
GLdouble GLdouble t
Definition: gl.h:2047

Referenced by _TIFFSwab64BitData(), and TIFFWriteDirectoryTagCheckedDoubleArray().

◆ TIFFSwabArrayOfFloat()

void TIFFSwabArrayOfFloat ( register float fp,
tmsize_t  n 
)

Definition at line 151 of file tif_swab.c.

152{
153 register unsigned char *cp;
154 register unsigned char t;
155 assert(sizeof(float)==4);
156 /* XXX unroll loop some */
157 while (n-- > 0) {
158 cp = (unsigned char *)fp;
159 t = cp[3]; cp[3] = cp[0]; cp[0] = t;
160 t = cp[2]; cp[2] = cp[1]; cp[1] = t;
161 fp++;
162 }
163}

Referenced by TIFFWriteDirectoryTagCheckedFloatArray().

◆ TIFFSwabArrayOfLong()

void TIFFSwabArrayOfLong ( register uint32 lp,
tmsize_t  n 
)

◆ TIFFSwabArrayOfLong8()

void TIFFSwabArrayOfLong8 ( register uint64 lp,
tmsize_t  n 
)

Definition at line 120 of file tif_swab.c.

121{
122 register unsigned char *cp;
123 register unsigned char t;
124 assert(sizeof(uint64)==8);
125 /* XXX unroll loop some */
126 while (n-- > 0) {
127 cp = (unsigned char *)lp;
128 t = cp[7]; cp[7] = cp[0]; cp[0] = t;
129 t = cp[6]; cp[6] = cp[1]; cp[1] = t;
130 t = cp[5]; cp[5] = cp[2]; cp[2] = t;
131 t = cp[4]; cp[4] = cp[3]; cp[3] = t;
132 lp++;
133 }
134}
unsigned long long uint64
Definition: platform.h:18

Referenced by _TIFFRewriteField(), TIFFReadDirEntryDoubleArray(), TIFFReadDirEntryFloatArray(), TIFFReadDirEntryIfd8Array(), TIFFReadDirEntryLong8ArrayWithLimit(), TIFFReadDirEntrySlong8Array(), TIFFWriteDirectoryTagCheckedIfd8Array(), TIFFWriteDirectoryTagCheckedLong8Array(), and TIFFWriteDirectoryTagCheckedSlong8Array().

◆ TIFFSwabArrayOfShort()

void TIFFSwabArrayOfShort ( register uint16 wp,
tmsize_t  n 
)

Definition at line 71 of file tif_swab.c.

72{
73 register unsigned char* cp;
74 register unsigned char t;
75 assert(sizeof(uint16)==2);
76 /* XXX unroll loop some */
77 while (n-- > 0) {
78 cp = (unsigned char*) wp;
79 t = cp[1]; cp[1] = cp[0]; cp[0] = t;
80 wp++;
81 }
82}
unsigned short uint16
Definition: types.h:30

Referenced by _TIFFRewriteField(), _TIFFSwab16BitData(), swabHorAcc16(), swabHorDiff16(), TIFFReadDirEntryShortArray(), TIFFReadDirEntrySshortArray(), TIFFWriteDirectoryTagCheckedShortArray(), and TIFFWriteDirectoryTagCheckedSshortArray().

◆ TIFFSwabArrayOfTriples()

void TIFFSwabArrayOfTriples ( register uint8 tp,
tmsize_t  n 
)

Definition at line 87 of file tif_swab.c.

88{
89 unsigned char* cp;
90 unsigned char t;
91
92 /* XXX unroll loop some */
93 while (n-- > 0) {
94 cp = (unsigned char*) tp;
95 t = cp[2]; cp[2] = cp[0]; cp[0] = t;
96 tp += 3;
97 }
98}
_In_ uint64_t _In_ uint64_t _In_ uint64_t _In_opt_ traverse_ptr * tp
Definition: btrfs.c:2996

Referenced by _TIFFSwab24BitData().

◆ TIFFSwabDouble()

void TIFFSwabDouble ( double dp)

Definition at line 168 of file tif_swab.c.

169{
170 register unsigned char* cp = (unsigned char*) dp;
171 unsigned char t;
172 assert(sizeof(double)==8);
173 t = cp[7]; cp[7] = cp[0]; cp[0] = t;
174 t = cp[6]; cp[6] = cp[1]; cp[1] = t;
175 t = cp[5]; cp[5] = cp[2]; cp[2] = t;
176 t = cp[4]; cp[4] = cp[3]; cp[3] = t;
177}

◆ TIFFSwabFloat()

void TIFFSwabFloat ( float fp)

Definition at line 139 of file tif_swab.c.

140{
141 register unsigned char* cp = (unsigned char*) fp;
142 unsigned char t;
143 assert(sizeof(float)==4);
144 t = cp[3]; cp[3] = cp[0]; cp[0] = t;
145 t = cp[2]; cp[2] = cp[1]; cp[1] = t;
146}

◆ TIFFSwabLong()

◆ TIFFSwabLong8()

◆ TIFFSwabShort()

Variable Documentation

◆ TIFFBitRevTable

const unsigned char TIFFBitRevTable[256]
static

Definition at line 208 of file tif_swab.c.

Referenced by TIFFGetBitRevTable(), and TIFFReverseBits().

◆ TIFFNoBitRevTable

const unsigned char TIFFNoBitRevTable[256]
static

Definition at line 242 of file tif_swab.c.

Referenced by TIFFGetBitRevTable().