filters

kis_tiff_stream.h
1/*
2 * Copyright (c) 2005-2006 Cyrille Berger <cberger@cberger.net>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18 */
19
20#ifndef TIFFSTREAM_H_
21#define TIFFSTREAM_H_
22
23#include <tiffio.h>
24
25class TIFFStreamBase {
26 public:
27 TIFFStreamBase( uint16 depth ) : m_depth(depth) {};
28 virtual uint32 nextValue() =0;
29 virtual void restart() =0;
30 virtual void moveToLine(uint32 lineNumber) =0;
31 protected:
32 uint16 m_depth;
33};
34
35class TIFFStreamContigBase : public TIFFStreamBase {
36 public:
37 TIFFStreamContigBase( uint8* src, uint16 depth, uint32 lineSize );
38 virtual void restart();
39 virtual void moveToLine(uint32 lineNumber);
40 protected:
41 uint8* m_src;
42 uint8* m_srcit;
43 uint8 m_posinc;
44 uint32 m_lineSize;
45};
46
47class TIFFStreamContigBelow16 : public TIFFStreamContigBase {
48 public:
49 TIFFStreamContigBelow16( uint8* src, uint16 depth, uint32 lineSize ) : TIFFStreamContigBase(src, depth, lineSize) { }
50 public:
51 virtual uint32 nextValue();
52};
53
54class TIFFStreamContigBelow32 : public TIFFStreamContigBase {
55 public:
56 TIFFStreamContigBelow32( uint8* src, uint16 depth, uint32 lineSize ) : TIFFStreamContigBase(src, depth, lineSize) { }
57 public:
58 virtual uint32 nextValue();
59};
60
61class TIFFStreamContigAbove32 : public TIFFStreamContigBase {
62 public:
63 TIFFStreamContigAbove32( uint8* src, uint16 depth, uint32 lineSize ) : TIFFStreamContigBase(src, depth, lineSize) { }
64 public:
65 virtual uint32 nextValue();
66};
67
68
69class TIFFStreamSeperate : public TIFFStreamBase {
70 public:
71 TIFFStreamSeperate( uint8** srcs, uint8 nb_samples ,uint16 depth, uint32* lineSize);
72 ~TIFFStreamSeperate();
73 virtual uint32 nextValue();
74 virtual void restart();
75 virtual void moveToLine(uint32 lineNumber);
76 private:
77 TIFFStreamContigBase** streams;
78 uint8 m_current_sample, m_nb_samples;
79};
80
81#endif