|
Resources |
Main / LibTargaWrapperDocumentation - CS559 2007TargaImage - DocumentationSeptember 10, 2007TargaImage is a C++ class wrapper for the LibTarga library. Get the files here:
IMPORTANT. TargaImage treats the upper-left hand corner of a Targa image as location (0,0), while LibTarga (and TGA files) treats the lower-left hand corner as (0,0). TargaImage loads the image array left to right from top to bottom. TargaImage always stores pixels in premultiplied RGBA format internally but writes out TGA files in non-premultiplied RGBA format. Note: All constructors of TargaImage are private. Images can only be created by calling the static functions blankImage and readImage. That way we'll never get any invalid images (either accidentally or intentionally). Constructors / DestructorTargaImage(const unsigned int width, const int height, const unsigned char* pixels); TargaImage(); ~TargaImage(); Methodsstatic TargaImage* blankImage(const unsigned int width, const unsigned int height); static TargaImage* readImage(const char* filename); int write(const char* filename) const; TargaImage* clone() const; void flip(); void fillAlpha(const unsigned char value); unsigned int width() const; unsigned int height() const; unsigned char* pixels() const; |