jpeg_io.hpp File Reference


Detailed Description

Support for reading and writing JPEG files Requires libjpeg.

Author:
Hailin Jin and Lubomir Bourdev
Adobe Systems Incorporated
Date:
2005-2007
Last updated September 24, 2006

#include <cstdio>
#include <algorithm>
#include <string>
#include <boost/static_assert.hpp>
#include <boost/shared_ptr.hpp>
#include <jpeglib.h>
#include "io_error.hpp"
#include "jpeg_io_private.hpp"

Go to the source code of this file.


Namespaces

namespace  boost
namespace  boost::gil

Classes

struct  jpeg_read_support
 Determines whether the given view type is supported for reading. More...
struct  jpeg_write_support
 Determines whether the given view type is supported for writing. More...

Functions

point2< std::ptrdiff_t > boost::gil::jpeg_read_dimensions (const char *filename)
 Returns the width and height of the JPEG file at the specified location. Throws std::ios_base::failure if the location does not correspond to a valid JPEG file.
point2< std::ptrdiff_t > boost::gil::jpeg_read_dimensions (const std::string &filename)
 Returns the width and height of the JPEG file at the specified location. Throws std::ios_base::failure if the location does not correspond to a valid JPEG file.
template<typename View>
void boost::gil::jpeg_read_view (const char *filename, const View &view)
 Loads the image specified by the given jpeg image file name into the given view. Triggers a compile assert if the view color space and channel depth are not supported by the JPEG library or by the I/O extension. Throws std::ios_base::failure if the file is not a valid JPEG file, or if its color space or channel depth are not compatible with the ones specified by View, or if its dimensions don't match the ones of the view.
template<typename View>
void boost::gil::jpeg_read_view (const std::string &filename, const View &view)
 Loads the image specified by the given jpeg image file name into the given view.
template<typename Image>
void boost::gil::jpeg_read_image (const char *filename, Image &im)
 Allocates a new image whose dimensions are determined by the given jpeg image file, and loads the pixels into it. Triggers a compile assert if the image color space or channel depth are not supported by the JPEG library or by the I/O extension. Throws std::ios_base::failure if the file is not a valid JPEG file, or if its color space or channel depth are not compatible with the ones specified by Image.
template<typename Image>
void boost::gil::jpeg_read_image (const std::string &filename, Image &im)
 Allocates a new image whose dimensions are determined by the given jpeg image file, and loads the pixels into it.
template<typename View, typename CC>
void boost::gil::jpeg_read_and_convert_view (const char *filename, const View &view, CC cc)
 Loads and color-converts the image specified by the given jpeg image file name into the given view. Throws std::ios_base::failure if the file is not a valid JPEG file, or if its dimensions don't match the ones of the view.
template<typename View>
void boost::gil::jpeg_read_and_convert_view (const char *filename, const View &view)
 Loads and color-converts the image specified by the given jpeg image file name into the given view. Throws std::ios_base::failure if the file is not a valid JPEG file, or if its dimensions don't match the ones of the view.
template<typename View, typename CC>
void boost::gil::jpeg_read_and_convert_view (const std::string &filename, const View &view, CC cc)
 Loads and color-converts the image specified by the given jpeg image file name into the given view.
template<typename View>
void boost::gil::jpeg_read_and_convert_view (const std::string &filename, const View &view)
 Loads and color-converts the image specified by the given jpeg image file name into the given view.
template<typename Image, typename CC>
void boost::gil::jpeg_read_and_convert_image (const char *filename, Image &im, CC cc)
 Allocates a new image whose dimensions are determined by the given jpeg image file, loads and color-converts the pixels into it. Throws std::ios_base::failure if the file is not a valid JPEG file.
template<typename Image>
void boost::gil::jpeg_read_and_convert_image (const char *filename, Image &im)
 Allocates a new image whose dimensions are determined by the given jpeg image file, loads and color-converts the pixels into it. Throws std::ios_base::failure if the file is not a valid JPEG file.
template<typename Image, typename CC>
void boost::gil::jpeg_read_and_convert_image (const std::string &filename, Image &im, CC cc)
 Allocates a new image whose dimensions are determined by the given jpeg image file, loads and color-converts the pixels into it.
template<typename Image>
void boost::gil::jpeg_read_and_convert_image (const std::string &filename, Image &im)
 Allocates a new image whose dimensions are determined by the given jpeg image file, loads and color-converts the pixels into it.
template<typename View>
void boost::gil::jpeg_write_view (const char *filename, const View &view, int quality=100)
 Saves the view to a jpeg file specified by the given jpeg image file name. Triggers a compile assert if the view color space and channel depth are not supported by the JPEG library or by the I/O extension. Throws std::ios_base::failure if it fails to create the file.
template<typename View>
void boost::gil::jpeg_write_view (const std::string &filename, const View &view, int quality=100)
 Saves the view to a jpeg file specified by the given jpeg image file name.

Copyright © 2006-2007 Adobe Systems Incorporated.

Use of this website signifies your agreement to the Terms of Use and Online Privacy Policy.

Search powered by Google