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_gain_map.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_gain_map.h#3 $ */ 00010 /* $DateTime: 2009/03/09 23:23:07 $ */ 00011 /* $Change: 546296 $ */ 00012 /* $Author: stern $ */ 00013 00014 /*****************************************************************************/ 00015 00016 #ifndef __dng_gain_map__ 00017 #define __dng_gain_map__ 00018 00019 /*****************************************************************************/ 00020 00021 #include "dng_memory.h" 00022 #include "dng_misc_opcodes.h" 00023 #include "dng_tag_types.h" 00024 00025 /*****************************************************************************/ 00026 00027 class dng_gain_map 00028 { 00029 00030 private: 00031 00032 dng_point fPoints; 00033 00034 dng_point_real64 fSpacing; 00035 00036 dng_point_real64 fOrigin; 00037 00038 uint32 fPlanes; 00039 00040 uint32 fRowStep; 00041 00042 AutoPtr<dng_memory_block> fBuffer; 00043 00044 public: 00045 00046 dng_gain_map (dng_memory_allocator &allocator, 00047 const dng_point &points, 00048 const dng_point_real64 &spacing, 00049 const dng_point_real64 &origin, 00050 uint32 planes); 00051 00052 const dng_point & Points () const 00053 { 00054 return fPoints; 00055 } 00056 00057 const dng_point_real64 & Spacing () const 00058 { 00059 return fSpacing; 00060 } 00061 00062 const dng_point_real64 & Origin () const 00063 { 00064 return fOrigin; 00065 } 00066 00067 uint32 Planes () const 00068 { 00069 return fPlanes; 00070 } 00071 00072 real32 & Entry (uint32 rowIndex, 00073 uint32 colIndex, 00074 uint32 plane) 00075 { 00076 00077 return *(fBuffer->Buffer_real32 () + 00078 rowIndex * fRowStep + 00079 colIndex * fPlanes + 00080 plane); 00081 00082 } 00083 00084 const real32 & Entry (uint32 rowIndex, 00085 uint32 colIndex, 00086 uint32 plane) const 00087 { 00088 00089 return *(fBuffer->Buffer_real32 () + 00090 rowIndex * fRowStep + 00091 colIndex * fPlanes + 00092 plane); 00093 00094 } 00095 00096 real32 Interpolate (int32 row, 00097 int32 col, 00098 uint32 plane, 00099 const dng_rect &bounds) const; 00100 00101 uint32 PutStreamSize () const; 00102 00103 void PutStream (dng_stream &stream) const; 00104 00105 static dng_gain_map * GetStream (dng_host &host, 00106 dng_stream &stream); 00107 00108 private: 00109 00110 // Hidden copy constructor and assignment operator. 00111 00112 dng_gain_map (const dng_gain_map &map); 00113 00114 dng_gain_map & operator= (const dng_gain_map &map); 00115 00116 }; 00117 00118 /*****************************************************************************/ 00119 00120 class dng_opcode_GainMap: public dng_inplace_opcode 00121 { 00122 00123 private: 00124 00125 dng_area_spec fAreaSpec; 00126 00127 AutoPtr<dng_gain_map> fGainMap; 00128 00129 public: 00130 00131 dng_opcode_GainMap (const dng_area_spec &areaSpec, 00132 AutoPtr<dng_gain_map> &gainMap); 00133 00134 dng_opcode_GainMap (dng_host &host, 00135 dng_stream &stream); 00136 00137 virtual void PutData (dng_stream &stream) const; 00138 00139 virtual uint32 BufferPixelType (uint32 /* imagePixelType */) 00140 { 00141 return ttFloat; 00142 } 00143 00144 virtual dng_rect ModifiedBounds (const dng_rect &imageBounds) 00145 { 00146 return fAreaSpec.Overlap (imageBounds); 00147 } 00148 00149 virtual void ProcessArea (dng_negative &negative, 00150 uint32 threadIndex, 00151 dng_pixel_buffer &buffer, 00152 const dng_rect &dstArea, 00153 const dng_rect &imageBounds); 00154 00155 private: 00156 00157 // Hidden copy constructor and assignment operator. 00158 00159 dng_opcode_GainMap (const dng_opcode_GainMap &opcode); 00160 00161 dng_opcode_GainMap & operator= (const dng_opcode_GainMap &opcode); 00162 00163 }; 00164 00165 /*****************************************************************************/ 00166 00167 #endif 00168 00169 /*****************************************************************************/ |