Classes | Defines | Functions

hsv.h File Reference

#include "maxheap.h"
#include "coreexp.h"
#include <WTypes.h>
#include "acolor.h"
#include "ipoint2.h"
#include "baseinterface.h"
#include "strbasic.h"

Go to the source code of this file.

Classes

class   HSVCallback
class   ColorPicker
class   ColPick

Defines

#define  MAXCOLORS   16
#define  WM_ADD_COLOR   (WM_USER+2321)
#define  DEFAULT_COLPICK_CLASS_ID   1

Functions

CoreExport INT_PTR  HSVDlg_Do (HWND hwndOwner, DWORD *lpc, IPoint2 *spos, HSVCallback *callBack, MCHAR *name)
CoreExport INT_PTR  HSVDlg_Do (HWND hwndOwner, AColor *lpc, IPoint2 *spos, HSVCallback *callBack, MCHAR *name)
CoreExport void  RGBtoHSV (DWORD rgb, int *ho, int *so, int *vo)
CoreExport DWORD  HSVtoRGB (int H, int S, int V)
CoreExport void  HSVtoHWBt (int h, int s, int v, int *ho, int *w, int *bt)
CoreExport void  HWBttoHSV (int h, int w, int bt, int *ho, int *s, int *v)
CoreExport Color  RGBtoHSV (Color rgb)
CoreExport Color  HSVtoRGB (Color hsv)
CoreExport ColorPicker CreateColorPicker (HWND hwndOwner, DWORD initColor, IPoint2 *spos, HSVCallback *pcallback, MCHAR *name, int objClr=0)
CoreExport ColorPicker CreateColorPicker (HWND hwndOwner, AColor initColor, IPoint2 *spos, HSVCallback *pcallback, MCHAR *name, int objClr=0)
CoreExport void  SetCPInitPos (IPoint2 &pos)
CoreExport IPoint2  GetCPInitPos (void)
CoreExport ColPick SetCurColPick (ColPick *colpick)
CoreExport ColPick GetCurColPick ()

Define Documentation

#define MAXCOLORS   16

Definition at line 25 of file hsv.h.

#define WM_ADD_COLOR   (WM_USER+2321)

Definition at line 291 of file hsv.h.

#define DEFAULT_COLPICK_CLASS_ID   1

Definition at line 409 of file hsv.h.


Function Documentation

CoreExport INT_PTR HSVDlg_Do ( HWND  hwndOwner,
DWORD *  lpc,
IPoint2 spos,
HSVCallback callBack,
MCHAR *  name 
)
Remarks:
This method puts up the modal HSV color picker dialog box. This dialog appears below:

dlgcsel.gif
Parameters:
HWND hwndOwner

Owner window handle.

DWORD *lpc

Pointer to color to be edited. See COLORREF.

IPoint2 *spos

The starting position of the upper left corner of the dialog window. This is set to the ending position when the user is done. You may pass NULL to get the default location.

HSVCallback *callBack

Callback object whose procs are called when the color changes. See Class HSVCallback.

MCHAR *name

The name of color being edited to appear in the title bar.
Returns:
Returns TRUE if the user exists the dialog with OK, otherwise returns FALSE.
CoreExport INT_PTR HSVDlg_Do ( HWND  hwndOwner,
AColor lpc,
IPoint2 spos,
HSVCallback callBack,
MCHAR *  name 
)
Remarks:
This method puts up the modal HSV color picker dialog box.
Parameters:
HWND hwndOwner

Owner window handle.

AColor *lpc

Pointer to color to be edited.

IPoint2 *spos

The starting position of the upper left corner of the dialog window. This is set to the ending position when the user is done. You may pass NULL to get the default location.

HSVCallback *callBack

Callback object whose procs are called when the color changes. See Class HSVCallback.

MCHAR *name

The name of color being edited to appear in the title bar.
Returns:
Returns TRUE if the user exists the dialog with OK, otherwise returns FALSE.
CoreExport void RGBtoHSV ( DWORD  rgb,
int *  ho,
int *  so,
int *  vo 
)
CoreExport DWORD HSVtoRGB ( int  H,
int  S,
int  V 
)
CoreExport void HSVtoHWBt ( int  h,
int  s,
int  v,
int *  ho,
int *  w,
int *  bt 
)
CoreExport void HWBttoHSV ( int  h,
int  w,
int  bt,
int *  ho,
int *  s,
int *  v 
)
CoreExport Color RGBtoHSV ( Color  rgb )
CoreExport Color HSVtoRGB ( Color  hsv )
CoreExport ColorPicker* CreateColorPicker ( HWND  hwndOwner,
DWORD  initColor,
IPoint2 spos,
HSVCallback pcallback,
MCHAR *  name,
int  objClr = 0 
)
Remarks:
Call this function to bring up the modeless color picker.
Parameters:
HWND hwndOwner

The owner window handle.

DWORD initColor

The initial color for the color picker.

IPoint2* spos

The initial screen position of the upper left corner. NULL may be passed for the default location.

HSVCallback *pcallback

The callback object to respond to color change events.

MCHAR *name

The title string in the dialog.

int objClr=0

A BOOLEAN used to indicate that the ColorPicker is being used to set the object color from the control panel. In all other cases, the default value of 0 should be used.
Returns:
A pointer to a ColorPicker object.
CoreExport ColorPicker* CreateColorPicker ( HWND  hwndOwner,
AColor  initColor,
IPoint2 spos,
HSVCallback pcallback,
MCHAR *  name,
int  objClr = 0 
)
CoreExport void SetCPInitPos ( IPoint2 pos )
Remarks:
Establishes the color picker initial screen position.
Parameters:
IPoint2 &pos

The upper left corner screen coordinate for the color picker.
CoreExport IPoint2 GetCPInitPos ( void  )
Remarks:
Retrieves the color picker initial screen position.
Returns:
The screen coordinates of the color picker. This is the coordinate of the upper left corner.
CoreExport ColPick* SetCurColPick ( ColPick colpick )
Remarks:
This function is available in release 3.0 and later only.

This global function is used internally to establish the current color picker used.
Parameters:
ColPick *colpick

Points to the color picker to use.
Returns:
A pointer to the current color picker.
CoreExport ColPick* GetCurColPick ( )
Remarks:
This function is available in release 3.0 and later only.

Returns a pointer to the current color picker.