TinyTIFF
a lightweight C/C++ library for reading and writing TIFF files
Loading...
Searching...
No Matches

Data Structures

struct  TinyTIFFWriterFile
 this struct represents a TIFF file More...
 

Macros

#define TIFF_HEADER_MAX_ENTRIES   20
 maximum number of field entries in a TIFF header
 
#define TIFF_HEADER_SIZE   500
 fixed size of the TIFF frame header in bytes
 
#define WRITE16DIRECT(filen, data)
 write a 2-byte word data directly into a file fileno
 
#define WRITE16DIRECT_CAST(filen, data)
 write a data word data , which is first cast into a 2-byte word directly into a file fileno
 
#define WRITE32DIRECT(filen, data)
 write a 4-byte word data directly into a file fileno
 
#define WRITE32DIRECT_CAST(filen, data)
 write a data word data , which is first cast into a 4-byte word directly into a file fileno
 
#define WRITE8DIRECT(filen, data)
 write a data word data , which is first cast into a 1-byte word directly into a file fileno
 
#define WRITEH16_LE(filen, data)
 writes a value, which is cast to a 16-bit word at the current position into the current file header and advances the position by 4 bytes
 
#define WRITEH16DIRECT_LE(filen, data)
 writes a 16-bit word at the current position into the current file header and advances the position by 4 bytes
 
#define WRITEH32_LE(filen, data)
 writes a value, which is cast to a 32-bit word at the current position into the current file header and advances the position by 4 bytes
 
#define WRITEH32DIRECT_LE(filen, data)
 writes a 32-bit word at the current position into the current file header and advances the position by 4 bytes
 
#define WRITEH8(filen, data)   { filen->lastHeader[filen->pos]=data; filen->pos+=1; }
 writes an 8-bit word at the current position into the current file header and advances the position by 4 bytes
 
#define WRITEH8DIRECT(filen, data)   { filen->lastHeader[filen->pos]=data; filen->pos+=1; }
 writes an 8-bit word at the current position into the current file header and advances the position by 4 bytes
 

Functions

int TIFF_get_byteorder ()
 determines the byte order of the system
 
void TinyTIFFWriter_writeIFDEntrySHORT (TinyTIFFWriterFile *tiff, uint16_t tag, uint16_t data)
 write an 16-bit word IFD entry
 

Detailed Description

Macro Definition Documentation

◆ WRITE16DIRECT

#define WRITE16DIRECT (   filen,
  data 
)
Value:
{ \
TinyTIFFWriter_fwrite((void*)(&(data)), 2, 1, filen); \
}

write a 2-byte word data directly into a file fileno

◆ WRITE16DIRECT_CAST

#define WRITE16DIRECT_CAST (   filen,
  data 
)
Value:
{ \
uint16_t d=data; \
WRITE16DIRECT((filen), d); \
}

write a data word data , which is first cast into a 2-byte word directly into a file fileno

◆ WRITE32DIRECT

#define WRITE32DIRECT (   filen,
  data 
)
Value:
{ \
TinyTIFFWriter_fwrite((void*)(&(data)), 4, 1, filen); \
}

write a 4-byte word data directly into a file fileno

◆ WRITE32DIRECT_CAST

#define WRITE32DIRECT_CAST (   filen,
  data 
)
Value:
{ \
uint32_t d=data; \
WRITE32DIRECT((filen), d); \
}

write a data word data , which is first cast into a 4-byte word directly into a file fileno

◆ WRITE8DIRECT

#define WRITE8DIRECT (   filen,
  data 
)
Value:
{\
uint8_t ch=data; \
TinyTIFFWriter_fwrite(&ch, 1, 1, filen);\
}

write a data word data , which is first cast into a 1-byte word directly into a file fileno

◆ WRITEH16_LE

#define WRITEH16_LE (   filen,
  data 
)
Value:
{ \
uint16_t d=data; \
WRITEH16DIRECT_LE(filen, d); \
}

writes a value, which is cast to a 16-bit word at the current position into the current file header and advances the position by 4 bytes

◆ WRITEH16DIRECT_LE

#define WRITEH16DIRECT_LE (   filen,
  data 
)
Value:
{ \
*((uint16_t*)(&filen->lastHeader[filen->pos]))=data; \
filen->pos+=2; \
}

writes a 16-bit word at the current position into the current file header and advances the position by 4 bytes

◆ WRITEH32_LE

#define WRITEH32_LE (   filen,
  data 
)
Value:
{ \
uint32_t d=data; \
WRITEH32DIRECT_LE(filen, d); \
}

writes a value, which is cast to a 32-bit word at the current position into the current file header and advances the position by 4 bytes

◆ WRITEH32DIRECT_LE

#define WRITEH32DIRECT_LE (   filen,
  data 
)
Value:
{ \
*((uint32_t*)(&filen->lastHeader[filen->pos]))=data; \
filen->pos+=4;\
}

writes a 32-bit word at the current position into the current file header and advances the position by 4 bytes