mi32/colorbal.h File Reference

<mi32/colorbal.h> More...

#include <mi32/xbase.h>
#include <mi32/micallbacklist.h>
#include <mi32/serializerbase.h>
#include <memory.h>
Include dependency graph for colorbal.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  CBPARMS
class  COLORBALANCE
struct  MCBALCALLBACKSTRUCT
 MCBALCALLBACKSTRUCT Structure. More...

Defines

#define CBAL_AdjustHue   0x00000002
#define CBAL_AdjustHueShift   0x00000010
#define CBAL_AdjustInt   0x00000004
#define CBAL_AdjustMask   (CBAL_AdjustHue|CBAL_AdjustInt|CBAL_AdjustSat|CBAL_AdjustHueShift)
#define CBAL_AdjustSat   0x00000008
#define CBAL_ForceGray   0x00000020
#define CBAL_ValsSet   0x00000001

Functions

void HISTransCompHueAmpTable (signed char *atrans, const double *sval)
void HISTransCompHueTable (short *htrans, const double *sval, const double *hsval)
void McbalCompHueAmpTable (signed char *atrans, double *sval)
void McbalCompHueTable (short *htrans, double *sval, double *hsval)
int McbalInit (CBPARMS *parms, void **handle)
int McbalIsIdentity (void *parms)
int McbalParmIsIdentity (CBPARMS *)
void McbalStop (void *handle)
void McbalTransBuffers (void *handle, UINT8 *rbuf, UINT8 *gbuf, UINT8 *bbuf, int count)
void McbalTransCOLORs (void *handle, COLOR *colors, int count)
void McbalTransInt8 (void *handle, int *rbuf, int *gbuf, int *bbuf, int count)
int MxColorBalanceForm (Widget parent, CBPARMS *cp, PRINTGAMMA *gamma, Widget *pForm, XTARGS &args, UINT32 flags)
int MxColorBalanceFormSetParms (Widget form, CBPARMS *cp, PRINTGAMMA *gamma)
void MxColorBalanceFormSetTestCallback (Widget form, MICALLBACKLIST::CALLBACKFUNC func, void *cbdata)
int MxdColorBalanceAddCallback (MXDHANDLE dhandle, MICALLBACKLIST::CALLBACKFUNC cbfunc, void *cbdata, UINT32 reason)
int MxdColorBalanceClose (MXDHANDLE dhandle)
int MxdColorBalanceCreate (Widget pwidget, MXDHANDLE *dhandle, char *dialogname, CBPARMS *cbparms, UINT32 dialogflags)
int MxdColorBalanceDestroy (MXDHANDLE dhandle)
int MxdColorBalanceGetParms (MXDHANDLE dhandle, CBPARMS *cbparms, UINT32 flags)
int MxdColorBalanceOpen (MXDHANDLE dhandle)
int MxdColorBalanceRemoveCallback (MXDHANDLE dhandle, MICALLBACKLIST::CALLBACKFUNC cbfunc, void *cbdata, UINT32 reason)
int MxdColorBalanceSetParms (MXDHANDLE dhandle, CBPARMS *cbparms, UINT32 flags)

Detailed Description

<mi32/colorbal.h>

Header file for color balance tools


Define Documentation

#define CBAL_AdjustHue   0x00000002
#define CBAL_AdjustHueShift   0x00000010
#define CBAL_AdjustInt   0x00000004
#define CBAL_AdjustMask   (CBAL_AdjustHue|CBAL_AdjustInt|CBAL_AdjustSat|CBAL_AdjustHueShift)
#define CBAL_AdjustSat   0x00000008
#define CBAL_ForceGray   0x00000020
#define CBAL_ValsSet   0x00000001

Function Documentation

void HISTransCompHueAmpTable ( signed char *  atrans,
const double *  sval 
)

Computes the lookup table for Hue/Amp.

Parameters:
sval Array of 6 slider values in the range -1.0 to 1.0
void HISTransCompHueTable ( short *  htrans,
const double *  sval,
const double *  hsval 
)

This routine computes the lookup table for Hue.

Parameters:
htrans Array of 360 integers
sval Array of 6 slider values in the range -1.0 to 1.0
void McbalCompHueAmpTable ( signed char *  atrans,
double *  sval 
)

Computes the lookup table for Hue/Amp.

Parameters:
sval Array of 6 slider values in the range -1.0 to 1.0
void McbalCompHueTable ( short *  htrans,
double *  sval,
double *  hsval 
)

This routine computes the lookup table for Hue.

Parameters:
htrans Array of 360 integers
sval Array of 6 slider values in the range -1.0 to 1.0
int McbalInit ( CBPARMS parms,
void **  handle 
)

Setup color balance conversion functions.

This function sets up a color balance conversion handle using the given parameters. The color balance functions do color conversion in-place and are optimized to do nothing if the color balance is "identity".

Parameters:
parms Color balance parameters
handle Handle returned
int McbalIsIdentity ( void *  parms  ) 

Check to see if a CBPARM is set to default settings.

This returns true if the given color balance does nothing (all values set to default). Note: this is not a very fast check, so don't do it in a loop.

int McbalParmIsIdentity ( CBPARMS  ) 
void McbalStop ( void *  handle  ) 

Free color balance conversion handle.

Parameters:
handle Handle from McbalInit()
void McbalTransBuffers ( void *  handle,
UINT8 rbuf,
UINT8 gbuf,
UINT8 bbuf,
int  count 
)

