filters

kis_tiff_stream.h

00001 /*
00002  *  Copyright (c) 2005-2006 Cyrille Berger <cberger@cberger.net>
00003  *
00004  *  This program is free software; you can redistribute it and/or modify
00005  *  it under the terms of the GNU General Public License as published by
00006  *  the Free Software Foundation; either version 2 of the License, or
00007  *  (at your option) any later version.
00008  *
00009  *  This program is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *  GNU General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU General Public License
00015  *  along with this program; if not, write to the Free Software
00016  *  Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017  * Boston, MA 02110-1301, USA.
00018  */
00019 
00020 #ifndef TIFFSTREAM_H_
00021 #define TIFFSTREAM_H_
00022 
00023 #include <tiffio.h>
00024 
00025 class TIFFStreamBase {
00026     public:
00027        TIFFStreamBase( uint16 depth ) : m_depth(depth) {};
00028         virtual uint32 nextValue() =0;
00029         virtual void restart() =0;
00030         virtual void moveToLine(uint32 lineNumber) =0;
00031     protected:
00032         uint16 m_depth;
00033 };
00034 
00035 class TIFFStreamContigBase : public TIFFStreamBase {
00036     public:
00037         TIFFStreamContigBase( uint8* src, uint16 depth, uint32 lineSize );
00038         virtual void restart();
00039         virtual void moveToLine(uint32 lineNumber);
00040     protected:
00041         uint8* m_src;
00042         uint8* m_srcit;
00043         uint8 m_posinc;
00044         uint32 m_lineSize;
00045 };
00046 
00047 class TIFFStreamContigBelow16 : public TIFFStreamContigBase {
00048     public:
00049         TIFFStreamContigBelow16( uint8* src, uint16 depth, uint32 lineSize ) : TIFFStreamContigBase(src, depth, lineSize) { }
00050     public:
00051         virtual uint32 nextValue();
00052 };
00053 
00054 class TIFFStreamContigBelow32 : public TIFFStreamContigBase {
00055     public:
00056         TIFFStreamContigBelow32( uint8* src, uint16 depth, uint32 lineSize ) : TIFFStreamContigBase(src, depth, lineSize) { }
00057     public:
00058         virtual uint32 nextValue();
00059 };
00060 
00061 class TIFFStreamContigAbove32 : public TIFFStreamContigBase {
00062     public:
00063         TIFFStreamContigAbove32( uint8* src, uint16 depth, uint32 lineSize ) : TIFFStreamContigBase(src, depth, lineSize) { }
00064     public:
00065         virtual uint32 nextValue();
00066 };
00067 
00068 
00069 class TIFFStreamSeperate : public TIFFStreamBase {
00070     public:
00071         TIFFStreamSeperate( uint8** srcs, uint8 nb_samples ,uint16 depth, uint32* lineSize);
00072         ~TIFFStreamSeperate();
00073         virtual uint32 nextValue();
00074         virtual void restart();
00075         virtual void moveToLine(uint32 lineNumber);
00076     private:
00077         TIFFStreamContigBase** streams;
00078         uint8 m_current_sample, m_nb_samples;
00079 };
00080 
00081 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys