Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

ImageUtil.h File Reference

#include <string>
Include dependency graph for ImageUtil.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  image_util
 

Provides a variety of straightforward calls to compress or decompress images in JPEG or PNG formats.


Functions

bool image_util::decodePNGToDepth (std::istream &inStream, size_t &width, size_t &height, size_t &channels, char *&outbuf, size_t &outbufSize)
Generic File Utilities

bool image_util::loadFile (const std::string &file, char *&buf, size_t &size)
 loads a file into memory, returns true if successful, storing resulting buffer information in buf and size
void image_util::releaseFile (char *buf, size_t size)
 releases memory from a previous call to loadFile, triggering munmap() or 'delete' as appropriate
Decode Header Information (from memory buffer)

bool image_util::decodeImage (char *inbuf, size_t inbufSize, size_t &width, size_t &height, size_t &channels)
 decodes an image header already in memory -- if it looks like a PNG decodePNG() will be called, otherwise decodeJPEG(); returns true if successful
bool image_util::decodeJPEG (char *inbuf, size_t inbufSize, size_t &width, size_t &height, size_t &channels)
 decodes a JPEG header already in memory, returns true if successful
bool image_util::decodePNG (char *inbuf, size_t inbufSize, size_t &width, size_t &height, size_t &channels)
 decodes a PNG header already in memory, returns true if successful
Decompress From Memory Buffer

bool image_util::decodeImage (char *inbuf, size_t inbufSize, size_t &width, size_t &height, size_t &channels, char *&outbuf, size_t &outbufSize)
 decodes an image already in memory -- if it looks like a PNG decodePNG() will be called, otherwise decodeJPEG(); returns true if successful
bool image_util::decodeJPEG (char *inbuf, size_t inbufSize, size_t &width, size_t &height, size_t &channels, char *&outbuf, size_t &outbufSize, const std::string &filename="")
 decodes a JPEG image already in memory, returns true if successful
bool image_util::decodePNG (char *inbuf, size_t inbufSize, size_t &width, size_t &height, size_t &channels, char *&outbuf, size_t &outbufSize)
 decodes a PNG image already in memory, returns true if successful
Decode Header Information (from stream)

bool image_util::decodeImage (std::istream &inStream, size_t &width, size_t &height, size_t &channels)
 decodes an image header already in memory -- if it looks like a PNG decodePNG() will be called, otherwise decodeJPEG(); returns true if successful
bool image_util::decodeJPEG (std::istream &inStream, size_t &width, size_t &height, size_t &channels)
 decodes a JPEG header already in memory, returns true if successful
bool image_util::decodePNG (std::istream &inStream, size_t &width, size_t &height, size_t &channels)
 decodes a PNG header already in memory, returns true if successful
Decompress From Input Stream

bool image_util::decodeImage (std::istream &inStream, size_t &width, size_t &height, size_t &channels, char *&outbuf, size_t &outbufSize)
 decodes am image from a standard library input stream -- if it looks like a PNG decodePNG() will be called, otherwise decodeJPEG(); returns true if successful
bool image_util::decodeJPEG (std::istream &inStream, size_t &width, size_t &height, size_t &channels, char *&outbuf, size_t &outbufSize, const std::string &filename="")
 decodes a JPEG image from a standard library input stream, returns true if successful
bool image_util::decodePNG (std::istream &inStream, size_t &width, size_t &height, size_t &channels, char *&outbuf, size_t &outbufSize)
 decodes a PNG image from a standard library input stream, returns true if successful
Decompress from File

bool image_util::loadImage (const std::string &file, size_t &width, size_t &height, size_t &channels, char *&outbuf, size_t &outbufSize)
 decodes an image from file on disk -- if it looks like a PNG decodePNG() will be called, otherwise decodeJPEG(); returns true if successful
bool image_util::loadJPEG (const std::string &file, size_t &width, size_t &height, size_t &channels, char *&outbuf, size_t &outbufSize)
 decodes a JPEG from disk, returns true if successful
bool image_util::loadPNG (const std::string &file, size_t &width, size_t &height, size_t &channels, char *&outbuf, size_t &outbufSize)
 decodes a PNG from disk, returns true if successful
Compression (In-Memory only)

size_t image_util::encodeJPEG (const char *inbuf, size_t inbufSize, size_t width, size_t height, size_t inbufChannels, char *&outbuf, size_t &outbufSize, size_t outbufChannels, int quality)
 encodes a JPEG from a pixel buffer into another memory buffer, returns number of bytes used, 0 if error
size_t image_util::encodeJPEG (const char *inbuf, size_t inbufSize, size_t width, size_t height, size_t inbufChannels, char *&outbuf, size_t &outbufSize, size_t outbufChannels, int quality, jpeg_compress_struct &cinfo)
 encodes a JPEG from a pixel buffer into another memory buffer, returns number of bytes used, 0 if error
size_t image_util::encodeJPEG (const char *inbuf, size_t inbufSize, size_t width, size_t height, size_t inbufChannels, char *&outbuf, size_t &outbufSize, size_t outbufChannels, int quality, unsigned int yskip, unsigned int uvskip, jpeg_compress_struct &cinfo)
 encodes a JPEG from a pixel buffer into another memory buffer, returns number of bytes used, 0 if error
size_t image_util::encodePNG (const char *inbuf, size_t inbufSize, size_t width, size_t height, size_t inbufChannels, char *&outbuf, size_t &outbufSize, size_t outbufChannels)
 encodes a PNG from a pixel buffer into another memory buffer, returns number of bytes used, 0 if error
size_t image_util::encodePNG (const char *inbuf, size_t inbufSize, size_t width, size_t height, size_t inbufChannels, char *&outbuf, size_t &outbufSize, size_t outbufChannels, int compressionLevel)
 encodes a PNG from a pixel buffer into another memory buffer, returns number of bytes used, 0 if error

Detailed Description

Author:
Ethan Tira-Thompson (ejt) (Creator)

Definition in file ImageUtil.h.


Tekkotsu v5.1CVS
Generated Mon May 9 04:58:57 2016 by Doxygen 1.6.3