DocumentationOverviewBuilding ASL Documentation Library Wiki Docs Indices Browse Perforce More InfoRelease NotesWiki Site Search License Success Stories Contributors MediaDownloadPerforce Depots SupportASL SourceForge HomeMailing Lists Discussion Forums Report Bugs Suggest Features Contribute to ASL RSSShort-text newsFull-text news File releases Other Adobe ProjectsAdobe AirAdobe GIL Adobe Labs Adobe Media Gallery Adobe XMP Tamarin project (Mozilla Foundation) Other ResourcesBoostRIAForge SGI STL |
dng_color_space.hGo to the documentation of this file.00001 /*****************************************************************************/ 00002 // Copyright 2006 Adobe Systems Incorporated 00003 // All Rights Reserved. 00004 // 00005 // NOTICE: Adobe permits you to use, modify, and distribute this file in 00006 // accordance with the terms of the Adobe license agreement accompanying it. 00007 /*****************************************************************************/ 00008 00009 /* $Id: //mondo/workarea/stern/camera_raw/dng_sdk/source/dng_color_space.h#8 $ */ 00010 /* $DateTime: 2008/03/22 14:45:32 $ */ 00011 /* $Change: 436777 $ */ 00012 /* $Author: stern $ */ 00013 00018 #ifndef __dng_color_space__ 00019 #define __dng_color_space__ 00020 00021 /*****************************************************************************/ 00022 00023 #include "dng_1d_function.h" 00024 #include "dng_classes.h" 00025 #include "dng_matrix.h" 00026 #include "dng_types.h" 00027 00028 /*****************************************************************************/ 00029 00031 00032 class dng_function_GammaEncode_sRGB: public dng_1d_function 00033 { 00034 00035 public: 00036 00037 virtual real64 Evaluate (real64 x) const; 00038 00039 virtual real64 EvaluateInverse (real64 y) const; 00040 00041 static const dng_1d_function & Get (); 00042 00043 }; 00044 00045 /*****************************************************************************/ 00046 00048 00049 class dng_function_GammaEncode_1_8: public dng_1d_function 00050 { 00051 00052 public: 00053 00054 virtual real64 Evaluate (real64 x) const; 00055 00056 virtual real64 EvaluateInverse (real64 y) const; 00057 00058 static const dng_1d_function & Get (); 00059 00060 }; 00061 00062 /*****************************************************************************/ 00063 00065 00066 class dng_function_GammaEncode_2_2: public dng_1d_function 00067 { 00068 00069 public: 00070 00071 virtual real64 Evaluate (real64 x) const; 00072 00073 virtual real64 EvaluateInverse (real64 y) const; 00074 00075 static const dng_1d_function & Get (); 00076 00077 }; 00078 00079 /*****************************************************************************/ 00080 00082 00083 class dng_color_space 00084 { 00085 00086 protected: 00087 00088 dng_matrix fMatrixToPCS; 00089 00090 dng_matrix fMatrixFromPCS; 00091 00092 public: 00093 00094 virtual ~dng_color_space (); 00095 00097 00098 const dng_matrix & MatrixToPCS () const 00099 { 00100 return fMatrixToPCS; 00101 } 00102 00104 00105 const dng_matrix & MatrixFromPCS () const 00106 { 00107 return fMatrixFromPCS; 00108 } 00109 00111 00112 bool IsMonochrome () const 00113 { 00114 return fMatrixToPCS.Cols () == 1; 00115 } 00116 00118 00119 virtual const dng_1d_function & GammaFunction () const; 00120 00122 00123 bool IsLinear () const 00124 { 00125 return GammaFunction ().IsIdentity (); 00126 } 00127 00129 00130 real64 GammaEncode (real64 x) const 00131 { 00132 return GammaFunction ().Evaluate (x); 00133 } 00134 00136 00137 real64 GammaDecode (real64 y) const 00138 { 00139 return GammaFunction ().EvaluateInverse (y); 00140 } 00141 00146 00147 virtual bool ICCProfile (uint32 &size, 00148 const uint8 *&data) const; 00149 00150 protected: 00151 00152 dng_color_space (); 00153 00154 void SetMonochrome (); 00155 00156 void SetMatrixToPCS (const dng_matrix_3by3 &M); 00157 00158 }; 00159 00160 /*****************************************************************************/ 00161 00163 00164 class dng_space_sRGB: public dng_color_space 00165 { 00166 00167 protected: 00168 00169 dng_space_sRGB (); 00170 00171 public: 00172 00174 00175 virtual const dng_1d_function & GammaFunction () const; 00176 00178 00179 virtual bool ICCProfile (uint32 &size, 00180 const uint8 *&data) const; 00181 00183 00184 static const dng_color_space & Get (); 00185 00186 }; 00187 00188 /*****************************************************************************/ 00189 00191 00192 class dng_space_AdobeRGB: public dng_color_space 00193 { 00194 00195 protected: 00196 00197 dng_space_AdobeRGB (); 00198 00199 public: 00200 00202 00203 virtual const dng_1d_function & GammaFunction () const; 00204 00206 00207 virtual bool ICCProfile (uint32 &size, 00208 const uint8 *&data) const; 00209 00211 00212 static const dng_color_space & Get (); 00213 00214 }; 00215 00216 /*****************************************************************************/ 00217 00219 00220 class dng_space_ColorMatch: public dng_color_space 00221 { 00222 00223 protected: 00224 00225 dng_space_ColorMatch (); 00226 00227 public: 00228 00230 00231 virtual const dng_1d_function & GammaFunction () const; 00232 00234 00235 virtual bool ICCProfile (uint32 &size, 00236 const uint8 *&data) const; 00237 00239 00240 static const dng_color_space & Get (); 00241 00242 }; 00243 00244 /*****************************************************************************/ 00245 00247 00248 class dng_space_ProPhoto: public dng_color_space 00249 { 00250 00251 protected: 00252 00253 dng_space_ProPhoto (); 00254 00255 public: 00256 00258 00259 virtual const dng_1d_function & GammaFunction () const; 00260 00262 00263 virtual bool ICCProfile (uint32 &size, 00264 const uint8 *&data) const; 00265 00267 00268 static const dng_color_space & Get (); 00269 00270 }; 00271 00272 /*****************************************************************************/ 00273 00275 00276 class dng_space_GrayGamma18: public dng_color_space 00277 { 00278 00279 protected: 00280 00281 dng_space_GrayGamma18 (); 00282 00283 public: 00284 00286 00287 virtual const dng_1d_function & GammaFunction () const; 00288 00290 00291 virtual bool ICCProfile (uint32 &size, 00292 const uint8 *&data) const; 00293 00295 00296 static const dng_color_space & Get (); 00297 00298 }; 00299 00300 /*****************************************************************************/ 00301 00303 00304 class dng_space_GrayGamma22: public dng_color_space 00305 { 00306 00307 protected: 00308 00309 dng_space_GrayGamma22 (); 00310 00311 public: 00312 00314 00315 virtual const dng_1d_function & GammaFunction () const; 00316 00318 00319 virtual bool ICCProfile (uint32 &size, 00320 const uint8 *&data) const; 00321 00323 00324 static const dng_color_space & Get (); 00325 00326 }; 00327 00328 /*****************************************************************************/ 00329 00330 class dng_space_fakeRGB: public dng_color_space 00331 { 00332 00333 protected: 00334 00335 dng_space_fakeRGB (); 00336 00337 public: 00338 00339 static const dng_color_space & Get (); 00340 00341 }; 00342 00343 /*****************************************************************************/ 00344 00345 #endif 00346 00347 /*****************************************************************************/ |