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_misc_opcodes.h00001 /*****************************************************************************/ 00002 // Copyright 2008-2009 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_misc_opcodes.h#6 $ */ 00010 /* $DateTime: 2009/05/19 11:15:50 $ */ 00011 /* $Change: 566868 $ */ 00012 /* $Author: stern $ */ 00013 00014 /*****************************************************************************/ 00015 00016 #ifndef __dng_misc_opcodes__ 00017 #define __dng_misc_opcodes__ 00018 00019 /*****************************************************************************/ 00020 00021 #include "dng_opcodes.h" 00022 00023 /*****************************************************************************/ 00024 00025 class dng_opcode_TrimBounds: public dng_opcode 00026 { 00027 00028 private: 00029 00030 dng_rect fBounds; 00031 00032 public: 00033 00034 dng_opcode_TrimBounds (const dng_rect &bounds); 00035 00036 dng_opcode_TrimBounds (dng_stream &stream); 00037 00038 virtual void PutData (dng_stream &stream) const; 00039 00040 virtual void Apply (dng_host &host, 00041 dng_negative &negative, 00042 AutoPtr<dng_image> &image); 00043 00044 }; 00045 00046 /*****************************************************************************/ 00047 00048 class dng_area_spec 00049 { 00050 00051 public: 00052 00053 enum 00054 { 00055 kDataSize = 32 00056 }; 00057 00058 private: 00059 00060 dng_rect fArea; 00061 00062 uint32 fPlane; 00063 uint32 fPlanes; 00064 00065 uint32 fRowPitch; 00066 uint32 fColPitch; 00067 00068 public: 00069 00070 dng_area_spec (const dng_rect &area = dng_rect (), 00071 uint32 plane = 0, 00072 uint32 planes = 1, 00073 uint32 rowPitch = 1, 00074 uint32 colPitch = 1) 00075 00076 : fArea (area) 00077 , fPlane (plane) 00078 , fPlanes (planes) 00079 , fRowPitch (rowPitch) 00080 , fColPitch (colPitch) 00081 00082 { 00083 } 00084 00085 const dng_rect & Area () const 00086 { 00087 return fArea; 00088 } 00089 00090 const uint32 Plane () const 00091 { 00092 return fPlane; 00093 } 00094 00095 const uint32 Planes () const 00096 { 00097 return fPlanes; 00098 } 00099 00100 const uint32 RowPitch () const 00101 { 00102 return fRowPitch; 00103 } 00104 00105 const uint32 ColPitch () const 00106 { 00107 return fColPitch; 00108 } 00109 00110 void GetData (dng_stream &stream); 00111 00112 void PutData (dng_stream &stream) const; 00113 00114 dng_rect Overlap (const dng_rect &tile) const; 00115 00116 }; 00117 00118 /*****************************************************************************/ 00119 00120 class dng_opcode_MapTable: public dng_inplace_opcode 00121 { 00122 00123 private: 00124 00125 dng_area_spec fAreaSpec; 00126 00127 AutoPtr<dng_memory_block> fTable; 00128 00129 uint32 fCount; 00130 00131 public: 00132 00133 dng_opcode_MapTable (dng_host &host, 00134 const dng_area_spec &areaSpec, 00135 const uint16 *table, 00136 uint32 count = 0x10000); 00137 00138 dng_opcode_MapTable (dng_host &host, 00139 dng_stream &stream); 00140 00141 virtual void PutData (dng_stream &stream) const; 00142 00143 virtual uint32 BufferPixelType (uint32 imagePixelType); 00144 00145 virtual dng_rect ModifiedBounds (const dng_rect &imageBounds); 00146 00147 virtual void ProcessArea (dng_negative &negative, 00148 uint32 threadIndex, 00149 dng_pixel_buffer &buffer, 00150 const dng_rect &dstArea, 00151 const dng_rect &imageBounds); 00152 00153 private: 00154 00155 void ReplicateLastEntry (); 00156 00157 }; 00158 00159 /*****************************************************************************/ 00160 00161 class dng_opcode_MapPolynomial: public dng_inplace_opcode 00162 { 00163 00164 public: 00165 00166 enum 00167 { 00168 kMaxDegree = 8 00169 }; 00170 00171 private: 00172 00173 dng_area_spec fAreaSpec; 00174 00175 uint32 fDegree; 00176 00177 real64 fCoefficient [kMaxDegree + 1]; 00178 00179 real32 fCoefficient32 [kMaxDegree + 1]; 00180 00181 public: 00182 00183 dng_opcode_MapPolynomial (const dng_area_spec &areaSpec, 00184 uint32 degree, 00185 const real64 *coefficient); 00186 00187 dng_opcode_MapPolynomial (dng_stream &stream); 00188 00189 virtual void PutData (dng_stream &stream) const; 00190 00191 virtual uint32 BufferPixelType (uint32 imagePixelType); 00192 00193 virtual dng_rect ModifiedBounds (const dng_rect &imageBounds); 00194 00195 virtual void ProcessArea (dng_negative &negative, 00196 uint32 threadIndex, 00197 dng_pixel_buffer &buffer, 00198 const dng_rect &dstArea, 00199 const dng_rect &imageBounds); 00200 00201 }; 00202 00203 /*****************************************************************************/ 00204 00205 class dng_opcode_DeltaPerRow: public dng_inplace_opcode 00206 { 00207 00208 private: 00209 00210 dng_area_spec fAreaSpec; 00211 00212 AutoPtr<dng_memory_block> fTable; 00213 00214 real32 fScale; 00215 00216 public: 00217 00218 dng_opcode_DeltaPerRow (const dng_area_spec &areaSpec, 00219 AutoPtr<dng_memory_block> &table); 00220 00221 dng_opcode_DeltaPerRow (dng_host &host, 00222 dng_stream &stream); 00223 00224 virtual void PutData (dng_stream &stream) const; 00225 00226 virtual uint32 BufferPixelType (uint32 imagePixelType); 00227 00228 virtual dng_rect ModifiedBounds (const dng_rect &imageBounds); 00229 00230 virtual void ProcessArea (dng_negative &negative, 00231 uint32 threadIndex, 00232 dng_pixel_buffer &buffer, 00233 const dng_rect &dstArea, 00234 const dng_rect &imageBounds); 00235 00236 }; 00237 00238 /*****************************************************************************/ 00239 00240 class dng_opcode_DeltaPerColumn: public dng_inplace_opcode 00241 { 00242 00243 private: 00244 00245 dng_area_spec fAreaSpec; 00246 00247 AutoPtr<dng_memory_block> fTable; 00248 00249 real32 fScale; 00250 00251 public: 00252 00253 dng_opcode_DeltaPerColumn (const dng_area_spec &areaSpec, 00254 AutoPtr<dng_memory_block> &table); 00255 00256 dng_opcode_DeltaPerColumn (dng_host &host, 00257 dng_stream &stream); 00258 00259 virtual void PutData (dng_stream &stream) const; 00260 00261 virtual uint32 BufferPixelType (uint32 imagePixelType); 00262 00263 virtual dng_rect ModifiedBounds (const dng_rect &imageBounds); 00264 00265 virtual void ProcessArea (dng_negative &negative, 00266 uint32 threadIndex, 00267 dng_pixel_buffer &buffer, 00268 const dng_rect &dstArea, 00269 const dng_rect &imageBounds); 00270 00271 }; 00272 00273 /*****************************************************************************/ 00274 00275 class dng_opcode_ScalePerRow: public dng_inplace_opcode 00276 { 00277 00278 private: 00279 00280 dng_area_spec fAreaSpec; 00281 00282 AutoPtr<dng_memory_block> fTable; 00283 00284 public: 00285 00286 dng_opcode_ScalePerRow (const dng_area_spec &areaSpec, 00287 AutoPtr<dng_memory_block> &table); 00288 00289 dng_opcode_ScalePerRow (dng_host &host, 00290 dng_stream &stream); 00291 00292 virtual void PutData (dng_stream &stream) const; 00293 00294 virtual uint32 BufferPixelType (uint32 imagePixelType); 00295 00296 virtual dng_rect ModifiedBounds (const dng_rect &imageBounds); 00297 00298 virtual void ProcessArea (dng_negative &negative, 00299 uint32 threadIndex, 00300 dng_pixel_buffer &buffer, 00301 const dng_rect &dstArea, 00302 const dng_rect &imageBounds); 00303 00304 }; 00305 00306 /*****************************************************************************/ 00307 00308 class dng_opcode_ScalePerColumn: public dng_inplace_opcode 00309 { 00310 00311 private: 00312 00313 dng_area_spec fAreaSpec; 00314 00315 AutoPtr<dng_memory_block> fTable; 00316 00317 public: 00318 00319 dng_opcode_ScalePerColumn (const dng_area_spec &areaSpec, 00320 AutoPtr<dng_memory_block> &table); 00321 00322 dng_opcode_ScalePerColumn (dng_host &host, 00323 dng_stream &stream); 00324 00325 virtual void PutData (dng_stream &stream) const; 00326 00327 virtual uint32 BufferPixelType (uint32 imagePixelType); 00328 00329 virtual dng_rect ModifiedBounds (const dng_rect &imageBounds); 00330 00331 virtual void ProcessArea (dng_negative &negative, 00332 uint32 threadIndex, 00333 dng_pixel_buffer &buffer, 00334 const dng_rect &dstArea, 00335 const dng_rect &imageBounds); 00336 00337 }; 00338 00339 /*****************************************************************************/ 00340 00341 #endif 00342 00343 /*****************************************************************************/ |