FreeImagePlus - FreeImage 3.17.0
Protected Attributes
fipWinImage Class Reference

A class designed for MS Windows (TM) platforms. More...

#include <FreeImagePlus.h>

Inheritance diagram for fipWinImage:
fipImage fipObject

List of all members.

Public Member Functions

Creation & Destruction
 fipWinImage (FREE_IMAGE_TYPE image_type=FIT_BITMAP, unsigned width=0, unsigned height=0, unsigned bpp=0)
 Constructor.
virtual ~fipWinImage ()
 Destructor.
virtual void clear ()
 Destroy image data.
BOOL isValid () const
 Returns TRUE if the image is allocated, FALSE otherwise.
Copying
fipWinImageoperator= (const fipImage &src)
 Copy constructor.
fipWinImageoperator= (const fipWinImage &src)
 Copy constructor Delete internal _display_dib data and copy tone mapping parameters.
HANDLE copyToHandle () const
 Clone function used for clipboard copy.
BOOL copyFromHandle (HANDLE hMem)
 Copy constructor used for clipboard paste.
BOOL copyFromBitmap (HBITMAP hbmp)
 Copy constructor.
Clipboard operations
BOOL copyToClipboard (HWND hWndNewOwner) const
 Clipboard copy.
BOOL pasteFromClipboard ()
 Retrieves data from the clipboard.
Screen capture
BOOL captureWindow (HWND hWndApplicationWindow, HWND hWndSelectedWindow)
 Capture a window and convert it to an image.
Painting operations
void draw (HDC hDC, RECT &rcDest) const
 Draw (stretch) the image on a HDC, using StretchDIBits.
void drawEx (HDC hDC, RECT &rcDest, BOOL useFileBkg=FALSE, RGBQUAD *appBkColor=NULL, FIBITMAP *bg=NULL) const
 Draw (stretch) the image on a HDC, using StretchDIBits.
void setToneMappingOperator (FREE_IMAGE_TMO tmo, double first_param=0, double second_param=0, double third_param=1, double fourth_param=0)
 Select a tone mapping algorithm used for drawing and set the image as modified so that the display will be refreshed.
void getToneMappingOperator (FREE_IMAGE_TMO *tmo, double *first_param, double *second_param, double *third_param, double *fourth_param) const
 Get the tone mapping algorithm used for drawing, with its parameters.

Protected Attributes

FIBITMAP * _display_dib
 DIB used for display (this allow to display non-standard bitmaps)
BOOL _bDeleteMe
 remember to delete _display_dib
FREE_IMAGE_TMO _tmo
 tone mapping operator
double _tmo_param_1
 first tone mapping algorithm parameter
double _tmo_param_2
 second tone mapping algorithm parameter
double _tmo_param_3
 third tone mapping algorithm parameter
double _tmo_param_4
 fourth tone mapping algorithm parameter

Detailed Description

A class designed for MS Windows (TM) platforms.

fipWinImage provides methods used to :

Version:
FreeImage 3
Author:
Hervé Drolon

Constructor & Destructor Documentation

fipWinImage::fipWinImage ( FREE_IMAGE_TYPE  image_type = FIT_BITMAP,
unsigned  width = 0,
unsigned  height = 0,
unsigned  bpp = 0 
)

Constructor.

virtual fipWinImage::~fipWinImage ( ) [virtual]

Destructor.


Member Function Documentation

BOOL fipWinImage::captureWindow ( HWND  hWndApplicationWindow,
HWND  hWndSelectedWindow 
)

Capture a window and convert it to an image.

Parameters:
hWndApplicationWindowHandle to the application main window
hWndSelectedWindowHandle to the window to be captured
Returns:
Returns TRUE if successful, returns FALSE otherwise
virtual void fipWinImage::clear ( ) [virtual]

Destroy image data.

Reimplemented from fipImage.

BOOL fipWinImage::copyFromBitmap ( HBITMAP  hbmp)

Copy constructor.


Converts a HBITMAP object to a FIBITMAP.

Returns:
Returns TRUE if successful, returns FALSE otherwise
BOOL fipWinImage::copyFromHandle ( HANDLE  hMem)

Copy constructor used for clipboard paste.


Converts a global object to a FIBITMAP. The clipboard format must be CF_DIB.
When the BITMAPINFOHEADER->biCompression field is set to 0xFF + [one of the predefined FREE_IMAGE_TYPE], the bitmap is recognized as non standard and correctly copied.

Returns:
Returns TRUE if successful, returns FALSE otherwise
BOOL fipWinImage::copyToClipboard ( HWND  hWndNewOwner) const

