FreeImagePlus - FreeImage 3.17.0
|
A class designed for MS Windows (TM) platforms. More...
#include <FreeImagePlus.h>
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 | |
fipWinImage & | operator= (const fipImage &src) |
Copy constructor. | |
fipWinImage & | operator= (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 |
A class designed for MS Windows (TM) platforms.
fipWinImage provides methods used to :
fipWinImage::fipWinImage | ( | FREE_IMAGE_TYPE | image_type = FIT_BITMAP , |
unsigned | width = 0 , |
||
unsigned | height = 0 , |
||
unsigned | bpp = 0 |
||
) |
Constructor.
virtual fipWinImage::~fipWinImage | ( | ) | [virtual] |
Destructor.
BOOL fipWinImage::captureWindow | ( | HWND | hWndApplicationWindow, |
HWND | hWndSelectedWindow | ||
) |
Capture a window and convert it to an image.
hWndApplicationWindow | Handle to the application main window |
hWndSelectedWindow | Handle to the window to be captured |
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.
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.
BOOL fipWinImage::copyToClipboard | ( | HWND | hWndNewOwner | ) | const |
Clipboard copy.
hWndNewOwner | Handle to the window to be associated with the open clipboard. In MFC, you can use AfxGetApp()->m_pMainWnd->GetSafeHwnd(). |
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.
hDC | Handle to the device context |
rcDest | Destination rectangle |
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.
hDC | Handle to the device context |
rcDest | Destination rectangle |
useFileBkg | When set to TRUE, the function uses the file color background if there is one |
appBkColor | When a color is given, the function uses it as the background color |
bg | When a FIBITMAP is given, the function uses it as the background image |
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.
tmo | Tone mapping operator |
first_param | First tone mapping algorithm parameter |
second_param | Second tone mapping algorithm parameter |
third_param | Third tone mapping algorithm parameter |
fourth_param | Fourth tone mapping algorithm parameter |
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.
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.
Reimplemented from fipImage.
BOOL fipWinImage::pasteFromClipboard | ( | ) |
Retrieves data from the clipboard.
The clipboard format must be CF_DIB.
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.
tmo | Tone mapping operator |
first_param | First tone mapping algorithm parameter |
second_param | Second tone mapping algorithm parameter |
third_param | Third tone mapping algorithm parameter |
fourth_param | Fourth tone mapping algorithm parameter |
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