HOME | DOWNLOAD | DOCS | DEVELOPMENT | LICENSE | CREDITS |
Reads / writes Joint Photographic Experts Group (JPEG) files. More...
#include <iJPEG.h>
Public Types | |
enum | JpegDCTMethod { DCTInteger, DCTFastInteger, DCTFloat } |
JPEG DCT Method. More... | |
enum | JpegSubsampling { SubSample444, SubSample422, SubSample411 } |
JPEG Subsampling. More... | |
Public Member Functions | |
iJPEG () | |
Constructs a null image. | |
iJPEG (const iJPEG &img) | |
Copy constructor. | |
iJPEG (const iAbstractImage &img) | |
iAbstractImage copy constructor. | |
iJPEG (int w, int h, iImageFormat f) | |
Constructs an image with the given size and format. | |
iJPEG (Iubyte *d, int w, int h, iImageFormat f, int b) | |
Constructs an image using an existing memory buffer. | |
iJPEG (const char *filename) | |
Loads a JPEG image file from disk. | |
iJPEG (Iubyte *buf, int len) | |
Loads a JPEG image from an existing memory buffer. | |
iJPEG (iDataStream *s) | |
Loads a JPEG image using an existing data stream. | |
~iJPEG () | |
Destructor. | |
void | clear () |
Detaches this image from the image data and resets all data members to their initial values. | |
bool | isFormatSupported (iImageFormat fmt) const |
Checks whether or not a given image color format is supported by this image type. | |
void | setQuality (int q) |
Sets the quality to use when writing JPEG images. | |
int | getQuality () const |
Gets the quality used when writing JPEG images. | |
void | setSmoothing (int sm) |
Sets the amount of smoothing to use when writing JPEG images. | |
int | getSmoothing () const |
Gets the amount of smoothing used when writing JPEG images. | |
void | setDCTMethod (JpegDCTMethod dct) |
Sets the algorithm to use for the DCT step when writing JPEG images. | |
JpegDCTMethod | getDCTMethod () const |
Gets the algorithm used for the DCT step when writing JPEG images. | |
void | setSubsampling (JpegSubsampling ss) |
Sets the subsampling to use when writing JPEG images. | |
JpegSubsampling | getSubsampling () const |
Gets the subsampling used when writing JPEG images. | |
void | enableProgression (bool bprg) |
Enables progression when writing a JPEG image. | |
void | enableOptimization (bool bopt) |
Enables optimization when writing a JPEG image. | |
void | enableChromaDownsampling (bool bdown) |
Enables chroma downsampling when writing a JPEG image. | |
void | saveExif (bool bexif) |
Saves Exif metadata when writing a JPEG image. | |
void | saveThumbnail (bool bthumb) |
Saves an embedded thumbnail image when writing a JPEG image. | |
iJPEG & | operator= (const iJPEG &img) |
iJPEG & | operator= (const iAbstractImage &img) |
Static Public Member Functions | |
static bool | isValid (iDataStream *s) |
Protected Member Functions | |
void | init () |
bool | loadImage () |
bool | saveImage () |
Reads / writes Joint Photographic Experts Group (JPEG) files.
Extensions:
jpg, jpeg, jpe, jif, jfif, and jfi
Image types:
Grayscale and truecolor
Pixel Depths:
8-bit and 24-bit
TODO:
Exif metadata
Thumbnail
Comments
Restart markers
Constructs a null image.
imagen::iJPEG::iJPEG | ( | const iJPEG & | img | ) |
Copy constructor.
This copies all image attributes, and attaches itself to img's shared data.
imagen::iJPEG::iJPEG | ( | const iAbstractImage & | img | ) |
iAbstractImage copy constructor.
imagen::iJPEG::iJPEG | ( | int | w, |
int | h, | ||
iImageFormat | f | ||
) |
Constructs an image with the given size and format.
The image data will be allocated, but not initialized.
w | : Image width. |
h | : Image height. |
f | : Image format. |
imagen::iJPEG::iJPEG | ( | Iubyte * | d, |
int | w, | ||
int | h, | ||
iImageFormat | f, | ||
int | b | ||
) |
Constructs an image using an existing memory buffer.
The memory buffer will not be deleted at destruction.
imagen::iJPEG::iJPEG | ( | const char * | filename | ) |
Loads a JPEG image file from disk.
imagen::iJPEG::iJPEG | ( | Iubyte * | buf, |
int | len | ||
) |
Loads a JPEG image from an existing memory buffer.
imagen::iJPEG::iJPEG | ( | iDataStream * | s | ) |
Loads a JPEG image using an existing data stream.
Destructor.
void imagen::iJPEG::clear | ( | ) | [virtual] |
Detaches this image from the image data and resets all data members to their initial values.
Reimplemented from imagen::iAbstractImage.
bool imagen::iJPEG::isFormatSupported | ( | iImageFormat | fmt | ) | const [virtual] |
Checks whether or not a given image color format is supported by this image type.
Implements imagen::iAbstractImage.
static bool imagen::iJPEG::isValid | ( | iDataStream * | s | ) | [static] |
void imagen::iJPEG::setQuality | ( | int | q | ) |
Sets the quality to use when writing JPEG images.
Must be in the range of 0 to 100.
It is set to a reasonable default: 85.
int imagen::iJPEG::getQuality | ( | ) | const [inline] |
Gets the quality used when writing JPEG images.
void imagen::iJPEG::setSmoothing | ( | int | sm | ) |
Sets the amount of smoothing to use when writing JPEG images.
Must be in the range of 0 to 100.
It is set to 0 (no smoothing) by default.
int imagen::iJPEG::getSmoothing | ( | ) | const [inline] |
Gets the amount of smoothing used when writing JPEG images.
void imagen::iJPEG::setDCTMethod | ( | JpegDCTMethod | dct | ) | [inline] |
Sets the algorithm to use for the DCT step when writing JPEG images.
It is set to iJPEG::DCTInteger by default.
JpegDCTMethod imagen::iJPEG::getDCTMethod | ( | ) | const [inline] |
Gets the algorithm used for the DCT step when writing JPEG images.
void imagen::iJPEG::setSubsampling | ( | JpegSubsampling | ss | ) | [inline] |
Sets the subsampling to use when writing JPEG images.
It is set to iJPEG::SubSample411 by default.
JpegSubsampling imagen::iJPEG::getSubsampling | ( | ) | const [inline] |
Gets the subsampling used when writing JPEG images.
void imagen::iJPEG::enableProgression | ( | bool | bprg | ) | [inline] |
Enables progression when writing a JPEG image.
Progression is disabled by default.
void imagen::iJPEG::enableOptimization | ( | bool | bopt | ) | [inline] |
Enables optimization when writing a JPEG image.
Optimization uses more time and memory, but yields slightly smaller image sizes.
Optimization is enabled by default.
void imagen::iJPEG::enableChromaDownsampling | ( | bool | bdown | ) | [inline] |
Enables chroma downsampling when writing a JPEG image.
Disabling chroma downsampling can slightly improve image quality, but enlarge the image size.
Chroma downsampling is enabled by default.
void imagen::iJPEG::saveExif | ( | bool | bexif | ) | [inline] |
Saves Exif metadata when writing a JPEG image.
void imagen::iJPEG::saveThumbnail | ( | bool | bthumb | ) | [inline] |
Saves an embedded thumbnail image when writing a JPEG image.
iJPEG& imagen::iJPEG::operator= | ( | const iAbstractImage & | img | ) |
Reimplemented from imagen::iAbstractImage.
void imagen::iJPEG::init | ( | ) | [protected] |
Reimplemented from imagen::iAbstractImage.
bool imagen::iJPEG::loadImage | ( | ) | [protected, virtual] |
Implements imagen::iAbstractImage.
bool imagen::iJPEG::saveImage | ( | ) | [protected, virtual] |
Implements imagen::iAbstractImage.
API Documentation by Mark D. Procarione | Generated by |