//-----------------------------------------------------------------------------
// wxTIFFHandler
//-----------------------------------------------------------------------------
IMPLEMENT_DYNAMIC_CLASS(wxTIFFHandler,wxImageHandler)
//-----------------------------------------------------------------------------
// wxTIFFHandler
//-----------------------------------------------------------------------------
IMPLEMENT_DYNAMIC_CLASS(wxTIFFHandler,wxImageHandler)
_tiffReadProc(thandle_t handle, tdata_t buf, tsize_t size)
{
wxInputStream *stream = (wxInputStream*) handle;
_tiffReadProc(thandle_t handle, tdata_t buf, tsize_t size)
{
wxInputStream *stream = (wxInputStream*) handle;
_tiffWriteProc(thandle_t handle, tdata_t buf, tsize_t size)
{
wxOutputStream *stream = (wxOutputStream*) handle;
_tiffWriteProc(thandle_t handle, tdata_t buf, tsize_t size)
{
wxOutputStream *stream = (wxOutputStream*) handle;
_tiffSeekIProc(thandle_t handle, toff_t off, int whence)
{
wxInputStream *stream = (wxInputStream*) handle;
_tiffSeekIProc(thandle_t handle, toff_t off, int whence)
{
wxInputStream *stream = (wxInputStream*) handle;
_tiffSeekOProc(thandle_t handle, toff_t off, int whence)
{
wxOutputStream *stream = (wxOutputStream*) handle;
_tiffSeekOProc(thandle_t handle, toff_t off, int whence)
{
wxOutputStream *stream = (wxOutputStream*) handle;
_tiffSizeProc(thandle_t handle)
{
wxStreamBase *stream = (wxStreamBase*) handle;
return (toff_t) stream->GetSize();
}
_tiffSizeProc(thandle_t handle)
{
wxStreamBase *stream = (wxStreamBase*) handle;
return (toff_t) stream->GetSize();
}
_tiffMapProc(thandle_t WXUNUSED(handle),
tdata_t* WXUNUSED(pbase),
toff_t* WXUNUSED(psize))
_tiffMapProc(thandle_t WXUNUSED(handle),
tdata_t* WXUNUSED(pbase),
toff_t* WXUNUSED(psize))
bool wxTIFFHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbose, int index )
{
bool wxTIFFHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbose, int index )
{
TIFFSetField(tif, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
TIFFSetField(tif, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_RGB);
TIFFSetField(tif, TIFFTAG_COMPRESSION, COMPRESSION_LZW);
TIFFSetField(tif, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
TIFFSetField(tif, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_RGB);
TIFFSetField(tif, TIFFTAG_COMPRESSION, COMPRESSION_LZW);
{
buf = NULL;
}
TIFFSetField(tif, TIFFTAG_ROWSPERSTRIP,
TIFFDefaultStripSize(tif, (uint32) -1));
{
buf = NULL;
}
TIFFSetField(tif, TIFFTAG_ROWSPERSTRIP,
TIFFDefaultStripSize(tif, (uint32) -1));
- if (buf)
- memcpy(buf, ptr, image->GetWidth());
-
- if (TIFFWriteScanline(tif, buf ? buf : ptr, (uint32)row, 0) < 0)
+ if (buf)
+ memcpy(buf, ptr, image->GetWidth());
+
+ if (TIFFWriteScanline(tif, buf ? buf : ptr, (uint32)row, 0) < 0)