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-2008 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/dng_sdk_1_2/dng_sdk/source/dng_host.h#1 $ */ 00010 /* $DateTime: 2008/03/09 14:29:54 $ */ 00011 /* $Change: 431850 $ */ 00012 /* $Author: tknoll $ */ 00013 00019 /*****************************************************************************/ 00020 00021 #ifndef __dng_host__ 00022 #define __dng_host__ 00023 00024 /*****************************************************************************/ 00025 00026 #include "dng_classes.h" 00027 #include "dng_errors.h" 00028 #include "dng_types.h" 00029 00030 /*****************************************************************************/ 00031 00048 00049 class dng_host 00050 { 00051 00052 private: 00053 00054 dng_memory_allocator *fAllocator; 00055 00056 dng_abort_sniffer *fSniffer; 00057 00058 // Does the host require all the image metadata (vs. just checking 00059 // to see if the file is readable)? 00060 00061 bool fNeedsMeta; 00062 00063 // Does the host require actual image data (vs. just getting metadata 00064 // or just checking to see if the file is readable)? 00065 00066 bool fNeedsImage; 00067 00068 // If we need the image data, can it be read at preview quality? 00069 00070 bool fForPreview; 00071 00072 // If non-zero, the minimum size (longer of the two pixel dimensions) 00073 // image to read. If zero, or if the full size image is smaller than 00074 // this, read the full size image. 00075 00076 uint32 fMinimumSize; 00077 00078 // What is the preferred size for a preview image? This can 00079 // be slightly larger than the minimum size. Zero if we want 00080 // the full resolution image. 00081 00082 uint32 fPreferredSize; 00083 00084 // What is the maximum size for a preview image? Zero if there 00085 // is no maximum size limit. 00086 00087 uint32 fMaximumSize; 00088 00089 // The fraction of the image kept after a crop. This is used to 00090 // adjust the sizes to take into account the cropping that 00091 // will be peformed. 00092 00093 real64 fCropFactor; 00094 00095 // Keep the stage 1 (original raw) image? 00096 00097 bool fKeepStage1; 00098 00099 // Keep the stage 2 (linearized) image? 00100 00101 bool fKeepStage2; 00102 00103 // Keep the DNG private data block? 00104 00105 bool fKeepDNGPrivate; 00106 00107 // Keep the original raw file data block? 00108 00109 bool fKeepOriginalFile; 00110 00111 public: 00112 00120 00121 dng_host (dng_memory_allocator *allocator = NULL, 00122 dng_abort_sniffer *sniffer = NULL); 00123 00127 00128 virtual ~dng_host (); 00129 00131 00132 dng_memory_allocator & Allocator (); 00133 00139 00140 virtual dng_memory_block * Allocate (uint32 logicalSize); 00141 00143 00144 void SetSniffer (dng_abort_sniffer *sniffer) 00145 { 00146 fSniffer = sniffer; 00147 } 00148 00150 00151 dng_abort_sniffer * Sniffer () 00152 { 00153 return fSniffer; 00154 } 00155 00158 00159 virtual void SniffForAbort (); 00160 00165 00166 void SetNeedsMeta (bool needs) 00167 { 00168 fNeedsMeta = needs; 00169 } 00170 00172 00173 bool NeedsMeta () const 00174 { 00175 return fNeedsMeta; 00176 } 00177 00182 00183 void SetNeedsImage (bool needs) 00184 { 00185 fNeedsImage = needs; 00186 } 00187 00189 00190 bool NeedsImage () const 00191 { 00192 return fNeedsImage; 00193 } 00194 00198 00199 void SetForPreview (bool preview) 00200 { 00201 fForPreview = preview; 00202 } 00203 00210 00211 bool ForPreview () const 00212 { 00213 return fForPreview; 00214 } 00215 00218 00219 void SetMinimumSize (uint32 size) 00220 { 00221 fMinimumSize = size; 00222 } 00223 00225 00226 uint32 MinimumSize () const 00227 { 00228 return fMinimumSize; 00229 } 00230 00233 00234 void SetPreferredSize (uint32 size) 00235 { 00236 fPreferredSize = size; 00237 } 00238 00240 00241 uint32 PreferredSize () const 00242 { 00243 return fPreferredSize; 00244 } 00245 00248 00249 void SetMaximumSize (uint32 size) 00250 { 00251 fMaximumSize = size; 00252 } 00253 00255 00256 uint32 MaximumSize () const 00257 { 00258 return fMaximumSize; 00259 } 00260 00263 00264 void SetCropFactor (real64 cropFactor) 00265 { 00266 fCropFactor = cropFactor; 00267 } 00268 00270 00271 real64 CropFactor () const 00272 { 00273 return fCropFactor; 00274 } 00275 00277 00278 void ValidateSizes (); 00279 00283 00284 void SetKeepStage1 (bool keep) 00285 { 00286 fKeepStage1 = keep; 00287 } 00288 00291 00292 bool KeepStage1 () const 00293 { 00294 return fKeepStage1; 00295 } 00296 00300 00301 void SetKeepStage2 (bool keep) 00302 { 00303 fKeepStage2 = keep; 00304 } 00305 00308 00309 bool KeepStage2 () const 00310 { 00311 return fKeepStage2; 00312 } 00313 00316 00317 void SetKeepDNGPrivate (bool keep) 00318 { 00319 fKeepDNGPrivate = keep; 00320 } 00321 00323 00324 bool KeepDNGPrivate () 00325 { 00326 return fKeepDNGPrivate; 00327 } 00328 00331 00332 void SetKeepOriginalFile (bool keep) 00333 { 00334 fKeepOriginalFile = keep; 00335 } 00336 00338 00339 bool KeepOriginalFile () 00340 { 00341 return fKeepOriginalFile; 00342 } 00343 00351 00352 virtual bool IsTransientError (dng_error_code code); 00353 00360 00361 virtual void PerformAreaTask (dng_area_task &task, 00362 const dng_rect &area); 00363 00366 00367 virtual dng_exif * Make_dng_exif (); 00368 00371 00372 virtual dng_shared * Make_dng_shared (); 00373 00376 00377 virtual dng_ifd * Make_dng_ifd (); 00378 00381 00382 virtual dng_negative * Make_dng_negative (); 00383 00386 00387 virtual dng_image * Make_dng_image (const dng_rect &bounds, 00388 uint32 planes, 00389 uint32 pixelType); 00390 00391 private: 00392 00393 // Hidden copy constructor and assignment operator. 00394 00395 dng_host (const dng_host &host); 00396 00397 dng_host & operator= (const dng_host &host); 00398 00399 }; 00400 00401 /*****************************************************************************/ 00402 00403 #endif 00404 00405 /*****************************************************************************/ | |||
