23#ifndef _PNGCOMPRESSOR_H
24#define _PNGCOMPRESSOR_H
27#include "Compressor.h"
32#ifndef PNG_FAST_FILTERS
33#define PNG_FAST_FILTERS ( PNG_FILTER_NONE | PNG_FILTER_SUB | PNG_FILTER_UP )
72 void writeICCProfile();
75 void writeXMPMetadata();
97 filterType = PNG_FAST_FILTERS;
117 unsigned int CompressStrip(
unsigned char* source,
unsigned char* output,
unsigned int tile_height );
124 unsigned int Finish(
unsigned char* output );
162 if( quality < 0 )
Q = 0;
163 else if( quality > 9 )
Q = 9;
Base class for IIP output images.
Definition: Compressor.h:32
unsigned int header_size
Size of the header data.
Definition: Compressor.h:43
int Q
Quality or compression level for all image types.
Definition: Compressor.h:37
unsigned char * header
Pointer to the header data for the output image.
Definition: Compressor.h:40
Wrapper class to PNG library: Handles 8 and 16 bit PNG as well as alpha transparency.
Definition: PNGCompressor.h:57
unsigned char * getHeader()
Return a pointer to the header itself.
Definition: PNGCompressor.h:138
unsigned int Finish(unsigned char *output)
Finish the strip based compression and free memory.
unsigned int CompressStrip(unsigned char *source, unsigned char *output, unsigned int tile_height)
Compress a strip of image data.
unsigned int Compress(RawTile &t)
Compress an entire buffer of image data at once in one command.
int getQuality() const
Get the current compression level.
Definition: PNGCompressor.h:152
void InitCompression(const RawTile &rawtile, unsigned int strip_height)
Initialize strip based compression.
const char * getMimeType() const
Return the PNG mime type.
Definition: PNGCompressor.h:141
const char * getSuffix() const
Return the image filename suffix.
Definition: PNGCompressor.h:144
CompressionType getCompressionType() const
Get compression type.
Definition: PNGCompressor.h:147
PNGCompressor(int compressionLevel)
Constructor.
Definition: PNGCompressor.h:83
void setQuality(int quality)
Set the compression level.
Definition: PNGCompressor.h:159
unsigned int getHeaderSize() const
Return the PNG header size.
Definition: PNGCompressor.h:135
Class to represent a single image tile.
Definition: RawTile.h:47
Expanded data destination object for buffered output used by PNG library.
Definition: PNGCompressor.h:39
unsigned int bytes_per_pixel
bytes per pixel (1 for 8 bit and 2 for 16 bit images)
Definition: PNGCompressor.h:48
png_infop info_ptr
png info pointer
Definition: PNGCompressor.h:42
size_t output_size
size of output buffer
Definition: PNGCompressor.h:45
unsigned int strip_height
strip height: used for stream-based encoding
Definition: PNGCompressor.h:47
unsigned char * output
output buffer pointer
Definition: PNGCompressor.h:44
png_structp png_ptr
png data pointer
Definition: PNGCompressor.h:41
size_t written
number of bytes written to buffer
Definition: PNGCompressor.h:46