Renamed the options specific to the TIFF handler.
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
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user