24 #include "FreeImagePlus.h" 31 #ifdef __PNMEXSUPPORT__ 44 return TRUE ==
m_image->setSize(FIT_BITMAP, (WORD)width, (WORD)height, (WORD)bpp);
50 FREE_IMAGE_TYPE FItype;
73 return TRUE ==
m_image->setSize(FItype, (WORD)width, (WORD)height, (WORD)bpp, FI16_565_RED_MASK, FI16_565_GREEN_MASK, FI16_565_BLUE_MASK);
93 return TRUE ==
m_image->setSize(FItype, (WORD)width, (WORD)height, (WORD)bpp);
98 return (
unsigned char*)
m_image->accessPixels();
103 return m_image->getScanWidth();
108 return (
unsigned char)
m_image->getBitsPerPixel();
123 return TRUE ==
m_image->save(dest, 0);
128 if (
m_image->load(source, 0)) {
140 return (
m_image->getColorType() == FIC_RGBALPHA);
145 return ((
m_image->getColorType() == FIC_PALETTE) ||
146 (
m_image->getColorType() == FIC_MINISBLACK) ||
147 (
m_image->getColorType() == FIC_MINISWHITE));
152 return m_image->getColorsUsed();
157 RGBQUAD* palette =
m_image->getPalette();
158 int max = firstColor + numColors;
160 RGBQUAD* target = (RGBQUAD*)prgbColors;
161 for (
int i = firstColor; i < max; ++i) {
162 target[i] = palette[i];
168 RGBQUAD* palette =
m_image->getPalette();
169 int max = firstColor + numColors;
171 RGBQUAD* source = (RGBQUAD*)prgbColors;
172 for (
int i = firstColor; i < max; ++i) {
173 palette[i] = source[i];
179 switch (
m_image->getImageType()) {
182 switch (
m_image->getColorType()) {
185 switch (
m_image->getBitsPerPixel()) {
203 switch (
m_image->getBitsPerPixel()) {
221 switch (
m_image->getBitsPerPixel()) {
236 if (
m_image->getColorType() == FIC_RGB)
298 #ifdef __PNMEXSUPPORT__ 301 extern void DLL_CALLCONV
InitPNM(Plugin *plugin,
int format_id);
304 FREE_IMAGE_FORMAT fif = FreeImage_RegisterLocalPlugin(
InitPNM);
306 FreeImage_SetPluginEnabled(FIF_PBMRAW, FALSE);
307 FreeImage_SetPluginEnabled(FIF_PBM, FALSE);
308 FreeImage_SetPluginEnabled(FIF_PGMRAW, FALSE);
309 FreeImage_SetPluginEnabled(FIF_PGM, FALSE);
310 FreeImage_SetPluginEnabled(FIF_PPMRAW, FALSE);
311 FreeImage_SetPluginEnabled(FIF_PPM, FALSE);
313 FreeImage_SetPluginEnabled(fif, TRUE);
bool Load(const char *source)
#define ImageModeRGBColor
static void RegisterPNM()
unsigned char GetBPP() const
#define ImageModeGrayScale
#define ImageModeIndexedColor
void DLL_CALLCONV InitPNM(Plugin *plugin, int format_id)
unsigned char * GetBits() const
unsigned char GetColorType() const
bool Create(int width, int height, int bpp)
bool IsTransparencySupported()
void GetColorTable(int firstColor, int numColors, void *prgbColors)
void SetColorTable(int firstColor, int numColors, const void *prgbColors)
bool Save(const char *dest)
int GetMaxColorTableEntries()
unsigned int GetHeight() const
int GetChannelDepth() const
unsigned int GetWidth() const
void SetMaxValue(int maxValue)