diff options
author | yazoo <yazoo> | 2007-04-14 00:26:41 +0000 |
---|---|---|
committer | yazoo <yazoo> | 2007-04-14 00:26:41 +0000 |
commit | 79e08a88a832597996acc2b39dda462a4016513f (patch) | |
tree | 7e483f1907907277e0b7ba521c2a8f2df8502fed /lib | |
parent | 9cfe7c26d1819a7cdbeb177079753de50fee8064 (diff) |
Adding methods to Image class to enable caller to know which formats are supported.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Image.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/Image.cc b/lib/Image.cc index f4d2ee0..8a87a0e 100644 --- a/lib/Image.cc +++ b/lib/Image.cc @@ -167,6 +167,20 @@ unsigned char * Image::GetBuffer() { #define WORDS_BIGENDIAN 1 #endif +bool Image::SupportsFormat(unsigned int f) { + switch(f) { + case FORMAT_TGA_BASIC: + return true; + case FORMAT_JPEG: +#ifndef HAVE_LIBJPEG + return false; +#else + return true; +#endif + } + return false; +} + bool Image::Prepare(unsigned int f) throw (GeneralException) { int ix, iy; |