Do color balancing on RGB buffers (3 buffers).

Do color balance in-place on the given buffers. If the color balance handle is set up such that nothing needs to be done, then nothing will be done.

Parameters:
handle Handle from McbalInit()
rbuf Buffer of red values
gbuf Buffer of green values
bbuf Buffer of blue values
count Number of cells to convert
void McbalTransCOLORs ( void *  handle,
COLOR colors,
int  count 
)

Do color balancing on an array of COLORs.

Modifies the colors through the color balance handle.

Parameters:
handle Handle from McbalInit()
colors Array of color values
count Number of cells to convert
void McbalTransInt8 ( void *  handle,
int *  rbuf,
int *  gbuf,
int *  bbuf,
int  count 
)

Do color balancing on integer RGB buffers.

Do color balance in-place on the given buffers. If the color balance handle is set up such that nothing needs to be done, then nothing will be done. This is the same as McbalTransBuffers() but the buffers are (int*) instead of (UBYTE *) I have no idea why this exists, but something must have used it at one time.

Parameters:
handle Handle from McbalInit()
rbuf Buffer of red values
gbuf Buffer of green values
bbuf Buffer of blue values
count Number of cells to convert
int MxColorBalanceForm ( Widget  parent,
CBPARMS cp,
PRINTGAMMA gamma,
Widget pForm,
XTARGS args,
UINT32  flags 
)

Function prototypes.

Create color balance form.

int MxColorBalanceFormSetParms ( Widget  form,
CBPARMS cp,
PRINTGAMMA gamma 
)

Set color balance form parameters.

void MxColorBalanceFormSetTestCallback ( Widget  form,
MICALLBACKLIST::CALLBACKFUNC  func,
void *  cbdata 
)

Set test callback for color balance form.

int MxdColorBalanceAddCallback ( MXDHANDLE  dhandle,
MICALLBACKLIST::CALLBACKFUNC  cbfunc,
void *  cbdata,
UINT32  reason 
)

Add callback for color balance dialog.

Parameters:
dhandle Handle created by MxdColorBalanceCreate()
cbfunc Callback function
cbdata Callback "hook" data
reason Reasons for which cbfunc() should get called
int MxdColorBalanceClose ( MXDHANDLE  dhandle  ) 

Close previously opened color balance dialog.

Using this function will call any callbacks selected by the MxdCR_Close reason.

Parameters:
dhandle Handle created by MxdColorBalanceCreate()
int MxdColorBalanceCreate ( Widget  pwidget,
MXDHANDLE dhandle,
char *  dialogname,
CBPARMS cbparms,
UINT32  dialogflags 
)

Create color balance dialog.

The dialog keeps track of the pointer you give it and modifies the structure directly. If you pass NULL, it will edit an internal cbparms and you can use MxdColorBalanceGetCBParms()/MxdColorBalanceSetCBParms() to access it. The dialog always gets an "Apply..." button, which is automatically enabled/ disabled by adding/removing an MxdCR_Apply callback. Callbacks supported: MxdCR_Open MxdCR_Close MxdCR_Destroy MxdCR_Apply User hit apply button MxdCR_ChangeContinue Called for drag callback on slider MxdCR_ChangeEnd Slider change done.

Parameters:
pwidget parent widget
dhandle Dialog handle returned
dialogname Dialog name returned
cbparms Parms to edit
dialogflags MxdFLAG_... flags
int MxdColorBalanceDestroy ( MXDHANDLE  dhandle  ) 

Destroy previously created color balance dialog.

Using this function will call any callbacks selected by the MxdCR_Destroy reason.

Parameters:
dhandle Handle created by MxdColorBalanceCreate()
int MxdColorBalanceGetParms ( MXDHANDLE  dhandle,
CBPARMS cbparms,
UINT32  flags 
)

Get the color balance parmameters.

Returns:
the color balance parameters.
Parameters:
dhandle Dialog handle
cbparms Parms to fill in
flags None yet. Just for future expansion.
int MxdColorBalanceOpen ( MXDHANDLE  dhandle  ) 

Open previously created color balance dialog.

If the MxdFLAG_ReturnWhenClose flag was specified when the dialog was created, this function will not return until the user closes the dialog. Using this function will call any callbacks selected by the MxdCR_Open reason.

Parameters:
dhandle Handle created by MxdColorBalanceCreate()
int MxdColorBalanceRemoveCallback ( MXDHANDLE  dhandle,
MICALLBACKLIST::CALLBACKFUNC  cbfunc,
void *  cbdata,
UINT32  reason 
)

Remove callback for color balance dialog.

Parameters:
dhandle Handle created by MxdColorBalanceCreate()
cbfunc Callback function
cbdata Callback "hook" data, must be same as when added
reason Reasons for which cbfunc() should get called, must be same as when added
int MxdColorBalanceSetParms ( MXDHANDLE  dhandle,
CBPARMS cbparms,
UINT32  flags 
)

Set the color balance parmameters.

Note, if you passed a non-NULL pointer for cbparms to MxdColorBalanceCreate, this function will set the structure that pointer pointed to.

Parameters:
dhandle Dialog handle
cbparms Parms to use
flags None yet. Just for future expansion.

Generated on Sun Oct 7 21:25:46 2012 for TNTsdk 2012 by  doxygen 1.6.1