#include <gilImageBase.h>
Public Member Functions | |
ImageBase (void) | |
ImageBase (int w, int h, int c) | |
ImageBase (const ImageBase< Type > &image) | |
~ImageBase (void) | |
int | width (void) const |
int | height (void) const |
int | channels (void) const |
int | elements (void) const |
int | pitch (void) const |
Type * | data (void) |
Type * | rowp (int r) |
void | allocate (int w, int h, int c) |
void | allocate (const ImageBase< Type > &image) |
void | fillPixels (Type value) |
void | copyPixelsTo (ImageBase< Type > &dst) |
PixelPtr< Type > | getPixelPtr (int x, int y) |
PixelPtr< Type > | begin (void) |
PixelPtr< Type > | end (void) |
Type & | pixel (int x, int y, int channel=0) |
bool | inBounds (int x, int y) |
void | reverseRows () |
bool | readFile (const char *filename) |
bool | writeFile (const char *filename) |
ImageBase< Type > * | subImage (int x, int y, int w, int h) |
void | cropImage (int x, int y, int w, int h) |
void | setSaveQuality (int q) |
int | getNumComments () |
void | printComments () |
void | addComment (string key, string text) |
string | getComment (string key) |
void | getOriginalSize (int &w, int &h) |
void | getOriginalPos (int &x, int &y) |
|
|
|
Construct an image with width a, height h and c channels. |
|
Copy constructor: all pixels in image will be copied. |
|
|
|
|
|
Allocate memories according to the size of the specified image. Note that original data will be lost after allocation. |
|
Allocate memories for the specified size. Note that original data will be lost after allocation. |
|
Get a pixel pointer pointing to the first pixel, which is ssually (0, 0). |
|
Get the channel number of the image. |
|
Exactly copy all pixels to another image. |
|
|
|
Get the pointer pointing to the raw data. |
|
Get the number of elements of the image. |
|
Get a pixel pointer which is next to the last pixel, so you can use the following code to iterate all pixels: for(PixelPtr<Type> ptr = img.begin(); ptr != img.end(); ptr++){ //... } |
|
Fill the image with the same value. |
|
|
|
|
|
|
|
|
|
Get a pixel pointer pointing to the (x, y) pixel. |
|
Get the height of the image. |
|
Check if the specified position is inside the image. |
|
Get the number of elements of a row. |
|
|
|
|
|
Read data from an image file. Currently PGM, PPM, JPG, BMP, PNG, TIF for ByteImage is supported. For FloatImage, HDR, FLT, PFM and UVE is supported. The filetype is determined by filename extensions. |
|
|
|
Get the pointer pointing to a specified row in this image. |
|
|
|
|
|
Get the width of the image. |
|
Write data to an image file. The filetype is determined by filename extensions, too. |