1 /*******************************************************************************
2 **
3 ** Photivo
4 **
5 ** Copyright (C) 2008,2009 Jos De Laender <jos.de_laender@telenet.be>
6 ** Copyright (C) 2009,2010 Michael Munzert <mail@mm-log.com>
7 **
8 ** This file is part of Photivo.
9 **
10 ** Photivo is free software: you can redistribute it and/or modify
11 ** it under the terms of the GNU General Public License version 3
12 ** as published by the Free Software Foundation.
13 **
14 ** Photivo is distributed in the hope that it will be useful,
15 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 ** GNU General Public License for more details.
18 **
19 ** You should have received a copy of the GNU General Public License
20 ** along with Photivo.  If not, see <http://www.gnu.org/licenses/>.
21 **
22 *******************************************************************************/
23 
24 #ifndef PTCONSTANTS_H
25 #define PTCONSTANTS_H
26 
27 //==============================================================================
28 
29 #include <lcms2.h>
30 #include <lensfun.h>
31 
32 #include <QString>
33 
34 //==============================================================================
35 
36 /* !!!
37   IMPORTANT: Photivo uses groups of const short for historical reasons.
38   They are deprecated for new constants groups! Instead use enums or, even better,
39   C++11 enum classes.
40   Up to at least v2.5 beta Qt Creator does not support enum classes properly.
41   Do not let red error underlining impress you. Compiling works fine. ;)
42 !!! */
43 
44 //==============================================================================
45 
46 const char ProgramName[] = "Photivo";
47 const char CompanyName[] = "http://photivo.org/";
48 
49 const int PhotivoSettingsVersion = 1;
50 
51 struct ptFiles {
52   QString GlobalIni;
53   QString TagsIni;
54 };
55 const ptFiles PhotivoFile = { "photivo.ini",
56                               "tags.ini"};
57 
58 //==============================================================================
59 
60 // Mathematical constants.
61 const double ptPI     = 3.14159265358979323846264338327950288419716939937510;
62 const double ptSQ2PI  = 2.50662827463100024161235523934010416269302368164062;
63 const float  pt2PI    = 6.28318530717f;
64 
65 // Some program limits.
66 const short ptMaxAnchors    = 50; // Curve anchors.
67 const short ptMaxInputFiles = 2048;
68 
69 // White point
70 const uint16_t ptWP    = 0xffff;
71 const float    ptWPf   = (float)ptWP;
72 const float    ptInvWP = 1.0f/(float)ptWP;
73 
74 const uint16_t ptWPH   = 0x7fff;
75 const float    ptWPHf  = (float)ptWPH;
76 
77 // Neutral AB value
78 const float ptWPHLab = 0x8080;
79 
80 /*! Processor phases.
81     Don't mess with the numbers of any of those constants.
82     Often they are relied upon, for instance as index in an array.
83     Or the numbers are assumptions from dcraw.
84 */
85 const short ptProcessorPhase_Raw           = 1;   // dcraw
86   // subphases of Raw
87   const short ptProcessorPhase_Load          = 1; // Same constant, subphase !
88   const short ptProcessorPhase_Demosaic      = 2; // Same constant, subphase !
89   const short ptProcessorPhase_Highlights    = 3; // Same constant, subphase !
90 const short ptProcessorPhase_LocalEdit     = 2;
91 const short ptProcessorPhase_Geometry      = 3;
92 const short ptProcessorPhase_RGB           = 4;
93 const short ptProcessorPhase_LabCC         = 5;
94 const short ptProcessorPhase_LabSN         = 6;
95 const short ptProcessorPhase_LabEyeCandy   = 7;
96 const short ptProcessorPhase_EyeCandy      = 8;
97 const short ptProcessorPhase_Output        = 9;
98 // special phases, not your usual pipe run
99 const short ptProcessorPhase_Preview       = 10; // escape characters
100 const short ptProcessorPhase_OnlyHistogram = 11;
101 const short ptProcessorPhase_WriteOut      = 12;
102 const short ptProcessorPhase_ToGimp        = 13;
103 
104 // if stop is set, we have no console output of processing, to prevent
105 // spamming while crop preview
106 enum class ptProcessorStopBefore {
107   NoStop       = 0,
108   SpotTuning   = 1,
109   SpotRepair   = 2,
110   Rotate       = 3,
111   Crop         = 4
112 };
113 
114 // Processor modes.
115 
116 const short ptProcessorMode_Preview     = 0;
117 const short ptProcessorMode_Full        = 1;
118 const short ptProcessorMode_Thumb       = 2;
119 
120 // Run modes.
121 
122 const short ptRunMode_None     = 0;
123 const short ptRunMode_Once     = 1;
124 const short ptRunMode_Auto     = 2;
125 
126 // Color spaces.
127 
128 const short ptSpace_sRGB_D65         = 1;
129 const short ptSpace_AdobeRGB_D65     = 2;
130 const short ptSpace_WideGamutRGB_D50 = 3;
131 const short ptSpace_ProPhotoRGB_D50  = 4;
132 const short ptSpace_Lab              = 10;
133 const short ptSpace_XYZ              = 11;
134 const short ptSpace_LCH              = 15;
135 const short ptSpace_Profiled         = 20;
136 
137 // Color profiles.
138 
139 const short ptCameraColor_Flat              = 0;
140 const short ptCameraColor_Adobe_Matrix      = 1;
141 const short ptCameraColor_Adobe_Profile     = 2;
142 const short ptCameraColor_Embedded          = 3;
143 const short ptCameraColor_Profile           = 4;
144 
145 const short ptCameraColorGamma_None     = 0;
146 const short ptCameraColorGamma_sRGB     = 1;
147 const short ptCameraColorGamma_BT709    = 2;
148 const short ptCameraColorGamma_Pure22   = 3;
149 
150 const short ptScreenColor_Profile    = 20;/* Avoid collision with RGB or LAB */
151 const short ptOutputColor_Profile    = 21;/* Avoid collision with RGB or LAB */
152 
153 const short ptCMQuality_NoOptimize         = 0;
154 const short ptCMQuality_HighResPreCalc     = 1;
155 const short ptCMQuality_FastSRGB           = 2;
156 
157 // Size of the pipe.
158 
159 const short ptPipeSize_Thirtyfour    = 5;
160 const short ptPipeSize_Sixteen       = 4;
161 const short ptPipeSize_Eighth        = 3;
162 const short ptPipeSize_Quarter       = 2; // Relying on this values for shift.
163 const short ptPipeSize_Half          = 1;
164 const short ptPipeSize_Full          = 0;
165 
166 // Way of viewing.
167 
168 const short ptPreviewMode_End        = 0;
169 const short ptPreviewMode_Tab        = 1;
170 
171 // Histogram Channels
172 
173 const short ptHistogramChannel_R     = 1; // Be aware : encoded values !
174 const short ptHistogramChannel_G     = 2;
175 const short ptHistogramChannel_B     = 4;
176 const short ptHistogramChannel_RGB   = 7;
177 
178 // Histogram Gamma Mode
179 const short ptHistogramMode_Linear  = 0;
180 const short ptHistogramMode_Preview = 1;
181 const short ptHistogramMode_Output  = 2;
182 
183 // Style
184 const short ptStyle_None            = 0;
185 const short ptStyle_Normal          = 1;
186 const short ptStyle_50Grey          = 2;
187 const short ptStyle_DarkGrey        = 3;
188 const short ptStyle_VeryDark        = 4;
189 
190 // Style highlight color
191 const short ptStyleHighLight_White    = 0;
192 const short ptStyleHighLight_Purple   = 1;
193 const short ptStyleHighLight_Blue     = 2;
194 const short ptStyleHighLight_Green    = 3;
195 const short ptStyleHighLight_Orange   = 4;
196 
197 // Starup UI mode
198 const short ptStartupUIMode_Tab       = 0;
199 const short ptStartupUIMode_Favourite = 1;
200 const short ptStartupUIMode_AllTools  = 2;
201 
202 // local adjust modes
203 enum ptLocalAdjustMode {
204   lamFloodFill    = 0,
205   lamSearch       = 1
206 };
207 
208 // Lensfun
209 const short ptLfunCAModel_None        = LF_TCA_MODEL_NONE;
210 const short ptLfunCAModel_Linear      = LF_TCA_MODEL_LINEAR;
211 const short ptLfunCAModel_Poly3       = LF_TCA_MODEL_POLY3;
212 
213 const short ptLfunVignetteModel_None  = LF_VIGNETTING_MODEL_NONE;
214 const short ptLfunVignetteModel_Poly6 = LF_VIGNETTING_MODEL_PA;
215 
216 const short ptLfunGeo_Unknown         = LF_UNKNOWN;
217 const short ptLfunGeo_Rectilinear     = LF_RECTILINEAR;
218 const short ptLfunGeo_Fisheye         = LF_FISHEYE;
219 const short ptLfunGeo_Panoramic       = LF_PANORAMIC;
220 const short ptLfunGeo_Equirectangular = LF_EQUIRECTANGULAR;
221 
222 const short ptLfunDistModel_None      = LF_DIST_MODEL_NONE;
223 const short ptLfunDistModel_Poly3     = LF_DIST_MODEL_POLY3;
224 const short ptLfunDistModel_Poly5     = LF_DIST_MODEL_POLY5;
225 #if LF_VERSION < (3 << 16)
226 const short ptLfunDistModel_Fov1      = LF_DIST_MODEL_FOV1;
227 #endif
228 const short ptLfunDistModel_PTLens    = LF_DIST_MODEL_PTLENS;
229 
230 
231 // White balances.
232 
233 const short ptWhiteBalance_Camera    = 0;
234 const short ptWhiteBalance_Auto      = 1;
235 const short ptWhiteBalance_Spot      = 2;
236 const short ptWhiteBalance_Manual    = 3;
237 
238 // CA correction
239 
240 const short ptCACorrect_Off          = 0;
241 const short ptCACorrect_Auto         = 1;
242 const short ptCACorrect_Manual       = 2;
243 
244 // Interpolations.
245 
246 const short ptInterpolation_Linear   = 0;
247 const short ptInterpolation_VNG      = 1;
248 const short ptInterpolation_VNG4     = 2;
249 const short ptInterpolation_PPG      = 3;
250 const short ptInterpolation_AHD      = 4;
251 const short ptInterpolation_DCB      = 5;
252 const short ptInterpolation_DCBSoft  = 6;
253 const short ptInterpolation_DCBSharp = 7;
254 const short ptInterpolation_AHD_mod  = 8;
255 const short ptInterpolation_VCD      = 9;
256 const short ptInterpolation_LMMSE    = 10;
257 const short ptInterpolation_AMaZE    = 11;
258 const short ptInterpolation_Bayer    = 12;
259 
260 // Bayer Denoise
261 
262 const short ptBayerDenoise_None       = 0;
263 const short ptBayerDenoise_FBDD1      = 1;
264 const short ptBayerDenoise_FBDD2      = 2;
265 
266 // Clip modes;
267 const short ptClipMode_Clip          = 0;
268 const short ptClipMode_NoClip        = 1;
269 const short ptClipMode_Lab           = 2;
270 const short ptClipMode_HSV           = 3;
271 const short ptClipMode_Blend         = 4;
272 const short ptClipMode_Rebuild       = 5;
273 
274 // Aspect Ratio modes
275 
276 const short ptAspectRatio_Free      = 0;
277 const short ptAspectRatio_Original  = 1;
278 const short ptAspectRatio_Manual    = 2;
279 
280 // Crop/Selection rectangle guidelines modes
281 
282 const short ptGuidelines_None        = 0;
283 const short ptGuidelines_RuleThirds  = 1;
284 const short ptGuidelines_GoldenRatio = 2;
285 const short ptGuidelines_Diagonals   = 3;
286 const short ptGuidelines_Centerlines = 4;
287 
288 // Lights Out modes
289 
290 const short ptLightsOutMode_None    = 0;
291 const short ptLightsOutMode_Dimmed  = 1;
292 const short ptLightsOutMode_Black   = 2;
293 
294 enum class TExposureClipMode: int {
295   Hard,
296   Ratio,
297   FilmCurve
298 };
299 
300 // Curves.
301 
302 // Beware the “channel”. It’s a historical name and not accurate anymore. Read: “curve type”
303 const short ptCurveChannel_RGB               = 0;
304 const short ptCurveChannel_R                 = 1;
305 const short ptCurveChannel_G                 = 2;
306 const short ptCurveChannel_B                 = 3;
307 const short ptCurveChannel_L                 = 4;
308 const short ptCurveChannel_a                 = 5;
309 const short ptCurveChannel_b                 = 6;
310 const short ptCurveChannel_Saturation        = 7;
311 const short ptCurveChannel_Base              = 8;
312 const short ptCurveChannel_Base2             = 9;
313 const short ptCurveChannel_LByHue            = 10;
314 const short ptCurveChannel_Texture           = 11;
315 const short ptCurveChannel_ShadowsHighlights = 12;
316 const short ptCurveChannel_Denoise           = 13;
317 const short ptCurveChannel_Hue               = 14;
318 const short ptCurveChannel_Denoise2          = 15;
319 const short ptCurveChannel_Outline           = 16;
320 const short ptCurveChannel_SpotLuma          = 17;
321 
322 const short ptCurveType_Full         = 0;
323 const short ptCurveType_Anchor       = 1;
324 
325 const short ptCurveChoice_None       = 0;
326 const short ptCurveChoice_Manual     = 1;
327 const short ptCurveChoice_File       = 2;
328 
329 // Curve Interpolation Type
330 
331 const short ptCurveIT_Spline = 0;
332 const short ptCurveIT_Linear = 1;
333 const short ptCurveIT_Cosine = 2;
334 
335 enum class TGreyCInterpol: int {
336   NearestNeighbour,
337   Linear,
338   RungeKutta
339 };
340 
341 enum class TGreyCDenoiseMask: int {
342   All,
343   Shadows1,
344   Shadows2,
345   Shadows3,
346   Shadows4,
347   Shadows5
348 };
349 
350 // FlipModes
351 
352 const short ptFlipMode_None       = 0;
353 const short ptFlipMode_Horizontal = 1;
354 const short ptFlipMode_Vertical   = 2;
355 
356 enum class TGradualBlurMode: int {
357   // There used to be an unused "none" mode with value 0. For settings compatibility
358   // values need to start at 1.
359   Linear       = 1,
360   Vignette     = 2,
361   LinearMask   = 3,
362   VignetteMask = 4
363 };
364 
365 enum class TGrainType: int {
366   // ptImage::Grain() relies on the integer values! Do not change them!
367   SoftGaussian   = 0,
368   SoftUniform    = 1,
369   SoftSaltPepper = 2,
370   HardGaussian   = 3,
371   HardUniform    = 4,
372   HardSaltPepper = 5
373 };
374 
375 // GradientModes
376 
377 const short ptGradientMode_Backward    = 0;
378 const short ptGradientMode_Centered    = 1;
379 const short ptGradientMode_Forward     = 2;
380 const short ptGradientMode_Sobel       = 3;
381 const short ptGradientMode_RotInv      = 4;
382 const short ptGradientMode_Deriche     = 5;
383 
384 enum class TMaskType: int {
385   Disabled    = 0,
386   Shadows     = 1,
387   Midtones    = 2,
388   Highlights  = 3,
389   All         = 4,
390   Screen      = 5,
391   Multiply    = 6,
392   GammaBright = 12, // keep in sync with overlay mode of same name
393   GammaDark   = 13  // keep in sync with overlay mode of same name
394 };
395 
396 const short ptSaturationMode_Absolute = 0;
397 const short ptSaturationMode_Adaptive = 1;
398 
399 
400 // Special Preview
401 
402 const short ptSpecialPreview_RGB       = 0;
403 const short ptSpecialPreview_L         = 1;
404 const short ptSpecialPreview_Gradient  = 2;
405 const short ptSpecialPreview_Structure = 3;
406 const short ptSpecialPreview_A         = 4;
407 const short ptSpecialPreview_B         = 5;
408 
409 // LABTransform
410 
411 const short ptLABTransform_L  = 0;
412 const short ptLABTransform_R  = 1;
413 const short ptLABTransform_G  = 2;
414 const short ptLABTransform_B  = 3;
415 
416 enum class TViewLabChannel: int {
417   Lab,
418   L,
419   a,
420   b,
421   LStructure,
422   C,
423   H
424 };
425 
426 // Enable (DEPRECATED! To be replaced by TFilterMode)
427 
428 const short ptEnable_None      = 0;
429 const short ptEnable_NoPreview = 1;
430 const short ptEnable_Preview   = 2;
431 const short ptEnable_ShowMask  = 3;
432 
433 enum class TFilterMode: int {
434   Disabled,
435   FinalRun,
436   AlwaysOn,
437   ShowMask
438 };
439 
440 enum class TBWFilmType: int {
441   // There used to be an unused "none" value. Integer representation needs to start at
442   // 1 for settings compatibility.
443   LowSensitivity    = 1,
444   HighSensitivity   = 2,
445   Hyperpanchromatic = 3,
446   Orthochromatic    = 4,
447   NormalContrast    = 5,
448   HighContrast      = 6,
449   Luminance         = 7,
450   Landscape         = 8,
451   FaceInterior      = 9,
452   ChannelMixer      = 10
453 
454 };
455 
456 enum class TBWColorFilter: int {
457   None,
458   Red,
459   Orange,
460   Yellow,
461   Lime,
462   Green,
463   Blue,
464   FakeIR
465 };
466 
467 enum class TCrossProcessMode: int {
468   Disabled,
469   GreenYellow,
470   GreenCyan,
471   RedYellow,
472   RedMagenta,
473   BlueCyan,
474   BlueMagenta
475 };
476 
477 enum class TOverlayMode: int {
478   Disabled,
479   Softlight,
480   Multiply,
481   Screen,
482   Normal,
483   Lighten,
484   Overlay,
485   GrainMerge,
486   ShowMask,
487   Replace,
488   ColorDodge,
489   ColorBurn,
490   GammaDark,
491   GammaBright,
492   Darken
493 };
494 
495 enum class TTextureOverlayMaskMode: int {
496   Full,
497   Vignette,
498   InvVignette
499 };
500 
501 enum class TVignetteMask: int {
502   Disabled,
503   Soft,
504   Hard,
505   Fancy,
506   ShowMask
507 };
508 
509 enum class TVignetteShape: int {
510   // ptImage::GetVignetteMask relies on the integer values. Do not change them.
511   Diamond = 1,
512   Circle  = 2,
513   Rect1   = 3,
514   Rect2   = 4,
515   Rect3   = 5,
516   Rect4   = 6,
517   Rect5   = 7,
518   Rect6   = 8,
519   Rect7   = 9,
520   Rect8   = 10
521 };
522 
523 enum class TSoftglowMode: int {
524   Disabled,
525   Lighten,
526   Screen,
527   Softlight,
528   Normal,
529   OrtonScreen,
530   OrtonSoftlight
531 };
532 
533 // Output formats.
534 
535 const short ptSaveFormat_PPM8  = 0;
536 const short ptSaveFormat_PPM16 = 1;
537 const short ptSaveFormat_TIFF8 = 2;
538 const short ptSaveFormat_TIFF16= 3;
539 const short ptSaveFormat_JPEG  = 4;
540 const short ptSaveFormat_PNG   = 5;
541 const short ptSaveFormat_PNG16 = 6;
542 
543 // Sampling for JPEG
544 
545 const short ptSaveSampling_111 = 0;
546 const short ptSaveSampling_211 = 1;
547 
548 // Output modes
549 
550 const short ptOutputMode_Full = 0;
551 const short ptOutputMode_Pipe = 1;
552 const short ptOutputMode_Jobfile = 2;
553 const short ptOutputMode_Settingsfile = 3;
554 const short ptOutputMode_Batch = 4;
555 
556 // Export modes
557 
558 const short ptExportMode_GimpFull = 0;
559 const short ptExportMode_GimpPipe = 1;
560 
561 // Reset modes
562 
563 const short ptResetMode_Full = 0;
564 const short ptResetMode_User = 1;
565 const short ptResetMode_OpenPreset = 2;
566 const short ptResetMode_OpenSettings = 3;
567 
568 // Gui Tabs.
569 
570 const short ptGenericTab      = 0;
571 const short ptCameraTab       = 1;
572 const short ptLocalTab        = 2;
573 const short ptGeometryTab     = 3;
574 const short ptRGBTab          = 4;
575 const short ptLabCCTab        = 5;
576 const short ptLabSNTab        = 6;
577 const short ptEyeCandyTab     = 7;
578 const short ptLabEyeCandyTab  = 8;
579 const short ptOutTab          = 9;
580 
581 // Resize filters
582 
583 const short ptResizeFilter_Box              = 0;
584 const short ptResizeFilter_Triangle         = 1;
585 const short ptResizeFilter_Quadratic        = 2;
586 const short ptResizeFilter_CubicBSpline     = 3;
587 const short ptResizeFilter_QuadraticBSpline = 4;
588 const short ptResizeFilter_CubicConvolution = 5;
589 const short ptResizeFilter_Lanczos3         = 6;
590 const short ptResizeFilter_Mitchell         = 7;
591 const short ptResizeFilter_CatmullRom       = 8;
592 const short ptResizeFilter_Cosine           = 9;
593 const short ptResizeFilter_Bell             = 10;
594 const short ptResizeFilter_Hermite          = 11;
595 
596 // Resize filters for Imagemagick
597 
598 const short ptIMFilter_Point     = 0;
599 const short ptIMFilter_Box       = 1;
600 const short ptIMFilter_Triangle  = 2;
601 const short ptIMFilter_Hermite   = 3;
602 const short ptIMFilter_Hanning   = 4;
603 const short ptIMFilter_Hamming   = 5;
604 const short ptIMFilter_Blackman  = 6;
605 const short ptIMFilter_Gaussian  = 7;
606 const short ptIMFilter_Quadratic = 8;
607 const short ptIMFilter_Cubic     = 9;
608 const short ptIMFilter_Catrom    = 10;
609 const short ptIMFilter_Mitchell  = 11;
610 const short ptIMFilter_Lanczos   = 12;
611 //const short ptIMFilter_Bessel    = 13;
612 //const short ptIMFilter_Sinc      = 14;
613 
614 // Resize modes
615 const short ptResizeDimension_LongerEdge  = 0;
616 const short ptResizeDimension_Width       = 1;
617 const short ptResizeDimension_Height      = 2;
618 const short ptResizeDimension_WidthHeight = 3;
619 
620 // Liquid rescale energies
621 const short ptLqr_Disabled         = 0;
622 const short ptLqr_GradXabs         = 1;
623 const short ptLqr_GradSumabs       = 2;
624 const short ptLqr_GradNorm         = 3;
625 const short ptLqr_LumaGradXabs     = 4;
626 const short ptLqr_LumaGradSumabs   = 5;
627 const short ptLqr_LumaGradNorm     = 6;
628 
629 // Liquid rescale scaling
630 const short ptLqr_ScaleRelative    = 0;
631 const short ptLqr_ScaleAbsolute    = 1;
632 
633 // Spot repair algos
634 // indexes MUST be consecutive integers starting from 0
635 enum ptSpotRepairAlgo {
636   SpotRepairAlgo_Clone = 0,
637   SpotRepairAlgo_Heal  = 1
638 };
639 
640 // Zoom modes
641 const short ptZoomMode_Fit    = 0;
642 const short ptZoomMode_NonFit = 1;
643 
644 // Zoom levels
645 const short ptZoomLevel_Current = 0;
646 const short ptZoomLevel_Fit     = 1;
647 const short ptZoomLevel_5       = 5;
648 const short ptZoomLevel_10      = 10;
649 const short ptZoomLevel_20      = 20;
650 const short ptZoomLevel_25      = 25;
651 const short ptZoomLevel_33      = 33;
652 const short ptZoomLevel_50      = 50;
653 const short ptZoomLevel_66      = 66;
654 const short ptZoomLevel_100     = 100;
655 const short ptZoomLevel_150     = 150;
656 const short ptZoomLevel_200     = 200;
657 const short ptZoomLevel_300     = 300;
658 const short ptZoomLevel_400     = 400;
659 
660 // Status overlay modes
661 const short ptStatus_Done = 0;
662 const short ptStatus_Updating = 1;
663 const short ptStatus_Processing = 2;
664 
665 // Gui events : timeout filter
666 // 1s after releasing input arrows, processing will be triggered.
667 // Should be working also for sufficiently fast typing :)
668 const short ptTimeout_Input = 300;
669 
670 // Gui Elements
671 const short ptGT_None            = 0;
672 const short ptGT_Input           = 1;
673 const short ptGT_InputSlider     = 2;
674 const short ptGT_InputSliderHue  = 3;
675 const short ptGT_Choice          = 4;
676 const short ptGT_Check           = 5;
677 
678 // Warning values;
679 const short ptWarning_Argument      = 2;
680 const short ptWarning_Exiv2         = 8;
681 
682 // Error values.
683 const short ptError_FileOpen        = 1;
684 const short ptError_Argument        = 2;
685 const short ptError_Spline          = 3;
686 const short ptError_FileFormat      = 4;
687 const short ptError_Profile         = 5;
688 const short ptError_NotForeseen     = 6;
689 const short ptError_lcms            = 7;
690 const short ptError_Lensfun         = 8;
691 
692 // Matrices to transform from XYZ to RGB space.
693 // For different RGB spaces.
694 // XYZ = Matrix * RGB
695 // Dummy : Index 0 : don't use => 0
696 // ptSpace_sRGB_D65=1
697 // ptSpace_AdobeRGB_D65 = 2
698 // ptSpace_WideGamutRGB_D50 = 3
699 // ptSpace_ProPhotoRGB_D50 = 4
700 
701 const double MatrixRGBToXYZ [5][3][3] =
702   {
703   // Dummy : Index 0 : don't use => 0
704   {
705   {0.0,0.0,0.0},
706   {0.0,0.0,0.0},
707   {0.0,0.0,0.0}
708   },
709 
710   //ptSpace_sRGB_D65=1
711 
712   {
713   {0.412424  , 0.357579  , 0.180464},
714   {0.212656  , 0.715158  , 0.0721856},
715   {0.0193324 , 0.119193  , 0.950444}
716   },
717 
718   // ptSpace_AdobeRGB_D65 = 2
719   {
720   {0.576700  , 0.185556  , 0.188212},
721   {0.297361  , 0.627355  , 0.0752847},
722   {0.0270328 , 0.0706879 , 0.991248}
723   },
724 
725   // ptSpace_WideGamutRGB_D50 = 3
726   {
727   {0.716105  , 0.100930  , 0.147186},
728   {0.258187  , 0.724938  , 0.0168748},
729   {0.000000  , 0.0517813 , 0.773429}
730   },
731 
732   // ptSpace_ProPhotoRGB_D50 = 4
733   {
734   {0.797675  , 0.135192  , 0.0313534},
735   {0.288040  , 0.711874  , 0.000086},
736   {0.000000  , 0.000000  , 0.825210}
737   }
738   };
739 
740 // Matrices to transform from RGB to XYZ space.
741 // For different RGB spaces.
742 // RGB = Matrix * XYZ
743 
744 const double MatrixXYZToRGB [5][3][3] =
745   {
746   // Dummy : Index 0 : don't use => 0
747   {
748   {0.0,0.0,0.0},
749   {0.0,0.0,0.0},
750   {0.0,0.0,0.0}
751   },
752 
753   //ptSpace_sRGB_D65=1
754   {
755   { 3.24071   ,-1.53726   ,-0.498571},
756   {-0.969258  , 1.87599   , 0.0415557},
757   { 0.0556352 ,-0.203996  , 1.05707}
758   },
759 
760   // ptSpace_AdobeRGB_D65 = 2
761   {
762   { 2.04148   ,-0.564977  ,-0.344713},
763   {-0.969258  , 1.87599   , 0.0415557},
764   { 0.0134455 ,-0.118373  , 1.01527}
765   },
766 
767   // ptSpace_WideGamutRGB_D50 = 3
768   {
769   { 1.46281   ,-0.184062  ,-0.274361},
770   {-0.521793  , 1.44724   , 0.0677228},
771   { 0.0349342 ,-0.0968931 , 1.28841}
772   },
773 
774   // ptSpace_ProPhotoRGB_D50 = 4
775   {
776   { 1.34594   ,-0.255608  ,-0.0511118},
777   {-0.544599  , 1.50817   , 0.0205351},
778   { 0.000000  , 0.000000  , 1.21181}
779   }
780   };
781 
782 const double MatrixBradfordD50ToD65[3][3] =
783   {
784   { 0.955577  , -0.023039 , 0.063164},
785   {-0.028290  ,  1.009941 , 0.021007},
786   { 0.012298  , -0.020483 , 1.329910}
787   };
788 
789 // RGB Primaries for the different color spaces.
790 // Same indexing as matrices, also with index 0 being dummy.
791 
792 const cmsCIExyYTRIPLE RGBPrimaries[5] =
793   {
794   // Dummy : Index 0 : don't use => 0
795   {
796   {0.0,0.0,0.0},
797   {0.0,0.0,0.0},
798   {0.0,0.0,0.0}
799   },
800 
801   //ptSpace_sRGB_D65=1
802   {
803   {0.6400, 0.3300, 0.212656},
804   {0.3000, 0.6000, 0.715158},
805   {0.1500, 0.0600, 0.072186}
806   },
807 
808   // ptSpace_AdobeRGB_D65 = 2
809   {
810   {0.6400, 0.3300, 0.297361},
811   {0.2100, 0.7100, 0.627355},
812   {0.1500, 0.0600, 0.075285}
813   },
814 
815   // ptSpace_WideGamutRGB_D50 = 3
816   {
817   {0.7350, 0.2650, 0.258187},
818   {0.1150, 0.8260, 0.724938},
819   {0.1570, 0.0180, 0.016875}
820   },
821   //
822   // ptSpace_ProPhotoRGB_D50 = 4
823   {
824   {0.7347, 0.2653, 0.288040},
825   {0.1596, 0.8404, 0.711874},
826   {0.0366, 0.0001, 0.000086}
827   }
828   };
829 
830 // D50 and D65 references.
831 
832 const double D50Reference[3] = {0.96422,  1.0, 0.82521};
833 const double D65Reference[3] = {0.950456, 1.0, 1.088754};
834 
835 // Possible tool states
836 
837 enum ptToolState {
838   tsHidden = 0,
839   tsNormal = 1,
840   tsFavourite = 2
841 };
842 
843 /*! General status return values.
844   If you add more states make sure to use values >= 2. */
845 enum ptStatus {
846   stUndetermined = -1,
847   stSuccess = 0,
848   stFailure = 1
849 };
850 
851 /*! This enum defines the available methods for blocking and unblocking tools. */
852 enum ptBlockToolsMode {
853   btmUnblock             = 0,
854   btmBlockAll            = 1,
855   btmBlockForCrop        = 2,
856   btmBlockForSpotRepair  = 3,
857   btmBlockForSpotTuning = 4
858 };
859 
860 /*! This enum defines the different modes for loading a pipe configuration
861   (preset or settings file). */
862 enum ptLoadCfgMode {
863   lcmGeneralCfg     = 0,
864   lcmNeutralPreset  = 1,
865   lcmStartupPreset  = 2,
866   lcmPresetFile     = 3,
867   lcmSettingsFile   = 4
868 };
869 
870 /*! This enum defines the possible types of images.
871     When you add new types make sure that error types have negative values and
872     valid types have positive values.
873 */
874 enum ptImageType {
875   itNotSupported  = -1,
876   itUndetermined  = 0,
877   itRaw           = 1,
878   itBitmap        = 2
879 };
880 
881 /*! This enum defines the type of a file system object. */
882 enum ptFSOType {
883   fsoUnknown    = 0,
884   fsoFile       = 1,
885   fsoDir        = 2,
886   fsoParentDir  = 3,
887   fsoRoot       = 4,   // "My Computer" on Windows, "/" on Linux
888   fsoDrive      = 5    // A drive with an assigned letter, only relevant on Windows
889 };
890 
891 /*! This enum defines the state of the UI. */
892 enum ptUIState {
893   uisNone       = 0,
894   uisProcessing = 1,
895   uisFileMgr    = 2,
896   uisBatch      = 3
897 };
898 
899 /*! This enum defines types of autosaving current batch list. */
900 enum ptBatchSaveFile {
901   bsfStandard = 0,
902   bsfLocal    = 1
903 };
904 
905 
906 //==============================================================================
907 #endif
908