fipImage Class Reference

A class used to manage all photo related images and all image types used by the library. More...

`#include <FreeImagePlus.h>`

Inheritance diagram for fipImage:

## Public Member Functions

Creation & Destruction
| fipImage (FREE_IMAGE_TYPE image_type=FIT_BITMAP, unsigned width=0, unsigned height=0, unsigned bpp=0)
| Constructor. More...
virtual | ~fipImage ()
| Destructor. More...
BOOL | setSize (FREE_IMAGE_TYPE image_type, unsigned width, unsigned height, unsigned bpp, unsigned red_mask=0, unsigned green_mask=0, unsigned blue_mask=0)
| Image allocator. More...
virtual void | clear ()
| Destroy image data. More...
Copying
| fipImage (const fipImage &src)
| Copy constructor. More...
fipImage & | operator= (const fipImage &src)
| Copy constructor. More...
fipImage & | operator= (FIBITMAP *dib)
| Assignement operator Copy the input pointer and manage its destruction More...
BOOL | copySubImage (fipImage &dst, int left, int top, int right, int bottom) const
| Copy a sub part of the current image and returns it as a fipImage object. More...
BOOL | pasteSubImage (fipImage &src, int left, int top, int alpha=256)
BOOL | crop (int left, int top, int right, int bottom)
| Crop a sub part of the current image and update it accordingly. More...
BOOL | createView (fipImage &dynamicView, unsigned left, unsigned top, unsigned right, unsigned bottom)
| Returns a reference (a.k.a. More...
Loading & Saving
Loading and saving is handled by the FreeImage library.
BOOL | load (const char *lpszPathName, int flag=0)
| Loads an image from disk, given its file name and an optional flag. More...
BOOL | load (FREE_IMAGE_FORMAT fif, const char *lpszPathName, int flag=0)
| Loads an image from disk, given its format, file name and an optional flag. More...
BOOL | loadU (const wchar_t *lpszPathName, int flag=0)
| UNICODE version of load (this function only works under WIN32 and does nothing on other OS) More...
BOOL | loadU (FREE_IMAGE_FORMAT fif, const wchar_t *lpszPathName, int flag=0)
| UNICODE version of load (this function only works under WIN32 and does nothing on other OS) More...
BOOL | loadFromHandle (FreeImageIO *io, fi_handle handle, int flag=0)
| Loads an image using the specified FreeImageIO struct and fi_handle, and an optional flag. More...
BOOL | loadFromMemory (fipMemoryIO &memIO, int flag=0)
| Loads an image using the specified memory stream and an optional flag. More...
BOOL | loadFromMemory (FREE_IMAGE_FORMAT fif, fipMemoryIO &memIO, int flag=0)
| Loads an image using the specified fif and memory stream and an optional flag. More...
BOOL | save (const char *lpszPathName, int flag=0)
| Saves an image to disk, given its file name and an optional flag. More...
BOOL | save (FREE_IMAGE_FORMAT fif, const char *lpszPathName, int flag=0)
| Saves an image to disk, given its format, file name and an optional flag. More...
BOOL | saveU (const wchar_t *lpszPathName, int flag=0)
| UNICODE version of save (this function only works under WIN32 and does nothing on other OS) More...
BOOL | saveU (FREE_IMAGE_FORMAT fif, const wchar_t *lpszPathName, int flag=0)
| UNICODE version of save (this function only works under WIN32 and does nothing on other OS) More...
BOOL | saveToHandle (FREE_IMAGE_FORMAT fif, FreeImageIO *io, fi_handle handle, int flag=0)
| Saves an image using the specified FreeImageIO struct and fi_handle, and an optional flag. More...
BOOL | saveToMemory (FREE_IMAGE_FORMAT fif, fipMemoryIO &memIO, int flag=0)
| Saves an image using the specified memory stream and an optional flag. More...
Information functions
Accessors to the DIB BITMAPINFO structure.
FREE_IMAGE_TYPE | getImageType () const
| Returns the data type of the image. More...
FREE_IMAGE_FORMAT | getFIF () const
| Return the original (or last saved) fif format if available, returns FIF_UNKNOWN otherwise. More...
unsigned | getWidth () const
| Returns the image width in pixels. More...
unsigned | getHeight () const
| Returns the image height in pixels. More...
unsigned | getScanWidth () const
| Returns the width of the bitmap in bytes rounded to the nearest DWORD. More...
| operator FIBITMAP * ()
| Returns a pointer to the FIBITMAP data. More...
BOOL | isValid () const
| Returns TRUE if the image is allocated, FALSE otherwise. More...
const BITMAPINFO * | getInfo () const
| Returns a pointer to the bitmap's BITMAPINFO header. More...
const BITMAPINFOHEADER * | getInfoHeader () const
| Returns a pointer to the bitmap's BITMAPINFOHEADER. More...
unsigned | getImageSize () const
| Returns the size of the bitmap in bytes. More...
unsigned | getImageMemorySize () const
| Returns the memory footprint of a bitmap, in bytes. More...
unsigned | getBitsPerPixel () const
| Returns the bitdepth of the bitmap. More...
unsigned | getLine () const
| Returns the width of the bitmap in bytes. More...
double | getHorizontalResolution () const
| Returns the bitmap resolution along the X axis, in pixels / cm. More...
double | getVerticalResolution () const
| Returns the bitmap resolution along the Y axis, in pixels / cm. More...
void | setHorizontalResolution (double value)
| set the bitmap resolution along the X axis, in pixels / cm More...
void | setVerticalResolution (double value)
| set the bitmap resolution along the Y axis, in pixels / cm More...
Palette operations
RGBQUAD * | getPalette () const
| Returns a pointer to the bitmap's palette. More...
unsigned | getPaletteSize () const
| Returns the palette size in bytes. More...
unsigned | getColorsUsed () const
| Retrieves the number of colours used in the bitmap. More...
FREE_IMAGE_COLOR_TYPE | getColorType () const
| Investigates the colour type of the bitmap. More...
BOOL | isGrayscale () const
| Returns TRUE if the bitmap is a 8-bit bitmap with a greyscale palette, FALSE otherwise. More...
Thumbnail access
BOOL | getThumbnail (fipImage &image) const
| Retrieves a copy the thumbnail possibly attached to the bitmap. More...
BOOL | setThumbnail (const fipImage &image)
| Attach a thumbnail to the bitmap. More...
BOOL | hasThumbnail () const
| Check if the image has an embedded thumbnail. More...
BOOL | clearThumbnail ()
| Clear the thumbnail possibly attached to the bitmap. More...
Pixel access
BYTE * | accessPixels () const
| Returns a pointer to the bitmap bits. More...
BYTE * | getScanLine (unsigned scanline) const
| Returns a pointer to the start of the given scanline in the bitmap’s data-bits. More...
BOOL | getPixelIndex (unsigned x, unsigned y, BYTE *value) const
| Get the pixel index of a 1-, 4- or 8-bit palettized image at position (x, y), including range check (slow access). More...
BOOL | getPixelColor (unsigned x, unsigned y, RGBQUAD *value) const
| Get the pixel color of a 16-, 24- or 32-bit image at position (x, y), including range check (slow access). More...
BOOL | setPixelIndex (unsigned x, unsigned y, BYTE *value)
| Set the pixel index of a 1-, 4- or 8-bit palettized image at position (x, y), including range check (slow access). More...
BOOL | setPixelColor (unsigned x, unsigned y, RGBQUAD *value)
| Set the pixel color of a 16-, 24- or 32-bit image at position (x, y), including range check (slow access). More...
Conversion routines
Bitmaps are always loaded in their default bit depth. If you want the bitmap to be stored in another bit depth, the class provides several conversion functions.
BOOL | convertToType (FREE_IMAGE_TYPE image_type, BOOL scale_linear=TRUE)
| Converts an image to a type supported by FreeImage. More...
BOOL | threshold (BYTE T)
| Converts the bitmap to 1 bit using a threshold T. More...
BOOL | dither (FREE_IMAGE_DITHER algorithm)
| Converts a 8-bit image to a monochrome 1-bit image using a dithering algorithm. More...
BOOL | convertTo4Bits ()
| Converts the bitmap to 4 bits. More...
BOOL | convertTo8Bits ()
| Converts the bitmap to 8 bits. More...
BOOL | convertToGrayscale ()
| Converts the bitmap to 8 bits. More...
BOOL | colorQuantize (FREE_IMAGE_QUANTIZE algorithm)
| Quantizes a full colour 24-bit bitmap to a palletised 8-bit bitmap. More...
BOOL | convertTo16Bits555 ()
| Converts the bitmap to 16 bits. More...
BOOL | convertTo16Bits565 ()
| Converts the bitmap to 16 bits. More...
BOOL | convertTo24Bits ()
| Converts the bitmap to 24 bits. More...
BOOL | convertTo32Bits ()
| Converts the bitmap to 32 bits. More...
BOOL | convertToFloat ()
| Converts the bitmap to a 32-bit float image. More...
BOOL | convertToRGBF ()
| Converts the bitmap to a 96-bit RGBF image. More...
BOOL | convertToRGBAF ()
| Converts the bitmap to a 128-bit RGBAF image. More...
BOOL | convertToUINT16 ()
| Converts the bitmap to a 16-bit unsigned short image. More...
BOOL | convertToRGB16 ()
| Converts the bitmap to a 48-bit RGB16 image. More...
BOOL | convertToRGBA16 ()
| Converts the bitmap to a 64-bit RGBA16 image. More...
BOOL | toneMapping (FREE_IMAGE_TMO tmo, double first_param=0, double second_param=0, double third_param=1, double fourth_param=0)
| Converts a High Dynamic Range image (48-bit RGB or 96-bit RGB Float) to a 24-bit RGB image. More...
Transparency support: background colour and alpha channel
BOOL | isTransparent () const
| Returns TRUE if the image is transparent, returns FALSE otherwise. More...
unsigned | getTransparencyCount () const
| 8-bit transparency : get the number of transparent colors. More...
BYTE * | getTransparencyTable () const
| 8-bit transparency : get the bitmap’s transparency table. More...
void | setTransparencyTable (BYTE *table, int count)
| 8-bit transparency : set the bitmap’s transparency table. More...
BOOL | hasFileBkColor () const
| Returns TRUE when the image has a file background color, FALSE otherwise. More...
BOOL | getFileBkColor (RGBQUAD *bkcolor) const
| Retrieves the file background color of an image. More...
BOOL | setFileBkColor (RGBQUAD *bkcolor)
| Set the file background color of an image. More...
Channel processing support
BOOL | getChannel (fipImage &image, FREE_IMAGE_COLOR_CHANNEL channel) const
| Retrieves the red, green, blue or alpha channel of a 24- or 32-bit BGR[A] image. More...
BOOL | setChannel (fipImage &image, FREE_IMAGE_COLOR_CHANNEL channel)
| Insert a 8-bit dib into a 24- or 32-bit image. More...
BOOL | splitChannels (fipImage &RedChannel, fipImage &GreenChannel, fipImage &BlueChannel)
| Split a 24-bit RGB image into 3 greyscale images corresponding to the red, green and blue channels. More...
BOOL | combineChannels (fipImage &red, fipImage &green, fipImage &blue)
| Builds a 24-bit RGB image given its red, green and blue channel. More...
Rotation and flipping
BOOL | rotateEx (double angle, double x_shift, double y_shift, double x_origin, double y_origin, BOOL use_mask)
| Image translation and rotation using B-Splines. More...
BOOL | rotate (double angle, const void *bkcolor=NULL)
| Image rotation by means of three shears. More...
BOOL | flipHorizontal ()
| Flip the image horizontally along the vertical axis. More...
BOOL | flipVertical ()
| Flip the image vertically along the horizontal axis. More...
Color manipulation routines
BOOL | invert ()
| Inverts each pixel data. More...
BOOL | adjustCurve (BYTE *LUT, FREE_IMAGE_COLOR_CHANNEL channel)
| Perfoms an histogram transformation on a 8, 24 or 32-bit image according to the values of a lookup table (LUT). More...
BOOL | adjustGamma (double gamma)
| Performs gamma correction on a 8, 24 or 32-bit image. More...
BOOL | adjustBrightness (double percentage)
| Adjusts the brightness of a 8, 24 or 32-bit image by a certain amount. More...
BOOL | adjustContrast (double percentage)
| Adjusts the contrast of a 8, 24 or 32-bit image by a certain amount. More...
BOOL | adjustBrightnessContrastGamma (double brightness, double contrast, double gamma)
| Adjusts an image's brightness, contrast and gamma within a single operation. More...
BOOL | getHistogram (DWORD *histo, FREE_IMAGE_COLOR_CHANNEL channel=FICC_BLACK) const
| Computes image histogram. More...
Upsampling / downsampling
BOOL | rescale (unsigned new_width, unsigned new_height, FREE_IMAGE_FILTER filter)
| Rescale the image to a new width / height. More...
BOOL | makeThumbnail (unsigned max_size, BOOL convert=TRUE)
| Creates a thumbnail image keeping aspect ratio. More...
Image status
void | setModified (BOOL bStatus=TRUE)
| Set the image status as 'modified'. More...
BOOL | isModified ()
| Get the image status. More...
Metadata
unsigned | getMetadataCount (FREE_IMAGE_MDMODEL model) const
| Returns the number of tags contained in the model metadata model attached to the dib. More...
BOOL | getMetadata (FREE_IMAGE_MDMODEL model, const char *key, fipTag &tag) const
| Retrieve a metadata attached to the dib. More...
BOOL | setMetadata (FREE_IMAGE_MDMODEL model, const char *key, fipTag &tag)
| Attach a new FreeImage tag to the dib. More...
void | clearMetadata ()
| Clear all metadata contained in the dib. More...
Public Member Functions inherited from fipObject
virtual | ~fipObject ()
| Destructor. More...

## Static Public Member Functions

File type identification
static FREE_IMAGE_FORMAT | identifyFIF (const char *lpszPathName)
| Identifies an image from disk, given its file name. More...
static FREE_IMAGE_FORMAT | identifyFIFU (const wchar_t *lpszPathName)
| UNICODE version of identifyFIF (this function only works under WIN32 and does nothing on other OS) More...
static FREE_IMAGE_FORMAT | identifyFIFFromHandle (FreeImageIO *io, fi_handle handle)
| Identifies an image using the specified FreeImageIO struct and fi_handle. More...
static FREE_IMAGE_FORMAT | identifyFIFFromMemory (FIMEMORY *hmem)
| Identifies an image using the specified memory stream. More...

## Protected Member Functions

Internal use
BOOL | replace (FIBITMAP *new_dib)

## Protected Attributes

FIBITMAP * | _dib
| DIB data. More...
FREE_IMAGE_FORMAT | _fif
| Original (or last saved) fif format if available, FIF_UNKNOWN otherwise. More...
BOOL | _bHasChanged
| TRUE whenever the display need to be refreshed. More...

## Friends

class | fipMultiPage

## Detailed Description

A class used to manage all photo related images and all image types used by the library.

    fipImage encapsulates the FIBITMAP format. It relies on the FreeImage library, especially for
    loading / saving images and for bit depth conversion.
    @version FreeImage 3
    @author Hervé Drolon

## Constructor & Destructor Documentation

## fipImage() [1/2]

fipImage::fipImage | ( | FREE_IMAGE_TYPE | image_type = `FIT_BITMAP`,
|  | unsigned | width = `0`,
|  | unsigned | height = `0`,
|  | unsigned | bpp = `0`
| ) |  |

Constructor.

See also
  FreeImage_AllocateT

## ~fipImage()

virtual fipImage::~fipImage | ( |  | ) |

virtual

Destructor.

## fipImage() [2/2]

fipImage::fipImage | ( | const fipImage & | src | ) |

Copy constructor.

See also
  FreeImage_Clone

## Member Function Documentation

## accessPixels()

BYTE * fipImage::accessPixels | ( |  | ) | const

Returns a pointer to the bitmap bits.

It is up to you to interpret these bytes correctly, according to the results of FreeImage_GetBPP and GetRedMask, FreeImage_GetGreenMask and FreeImage_GetBlueMask.
Use this function with getScanWidth to iterates through the pixels.

See also
  FreeImage_GetBits

## adjustBrightness()

BOOL fipImage::adjustBrightness | ( | double | percentage | ) |

Adjusts the brightness of a 8, 24 or 32-bit image by a certain amount.

Parameters

  percentage | Where -100 <= percentage <= 100 A value 0 means no change, less than 0 will make the image darker and greater than 0 will make the image brighter.

Returns
  Returns TRUE if the operation was succesful, FALSE otherwise

See also
  FreeImage_AdjustBrightness, adjustCurve

## adjustBrightnessContrastGamma()

BOOL fipImage::adjustBrightnessContrastGamma | ( | double | brightness,
|  | double | contrast,
|  | double | gamma
| ) |  |

Adjusts an image's brightness, contrast and gamma within a single operation.

If more than one of these image display properties need to be adjusted, using this function should be preferred over calling each adjustment function separately. That's particularly true for huge images or if performance is an issue.

See also
  adjustBrightness
  adjustContrast
  adjustGamma
  FreeImage_AdjustColors

## adjustContrast()

BOOL fipImage::adjustContrast | ( | double | percentage | ) |

Adjusts the contrast of a 8, 24 or 32-bit image by a certain amount.

Parameters

  percentage | Where -100 <= percentage <= 100 A value 0 means no change, less than 0 will decrease the contrast and greater than 0 will increase the contrast of the image.

Returns
  Returns TRUE if the operation was succesfull, FALSE otherwise

See also
  FreeImage_AdjustContrast, adjustCurve

## adjustCurve()

BOOL fipImage::adjustCurve | ( | BYTE * | LUT,
|  | FREE_IMAGE_COLOR_CHANNEL | channel
| ) |  |

Perfoms an histogram transformation on a 8, 24 or 32-bit image according to the values of a lookup table (LUT).

The transformation is done as follows.
Image 8-bit : if the image has a color palette, the LUT is applied to this palette, otherwise, it is applied to the grey values.
Image 24-bit & 32-bit : if channel == IPL_CC_RGB, the same LUT is applied to each color plane (R,G, and B). Otherwise, the LUT is applied to the specified channel only.

Parameters

  LUT | Lookup table. The size of 'LUT' is assumed to be 256.
  channel | The color channel to be processed (only used with 24 & 32-bit DIB).

Returns
  Returns TRUE if the operation was successful, FALSE otherwise

See also
  FreeImage_AdjustCurve, FREE_IMAGE_COLOR_CHANNEL

## adjustGamma()

BOOL fipImage::adjustGamma | ( | double | gamma | ) |

Performs gamma correction on a 8, 24 or 32-bit image.

Parameters

  gamma | Gamma value to use. A value of 1.0 leaves the image alone, less than one darkens it, and greater than one lightens it.

Returns
  Returns TRUE if the operation was successful, FALSE otherwise

See also
  FreeImage_AdjustGamma, adjustCurve

## clear()

virtual void fipImage::clear | ( |  | ) |

virtual

Destroy image data.

Reimplemented in fipWinImage.

## clearMetadata()

void fipImage::clearMetadata | ( |  | ) |

Clear all metadata contained in the dib.

## clearThumbnail()

BOOL fipImage::clearThumbnail | ( |  | ) |

Clear the thumbnail possibly attached to the bitmap.

Returns
  Returns TRUE if successful, returns FALSe otherwise

See also
  FreeImage_SetThumbnail

## colorQuantize()

BOOL fipImage::colorQuantize | ( | FREE_IMAGE_QUANTIZE | algorithm | ) |

Quantizes a full colour 24-bit bitmap to a palletised 8-bit bitmap.

The quantize parameter specifies which colour reduction algorithm should be used.

Parameters

  algorithm | Color quantization algorithm to use.

Returns
  Returns TRUE if successful, FALSE otherwise.

See also
  FreeImage_ColorQuantize, FREE_IMAGE_QUANTIZE

## combineChannels()

BOOL fipImage::combineChannels | ( | fipImage & | red,
|  | fipImage & | green,
|  | fipImage & | blue
| ) |  |

Builds a 24-bit RGB image given its red, green and blue channel.

Parameters

  red | Input red channel.
  green | Input green channel.
  blue | Input blue channel.

Returns
  Returns FALSE if the dib can't be allocated, if the input channels are not 8-bit images. Returns TRUE otherwise.

See also
  FreeImage_SetChannel

## convertTo16Bits555()

BOOL fipImage::convertTo16Bits555 | ( |  | ) |

Converts the bitmap to 16 bits.

The resulting bitmap has a layout of 5 bits red, 5 bits green, 5 bits blue and 1 unused bit.

Returns
  Returns TRUE if successful, FALSE otherwise.

See also
  FreeImage_ConvertTo16Bits555

## convertTo16Bits565()

BOOL fipImage::convertTo16Bits565 | ( |  | ) |

Converts the bitmap to 16 bits.

The resulting bitmap has a layout of 5 bits red, 6 bits green and 5 bits blue.

Returns
  Returns TRUE if successful, FALSE otherwise.

See also
  FreeImage_ConvertTo16Bits565

## convertTo24Bits()

BOOL fipImage::convertTo24Bits | ( |  | ) |

Converts the bitmap to 24 bits.

Returns
  Returns TRUE if successful, FALSE otherwise.

See also
  FreeImage_ConvertTo24Bits

## convertTo32Bits()

BOOL fipImage::convertTo32Bits | ( |  | ) |

Converts the bitmap to 32 bits.

Returns
  Returns TRUE if successful, FALSE otherwise.

See also
  FreeImage_ConvertTo32Bits

## convertTo4Bits()

BOOL fipImage::convertTo4Bits | ( |  | ) |

Converts the bitmap to 4 bits.

Unless the bitmap is a 1-bit palettized bitmap, colour values are converted to greyscale.

Returns
  Returns TRUE if successful, FALSE otherwise.

See also
  FreeImage_ConvertTo4Bits

## convertTo8Bits()

BOOL fipImage::convertTo8Bits | ( |  | ) |

Converts the bitmap to 8 bits.

If the bitmap is 24 or 32-bit RGB, the colour values are converted to greyscale.

Returns
  Returns TRUE if successful, FALSE otherwise.

See also
  FreeImage_ConvertTo8Bits

## convertToFloat()

BOOL fipImage::convertToFloat | ( |  | ) |

Converts the bitmap to a 32-bit float image.

Returns
  Returns TRUE if successful, FALSE otherwise.

See also
  FreeImage_ConvertToFloat

## convertToGrayscale()

BOOL fipImage::convertToGrayscale | ( |  | ) |

Converts the bitmap to 8 bits.

For palletized bitmaps, the color map is converted to a greyscale ramp.

See also
  FreeImage_ConvertToGreyscale

Returns
  Returns TRUE if successful, FALSE otherwise.

## convertToRGB16()

BOOL fipImage::convertToRGB16 | ( |  | ) |

Converts the bitmap to a 48-bit RGB16 image.

Returns
  Returns TRUE if successful, FALSE otherwise.

See also
  FreeImage_ConvertToRGB16

## convertToRGBA16()

BOOL fipImage::convertToRGBA16 | ( |  | ) |

Converts the bitmap to a 64-bit RGBA16 image.

Returns
  Returns TRUE if successful, FALSE otherwise.

See also
  FreeImage_ConvertToRGBA16

## convertToRGBAF()

BOOL fipImage::convertToRGBAF | ( |  | ) |

Converts the bitmap to a 128-bit RGBAF image.

Returns
  Returns TRUE if successful, FALSE otherwise.

See also
  FreeImage_ConvertToRGBAF

## convertToRGBF()

BOOL fipImage::convertToRGBF | ( |  | ) |

Converts the bitmap to a 96-bit RGBF image.

Returns
  Returns TRUE if successful, FALSE otherwise.

See also
  FreeImage_ConvertToRGBF

## convertToType()

BOOL fipImage::convertToType | ( | FREE_IMAGE_TYPE | image_type,
|  | BOOL | scale_linear = `TRUE`
| ) |  |

Converts an image to a type supported by FreeImage.

Parameters

  image_type | New image type
  scale_linear | TRUE if image pixels must be scaled linearly when converting to a standard bitmap

Returns
  Returns TRUE if successful, FALSE otherwise.

See also
  FreeImage_ConvertToType, FreeImage_ConvertToStandardType

## convertToUINT16()

BOOL fipImage::convertToUINT16 | ( |  | ) |

Converts the bitmap to a 16-bit unsigned short image.

Returns
  Returns TRUE if successful, FALSE otherwise.

See also
  FreeImage_ConvertToUINT16

## copySubImage()

BOOL fipImage::copySubImage | ( | fipImage & | dst,
|  | int | left,
|  | int | top,
|  | int | right,
|  | int | bottom
| ) |  | const

Copy a sub part of the current image and returns it as a fipImage object.

This method works with any bitmap type.

Parameters

  dst | Output subimage
  left | Specifies the left position of the cropped rectangle.
  top | Specifies the top position of the cropped rectangle.
  right | Specifies the right position of the cropped rectangle.
  bottom | Specifies the bottom position of the cropped rectangle.

Returns
  Returns TRUE if successful, FALSE otherwise.

See also
  FreeImage_Copy

## createView()

BOOL fipImage::createView | ( | fipImage & | dynamicView,
|  | unsigned | left,
|  | unsigned | top,
|  | unsigned | right,
|  | unsigned | bottom
| ) |  |

Returns a reference (a.k.a.

"dynamic view") to a sub part of the current image.

A dynamic view is a FreeImage bitmap with its own width and height, that, however, shares its bits with another FreeImage bitmap. Typically, views are used to define one or more rectangular sub-images of an existing bitmap. All FreeImage operations, like saving, displaying and all the toolkit functions, when applied to the view, only affect the view's rectangular area. This method works with any bitmap type.

Parameters

  dynamicView | Returns a reference to the specified dynamic view
  left | Specifies the left position of the view's area
  top | Specifies the top position of the view's area
  right | Specifies the right position of the view's area
  bottom | Specifies the bottom position of the view's area

Returns
  Returns TRUE if successful, returns FALSE otherwise

See also
  FreeImage_CreateView

## crop()

BOOL fipImage::crop | ( | int | left,
|  | int | top,
|  | int | right,
|  | int | bottom
| ) |  |

Crop a sub part of the current image and update it accordingly.

This method works with any bitmap type.

Parameters

  left | Specifies the left position of the cropped rectangle.
  top | Specifies the top position of the cropped rectangle.
  right | Specifies the right position of the cropped rectangle.
  bottom | Specifies the bottom position of the cropped rectangle.

Returns
  Returns TRUE if successful, FALSE otherwise.

## dither()

BOOL fipImage::dither | ( | FREE_IMAGE_DITHER | algorithm | ) |

Converts a 8-bit image to a monochrome 1-bit image using a dithering algorithm.

Parameters

  algorithm | Dithering algorithm to use.

Returns
  Returns TRUE if successful, FALSE otherwise.

See also
  FreeImage_Dither, FREE_IMAGE_DITHER

## flipHorizontal()

BOOL fipImage::flipHorizontal | ( |  | ) |

Flip the image horizontally along the vertical axis.

See also
  FreeImage_FlipHorizontal

## flipVertical()

BOOL fipImage::flipVertical | ( |  | ) |

Flip the image vertically along the horizontal axis.

See also
  FreeImage_FlipVertical

## getBitsPerPixel()

unsigned fipImage::getBitsPerPixel | ( |  | ) | const

Returns the bitdepth of the bitmap.

When the image type is FIT_BITMAP, valid bitdepth can be 1, 4, 8, 16, 24 or 32.

See also
  FreeImage_GetBPP, getImageType

## getChannel()

BOOL fipImage::getChannel | ( | fipImage & | image,
|  | FREE_IMAGE_COLOR_CHANNEL | channel
| ) |  | const

Retrieves the red, green, blue or alpha channel of a 24- or 32-bit BGR[A] image.

Parameters

  image | Output image to be extracted
  channel | Color channel to extract

Returns
  Returns TRUE if successful, FALSE otherwise.

See also
  FreeImage_GetChannel, FREE_IMAGE_COLOR_CHANNEL

## getColorsUsed()

unsigned fipImage::getColorsUsed | ( |  | ) | const

Retrieves the number of colours used in the bitmap.

If the bitmap is non-palletised, 0 is returned.

See also
  FreeImage_GetColorsUsed

## getColorType()

FREE_IMAGE_COLOR_TYPE fipImage::getColorType | ( |  | ) | const

Investigates the colour type of the bitmap.

See also
  FreeImage_GetColorType, FREE_IMAGE_COLOR_TYPE

## getFIF()

FREE_IMAGE_FORMAT fipImage::getFIF | ( |  | ) | const

Return the original (or last saved) fif format if available, returns FIF_UNKNOWN otherwise.

## getFileBkColor()

BOOL fipImage::getFileBkColor | ( | RGBQUAD * | bkcolor | ) | const

Retrieves the file background color of an image.

For 8-bit images, the color index in the palette is returned in the rgbReserved member of the bkcolor parameter.

Returns
  Returns TRUE if successful, FALSE otherwise.

See also
  FreeImage_GetBackgroundColor

## getHeight()

unsigned fipImage::getHeight | ( |  | ) | const

Returns the image height in pixels.

See also
  FreeImage_GetHeight

## getHistogram()

BOOL fipImage::getHistogram | ( | DWORD * | histo,
|  | FREE_IMAGE_COLOR_CHANNEL | channel = `FICC_BLACK`
| ) |  | const

Computes image histogram.

For 24-bit and 32-bit images, histogram can be computed from red, green, blue and black channels. For 8-bit images, histogram is computed from the black channel. Other bit depth is not supported.

Parameters

  histo | pointer to an histogram array. Size of this array is assumed to be 256.
  channel | Color channel to use

Returns
  Returns TRUE if the operation was succesfull, FALSE otherwise

See also
  FreeImage_GetHistogram

## getHorizontalResolution()

double fipImage::getHorizontalResolution | ( |  | ) | const

Returns the bitmap resolution along the X axis, in pixels / cm.

See also
  FreeImage_GetDotsPerMeterX

## getImageMemorySize()

unsigned fipImage::getImageMemorySize | ( |  | ) | const

Returns the memory footprint of a bitmap, in bytes.

See also
  FreeImage_GetMemorySize

## getImageSize()

unsigned fipImage::getImageSize | ( |  | ) | const

Returns the size of the bitmap in bytes.

The size of the bitmap is the BITMAPINFOHEADER + the size of the palette + the size of the bitmap data.

See also
  FreeImage_GetDIBSize

## getImageType()

FREE_IMAGE_TYPE fipImage::getImageType | ( |  | ) | const

Returns the data type of the image.

See also
  FreeImage_GetImageType

## getInfo()

const BITMAPINFO * fipImage::getInfo | ( |  | ) | const

Returns a pointer to the bitmap's BITMAPINFO header.

See also
  FreeImage_GetInfo

## getInfoHeader()

const BITMAPINFOHEADER * fipImage::getInfoHeader | ( |  | ) | const

Returns a pointer to the bitmap's BITMAPINFOHEADER.

See also
  FreeImage_GetInfoHeader

## getLine()

unsigned fipImage::getLine | ( |  | ) | const

Returns the width of the bitmap in bytes.

This is not the size of the scanline.

See also
  FreeImage_GetLine, getScanWidth

## getMetadata()

BOOL fipImage::getMetadata | ( | FREE_IMAGE_MDMODEL | model,
|  | const char * | key,
|  | fipTag & | tag
| ) |  | const

Retrieve a metadata attached to the dib.

Parameters

  model | Metadata model to look for
  key | Metadata field name
  tag | Returned tag

Returns
  Returns TRUE if the operation was succesfull, FALSE otherwise

See also
  FreeImage_GetMetadata

## getMetadataCount()

unsigned fipImage::getMetadataCount | ( | FREE_IMAGE_MDMODEL | model | ) | const

Returns the number of tags contained in the model metadata model attached to the dib.

Parameters

  model | Metadata model to look for

## getPalette()

RGBQUAD * fipImage::getPalette | ( |  | ) | const

Returns a pointer to the bitmap's palette.

If the bitmap doesn't have a palette, getPalette returns NULL.

See also
  FreeImage_GetPalette

## getPaletteSize()

unsigned fipImage::getPaletteSize | ( |  | ) | const

Returns the palette size in bytes.

See also
  FreeImage_GetColorsUsed

## getPixelColor()

BOOL fipImage::getPixelColor | ( | unsigned | x,
|  | unsigned | y,
|  | RGBQUAD * | value
| ) |  | const

Get the pixel color of a 16-, 24- or 32-bit image at position (x, y), including range check (slow access).

Parameters

  x | Pixel position in horizontal direction
  y | Pixel position in vertical direction
  value | Pixel color (returned value)

Returns
  Returns TRUE if successful, FALSE otherwise.

See also
  FreeImage_GetPixelColor

## getPixelIndex()

BOOL fipImage::getPixelIndex | ( | unsigned | x,
|  | unsigned | y,
|  | BYTE * | value
| ) |  | const

Get the pixel index of a 1-, 4- or 8-bit palettized image at position (x, y), including range check (slow access).

Parameters

  x | Pixel position in horizontal direction
  y | Pixel position in vertical direction
  value | Pixel index (returned value)

Returns
  Returns TRUE if successful, FALSE otherwise.

See also
  FreeImage_GetPixelIndex

## getScanLine()

BYTE * fipImage::getScanLine | ( | unsigned | scanline | ) | const

Returns a pointer to the start of the given scanline in the bitmap’s data-bits.

This pointer can be cast according to the result returned by getImageType.
Use this function with getScanWidth to iterates through the pixels.

See also
  FreeImage_GetScanLine, FreeImage documentation

## getScanWidth()

unsigned fipImage::getScanWidth | ( |  | ) | const

Returns the width of the bitmap in bytes rounded to the nearest DWORD.

See also
  FreeImage_GetPitch

## getThumbnail()

BOOL fipImage::getThumbnail | ( | fipImage & | image | ) | const

Retrieves a copy the thumbnail possibly attached to the bitmap.

Returns
  Returns TRUE if the thumbnail is present in the bitmap and successfuly retrieved, returns FALSE otherwise

See also
  FreeImage_GetThumbnail

## getTransparencyCount()

unsigned fipImage::getTransparencyCount | ( |  | ) | const

8-bit transparency : get the number of transparent colors.

Returns
  Returns the number of transparent colors in a palletised bitmap.

See also
  FreeImage_GetTransparencyCount

## getTransparencyTable()

BYTE * fipImage::getTransparencyTable | ( |  | ) | const

8-bit transparency : get the bitmap’s transparency table.

Returns
  Returns a pointer to the bitmap’s transparency table.

See also
  FreeImage_GetTransparencyTable

## getVerticalResolution()

double fipImage::getVerticalResolution | ( |  | ) | const

Returns the bitmap resolution along the Y axis, in pixels / cm.

See also
  FreeImage_GetDotsPerMeterY

## getWidth()

unsigned fipImage::getWidth | ( |  | ) | const

Returns the image width in pixels.

See also
  FreeImage_GetWidth

## hasFileBkColor()

BOOL fipImage::hasFileBkColor | ( |  | ) | const

Returns TRUE when the image has a file background color, FALSE otherwise.

See also
  FreeImage_HasBackgroundColor

## hasThumbnail()

BOOL fipImage::hasThumbnail | ( |  | ) | const

Check if the image has an embedded thumbnail.

Returns
  Returns TRUE if a thumbnail is present in the bitmap, returns FALSE otherwise

See also
  FreeImage_GetThumbnail

## identifyFIF()

static FREE_IMAGE_FORMAT fipImage::identifyFIF | ( | const char * | lpszPathName | ) |

static

Identifies an image from disk, given its file name.

Parameters

  lpszPathName | Path and file name of the image to identify.

Returns
  Returns the found FreeImage format if successful, returns FIF_UNKNOWN otherwise.

See also
  FreeImage_GetFileType, FreeImage_GetFIFFromFilename, FreeImage documentation

## identifyFIFFromHandle()

static FREE_IMAGE_FORMAT fipImage::identifyFIFFromHandle | ( | FreeImageIO * | io,
|  | fi_handle | handle
| ) |  |

static

Identifies an image using the specified FreeImageIO struct and fi_handle.

Parameters

  io | FreeImageIO structure
  handle | FreeImage fi_handle

Returns
  Returns the found FreeImage format if successful, returns FIF_UNKNOWN otherwise.

See also
  FreeImage_GetFileTypeFromHandle, FreeImage documentation

## identifyFIFFromMemory()

static FREE_IMAGE_FORMAT fipImage::identifyFIFFromMemory | ( | FIMEMORY * | hmem | ) |

static

Identifies an image using the specified memory stream.

Parameters

  hmem | FreeImage memory stream

Returns
  Returns the found FreeImage format if successful, returns FIF_UNKNOWN otherwise.

See also
  FreeImage_GetFileTypeFromMemory, FreeImage documentation

## identifyFIFU()

static FREE_IMAGE_FORMAT fipImage::identifyFIFU | ( | const wchar_t * | lpszPathName | ) |

static

UNICODE version of identifyFIF (this function only works under WIN32 and does nothing on other OS)

See also
  FreeImage_GetFileTypeU, FreeImage_GetFIFFromFilenameU, FreeImage documentation

## invert()

BOOL fipImage::invert | ( |  | ) |

Inverts each pixel data.

Returns
  Returns TRUE if successful, FALSE otherwise.

See also
  FreeImage_Invert

## isGrayscale()

BOOL fipImage::isGrayscale | ( |  | ) | const

Returns TRUE if the bitmap is a 8-bit bitmap with a greyscale palette, FALSE otherwise.

See also
  FreeImage_GetBPP, FreeImage_GetColorType

## isModified()

BOOL fipImage::isModified | ( |  | ) |

inline

Get the image status.

Returns
  Returns TRUE if the image is marked as modified, FALSE otherwise

See also
  setModified

## isTransparent()

BOOL fipImage::isTransparent | ( |  | ) | const

Returns TRUE if the image is transparent, returns FALSE otherwise.

See also
  FreeImage_IsTransparent

## isValid()

BOOL fipImage::isValid | ( |  | ) | const

virtual

Returns TRUE if the image is allocated, FALSE otherwise.

Implements fipObject.

Reimplemented in fipWinImage.

## load() [1/2]

BOOL fipImage::load | ( | const char * | lpszPathName,
|  | int | flag = `0`
| ) |  |

Loads an image from disk, given its file name and an optional flag.

The function will use FreeImage_GetFileType to get the right FREE_IMAGE_FORMAT.

Parameters

  lpszPathName | Path and file name of the image to load.
  flag | The signification of this flag depends on the image to be read.

Returns
  Returns TRUE if successful, FALSE otherwise.

See also
  FreeImage_Load, FreeImage_GetFileType, FreeImage documentation

## load() [2/2]

BOOL fipImage::load | ( | FREE_IMAGE_FORMAT | fif,
|  | const char * | lpszPathName,
|  | int | flag = `0`
| ) |  |

Loads an image from disk, given its format, file name and an optional flag.

Parameters

  fif | Format identifier (FreeImage format)
  lpszPathName | Path and file name of the image to load.
  flag | The signification of this flag depends on the image to be read.

Returns
  Returns TRUE if successful, FALSE otherwise.

See also
  FreeImage_Load, FreeImage documentation

## loadFromHandle()

BOOL fipImage::loadFromHandle | ( | FreeImageIO * | io,
|  | fi_handle | handle,
|  | int | flag = `0`
| ) |  |

Loads an image using the specified FreeImageIO struct and fi_handle, and an optional flag.

Parameters

  io | FreeImageIO structure
  handle | FreeImage fi_handle
  flag | The signification of this flag depends on the image to be read.

Returns
  Returns TRUE if successful, FALSE otherwise.

See also
  FreeImage_LoadFromHandle, FreeImage documentation

## loadFromMemory() [1/2]

BOOL fipImage::loadFromMemory | ( | fipMemoryIO & | memIO,
|  | int | flag = `0`
| ) |  |

Loads an image using the specified memory stream and an optional flag.

Parameters

  memIO | FreeImage memory stream
  flag | The signification of this flag depends on the image to be read.

Returns
  Returns TRUE if successful, FALSE otherwise.

See also
  FreeImage_LoadFromMemory, FreeImage documentation

## loadFromMemory() [2/2]

BOOL fipImage::loadFromMemory | ( | FREE_IMAGE_FORMAT | fif,
|  | fipMemoryIO & | memIO,
|  | int | flag = `0`
| ) |  |

Loads an image using the specified fif and memory stream and an optional flag.

Parameters

  fif | Expected format identifier (FreeImage format)
  memIO | FreeImage memory stream
  flag | The signification of this flag depends on the image to be read.

Returns
  Returns TRUE if successful, FALSE otherwise.

See also
  FreeImage_LoadFromMemory, FreeImage documentation

## loadU() [1/2]

BOOL fipImage::loadU | ( | const wchar_t * | lpszPathName,
|  | int | flag = `0`
| ) |  |

UNICODE version of load (this function only works under WIN32 and does nothing on other OS)

See also
  load

## loadU() [2/2]

BOOL fipImage::loadU | ( | FREE_IMAGE_FORMAT | fif,
|  | const wchar_t * | lpszPathName,
|  | int | flag = `0`
| ) |  |

UNICODE version of load (this function only works under WIN32 and does nothing on other OS)

See also
  load

## makeThumbnail()

BOOL fipImage::makeThumbnail | ( | unsigned | max_size,
|  | BOOL | convert = `TRUE`
| ) |  |

Creates a thumbnail image keeping aspect ratio.

Parameters

  max_size | Maximum width or height in pixel units
  convert | When set to TRUE, converts the image to a standard type

Returns
  Returns TRUE if the operation was successful, FALSE otherwise

See also
  FreeImage_MakeThumbnail

## operator FIBITMAP *()

fipImage::operator FIBITMAP * | ( |  | ) |

inline

Returns a pointer to the FIBITMAP data.

Used for direct access from FREEIMAGE functions or from your own low level C functions.
Sample use :

    fipImage src, dst;
    src.load("test.png");
    dst = FreeImage_ConvertTo8Bits(src);
    FreeImage_Save(FIF_TIFF, dst, "test.tif", 0);

See also
  operator=(FIBITMAP *dib)

## operator=() [1/2]

fipImage & fipImage::operator= | ( | const fipImage & | src | ) |

Copy constructor.

See also
  FreeImage_Clone

## operator=() [2/2]

fipImage & fipImage::operator= | ( | FIBITMAP * | dib | ) |

Assignement operator
Copy the input pointer and manage its destruction

See also
  operator FIBITMAP*()

## pasteSubImage()

BOOL fipImage::pasteSubImage | ( | fipImage & | src,
|  | int | left,
|  | int | top,
|  | int | alpha = `256`
| ) |  |

    @brief Alpha blend or combine a sub part image with the current image.

The bit depth of dst bitmap must be greater than or equal to the bit depth of src. Upper promotion of src is done internally. Supported bit depth equals to 4, 8, 16, 24 or 32.

Parameters

  src | Source subimage
  left | Specifies the left position of the sub image.
  top | Specifies the top position of the sub image.
  alpha | Alpha blend factor. The source and destination images are alpha blended if alpha = 0..255. If alpha > 255, then the source image is combined to the destination image.

Returns
  Returns TRUE if successful, FALSE otherwise.

See also
  FreeImage_Paste

## rescale()

BOOL fipImage::rescale | ( | unsigned | new_width,
|  | unsigned | new_height,
|  | FREE_IMAGE_FILTER | filter
| ) |  |

Rescale the image to a new width / height.

Parameters

  new_width | New image width
  new_height | New image height
  filter | The filter parameter specifies which resampling filter should be used.

Returns
  Returns TRUE if the operation was successful, FALSE otherwise

See also
  FreeImage_Rescale, FREE_IMAGE_FILTER

## rotate()

BOOL fipImage::rotate | ( | double | angle,
|  | const void * | bkcolor = `NULL`
| ) |  |

Image rotation by means of three shears.

Parameters

  angle | Image rotation angle, in degree
  bkcolor | Background color (image type dependent), default to black background

Returns
  Returns rotated dib if successful, returns NULL otherwise

See also
  FreeImage_Rotate

## rotateEx()

BOOL fipImage::rotateEx | ( | double | angle,
|  | double | x_shift,
|  | double | y_shift,
|  | double | x_origin,
|  | double | y_origin,
|  | BOOL | use_mask
| ) |  |

Image translation and rotation using B-Splines.

Parameters

  angle | Image rotation angle, in degree
  x_shift | Image horizontal shift
  y_shift | Image vertical shift
  x_origin | Origin of the x-axis
  y_origin | Origin of the y-axis
  use_mask | Whether or not to mask the image. Image mirroring is applied when use_mask is set to FALSE

Returns
  Returns the translated & rotated dib if successful, returns NULL otherwise

See also
  FreeImage_RotateEx

## save() [1/2]

BOOL fipImage::save | ( | const char * | lpszPathName,
|  | int | flag = `0`
| ) |  |

Saves an image to disk, given its file name and an optional flag.

The function will use FreeImage_GetFIFFromFilename to get the right FREE_IMAGE_FORMAT.

Parameters

  lpszPathName | Path and file name of the image to save.
  flag | The signification of this flag depends on the image to be saved.

Returns
  Returns TRUE if successful, FALSE otherwise.

See also
  FreeImage_Save, FreeImage_GetFIFFromFilename, FreeImage documentation

## save() [2/2]

BOOL fipImage::save | ( | FREE_IMAGE_FORMAT | fif,
|  | const char * | lpszPathName,
|  | int | flag = `0`
| ) |  |

Saves an image to disk, given its format, file name and an optional flag.

Parameters

  fif | Format identifier (FreeImage format)
  lpszPathName | Path and file name of the image to save.
  flag | The signification of this flag depends on the image to be saved.

Returns
  Returns TRUE if successful, FALSE otherwise.

See also
  FreeImage_Save, FreeImage documentation

## saveToHandle()

BOOL fipImage::saveToHandle | ( | FREE_IMAGE_FORMAT | fif,
|  | FreeImageIO * | io,
|  | fi_handle | handle,
|  | int | flag = `0`
| ) |  |

Saves an image using the specified FreeImageIO struct and fi_handle, and an optional flag.

Parameters

  fif | Format identifier (FreeImage format)
  io | FreeImageIO structure
  handle | FreeImage fi_handle
  flag | The signification of this flag depends on the image to be saved.

Returns
  Returns TRUE if successful, FALSE otherwise.

See also
  FreeImage_SaveToHandle, FreeImage documentation

## saveToMemory()

BOOL fipImage::saveToMemory | ( | FREE_IMAGE_FORMAT | fif,
|  | fipMemoryIO & | memIO,
|  | int | flag = `0`
| ) |  |

Saves an image using the specified memory stream and an optional flag.

Parameters

  fif | Format identifier (FreeImage format)
  memIO | FreeImage memory stream
  flag | The signification of this flag depends on the image to be saved.

Returns
  Returns TRUE if successful, FALSE otherwise.

See also
  FreeImage_SaveToMemory, FreeImage documentation

## saveU() [1/2]

BOOL fipImage::saveU | ( | const wchar_t * | lpszPathName,
|  | int | flag = `0`
| ) |  |

UNICODE version of save (this function only works under WIN32 and does nothing on other OS)

See also
  save

## saveU() [2/2]

BOOL fipImage::saveU | ( | FREE_IMAGE_FORMAT | fif,
|  | const wchar_t * | lpszPathName,
|  | int | flag = `0`
| ) |  |

UNICODE version of save (this function only works under WIN32 and does nothing on other OS)

See also
  save

## setChannel()

BOOL fipImage::setChannel | ( | fipImage & | image,
|  | FREE_IMAGE_COLOR_CHANNEL | channel
| ) |  |

Insert a 8-bit dib into a 24- or 32-bit image.

Parameters

  image | Input 8-bit image to insert
  channel | Color channel to replace

Returns
  Returns TRUE if successful, FALSE otherwise.

See also
  FreeImage_SetChannel, FREE_IMAGE_COLOR_CHANNEL

## setFileBkColor()

BOOL fipImage::setFileBkColor | ( | RGBQUAD * | bkcolor | ) |

Set the file background color of an image.

When saving an image to PNG, this background color is transparently saved to the PNG file. When the bkcolor parameter is NULL, the background color is removed from the image.

Returns
  Returns TRUE if successful, FALSE otherwise.

See also
  FreeImage_SetBackgroundColor

## setHorizontalResolution()

void fipImage::setHorizontalResolution | ( | double | value | ) |

set the bitmap resolution along the X axis, in pixels / cm

See also
  FreeImage_GetInfoHeader

## setMetadata()

BOOL fipImage::setMetadata | ( | FREE_IMAGE_MDMODEL | model,
|  | const char * | key,
|  | fipTag & | tag
| ) |  |

Attach a new FreeImage tag to the dib.

Sample use :

    fipImage image;
    // ...
    fipTag tag;
    tag.setKeyValue("Caption-Abstract", "my caption");
    image.setMetadata(FIMD_IPTC, tag.getKey(), tag);
    tag.setKeyValue("Keywords", "FreeImage;Library;Images;Compression");
    image.setMetadata(FIMD_IPTC, tag.getKey(), tag);

Parameters

  model | Metadata model used to store the tag
  key | Tag field name
  tag | Tag to be attached

Returns
  Returns TRUE if the operation was succesfull, FALSE otherwise

See also
  FreeImage_SetMetadata

## setModified()

void fipImage::setModified | ( | BOOL | bStatus = `TRUE` | ) |

inline

Set the image status as 'modified'.

When using the fipWinImage class, the image status is used to refresh the display. It is changed to FALSE whenever the display has just been refreshed.

Parameters

  bStatus | TRUE if the image should be marked as modified, FALSE otherwise

See also
  isModified

## setPixelColor()

BOOL fipImage::setPixelColor | ( | unsigned | x,
|  | unsigned | y,
|  | RGBQUAD * | value
| ) |  |

Set the pixel color of a 16-, 24- or 32-bit image at position (x, y), including range check (slow access).

Parameters

  x | Pixel position in horizontal direction
  y | Pixel position in vertical direction
  value | Pixel color

Returns
  Returns TRUE if successful, FALSE otherwise.

See also
  FreeImage_SetPixelColor

## setPixelIndex()

BOOL fipImage::setPixelIndex | ( | unsigned | x,
|  | unsigned | y,
|  | BYTE * | value
| ) |  |

Set the pixel index of a 1-, 4- or 8-bit palettized image at position (x, y), including range check (slow access).

Parameters

  x | Pixel position in horizontal direction
  y | Pixel position in vertical direction
  value | Pixel index

Returns
  Returns TRUE if successful, FALSE otherwise.

See also
  FreeImage_SetPixelIndex

## setSize()

BOOL fipImage::setSize | ( | FREE_IMAGE_TYPE | image_type,
|  | unsigned | width,
|  | unsigned | height,
|  | unsigned | bpp,
|  | unsigned | red_mask = `0`,
|  | unsigned | green_mask = `0`,
|  | unsigned | blue_mask = `0`
| ) |  |

Image allocator.

See also
  FreeImage_AllocateT

## setThumbnail()

BOOL fipImage::setThumbnail | ( | const fipImage & | image | ) |

Attach a thumbnail to the bitmap.

Returns
  Returns TRUE if the thumbnail was successfuly set, returns FALSE otherwise

See also
  FreeImage_SetThumbnail

## setTransparencyTable()

void fipImage::setTransparencyTable | ( | BYTE * | table,
|  | int | count
| ) |  |

8-bit transparency : set the bitmap’s transparency table.

See also
  FreeImage_SetTransparencyTable

## setVerticalResolution()

void fipImage::setVerticalResolution | ( | double | value | ) |

set the bitmap resolution along the Y axis, in pixels / cm

See also
  FreeImage_GetInfoHeader

## splitChannels()

BOOL fipImage::splitChannels | ( | fipImage & | RedChannel,
|  | fipImage & | GreenChannel,
|  | fipImage & | BlueChannel
| ) |  |

Split a 24-bit RGB image into 3 greyscale images corresponding to the red, green and blue channels.

Parameters

  RedChannel | Output red channel.
  GreenChannel | Output green channel.
  BlueChannel | Output blue channel.

Returns
  Returns FALSE if the dib isn't a valid image, if it's not a 24-bit image or if one of the output channel can't be allocated. Returns TRUE otherwise.

See also
  FreeImage_GetChannel

## threshold()

BOOL fipImage::threshold | ( | BYTE | T | ) |

Converts the bitmap to 1 bit using a threshold T.

Parameters

  T | Threshold value in [0..255]

Returns
  Returns TRUE if successful, FALSE otherwise.

See also
  FreeImage_Threshold

## toneMapping()

BOOL fipImage::toneMapping | ( | FREE_IMAGE_TMO | tmo,
|  | double | first_param = `0`,
|  | double | second_param = `0`,
|  | double | third_param = `1`,
|  | double | fourth_param = `0`
| ) |  |

Converts a High Dynamic Range image (48-bit RGB or 96-bit RGB Float) to a 24-bit RGB image.

Parameters

  tmo | Tone mapping operator
  first_param | First tone mapping algorithm parameter (algorithm dependant)
  second_param | Second tone mapping algorithm parameter (algorithm dependant)
  third_param | Third tone mapping algorithm parameter (algorithm dependant)
  fourth_param | Fourth tone mapping algorithm parameter (algorithm dependant)

Returns
  Returns TRUE if successful, FALSE otherwise.

See also
  FreeImage_ToneMapping, FreeImage_TmoReinhard05Ex

## Member Data Documentation

## _bHasChanged

BOOL fipImage::_bHasChanged

mutable protected

TRUE whenever the display need to be refreshed.

## _dib

FIBITMAP* fipImage::_dib

protected

DIB data.

## _fif

FREE_IMAGE_FORMAT fipImage::_fif

protected

Original (or last saved) fif format if available, FIF_UNKNOWN otherwise.

The documentation for this class was generated from the following file:

- FreeImagePlus.h