#include <glt/config.h>
#include <misc/config.h>
#include <string>
#include <iosfwd>
#include <vector>
Include dependency graph for image.h:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Functions | |
bool | isGreyscale (const std::string &rgb) |
Is an RGB buffer greyscale? | |
bool | is256Colors (const std::string &rgb) |
Is an RGB buffer 256 colors or less? | |
void | getChannel (std::string &dest, const std::string &src, const uint32 size, const uint32 channel) |
Extract channel from image buffer. | |
void | rgb2Indexed (std::string &dest, const std::string &rgb) |
Convert RGB data to indexed. | |
void | indexed2rgb (std::string &dest, const std::string &indexed) |
Convert indexed data to RGB. | |
void | flipImage (std::string &dest, const std::string &src, const int width, const int height) |
Flip image vertically. | |
void | mirrorImage (std::string &dest, const std::string &src, const int width, const int height) |
Mirror image horizontally. | |
void | adjustGamma (std::string &image, const double gamma) |
Adjust image gamma. | |
void | adjustHSV (std::string &image, const int width, const int height, const real hue, const real saturation, const real value) |
Adjust image hue, saturation and brightness. | |
bool | stitchImages (std::string &image, const int dx, const int dy, const std::vector< std::string > &src, const int lineSize) |
Stitch tiled images. | |
bool | decode (uint32 &width, uint32 &height, std::string &image, const std::string &data) |
Decode image data from PPM, BMP, TGA and PNG. | |
bool | decodePPM (std::string &type, uint32 &width, uint32 &height, std::string &image, const std::string &data) |
Decode image data from PPM. | |
bool | decodeBMP (uint32 &width, uint32 &height, std::string &image, const std::string &data) |
Decode image data from BMP. | |
bool | decodeTGA (uint32 &width, uint32 &height, std::string &image, const std::string &data) |
Decode image data from TGA. | |
bool | encodePPM (std::string &data, const uint32 width, const uint32 height, const std::string &image) |
Encode image data as RGB unix PPM or PGM. | |
bool | encodeBMP (std::string &data, const uint32 width, const uint32 height, const std::string &image) |
Encode image data as RGB Windows BMP. | |
bool | encodeTGA (std::string &data, const uint32 width, const uint32 height, const std::string &image) |
Encode image data as RGB TGA. |
These routines are not intended as a general-purpose image viewing, output or image-processing package. The priority here is to support image formats that are most likely to be used in the context of OpenGL texture mapping.
Here are a few notes about the relative advantages of each type of image encoding.
PPM is simple to read and write - greyscale and RGB variants are useful for input and output, commonly used on the UNIX platform. PPM's are not compressed, and are not lossy.
TGA come in uncompressed or compressed variants, and support indexed, greyscale, or 16/24/32 bit RGB and RGBA pixel data. TGA's support an alpha (transparency) channel.
BMP is the standard image format for the Windows platform. The structure of BMP files is relatively convoluted, but similar to TGA.
Definition in file image.h.
|
Mirror image horizontally.
|
|
Adjust image gamma.
Definition at line 189 of file image.cpp. References byte. Referenced by GltTexture::init(). |
|
Adjust image hue, saturation and brightness.
Definition at line 204 of file image.cpp. References GltColor::blue(), byte, GltColor::fromHSV(), GltColor::green(), real, GltColor::red(), and GltColor::toHSV(). Referenced by GltTexture::init(). |
|
Decode image data from PPM, BMP, TGA and PNG.
Definition at line 277 of file image.cpp. References decodeBMP(), decodePPM(), decodeTGA(), and uint32. |