23#ifndef _AVIFCOMPRESSOR_H
24#define _AVIFCOMPRESSOR_H
27#include "Compressor.h"
40 avifCodecChoice codec;
45 unsigned int chunk_size;
50 void writeICCProfile();
53 void writeXMPMetadata();
56 void writeExifMetadata();
85 unsigned int CompressStrip(
unsigned char* source,
unsigned char* output,
unsigned int tile_height );
92 unsigned int Finish(
unsigned char* output );
133 else if(
Q > 100 )
Q = 100;
154 if( codec == 1 )
return AVIF_CODEC_CHOICE_AOM;
155 else if( codec == 2 )
return AVIF_CODEC_CHOICE_RAV1E;
156 else if( codec == 3 )
return AVIF_CODEC_CHOICE_SVT;
157 else return AVIF_CODEC_CHOICE_AUTO;
169 const char* name = avifCodecName( choice, AVIF_CODEC_FLAG_CAN_ENCODE );
170 if( name == NULL )
return "unsupported codec - will not be able to encode to avif";
Wrapper class to AVIF library: Handles 8 bit and alpha channels.
Definition AVIFCompressor.h:33
const char * getSuffix() const
Return the image filename suffix.
Definition AVIFCompressor.h:112
unsigned int Compress(RawTile &t)
Compress an entire buffer of image data at once in one command.
Definition AVIFCompressor.cc:90
void setQuality(int quality)
Set the compression level.
Definition AVIFCompressor.h:126
unsigned int getHeaderSize() const
Return the WebP header size.
Definition AVIFCompressor.h:103
AVIFCompressor(int quality)
Constructor.
Definition AVIFCompressor.h:64
static const char * getCodecName(unsigned int codec)
Static function: Get codec name from IIPImage codec option code.
Definition AVIFCompressor.h:166
const char * getMimeType() const
Return the WebP mime type.
Definition AVIFCompressor.h:109
void InitCompression(const RawTile &rawtile, unsigned int strip_height)
Initialize strip based compression.
Definition AVIFCompressor.cc:33
unsigned char * getHeader()
Return a pointer to the header itself.
Definition AVIFCompressor.h:106
int getQuality() const
Get the current compression level.
Definition AVIFCompressor.h:120
static avifCodecChoice getCodecChoice(unsigned int codec)
Static function: Convert from our option native system to libavif's codec choices.
Definition AVIFCompressor.h:152
unsigned int Finish(unsigned char *output)
Finish the strip based compression and free memory.
Definition AVIFCompressor.cc:74
~AVIFCompressor()
Destructor.
Definition AVIFCompressor.h:67
void setCodec(unsigned int codec)
Set codec for use during encoding - note that not all may be enabled in libavif.
Definition AVIFCompressor.h:141
ImageEncoding getImageEncoding() const
Get compression type.
Definition AVIFCompressor.h:115
unsigned int CompressStrip(unsigned char *source, unsigned char *output, unsigned int tile_height)
Compress a strip of image data.
Definition AVIFCompressor.cc:54
Base class for IIP output images.
Definition Compressor.h:31
unsigned int header_size
Size of the header data.
Definition Compressor.h:45
int Q
Quality or compression level for all image types.
Definition Compressor.h:36
unsigned char * header
Pointer to the header data for the output image.
Definition Compressor.h:42
Class to represent a single image tile.
Definition RawTile.h:45