JX Application Framework
|
#include <JImage.h>
Classes | |
class | FileIsNotGIF |
class | FileIsNotJPEG |
class | FileIsNotPNG |
class | FileIsNotXBM |
class | FileIsNotXPM |
class | TooManyColors |
class | UnknownFileType |
Public Types | |
enum | FileType { kUnknownType , kGIFType , kPNGType , kJPEGType , kXPMType , kXBMType } |
Public Member Functions | |
JImage (const JCoordinate width, const JCoordinate height, JColorManager *colorManager) | |
virtual | ~JImage () |
JCoordinate | GetWidth () const |
JCoordinate | GetHeight () const |
JRect | GetBounds () const |
JColorManager * | GetColorManager () const |
virtual JColorID | GetColor (const JCoordinate x, const JCoordinate y) const =0 |
virtual void | SetColor (const JCoordinate x, const JCoordinate y, const JColorID color)=0 |
virtual bool | GetMask (JImageMask **mask) const =0 |
JError | WriteGIF (const JString &fileName, const bool compressColorsToFit, const bool interlace=false) const |
JError | WritePNG (const JString &fileName, const bool useTrueColor=true, const bool compressColorsToFit=false, const bool interlace=false) const |
JError | WriteJPEG (const JString &fileName, const bool interlace=false, const int quality=-1) const |
virtual unsigned long | GetSystemColor (const JColorID color) const =0 |
virtual unsigned long | GetSystemColor (const JCoordinate x, const JCoordinate y) const =0 |
Static Public Member Functions | |
static FileType | GetFileType (const JString &fileName) |
Static Public Attributes | |
static const JUtf8Byte * | kUnknownFileType = "UnknownFileType::JImage" |
static const JUtf8Byte * | kFileIsNotGIF = "FileIsNotGIF::JImage" |
static const JUtf8Byte * | kGIFNotAvailable = "GIFNotAvailable::JImage" |
static const JUtf8Byte * | kFileIsNotPNG = "FileIsNotPNG::JImage" |
static const JUtf8Byte * | kPNGNotAvailable = "PNGNotAvailable::JImage" |
static const JUtf8Byte * | kFileIsNotJPEG = "FileIsNotJPEG::JImage" |
static const JUtf8Byte * | kJPEGNotAvailable = "JPEGNotAvailable::JImage" |
static const JUtf8Byte * | kFileIsNotXPM = "FileIsNotXPM::JImage" |
static const JUtf8Byte * | kXPMNotAvailable = "XPMNotAvailable::JImage" |
static const JUtf8Byte * | kFileIsNotXBM = "FileIsNotXBM::JImage" |
static const JUtf8Byte * | kTooManyColors = "TooManyColors::JImage" |
Protected Member Functions | |
JImage (const JImage &source) | |
void | SetDimensions (const JCoordinate width, const JCoordinate height) |
JError | ReadGIF (const JString &fileName) |
JError | ReadPNG (const JString &fileName) |
JError | ReadJPEG (const JString &fileName) |
void | ReadFromJXPM (const JXPM &pixmap) |
virtual void | SetImageData (const JSize colorCount, const JColorID *colorTable, unsigned short **imageData, const bool hasMask, const unsigned long maskColor)=0 |
virtual void | PrepareForImageData ()=0 |
virtual void | ImageDataFinished ()=0 |
Static Protected Member Functions | |
static JError | AllocateImageData (const JCoordinate w, const JCoordinate h, unsigned short **data, unsigned short ***cols) |
Pure virtual base class to represent an offscreen picture.
enum JImage::FileType |
JImage::JImage | ( | const JCoordinate | width, |
const JCoordinate | height, | ||
JColorManager * | colorManager | ||
) |
|
virtual |
|
protected |
|
staticprotected |
Allocate space for image data of the given width and height. Delete both arrays with "delete []". This data can be passed to SetImageData().
We return an error because it is not unreasonable that the user might request an image larger than will fit in memory.
|
inline |
|
pure virtual |
Implemented in JXImage.
|
inline |
|
static |
Returns the type of image stored in the file.
We do not deal with compressed files because most image formats are already inherently compressed.
|
inline |
|
pure virtual |
Implemented in JXImage.
|
pure virtual |
Implemented in JXImage.
|
pure virtual |
Implemented in JXImage.
|
inline |
|
protectedpure virtual |
Implemented in JXImage.
|
protectedpure virtual |
Implemented in JXImage.
|
protected |
This only works for XPM's with up to 255 colors. This shouldn't be a problem, because even with that many, you shouldn't be using XPM's.
Color approximation is controlled by the settings in the colorManager object.
|
pure virtual |
Implemented in JXImage.
|
inlineprotected |
|
protectedpure virtual |
Implemented in JXImage.
JError JImage::WriteGIF | ( | const JString & | fileName, |
const bool | compressColorsToFit, | ||
const bool | interlace = false |
||
) | const |
JError JImage::WriteJPEG | ( | const JString & | fileName, |
const bool | interlace = false , |
||
const int | quality = -1 |
||
) | const |
JError JImage::WritePNG | ( | const JString & | fileName, |
const bool | useTrueColor = true , |
||
const bool | compressColorsToFit = false , |
||
const bool | interlace = false |
||
) | const |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |