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_render.hGo to the documentation of this file.00001 /*****************************************************************************/ 00002 // Copyright 2006-2007 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_render.h#6 $ */ 00010 /* $DateTime: 2007/12/05 09:51:03 $ */ 00011 /* $Change: 403668 $ */ 00012 /* $Author: stern $ */ 00013 00018 /*****************************************************************************/ 00019 00020 #ifndef __dng_render__ 00021 #define __dng_render__ 00022 00023 /*****************************************************************************/ 00024 00025 #include "dng_1d_function.h" 00026 #include "dng_auto_ptr.h" 00027 #include "dng_classes.h" 00028 #include "dng_spline.h" 00029 #include "dng_xy_coord.h" 00030 00031 /******************************************************************************/ 00032 00034 00035 class dng_function_exposure_ramp: public dng_1d_function 00036 { 00037 00038 public: 00039 00040 real64 fSlope; // Slope of straight segment. 00041 00042 real64 fBlack; // Intercept of straight segment. 00043 00044 real64 fRadius; // Rounding radius. 00045 00046 real64 fQScale; // Quadradic scale. 00047 00048 public: 00049 00050 dng_function_exposure_ramp (real64 white, 00051 real64 black, 00052 real64 minBlack); 00053 00054 virtual real64 Evaluate (real64 x) const; 00055 00056 }; 00057 00058 /******************************************************************************/ 00059 00061 00062 class dng_function_exposure_tone: public dng_1d_function 00063 { 00064 00065 protected: 00066 00067 bool fIsNOP; // Is this a NOP function? 00068 00069 real64 fSlope; // Slope for lower part of curve. 00070 00071 real64 a; // Quadradic parameters for upper two f-stops. 00072 real64 b; 00073 real64 c; 00074 00075 public: 00076 00077 dng_function_exposure_tone (real64 exposure); 00078 00080 00081 virtual real64 Evaluate (real64 x) const; 00082 00083 }; 00084 00085 /*****************************************************************************/ 00086 00088 00089 class dng_tone_curve_acr3_default: public dng_1d_function 00090 { 00091 00092 public: 00093 00095 00096 virtual real64 Evaluate (real64 x) const; 00097 00099 00100 virtual real64 EvaluateInverse (real64 x) const; 00101 00102 static const dng_1d_function & Get (); 00103 00104 }; 00105 00106 /*****************************************************************************/ 00107 00109 00110 class dng_function_gamma_encode: public dng_1d_function 00111 { 00112 00113 protected: 00114 00115 const dng_color_space &fSpace; 00116 00117 public: 00118 00119 dng_function_gamma_encode (const dng_color_space &space); 00120 00121 virtual real64 Evaluate (real64 x) const; 00122 00123 }; 00124 00125 /*****************************************************************************/ 00126 00128 00129 class dng_render 00130 { 00131 00132 protected: 00133 00134 dng_host &fHost; 00135 00136 const dng_negative &fNegative; 00137 00138 dng_xy_coord fWhiteXY; 00139 00140 real64 fExposure; 00141 00142 real64 fShadows; 00143 00144 const dng_1d_function *fToneCurve; 00145 00146 const dng_color_space *fFinalSpace; 00147 00148 uint32 fFinalPixelType; 00149 00150 uint32 fMaximumSize; 00151 00152 private: 00153 00154 AutoPtr<dng_spline_solver> fProfileToneCurve; 00155 00156 public: 00157 00161 00162 dng_render (dng_host &host, 00163 const dng_negative &negative); 00164 00165 virtual ~dng_render () 00166 { 00167 } 00168 00171 00172 void SetWhiteXY (const dng_xy_coord &white) 00173 { 00174 fWhiteXY = white; 00175 } 00176 00179 00180 const dng_xy_coord WhiteXY () const 00181 { 00182 return fWhiteXY; 00183 } 00184 00187 00188 void SetExposure (real64 exposure) 00189 { 00190 fExposure = exposure; 00191 } 00192 00195 00196 real64 Exposure () const 00197 { 00198 return fExposure; 00199 } 00200 00203 00204 void SetShadows (real64 shadows) 00205 { 00206 fShadows = shadows; 00207 } 00208 00211 00212 real64 Shadows () const 00213 { 00214 return fShadows; 00215 } 00216 00219 00220 void SetToneCurve (const dng_1d_function &curve) 00221 { 00222 fToneCurve = &curve; 00223 } 00224 00227 00228 const dng_1d_function & ToneCurve () const 00229 { 00230 return *fToneCurve; 00231 } 00232 00236 00237 void SetFinalSpace (const dng_color_space &space) 00238 { 00239 fFinalSpace = &space; 00240 } 00241 00244 00245 const dng_color_space & FinalSpace () const 00246 { 00247 return *fFinalSpace; 00248 } 00249 00253 00254 void SetFinalPixelType (uint32 type) 00255 { 00256 fFinalPixelType = type; 00257 } 00258 00262 00263 uint32 FinalPixelType () const 00264 { 00265 return fFinalPixelType; 00266 } 00267 00273 00274 void SetMaximumSize (uint32 size) 00275 { 00276 fMaximumSize = size; 00277 } 00278 00284 00285 uint32 MaximumSize () const 00286 { 00287 return fMaximumSize; 00288 } 00289 00293 00294 virtual dng_image * Render (); 00295 00296 private: 00297 00298 // Hidden copy constructor and assignment operator. 00299 00300 dng_render (const dng_render &render); 00301 00302 dng_render & operator= (const dng_render &render); 00303 00304 }; 00305 00306 /*****************************************************************************/ 00307 00308 #endif 00309 00310 /*****************************************************************************/ |