ReactOS  0.4.14-dev-368-gfa26425
tif_dumpmode.c File Reference
#include <precomp.h>
Include dependency graph for tif_dumpmode.c:

Go to the source code of this file.

Functions

static int DumpFixupTags (TIFF *tif)
 
static int DumpModeEncode (TIFF *tif, uint8 *pp, tmsize_t cc, uint16 s)
 
static int DumpModeDecode (TIFF *tif, uint8 *buf, tmsize_t cc, uint16 s)
 
static int DumpModeSeek (TIFF *tif, uint32 nrows)
 
int TIFFInitDumpMode (TIFF *tif, int scheme)
 

Function Documentation

◆ DumpFixupTags()

static int DumpFixupTags ( TIFF tif)
static

Definition at line 34 of file tif_dumpmode.c.

35 {
36  (void) tif;
37  return (1);
38 }
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49

Referenced by TIFFInitDumpMode().

◆ DumpModeDecode()

static int DumpModeDecode ( TIFF tif,
uint8 buf,
tmsize_t  cc,
uint16  s 
)
static

Definition at line 77 of file tif_dumpmode.c.

78 {
79  static const char module[] = "DumpModeDecode";
80  (void) s;
81  if (tif->tif_rawcc < cc) {
82 #if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))
84 "Not enough data for scanline %lu, expected a request for at most %I64d bytes, got a request for %I64d bytes",
85  (unsigned long) tif->tif_row,
86  (signed __int64) tif->tif_rawcc,
87  (signed __int64) cc);
88 #else
90 "Not enough data for scanline %lu, expected a request for at most %lld bytes, got a request for %lld bytes",
91  (unsigned long) tif->tif_row,
92  (signed long long) tif->tif_rawcc,
93  (signed long long) cc);
94 #endif
95  return (0);
96  }
97  /*
98  * Avoid copy if client has setup raw
99  * data buffer to avoid extra copy.
100  */
101  if (tif->tif_rawcp != buf)
102  _TIFFmemcpy(buf, tif->tif_rawcp, cc);
103  tif->tif_rawcp += cc;
104  tif->tif_rawcc -= cc;
105  return (1);
106 }
uint8 * tif_rawcp
Definition: tiffiop.h:183
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
thandle_t tif_clientdata
Definition: tiffiop.h:191
tmsize_t tif_rawcc
Definition: tiffiop.h:184
void TIFFErrorExt(thandle_t fd, const char *module, const char *fmt,...)
Definition: tif_error.c:65
GLdouble s
Definition: gl.h:2039
uint32_t cc
Definition: isohybrid.c:75
uint32 tif_row
Definition: tiffiop.h:143
void _TIFFmemcpy(void *d, const void *s, tmsize_t c)
Definition: tif_unix.c:344
#define __int64
Definition: basetyps.h:16

Referenced by TIFFInitDumpMode().

◆ DumpModeEncode()

static int DumpModeEncode ( TIFF tif,
uint8 pp,
tmsize_t  cc,
uint16  s 
)
static

Definition at line 44 of file tif_dumpmode.c.

45 {
46  (void) s;
47  while (cc > 0) {
48  tmsize_t n;
49 
50  n = cc;
51  if (tif->tif_rawcc + n > tif->tif_rawdatasize)
52  n = tif->tif_rawdatasize - tif->tif_rawcc;
53 
54  assert( n > 0 );
55 
56  /*
57  * Avoid copy if client has setup raw
58  * data buffer to avoid extra copy.
59  */
60  if (tif->tif_rawcp != pp)
61  _TIFFmemcpy(tif->tif_rawcp, pp, n);
62  tif->tif_rawcp += n;
63  tif->tif_rawcc += n;
64  pp += n;
65  cc -= n;
66  if (tif->tif_rawcc >= tif->tif_rawdatasize &&
67  !TIFFFlushData1(tif))
68  return (0);
69  }
70  return (1);
71 }
uint8 * tif_rawcp
Definition: tiffiop.h:183
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
GLdouble n
Definition: glext.h:7729
#define assert(x)
Definition: debug.h:53
tmsize_t tif_rawcc
Definition: tiffiop.h:184
TIFF_SSIZE_T tmsize_t
Definition: tiffio.h:65
#define pp
Definition: hlsl.yy.c:1208
tmsize_t tif_rawdatasize
Definition: tiffiop.h:180
GLdouble s
Definition: gl.h:2039
uint32_t cc
Definition: isohybrid.c:75
int TIFFFlushData1(TIFF *tif)
Definition: tif_write.c:792
void _TIFFmemcpy(void *d, const void *s, tmsize_t c)
Definition: tif_unix.c:344

Referenced by TIFFInitDumpMode().

◆ DumpModeSeek()

static int DumpModeSeek ( TIFF tif,
uint32  nrows 
)
static

Definition at line 112 of file tif_dumpmode.c.

113 {
114  tif->tif_rawcp += nrows * tif->tif_scanlinesize;
115  tif->tif_rawcc -= nrows * tif->tif_scanlinesize;
116  return (1);
117 }
uint8 * tif_rawcp
Definition: tiffiop.h:183
tmsize_t tif_scanlinesize
Definition: tiffiop.h:177
tmsize_t tif_rawcc
Definition: tiffiop.h:184

Referenced by TIFFInitDumpMode().

◆ TIFFInitDumpMode()

int TIFFInitDumpMode ( TIFF tif,
int  scheme 
)

Definition at line 123 of file tif_dumpmode.c.

124 {
125  (void) scheme;
133  tif->tif_seek = DumpModeSeek;
134  return (1);
135 }
TIFFCodeMethod tif_decoderow
Definition: tiffiop.h:164
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
TIFFCodeMethod tif_encodestrip
Definition: tiffiop.h:167
TIFFCodeMethod tif_encoderow
Definition: tiffiop.h:165
DWORD scheme
static int DumpModeEncode(TIFF *tif, uint8 *pp, tmsize_t cc, uint16 s)
Definition: tif_dumpmode.c:44
static int DumpModeSeek(TIFF *tif, uint32 nrows)
Definition: tif_dumpmode.c:112
static int DumpFixupTags(TIFF *tif)
Definition: tif_dumpmode.c:34
TIFFCodeMethod tif_decodestrip
Definition: tiffiop.h:166
TIFFCodeMethod tif_encodetile
Definition: tiffiop.h:169
TIFFSeekMethod tif_seek
Definition: tiffiop.h:171
TIFFCodeMethod tif_decodetile
Definition: tiffiop.h:168
static int DumpModeDecode(TIFF *tif, uint8 *buf, tmsize_t cc, uint16 s)
Definition: tif_dumpmode.c:77
TIFFBoolMethod tif_fixuptags
Definition: tiffiop.h:157