Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

ImageUtil.cc File Reference


Detailed Description

Author:
Ethan Tira-Thompson (ejt) (Creator)
Author
ejt
Name
Revision
1.3
State
Exp
Date
2007/04/09 22:22:04

Definition in file ImageUtil.cc.

#include "ImageUtil.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
#include <iostream>
#include "Shared/jpeg-6b/jpeg_mem_dest.h"
#include "Shared/jpeg-6b/jpeg_mem_src.h"
#include "Shared/Config.h"
#include <fcntl.h>
#include <sys/mman.h>
#include <png.h>
#include <jpeglib.h>

Include dependency graph for ImageUtil.cc:

Go to the source code of this file.

Namespaces

namespace  ImageUtil

Classes

struct  png_read_mem_status
 stores progress of user_read_png_data() between calls More...
struct  png_write_mem_status
 stores progress of user_write_png_data() between calls More...

Functions

static void user_read_png_data (png_structp png_ptr, png_bytep data, png_size_t length)
 user callback function for reading a png from user parameters stored in png_ptr into data
void user_write_png_data (png_structp png_ptr, png_bytep data, png_size_t length)
 user callback function for writing a png at data into user parameters stored in png_ptr
void user_flush_png_data (png_structp)
 user callback function for flushing results of user_write_png_data() (this is a no-op)
bool ImageUtil::loadFile (const std::string &file, char *&buf, size_t &size)
 loads a file into memory, returns true if successful
void ImageUtil::releaseFile (char *buf, size_t size)
 releases memory from a previous call to loadFile, triggering munmap() or 'delete' as appropriate
bool ImageUtil::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 ImageUtil::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
bool ImageUtil::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 ImageUtil::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 ImageUtil::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
bool ImageUtil::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
size_t ImageUtil::encodeJPEG (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 ImageUtil::encodeJPEG (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 ImageUtil::encodeJPEG (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 ImageUtil::encodePNG (char *inbuf, size_t inbufSize, size_t width, size_t height, size_t inbufChannels, char *&outbuf, size_t &outbufSize, size_t outbufChannels)
 encodes a JPEG from a pixel buffer into another memory buffer, returns number of bytes used, 0 if error


Tekkotsu v3.0
Generated Fri May 11 20:05:36 2007 by Doxygen 1.4.7