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_host.hGo to the documentation of this file.00001 /*****************************************************************************/ 00002 // Copyright 2006-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_host.h#14 $ */ 00010 /* $DateTime: 2009/05/19 11:15:50 $ */ 00011 /* $Change: 566868 $ */ 00012 /* $Author: stern $ */ 00013 00019 /*****************************************************************************/ 00020 00021 #ifndef __dng_host__ 00022 #define __dng_host__ 00023 00024 /*****************************************************************************/ 00025 00026 #include "dng_auto_ptr.h" 00027 #include "dng_classes.h" 00028 #include "dng_errors.h" 00029 #include "dng_types.h" 00030 00031 /*****************************************************************************/ 00032 00049 00050 class dng_host 00051 { 00052 00053 private: 00054 00055 dng_memory_allocator *fAllocator; 00056 00057 dng_abort_sniffer *fSniffer; 00058 00059 // Does the host require all the image metadata (vs. just checking 00060 // to see if the file is readable)? 00061 00062 bool fNeedsMeta; 00063 00064 // Does the host require actual image data (vs. just getting metadata 00065 // or just checking to see if the file is readable)? 00066 00067 bool fNeedsImage; 00068 00069 // If we need the image data, can it be read at preview quality? 00070 00071 bool fForPreview; 00072 00073 // If non-zero, the minimum size (longer of the two pixel dimensions) 00074 // image to read. If zero, or if the full size image is smaller than 00075 // this, read the full size image. 00076 00077 uint32 fMinimumSize; 00078 00079 // What is the preferred size for a preview image? This can 00080 // be slightly larger than the minimum size. Zero if we want 00081 // the full resolution image. 00082 00083 uint32 fPreferredSize; 00084 00085 // What is the maximum size for a preview image? Zero if there 00086 // is no maximum size limit. 00087 00088 uint32 fMaximumSize; 00089 00090 // The fraction of the image kept after a crop. This is used to 00091 // adjust the sizes to take into account the cropping that 00092 // will be peformed. 00093 00094 real64 fCropFactor; 00095 00096 // What DNG version should we keep enough data to save? 00097 00098 uint32 fSaveDNGVersion; 00099 00100 // Do we want to force saving to a linear DNG? 00101 00102 bool fSaveLinearDNG; 00103 00104 // Keep the original raw file data block? 00105 00106 bool fKeepOriginalFile; 00107 00108 public: 00109 00117 00118 dng_host (dng_memory_allocator *allocator = NULL, 00119 dng_abort_sniffer *sniffer = NULL); 00120 00124 00125 virtual ~dng_host (); 00126 00128 00129 dng_memory_allocator & Allocator (); 00130 00136 00137 virtual dng_memory_block * Allocate (uint32 logicalSize); 00138 00140 00141 void SetSniffer (dng_abort_sniffer *sniffer) 00142 { 00143 fSniffer = sniffer; 00144 } 00145 00147 00148 dng_abort_sniffer * Sniffer () 00149 { 00150 return fSniffer; 00151 } 00152 00155 00156 virtual void SniffForAbort (); 00157 00162 00163 void SetNeedsMeta (bool needs) 00164 { 00165 fNeedsMeta = needs; 00166 } 00167 00169 00170 bool NeedsMeta () const 00171 { 00172 return fNeedsMeta; 00173 } 00174 00179 00180 void SetNeedsImage (bool needs) 00181 { 00182 fNeedsImage = needs; 00183 } 00184 00186 00187 bool NeedsImage () const 00188 { 00189 return fNeedsImage; 00190 } 00191 00195 00196 void SetForPreview (bool preview) 00197 { 00198 fForPreview = preview; 00199 } 00200 00207 00208 bool ForPreview () const 00209 { 00210 return fForPreview; 00211 } 00212 00215 00216 void SetMinimumSize (uint32 size) 00217 { 00218 fMinimumSize = size; 00219 } 00220 00222 00223 uint32 MinimumSize () const 00224 { 00225 return fMinimumSize; 00226 } 00227 00230 00231 void SetPreferredSize (uint32 size) 00232 { 00233 fPreferredSize = size; 00234 } 00235 00237 00238 uint32 PreferredSize () const 00239 { 00240 return fPreferredSize; 00241 } 00242 00245 00246 void SetMaximumSize (uint32 size) 00247 { 00248 fMaximumSize = size; 00249 } 00250 00252 00253 uint32 MaximumSize () const 00254 { 00255 return fMaximumSize; 00256 } 00257 00260 00261 void SetCropFactor (real64 cropFactor) 00262 { 00263 fCropFactor = cropFactor; 00264 } 00265 00267 00268 real64 CropFactor () const 00269 { 00270 return fCropFactor; 00271 } 00272 00274 00275 void ValidateSizes (); 00276 00279 00280 void SetSaveDNGVersion (uint32 version) 00281 { 00282 fSaveDNGVersion = version; 00283 } 00284 00286 00287 virtual uint32 SaveDNGVersion () const; 00288 00291 00292 void SetSaveLinearDNG (bool linear) 00293 { 00294 fSaveLinearDNG = linear; 00295 } 00296 00298 00299 virtual bool SaveLinearDNG (const dng_negative &negative) const; 00300 00303 00304 void SetKeepOriginalFile (bool keep) 00305 { 00306 fKeepOriginalFile = keep; 00307 } 00308 00310 00311 bool KeepOriginalFile () 00312 { 00313 return fKeepOriginalFile; 00314 } 00315 00323 00324 virtual bool IsTransientError (dng_error_code code); 00325 00332 00333 virtual void PerformAreaTask (dng_area_task &task, 00334 const dng_rect &area); 00335 00338 00339 virtual dng_exif * Make_dng_exif (); 00340 00343 00344 virtual dng_shared * Make_dng_shared (); 00345 00348 00349 virtual dng_ifd * Make_dng_ifd (); 00350 00353 00354 virtual dng_negative * Make_dng_negative (); 00355 00358 00359 virtual dng_image * Make_dng_image (const dng_rect &bounds, 00360 uint32 planes, 00361 uint32 pixelType); 00362 00365 00366 virtual dng_opcode * Make_dng_opcode (uint32 opcodeID, 00367 dng_stream &stream); 00368 00371 00372 virtual void ApplyOpcodeList (dng_opcode_list &list, 00373 dng_negative &negative, 00374 AutoPtr<dng_image> &image); 00375 00376 private: 00377 00378 // Hidden copy constructor and assignment operator. 00379 00380 dng_host (const dng_host &host); 00381 00382 dng_host & operator= (const dng_host &host); 00383 00384 }; 00385 00386 /*****************************************************************************/ 00387 00388 #endif 00389 00390 /*****************************************************************************/ |