]> git.saurik.com Git - wxWidgets.git/commitdiff
Renamed the options specific to the TIFF handler.
authorDimitri Schoolwerth <dimitri.schoolwerth@gmail.com>
Fri, 19 Aug 2011 01:19:21 +0000 (01:19 +0000)
committerDimitri Schoolwerth <dimitri.schoolwerth@gmail.com>
Fri, 19 Aug 2011 01:19:21 +0000 (01:19 +0000)
The loading/saving options that are specific for TIFF were in the form of wxIMAGE_OPTION_<name> while all other non-generic options use the form wxIMAGE_OPTION_<imagetype>_<name>. Renamed the TIFF options to the form wxIMAGE_OPTION_TIFF_<name> and kept the old names for backwards compatibility.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68780 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/imagtiff.h
src/common/imagtiff.cpp

index 3021a61e4a976a05a254037f8498e3d367910fac..19d1cf1c73c68689eff8a489dc400aaab40c53a2 100644 (file)
 #include "wx/versioninfo.h"
 
 // defines for wxImage::SetOption
 #include "wx/versioninfo.h"
 
 // defines for wxImage::SetOption
-#define wxIMAGE_OPTION_BITSPERSAMPLE               wxString(wxT("BitsPerSample"))
-#define wxIMAGE_OPTION_SAMPLESPERPIXEL             wxString(wxT("SamplesPerPixel"))
-#define wxIMAGE_OPTION_COMPRESSION                 wxString(wxT("Compression"))
-#define wxIMAGE_OPTION_IMAGEDESCRIPTOR             wxString(wxT("ImageDescriptor"))
+#define wxIMAGE_OPTION_TIFF_BITSPERSAMPLE               wxString(wxT("BitsPerSample"))
+#define wxIMAGE_OPTION_TIFF_SAMPLESPERPIXEL             wxString(wxT("SamplesPerPixel"))
+#define wxIMAGE_OPTION_TIFF_COMPRESSION                 wxString(wxT("Compression"))
+#define wxIMAGE_OPTION_TIFF_IMAGEDESCRIPTOR             wxString(wxT("ImageDescriptor"))
+
+// for backwards compatibility
+#define wxIMAGE_OPTION_BITSPERSAMPLE               wxIMAGE_OPTION_TIFF_BITSPERSAMPLE
+#define wxIMAGE_OPTION_SAMPLESPERPIXEL             wxIMAGE_OPTION_TIFF_SAMPLESPERPIXEL
+#define wxIMAGE_OPTION_COMPRESSION                 wxIMAGE_OPTION_TIFF_COMPRESSION
+#define wxIMAGE_OPTION_IMAGEDESCRIPTOR             wxIMAGE_OPTION_TIFF_IMAGEDESCRIPTOR
 
 class WXDLLIMPEXP_CORE wxTIFFHandler: public wxImageHandler
 {
 
 class WXDLLIMPEXP_CORE wxTIFFHandler: public wxImageHandler
 {
index a10940d63ce865c0402d38f55cd447584b221a48..80e9cb3d9104879537f40a77cdd88c5696c264d5 100644 (file)
@@ -444,17 +444,17 @@ bool wxTIFFHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbos
     */
     if ( TIFFGetFieldDefaulted(tif, TIFFTAG_SAMPLESPERPIXEL, &spp) )
     {
     */
     if ( TIFFGetFieldDefaulted(tif, TIFFTAG_SAMPLESPERPIXEL, &spp) )
     {
-        image->SetOption(wxIMAGE_OPTION_SAMPLESPERPIXEL, spp);
+        image->SetOption(wxIMAGE_OPTION_TIFF_SAMPLESPERPIXEL, spp);
     }
 
     if ( TIFFGetFieldDefaulted(tif, TIFFTAG_BITSPERSAMPLE, &bpp) )
     {
     }
 
     if ( TIFFGetFieldDefaulted(tif, TIFFTAG_BITSPERSAMPLE, &bpp) )
     {
-        image->SetOption(wxIMAGE_OPTION_BITSPERSAMPLE, bpp);
+        image->SetOption(wxIMAGE_OPTION_TIFF_BITSPERSAMPLE, bpp);
     }
 
     if ( TIFFGetFieldDefaulted(tif, TIFFTAG_COMPRESSION, &compression) )
     {
     }
 
     if ( TIFFGetFieldDefaulted(tif, TIFFTAG_COMPRESSION, &compression) )
     {
-        image->SetOption(wxIMAGE_OPTION_COMPRESSION, compression);
+        image->SetOption(wxIMAGE_OPTION_TIFF_COMPRESSION, compression);
     }
 
     // Set the resolution unit.
     }
 
     // Set the resolution unit.
@@ -587,15 +587,15 @@ bool wxTIFFHandler::SaveFile( wxImage *image, wxOutputStream& stream, bool verbo
     }
 
 
     }
 
 
-    int spp = image->GetOptionInt(wxIMAGE_OPTION_SAMPLESPERPIXEL);
+    int spp = image->GetOptionInt(wxIMAGE_OPTION_TIFF_SAMPLESPERPIXEL);
     if ( !spp )
         spp = 3;
 
     if ( !spp )
         spp = 3;
 
-    int bpp = image->GetOptionInt(wxIMAGE_OPTION_BITSPERSAMPLE);
+    int bpp = image->GetOptionInt(wxIMAGE_OPTION_TIFF_BITSPERSAMPLE);
     if ( !bpp )
         bpp = 8;
 
     if ( !bpp )
         bpp = 8;
 
-    int compression = image->GetOptionInt(wxIMAGE_OPTION_COMPRESSION);
+    int compression = image->GetOptionInt(wxIMAGE_OPTION_TIFF_COMPRESSION);
     if ( !compression )
     {
         // we can't use COMPRESSION_LZW because current version of libtiff
     if ( !compression )
     {
         // we can't use COMPRESSION_LZW because current version of libtiff