#line 1 "/user/cvsspst/ees1cg/RAVL/RAVL-0.7/Image/ExternalImageIO/ImgIOTiffB.hh" // This file is part of RAVL, Recognition And Vision Library // Copyright (C) 2001, University of Surrey // This code may be redistributed under the terms of the GNU Lesser // General Public License (LGPL). See the lgpl.licence file for details or // see http://www.gnu.org/copyleft/lesser.html // file-header-ends-here #ifndef RAVLDPIMAGEIOPPM_HEADER #define RAVLDPIMAGEIOPPM_HEADER /////////////////////////////////////////////////// //! userlevel=Develop //! rcsid="$Id: ImgIOTiffB.hh,v 1.6 2001/10/17 11:53:05 craftit Exp $" //! file="Ravl/Image/ExternalImageIO/ImgIOTiffB.hh" //! lib=RavlExtImgIO //! docentry="Ravl.Images.IO.Formats" //! author="Charles Galambos" //! date="29/10/98" #include "Ravl/DP/FileFormat.hh" #include "Ravl/DP/Port.hh" #include "Ravl/Stream.hh" #include "Ravl/Image/ImgIOTiff.hh" #include "Ravl/Image/ByteRGBAValue.hh" #include namespace RavlImageN { //: TIFF Utilities class DPImageIOTIFFBaseC { public: DPImageIOTIFFBaseC(); //: Constructor. ~DPImageIOTIFFBaseC(); //: Destructor. protected: TIFF *tif; }; //: Load a RGBA image. class DPIImageTIFFByteRGBABodyC : public DPIPortBodyC >, public DPImageIOTIFFBaseC { public: DPIImageTIFFByteRGBABodyC(StringC fn); //: Constructor from filename. DPIImageTIFFByteRGBABodyC(const IStreamC &in); //: Constructor from stream. virtual bool IsGetEOS() const; //: Is valid data ? virtual ImageC Get(); //: Get next piece of data. protected: static tsize_t TIFFReadProc(thandle_t, tdata_t, tsize_t); static tsize_t TIFFWriteProc(thandle_t, tdata_t, tsize_t); static toff_t TIFFSeekProc(thandle_t, toff_t, int); static int TIFFCloseProc(thandle_t); static toff_t TIFFSizeProc(thandle_t); static int TIFFMapFileProc(thandle_t, tdata_t*, toff_t*); static void TIFFUnmapFileProc(thandle_t, tdata_t, toff_t); IStreamC inf; // Infile. bool done; }; //: Save a ByteRGBA image. class DPOImageTIFFByteRGBABodyC : public DPOPortBodyC >, public DPImageIOTIFFBaseC { public: DPOImageTIFFByteRGBABodyC(StringC fn); //: Constructor from filename. DPOImageTIFFByteRGBABodyC(const OStreamC &strm); //: Constructor from filename. virtual bool Put(const ImageC &dat); //: Put data. virtual bool IsPutReady() const ; //: Is port ready for data ? protected: static tsize_t TIFFReadProc(thandle_t, tdata_t, tsize_t); static tsize_t TIFFWriteProc(thandle_t, tdata_t, tsize_t); static toff_t TIFFSeekProc(thandle_t, toff_t, int); static int TIFFCloseProc(thandle_t); static toff_t TIFFSizeProc(thandle_t); static int TIFFMapFileProc(thandle_t, tdata_t*, toff_t*); static void TIFFUnmapFileProc(thandle_t, tdata_t, toff_t); OStreamC outf; // Infile. bool done; }; } #endif