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_image_writer.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/workarea/stern/camera_raw/dng_sdk/source/dng_image_writer.h#16 $ */ 00010 /* $DateTime: 2009/05/07 15:13:54 $ */ 00011 /* $Change: 562719 $ */ 00012 /* $Author: stern $ */ 00013 00018 /*****************************************************************************/ 00019 00020 #ifndef __dng_image_writer__ 00021 #define __dng_image_writer__ 00022 00023 /*****************************************************************************/ 00024 00025 #include "dng_auto_ptr.h" 00026 #include "dng_classes.h" 00027 #include "dng_fingerprint.h" 00028 #include "dng_memory.h" 00029 #include "dng_point.h" 00030 #include "dng_rational.h" 00031 #include "dng_sdk_limits.h" 00032 #include "dng_string.h" 00033 #include "dng_tag_types.h" 00034 #include "dng_tag_values.h" 00035 #include "dng_types.h" 00036 00037 /*****************************************************************************/ 00038 00039 class dng_resolution 00040 { 00041 00042 public: 00043 00044 dng_urational fXResolution; 00045 dng_urational fYResolution; 00046 00047 uint16 fResolutionUnit; 00048 00049 public: 00050 00051 dng_resolution (); 00052 00053 }; 00054 00055 /*****************************************************************************/ 00056 00057 class tiff_tag 00058 { 00059 00060 protected: 00061 00062 uint16 fCode; 00063 00064 uint16 fType; 00065 00066 uint32 fCount; 00067 00068 protected: 00069 00070 tiff_tag (uint16 code, 00071 uint16 type, 00072 uint32 count) 00073 00074 : fCode (code) 00075 , fType (type) 00076 , fCount (count) 00077 00078 { 00079 } 00080 00081 public: 00082 00083 virtual ~tiff_tag () 00084 { 00085 } 00086 00087 uint16 Code () const 00088 { 00089 return fCode; 00090 } 00091 00092 uint16 Type () const 00093 { 00094 return fType; 00095 } 00096 00097 uint32 Count () const 00098 { 00099 return fCount; 00100 } 00101 00102 void SetCount (uint32 count) 00103 { 00104 fCount = count; 00105 } 00106 00107 uint32 Size () const 00108 { 00109 return TagTypeSize (Type ()) * Count (); 00110 } 00111 00112 virtual void Put (dng_stream &stream) const = 0; 00113 00114 private: 00115 00116 // Hidden copy constructor and assignment operator. 00117 00118 tiff_tag (const tiff_tag &tag); 00119 00120 tiff_tag & operator= (const tiff_tag &tag); 00121 00122 }; 00123 00124 /******************************************************************************/ 00125 00126 class tag_data_ptr: public tiff_tag 00127 { 00128 00129 protected: 00130 00131 const void *fData; 00132 00133 public: 00134 00135 tag_data_ptr (uint16 code, 00136 uint16 type, 00137 uint32 count, 00138 const void *data) 00139 00140 : tiff_tag (code, type, count) 00141 00142 , fData (data) 00143 00144 { 00145 } 00146 00147 void SetData (const void *data) 00148 { 00149 fData = data; 00150 } 00151 00152 virtual void Put (dng_stream &stream) const; 00153 00154 private: 00155 00156 // Hidden copy constructor and assignment operator. 00157 00158 tag_data_ptr (const tag_data_ptr &tag); 00159 00160 tag_data_ptr & operator= (const tag_data_ptr &tag); 00161 00162 }; 00163 00164 /******************************************************************************/ 00165 00166 class tag_string: public tiff_tag 00167 { 00168 00169 protected: 00170 00171 dng_string fString; 00172 00173 public: 00174 00175 tag_string (uint16 code, 00176 const dng_string &s, 00177 bool forceASCII = true); 00178 00179 virtual void Put (dng_stream &stream) const; 00180 00181 }; 00182 00183 /******************************************************************************/ 00184 00185 class tag_encoded_text: public tiff_tag 00186 { 00187 00188 private: 00189 00190 dng_string fText; 00191 00192 dng_memory_data fUTF16; 00193 00194 public: 00195 00196 tag_encoded_text (uint16 code, 00197 const dng_string &text); 00198 00199 virtual void Put (dng_stream &stream) const; 00200 00201 }; 00202 00203 /******************************************************************************/ 00204 00205 class tag_uint8: public tag_data_ptr 00206 { 00207 00208 private: 00209 00210 uint8 fValue; 00211 00212 public: 00213 00214 tag_uint8 (uint16 code, 00215 uint8 value = 0) 00216 00217 : tag_data_ptr (code, ttByte, 1, &fValue) 00218 00219 , fValue (value) 00220 00221 { 00222 } 00223 00224 void Set (uint8 value) 00225 { 00226 fValue = value; 00227 } 00228 00229 }; 00230 00231 /******************************************************************************/ 00232 00233 class tag_uint8_ptr: public tag_data_ptr 00234 { 00235 00236 public: 00237 00238 tag_uint8_ptr (uint16 code, 00239 const uint8 *data, 00240 uint32 count = 1) 00241 00242 : tag_data_ptr (code, ttByte, count, data) 00243 00244 { 00245 } 00246 00247 }; 00248 00249 /******************************************************************************/ 00250 00251 class tag_uint16: public tag_data_ptr 00252 { 00253 00254 private: 00255 00256 uint16 fValue; 00257 00258 public: 00259 00260 tag_uint16 (uint16 code, 00261 uint16 value = 0) 00262 00263 : tag_data_ptr (code, ttShort, 1, &fValue) 00264 00265 , fValue (value) 00266 00267 { 00268 } 00269 00270 void Set (uint16 value) 00271 { 00272 fValue = value; 00273 } 00274 00275 }; 00276 00277 /******************************************************************************/ 00278 00279 class tag_int16_ptr: public tag_data_ptr 00280 { 00281 00282 public: 00283 00284 tag_int16_ptr (uint16 code, 00285 const int16 *data, 00286 uint32 count = 1) 00287 00288 : tag_data_ptr (code, ttSShort, count, data) 00289 00290 { 00291 } 00292 00293 }; 00294 00295 /******************************************************************************/ 00296 00297 class tag_uint16_ptr: public tag_data_ptr 00298 { 00299 00300 public: 00301 00302 tag_uint16_ptr (uint16 code, 00303 const uint16 *data, 00304 uint32 count = 1) 00305 00306 : tag_data_ptr (code, ttShort, count, data) 00307 00308 { 00309 } 00310 00311 }; 00312 00313 /******************************************************************************/ 00314 00315 class tag_uint32: public tag_data_ptr 00316 { 00317 00318 private: 00319 00320 uint32 fValue; 00321 00322 public: 00323 00324 tag_uint32 (uint16 code, 00325 uint32 value = 0) 00326 00327 : tag_data_ptr (code, ttLong, 1, &fValue) 00328 00329 , fValue (value) 00330 00331 { 00332 } 00333 00334 void Set (uint32 value) 00335 { 00336 fValue = value; 00337 } 00338 00339 }; 00340 00341 /******************************************************************************/ 00342 00343 class tag_uint32_ptr: public tag_data_ptr 00344 { 00345 00346 public: 00347 00348 tag_uint32_ptr (uint16 code, 00349 const uint32 *data, 00350 uint32 count = 1) 00351 00352 : tag_data_ptr (code, ttLong, count, data) 00353 00354 { 00355 } 00356 00357 }; 00358 00359 /******************************************************************************/ 00360 00361 class tag_urational: public tag_data_ptr 00362 { 00363 00364 private: 00365 00366 const dng_urational fValue; 00367 00368 public: 00369 00370 tag_urational (uint16 code, 00371 const dng_urational &value) 00372 00373 : tag_data_ptr (code, ttRational, 1, &fValue) 00374 00375 , fValue (value) 00376 00377 { 00378 } 00379 00380 }; 00381 00382 /******************************************************************************/ 00383 00384 class tag_urational_ptr: public tag_data_ptr 00385 { 00386 00387 public: 00388 00389 tag_urational_ptr (uint16 code, 00390 const dng_urational *data = NULL, 00391 uint32 count = 1) 00392 00393 : tag_data_ptr (code, ttRational, count, data) 00394 00395 { 00396 } 00397 00398 }; 00399 00400 /******************************************************************************/ 00401 00402 class tag_srational: public tag_data_ptr 00403 { 00404 00405 private: 00406 00407 const dng_srational fValue; 00408 00409 public: 00410 00411 tag_srational (uint16 code, 00412 const dng_srational &value) 00413 00414 : tag_data_ptr (code, ttSRational, 1, &fValue) 00415 00416 , fValue (value) 00417 00418 { 00419 } 00420 00421 }; 00422 00423 /******************************************************************************/ 00424 00425 class tag_srational_ptr: public tag_data_ptr 00426 { 00427 00428 public: 00429 00430 tag_srational_ptr (uint16 code, 00431 const dng_srational *data = NULL, 00432 uint32 count = 1) 00433 00434 : tag_data_ptr (code, ttSRational, count, data) 00435 00436 { 00437 } 00438 00439 }; 00440 00441 /******************************************************************************/ 00442 00443 class tag_matrix: public tag_srational_ptr 00444 { 00445 00446 private: 00447 00448 dng_srational fEntry [kMaxColorPlanes * 00449 kMaxColorPlanes]; 00450 00451 public: 00452 00453 tag_matrix (uint16 code, 00454 const dng_matrix &m); 00455 00456 }; 00457 00458 /******************************************************************************/ 00459 00460 class tag_icc_profile: public tag_data_ptr 00461 { 00462 00463 public: 00464 00465 tag_icc_profile (const void *profileData, uint32 profileSize); 00466 00467 }; 00468 00469 /******************************************************************************/ 00470 00471 class tag_cfa_pattern: public tiff_tag 00472 { 00473 00474 private: 00475 00476 uint32 fRows; 00477 uint32 fCols; 00478 00479 const uint8 *fPattern; 00480 00481 public: 00482 00483 tag_cfa_pattern (uint16 code, 00484 uint32 rows, 00485 uint32 cols, 00486 const uint8 *pattern) 00487 00488 : tiff_tag (code, ttUndefined, 4 + rows * cols) 00489 00490 , fRows (rows ) 00491 , fCols (cols ) 00492 , fPattern (pattern) 00493 00494 { 00495 } 00496 00497 virtual void Put (dng_stream &stream) const; 00498 00499 private: 00500 00501 // Hidden copy constructor and assignment operator. 00502 00503 tag_cfa_pattern (const tag_cfa_pattern &tag); 00504 00505 tag_cfa_pattern & operator= (const tag_cfa_pattern &tag); 00506 00507 }; 00508 00509 /******************************************************************************/ 00510 00511 class tag_exif_date_time: public tag_data_ptr 00512 { 00513 00514 private: 00515 00516 char fData [20]; 00517 00518 public: 00519 00520 tag_exif_date_time (uint16 code, 00521 const dng_date_time &dt); 00522 00523 }; 00524 00525 /******************************************************************************/ 00526 00527 class tag_iptc: public tiff_tag 00528 { 00529 00530 private: 00531 00532 const void *fData; 00533 00534 uint32 fLength; 00535 00536 public: 00537 00538 tag_iptc (const void *data, 00539 uint32 length); 00540 00541 virtual void Put (dng_stream &stream) const; 00542 00543 private: 00544 00545 // Hidden copy constructor and assignment operator. 00546 00547 tag_iptc (const tag_iptc &tag); 00548 00549 tag_iptc & operator= (const tag_iptc &tag); 00550 00551 }; 00552 00553 /******************************************************************************/ 00554 00555 class tag_xmp: public tag_uint8_ptr 00556 { 00557 00558 private: 00559 00560 AutoPtr<dng_memory_block> fBuffer; 00561 00562 public: 00563 00564 tag_xmp (const dng_xmp *xmp); 00565 00566 private: 00567 00568 // Hidden copy constructor and assignment operator. 00569 00570 tag_xmp (const tag_xmp &tag); 00571 00572 tag_xmp & operator= (const tag_xmp &tag); 00573 00574 }; 00575 00576 /******************************************************************************/ 00577 00578 class dng_tiff_directory 00579 { 00580 00581 private: 00582 00583 enum 00584 { 00585 kMaxEntries = 100 00586 }; 00587 00588 uint32 fEntries; 00589 00590 const tiff_tag *fTag [kMaxEntries]; 00591 00592 uint32 fChained; 00593 00594 public: 00595 00596 dng_tiff_directory () 00597 00598 : fEntries (0) 00599 , fChained (0) 00600 00601 { 00602 } 00603 00604 virtual ~dng_tiff_directory () 00605 { 00606 } 00607 00608 void Add (const tiff_tag *tag); 00609 00610 void SetChained (uint32 offset) 00611 { 00612 fChained = offset; 00613 } 00614 00615 uint32 Size () const; 00616 00617 enum OffsetsBase 00618 { 00619 offsetsRelativeToStream = 0, 00620 offsetsRelativeToExplicitBase = 1, 00621 offsetsRelativeToIFD = 2 00622 }; 00623 00624 void Put (dng_stream &stream, 00625 OffsetsBase offsetsBase = offsetsRelativeToStream, 00626 uint32 explicitBase = 0) const; 00627 00628 private: 00629 00630 // Hidden copy constructor and assignment operator. 00631 00632 dng_tiff_directory (const dng_tiff_directory &dir); 00633 00634 dng_tiff_directory & operator= (const dng_tiff_directory &dir); 00635 00636 }; 00637 00638 /******************************************************************************/ 00639 00640 class dng_basic_tag_set 00641 { 00642 00643 private: 00644 00645 tag_uint32 fNewSubFileType; 00646 00647 tag_uint32 fImageWidth; 00648 tag_uint32 fImageLength; 00649 00650 tag_uint16 fPhotoInterpretation; 00651 00652 tag_uint16 fFillOrder; 00653 00654 tag_uint16 fSamplesPerPixel; 00655 00656 uint16 fBitsPerSampleData [kMaxSamplesPerPixel]; 00657 00658 tag_uint16_ptr fBitsPerSample; 00659 00660 bool fStrips; 00661 00662 tag_uint32 fTileWidth; 00663 tag_uint32 fTileLength; 00664 00665 dng_memory_data fTileInfoBuffer; 00666 00667 uint32 *fTileOffsetData; 00668 00669 tag_uint32_ptr fTileOffsets; 00670 00671 uint32 *fTileByteCountData; 00672 00673 tag_uint32_ptr fTileByteCounts; 00674 00675 tag_uint16 fPlanarConfiguration; 00676 00677 tag_uint16 fCompression; 00678 00679 tag_uint16 fPredictor; 00680 00681 uint16 fExtraSamplesData [kMaxSamplesPerPixel]; 00682 00683 tag_uint16_ptr fExtraSamples; 00684 00685 uint16 fSampleFormatData [kMaxSamplesPerPixel]; 00686 00687 tag_uint16_ptr fSampleFormat; 00688 00689 tag_uint16 fRowInterleaveFactor; 00690 00691 uint16 fSubTileBlockSizeData [2]; 00692 00693 tag_uint16_ptr fSubTileBlockSize; 00694 00695 public: 00696 00697 dng_basic_tag_set (dng_tiff_directory &directory, 00698 const dng_ifd &info); 00699 00700 virtual ~dng_basic_tag_set () 00701 { 00702 } 00703 00704 void SetTileOffset (uint32 index, 00705 uint32 offset) 00706 { 00707 fTileOffsetData [index] = offset; 00708 } 00709 00710 void SetTileByteCount (uint32 index, 00711 uint32 count) 00712 { 00713 fTileByteCountData [index] = count; 00714 } 00715 00716 bool WritingStrips () const 00717 { 00718 return fStrips; 00719 } 00720 00721 private: 00722 00723 // Hidden copy constructor and assignment operator. 00724 00725 dng_basic_tag_set (const dng_basic_tag_set &set); 00726 00727 dng_basic_tag_set & operator= (const dng_basic_tag_set &set); 00728 00729 }; 00730 00731 /******************************************************************************/ 00732 00733 class exif_tag_set 00734 { 00735 00736 protected: 00737 00738 dng_tiff_directory fExifIFD; 00739 dng_tiff_directory fGPSIFD; 00740 00741 private: 00742 00743 tag_uint32 fExifLink; 00744 tag_uint32 fGPSLink; 00745 00746 bool fAddedExifLink; 00747 bool fAddedGPSLink; 00748 00749 uint8 fExifVersionData [4]; 00750 00751 tag_data_ptr fExifVersion; 00752 00753 tag_urational fExposureTime; 00754 tag_srational fShutterSpeedValue; 00755 00756 tag_urational fFNumber; 00757 tag_urational fApertureValue; 00758 00759 tag_srational fBrightnessValue; 00760 00761 tag_srational fExposureBiasValue; 00762 00763 tag_urational fMaxApertureValue; 00764 00765 tag_urational fSubjectDistance; 00766 00767 tag_urational fFocalLength; 00768 00769 tag_uint16 fISOSpeedRatings; 00770 00771 tag_uint16 fFlash; 00772 00773 tag_uint16 fExposureProgram; 00774 00775 tag_uint16 fMeteringMode; 00776 00777 tag_uint16 fLightSource; 00778 00779 tag_uint16 fSensingMethod; 00780 00781 tag_uint16 fFocalLength35mm; 00782 00783 uint8 fFileSourceData; 00784 tag_data_ptr fFileSource; 00785 00786 uint8 fSceneTypeData; 00787 tag_data_ptr fSceneType; 00788 00789 tag_cfa_pattern fCFAPattern; 00790 00791 tag_uint16 fCustomRendered; 00792 tag_uint16 fExposureMode; 00793 tag_uint16 fWhiteBalance; 00794 tag_uint16 fSceneCaptureType; 00795 tag_uint16 fGainControl; 00796 tag_uint16 fContrast; 00797 tag_uint16 fSaturation; 00798 tag_uint16 fSharpness; 00799 tag_uint16 fSubjectDistanceRange; 00800 00801 tag_urational fDigitalZoomRatio; 00802 00803 tag_urational fExposureIndex; 00804 00805 tag_uint32 fImageNumber; 00806 00807 tag_uint16 fSelfTimerMode; 00808 00809 tag_string fBatteryLevelA; 00810 tag_urational fBatteryLevelR; 00811 00812 tag_urational fFocalPlaneXResolution; 00813 tag_urational fFocalPlaneYResolution; 00814 00815 tag_uint16 fFocalPlaneResolutionUnit; 00816 00817 uint16 fSubjectAreaData [4]; 00818 00819 tag_uint16_ptr fSubjectArea; 00820 00821 dng_urational fLensInfoData [4]; 00822 00823 tag_urational_ptr fLensInfo; 00824 00825 tag_exif_date_time fDateTime; 00826 tag_exif_date_time fDateTimeOriginal; 00827 tag_exif_date_time fDateTimeDigitized; 00828 00829 tag_string fSubsecTime; 00830 tag_string fSubsecTimeOriginal; 00831 tag_string fSubsecTimeDigitized; 00832 00833 int16 fTimeZoneOffsetData [2]; 00834 00835 tag_int16_ptr fTimeZoneOffset; 00836 00837 tag_string fMake; 00838 tag_string fModel; 00839 tag_string fArtist; 00840 tag_string fSoftware; 00841 tag_string fCopyright; 00842 tag_string fImageDescription; 00843 00844 tag_string fSerialNumber; 00845 00846 tag_uint16 fMakerNoteSafety; 00847 00848 tag_data_ptr fMakerNote; 00849 00850 tag_encoded_text fUserComment; 00851 00852 char fImageUniqueIDData [33]; 00853 00854 tag_data_ptr fImageUniqueID; 00855 00856 uint8 fGPSVersionData [4]; 00857 00858 tag_uint8_ptr fGPSVersionID; 00859 00860 tag_string fGPSLatitudeRef; 00861 tag_urational_ptr fGPSLatitude; 00862 00863 tag_string fGPSLongitudeRef; 00864 tag_urational_ptr fGPSLongitude; 00865 00866 tag_uint8 fGPSAltitudeRef; 00867 tag_urational fGPSAltitude; 00868 00869 tag_urational_ptr fGPSTimeStamp; 00870 00871 tag_string fGPSSatellites; 00872 tag_string fGPSStatus; 00873 tag_string fGPSMeasureMode; 00874 00875 tag_urational fGPSDOP; 00876 00877 tag_string fGPSSpeedRef; 00878 tag_urational fGPSSpeed; 00879 00880 tag_string fGPSTrackRef; 00881 tag_urational fGPSTrack; 00882 00883 tag_string fGPSImgDirectionRef; 00884 tag_urational fGPSImgDirection; 00885 00886 tag_string fGPSMapDatum; 00887 00888 tag_string fGPSDestLatitudeRef; 00889 tag_urational_ptr fGPSDestLatitude; 00890 00891 tag_string fGPSDestLongitudeRef; 00892 tag_urational_ptr fGPSDestLongitude; 00893 00894 tag_string fGPSDestBearingRef; 00895 tag_urational fGPSDestBearing; 00896 00897 tag_string fGPSDestDistanceRef; 00898 tag_urational fGPSDestDistance; 00899 00900 tag_encoded_text fGPSProcessingMethod; 00901 tag_encoded_text fGPSAreaInformation; 00902 00903 tag_string fGPSDateStamp; 00904 00905 tag_uint16 fGPSDifferential; 00906 00907 public: 00908 00909 exif_tag_set (dng_tiff_directory &directory, 00910 const dng_exif &exif, 00911 bool makerNoteSafe = false, 00912 const void *makerNoteData = NULL, 00913 uint32 makerNoteLength = 0, 00914 bool insideDNG = false); 00915 00916 void Locate (uint32 offset) 00917 { 00918 fExifLink.Set (offset); 00919 fGPSLink .Set (offset + fExifIFD.Size ()); 00920 } 00921 00922 uint32 Size () const 00923 { 00924 return fExifIFD.Size () + 00925 fGPSIFD .Size (); 00926 } 00927 00928 void Put (dng_stream &stream) const 00929 { 00930 fExifIFD.Put (stream); 00931 fGPSIFD .Put (stream); 00932 } 00933 00934 protected: 00935 00936 void AddLinks (dng_tiff_directory &directory); 00937 00938 private: 00939 00940 // Hidden copy constructor and assignment operator. 00941 00942 exif_tag_set (const exif_tag_set &set); 00943 00944 exif_tag_set & operator= (const exif_tag_set &set); 00945 00946 }; 00947 00948 /******************************************************************************/ 00949 00950 class tiff_dng_extended_color_profile: private dng_tiff_directory 00951 { 00952 00953 protected: 00954 00955 const dng_camera_profile &fProfile; 00956 00957 public: 00958 00959 tiff_dng_extended_color_profile (const dng_camera_profile &profile); 00960 00961 void Put (dng_stream &stream, 00962 bool includeModelRestriction = true); 00963 00964 }; 00965 00966 /*****************************************************************************/ 00967 00968 class tag_dng_noise_profile: public tag_data_ptr 00969 { 00970 00971 protected: 00972 00973 real64 fValues [2 * kMaxColorPlanes]; 00974 00975 public: 00976 00977 explicit tag_dng_noise_profile (const dng_noise_profile &profile); 00978 00979 }; 00980 00981 /*****************************************************************************/ 00982 00985 00986 class dng_image_writer 00987 { 00988 00989 protected: 00990 00991 enum 00992 { 00993 00994 // Target size for buffer used to copy data to the image. 00995 00996 kImageBufferSize = 128 * 1024 00997 00998 }; 00999 01000 AutoPtr<dng_memory_block> fCompressedBuffer; 01001 01002 AutoPtr<dng_memory_block> fUncompressedBuffer; 01003 01004 AutoPtr<dng_memory_block> fSubTileBlockBuffer; 01005 01006 public: 01007 01008 dng_image_writer (); 01009 01010 virtual ~dng_image_writer (); 01011 01012 virtual void WriteImage (dng_host &host, 01013 const dng_ifd &ifd, 01014 dng_basic_tag_set &basic, 01015 dng_stream &stream, 01016 const dng_image &image, 01017 uint32 fakeChannels = 1); 01018 01031 01032 virtual void WriteTIFF (dng_host &host, 01033 dng_stream &stream, 01034 const dng_image &image, 01035 uint32 photometricInterpretation = piBlackIsZero, 01036 uint32 compression = ccUncompressed, 01037 dng_negative *negative = NULL, 01038 const dng_color_space *space = NULL, 01039 const dng_resolution *resolution = NULL, 01040 const dng_jpeg_preview *thumbnail = NULL, 01041 const dng_memory_block *imageResources = NULL); 01042 01056 01057 virtual void WriteTIFFWithProfile (dng_host &host, 01058 dng_stream &stream, 01059 const dng_image &image, 01060 uint32 photometricInterpretation = piBlackIsZero, 01061 uint32 compression = ccUncompressed, 01062 dng_negative *negative = NULL, 01063 const void *profileData = NULL, 01064 uint32 profileSize = 0, 01065 const dng_resolution *resolution = NULL, 01066 const dng_jpeg_preview *thumbnail = NULL, 01067 const dng_memory_block *imageResources = NULL); 01068 01076 01077 virtual void WriteDNG (dng_host &host, 01078 dng_stream &stream, 01079 const dng_negative &negative, 01080 const dng_image_preview &thumbnail, 01081 uint32 compression = ccJPEG, 01082 const dng_preview_list *previewList = NULL); 01083 01084 protected: 01085 01086 virtual uint32 CompressedBufferSize (const dng_ifd &ifd, 01087 uint32 uncompressedSize); 01088 01089 virtual void EncodePredictor (dng_host &host, 01090 const dng_ifd &ifd, 01091 dng_pixel_buffer &buffer); 01092 01093 virtual void ByteSwapBuffer (dng_host &host, 01094 dng_pixel_buffer &buffer); 01095 01096 void ReorderSubTileBlocks (const dng_ifd &ifd, 01097 dng_pixel_buffer &buffer); 01098 01099 virtual void WriteData (dng_host &host, 01100 const dng_ifd &ifd, 01101 dng_stream &stream, 01102 dng_pixel_buffer &buffer); 01103 01104 virtual void WriteTile (dng_host &host, 01105 const dng_ifd &ifd, 01106 dng_stream &stream, 01107 const dng_image &image, 01108 const dng_rect &tileArea, 01109 uint32 fakeChannels); 01110 01111 }; 01112 01113 /*****************************************************************************/ 01114 01115 #endif 01116 01117 /*****************************************************************************/ |