Clipboard copy.

Parameters:
hWndNewOwnerHandle to the window to be associated with the open clipboard. In MFC, you can use AfxGetApp()->m_pMainWnd->GetSafeHwnd().
Returns:
Returns TRUE if successful, returns FALSE otherwise
HANDLE fipWinImage::copyToHandle ( ) const

Clone function used for clipboard copy.


Convert the FIBITMAP image to a DIB, and transfer the DIB in a global bitmap handle.
For non standard bitmaps, the BITMAPINFOHEADER->biCompression field is set to 0xFF + FreeImage_GetImageType(_dib), in order to recognize the bitmap as non standard.

void fipWinImage::draw ( HDC  hDC,
RECT &  rcDest 
) const [inline]

Draw (stretch) the image on a HDC, using StretchDIBits.

When the image is transparent or has a file background, this function composite the foreground image against a checkerboard background image.

Parameters:
hDCHandle to the device context
rcDestDestination rectangle
See also:
FreeImage_Composite
void fipWinImage::drawEx ( HDC  hDC,
RECT &  rcDest,
BOOL  useFileBkg = FALSE,
RGBQUAD appBkColor = NULL,
FIBITMAP *  bg = NULL 
) const

Draw (stretch) the image on a HDC, using StretchDIBits.

When the image is transparent or has a file background, this function can composite the foreground image against a checkerboard background image, against a single background color or against a user background image.
When the image is a High Dynamic Range image (48-bit or RGB float), this function will apply a tone mapping operator before drawing the image.
The original image (located in the fipImage class) will not be affected by any of the operations that could be done in order to display it.

Parameters:
hDCHandle to the device context
rcDestDestination rectangle
useFileBkgWhen set to TRUE, the function uses the file color background if there is one
appBkColorWhen a color is given, the function uses it as the background color
bgWhen a FIBITMAP is given, the function uses it as the background image
See also:
FreeImage_Composite
setToneMappingOperator
void fipWinImage::getToneMappingOperator ( FREE_IMAGE_TMO *  tmo,
double *  first_param,
double *  second_param,
double *  third_param,
double *  fourth_param 
) const

Get the tone mapping algorithm used for drawing, with its parameters.

Parameters:
tmoTone mapping operator
first_paramFirst tone mapping algorithm parameter
second_paramSecond tone mapping algorithm parameter
third_paramThird tone mapping algorithm parameter
fourth_paramFourth tone mapping algorithm parameter
See also:
FreeImage_ToneMapping
BOOL fipWinImage::isValid ( ) const [virtual]

Returns TRUE if the image is allocated, FALSE otherwise.

Reimplemented from fipImage.

fipWinImage& fipWinImage::operator= ( const fipWinImage src)

Copy constructor Delete internal _display_dib data and copy tone mapping parameters.

Copy also the base class image data.

See also:
FreeImage_Clone
fipWinImage& fipWinImage::operator= ( const fipImage src)

Copy constructor.

Delete internal _display_dib data and copy the base class image data. Tone mapping parameters are left unchanged.

See also:
FreeImage_Clone

Reimplemented from fipImage.

BOOL fipWinImage::pasteFromClipboard ( )

Retrieves data from the clipboard.

The clipboard format must be CF_DIB.

Returns:
Returns TRUE if successful, returns FALSE otherwise
void fipWinImage::setToneMappingOperator ( FREE_IMAGE_TMO  tmo,
double  first_param = 0,
double  second_param = 0,
double  third_param = 1,
double  fourth_param = 0 
)

Select a tone mapping algorithm used for drawing and set the image as modified so that the display will be refreshed.

Parameters:
tmoTone mapping operator
first_paramFirst tone mapping algorithm parameter
second_paramSecond tone mapping algorithm parameter
third_paramThird tone mapping algorithm parameter
fourth_paramFourth tone mapping algorithm parameter
See also:
FreeImage_ToneMapping

Member Data Documentation

BOOL fipWinImage::_bDeleteMe [mutable, protected]

remember to delete _display_dib

FIBITMAP* fipWinImage::_display_dib [mutable, protected]

DIB used for display (this allow to display non-standard bitmaps)

FREE_IMAGE_TMO fipWinImage::_tmo [protected]

tone mapping operator

double fipWinImage::_tmo_param_1 [protected]

first tone mapping algorithm parameter

double fipWinImage::_tmo_param_2 [protected]

second tone mapping algorithm parameter

double fipWinImage::_tmo_param_3 [protected]

third tone mapping algorithm parameter

double fipWinImage::_tmo_param_4 [protected]

fourth tone mapping algorithm parameter


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