67 class colourspaceCanvas:
public wxCanvas
71 colourspaceCanvas(colourspaceFrame *parent, colourspace_params *p,
int x,
int y,
int w,
int h,
long style=0);
72 ~colourspaceCanvas(
void);
74 void enableOutlineSum(
bool enable);
75 void setDrawingFunction(
void);
79 void OnSize(
int w,
int h);
81 void OnEvent(wxMouseEvent &mevt);
85 static const int colcanv_cborder;
87 static const int colcanv_mheight;
92 int setupRectangle(
int &from,
int &to,
float &x, wxRect *rect);
93 void drawOutline(
double peak,
double sigma, wxPen *pen, wxRect *rect);
94 void drawOutlineSum(wxPen *pen, wxRect *rect);
96 double (*conversionFunction)(double, double, double);
98 colourspaceFrame *parentObj;
99 colourspace_params *params;
102 wxPen redPen, greenPen, bluePen, blackPen;
105 float height, base, step;
113 class colourspaceFrame:
public rviewFrame
117 colourspaceFrame(colourspaceMapper *parent,
const colourspace_params *p);
118 ~colourspaceFrame(
void);
120 void setRange(
double newMinVal,
double newMaxVal);
121 void unlinkParent(
void);
123 void OnSize(
int w,
int h);
126 int process(wxObject &obj, wxEvent &evt);
128 void updateSettings(
void);
129 void updateDisplay(
const colourspace_params *cp=NULL);
130 void processMouseEvent(wxMouseEvent &mevt);
132 virtual const char *getFrameName(
void)
const;
133 virtual rviewFrameType getFrameType(
void)
const;
137 static const int colspc_border;
139 static const int colspc_width;
140 static const int colspc_height;
142 static const int colspc_bwidth;
143 static const int colspc_bheight;
145 static const int colspc_twidth;
146 static const int colspc_theight;
148 static const int colspc_chkheight;
150 static const int colspc_chwidth;
151 static const int colspc_chheight;
153 static const int colspc_cheight;
158 void makeUpdate(
void);
160 colourspaceMapper *parentObj;
161 colourspace_params newParams;
162 colourspace_params origParams;
164 colourspaceCanvas *canvas;
166 rviewText *posR, *posG, *posB;
167 rviewText *sigR, *sigG, *sigB;
168 rviewButton *okBut, *cancelBut, *defaultBut;
169 rviewCheckBox *immediateUpdate;
170 rviewCheckBox *drawSum;
171 rviewText *minVal, *maxVal;
173 bool doImmediateUpdate;
176 float mousex, mousey;
185 #define CSPACE_RANGE_ACTUAL 0
186 #define CSPACE_RANGE_FULL 1
187 #define CSPACE_RANGE_OLD 2
193 class colourspaceMapper
197 colourspaceMapper(r_Ref<r_GMarray> &mdd, rviewBaseType bt,
const colourspace_params *cp,
bool fullrange=
FALSE,
const r_Minterval *domain=NULL,
unsigned long frange=0x10000);
198 ~colourspaceMapper(
void);
200 void getObject(r_Ref<r_GMarray> &mdd, rviewBaseType &bt,
bool *fullrange=NULL, r_Minterval **domain=NULL)
const;
201 int bindMapper(r_Ref<r_GMarray> &mdd, rviewBaseType bt,
bool fullrange=
FALSE,
const r_Minterval *domain=NULL,
const colourspace_params *cp=NULL);
203 inline unsigned short ValToCS15(
double value)
205 return (this->*convert15)(value);
207 inline unsigned long ValToCS24(
double value)
209 return (this->*convert24)(value);
211 unsigned short *buildCSTab15(
bool forceRebuild=
FALSE);
212 unsigned long *buildCSTab24(
bool forceRebuild=
FALSE);
213 double getMinVal(
void);
214 double getMaxVal(
void);
215 double getScalingFactor(
void);
216 unsigned short *getCSTab15(
void);
217 unsigned long *getCSTab24(
void);
218 void processRange(
int rangeMode);
219 void updateProjection(
const r_Minterval *domain);
220 void colourspaceChanged(
const colourspace_params *newParams,
bool autoUpdate=
TRUE);
221 void openEditor(
void);
222 void closeEditor(
bool activeClose=
TRUE);
223 void getParameters(colourspace_params *dest);
224 void setMappingFunctions(
void);
229 static int getTableForType(rviewBaseType bt);
231 unsigned short ValToGauss15(
double value);
232 unsigned long ValToGauss24(
double value);
233 unsigned short ValToLinear15(
double value);
234 unsigned long ValToLinear24(
double value);
235 unsigned short ValToRectangle15(
double value);
236 unsigned long ValToRectangle24(
double value);
237 unsigned short ValToAsymptotic15(
double value);
238 unsigned long ValToAsymptotic24(
double value);
240 unsigned short (colourspaceMapper::*convert15)(
double value);
241 unsigned long (colourspaceMapper::*convert24)(
double value);
243 colourspace_params par;
244 double realMinVal, realMaxVal;
247 double peakR, peakG, peakB;
248 double invSigR, invSigG, invSigB;
249 double scalingFactor;
252 unsigned short *IntToRGBTab15;
253 unsigned long *IntToRGBTab24;
254 cspaceType tableType;
255 colourspaceFrame *csFrame;
256 r_Ref<r_GMarray> mddObj;
257 rviewBaseType baseType;
259 r_Minterval objInterv;
260 r_Minterval lastInterv;
261 const r_Minterval *useInterv;
#define FALSE
Definition: defs.h:70
#define TRUE
Definition: defs.h:67