From d65172db909ddd431a9f303949dadc57f6ac16fb Mon Sep 17 00:00:00 2001 From: Dimitri Schoolwerth Date: Fri, 19 Aug 2011 01:19:21 +0000 Subject: [PATCH] Renamed the options specific to the TIFF handler. The loading/saving options that are specific for TIFF were in the form of wxIMAGE_OPTION_ while all other non-generic options use the form wxIMAGE_OPTION__. Renamed the TIFF options to the form wxIMAGE_OPTION_TIFF_ 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 | 14 ++++++++++---- src/common/imagtiff.cpp | 12 ++++++------ 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/include/wx/imagtiff.h b/include/wx/imagtiff.h index 3021a61..19d1cf1 100644 --- a/include/wx/imagtiff.h +++ b/include/wx/imagtiff.h @@ -22,10 +22,16 @@ #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 { diff --git a/src/common/imagtiff.cpp b/src/common/imagtiff.cpp index a10940d..80e9cb3 100644 --- a/src/common/imagtiff.cpp +++ b/src/common/imagtiff.cpp @@ -444,17 +444,17 @@ bool wxTIFFHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbos */ 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) ) { - image->SetOption(wxIMAGE_OPTION_BITSPERSAMPLE, bpp); + image->SetOption(wxIMAGE_OPTION_TIFF_BITSPERSAMPLE, bpp); } if ( TIFFGetFieldDefaulted(tif, TIFFTAG_COMPRESSION, &compression) ) { - image->SetOption(wxIMAGE_OPTION_COMPRESSION, compression); + image->SetOption(wxIMAGE_OPTION_TIFF_COMPRESSION, compression); } // 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; - int bpp = image->GetOptionInt(wxIMAGE_OPTION_BITSPERSAMPLE); + int bpp = image->GetOptionInt(wxIMAGE_OPTION_TIFF_BITSPERSAMPLE); 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 -- 2.7.4