summaryrefslogtreecommitdiffstats
path: root/filters/chalk/tiff/kis_tiff_stream.h
blob: f203568e8fb6edbcd4152076abd5116d4bc5a5ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/*
 *  Copyright (c) 2005-2006 Cyrille Berger <cberger@cberger.net>
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301, USA.
 */

#ifndef TIFFSTREAM_H_
#define TIFFSTREAM_H_

#include <tiffio.h>

class TIFFStreamBase {
    public:
       TIFFStreamBase( uint16 depth ) : m_depth(depth) {};
        virtual uint32 nextValue() =0;
        virtual void restart() =0;
        virtual void moveToLine(uint32 lineNumber) =0;
    protected:
        uint16 m_depth;
};

class TIFFStreamContigBase : public TIFFStreamBase {
    public:
        TIFFStreamContigBase( uint8* src, uint16 depth, uint32 lineSize );
        virtual void restart();
        virtual void moveToLine(uint32 lineNumber);
    protected:
        uint8* m_src;
        uint8* m_srcit;
        uint8 m_posinc;
        uint32 m_lineSize;
};

class TIFFStreamContigBelow16 : public TIFFStreamContigBase {
    public:
        TIFFStreamContigBelow16( uint8* src, uint16 depth, uint32 lineSize ) : TIFFStreamContigBase(src, depth, lineSize) { }
    public:
        virtual uint32 nextValue();
};

class TIFFStreamContigBelow32 : public TIFFStreamContigBase {
    public:
        TIFFStreamContigBelow32( uint8* src, uint16 depth, uint32 lineSize ) : TIFFStreamContigBase(src, depth, lineSize) { }
    public:
        virtual uint32 nextValue();
};

class TIFFStreamContigAbove32 : public TIFFStreamContigBase {
    public:
        TIFFStreamContigAbove32( uint8* src, uint16 depth, uint32 lineSize ) : TIFFStreamContigBase(src, depth, lineSize) { }
    public:
        virtual uint32 nextValue();
};


class TIFFStreamSeperate : public TIFFStreamBase {
    public:
        TIFFStreamSeperate( uint8** srcs, uint8 nb_samples ,uint16 depth, uint32* lineSize);
        ~TIFFStreamSeperate();
        virtual uint32 nextValue();
        virtual void restart();
        virtual void moveToLine(uint32 lineNumber);
    private:
        TIFFStreamContigBase** streams;
        uint8 m_current_sample, m_nb_samples;
};

#endif