forked from KDE/krita
-
Notifications
You must be signed in to change notification settings - Fork 0
/
kis_buffer_stream.h
97 lines (86 loc) · 2.89 KB
/
kis_buffer_stream.h
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/*
* 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 _KIS_BUFFER_STREAM_H_
#define _KIS_BUFFER_STREAM_H_
#ifdef _MSC_VER
#define KDEWIN_STDIO_H // Remove KDEWIN extensions to stdio.h
#include <stdio.h>
#endif
#include <tiffio.h>
class KisBufferStreamBase
{
public:
KisBufferStreamBase(uint16 depth) : m_depth(depth) {}
virtual uint32 nextValue() = 0;
virtual void restart() = 0;
virtual void moveToLine(uint32 lineNumber) = 0;
virtual ~KisBufferStreamBase() {}
protected:
uint16 m_depth;
};
class KisBufferStreamContigBase : public KisBufferStreamBase
{
public:
KisBufferStreamContigBase(uint8* src, uint16 depth, uint32 lineSize);
virtual void restart();
virtual void moveToLine(uint32 lineNumber);
virtual ~KisBufferStreamContigBase() {}
protected:
uint8* m_src;
uint8* m_srcIt;
uint8 m_posinc;
uint32 m_lineSize;
};
class KisBufferStreamContigBelow16 : public KisBufferStreamContigBase
{
public:
KisBufferStreamContigBelow16(uint8* src, uint16 depth, uint32 lineSize) : KisBufferStreamContigBase(src, depth, lineSize) { }
public:
virtual ~KisBufferStreamContigBelow16() {}
virtual uint32 nextValue();
};
class KisBufferStreamContigBelow32 : public KisBufferStreamContigBase
{
public:
KisBufferStreamContigBelow32(uint8* src, uint16 depth, uint32 lineSize) : KisBufferStreamContigBase(src, depth, lineSize) { }
public:
virtual ~KisBufferStreamContigBelow32() {}
virtual uint32 nextValue();
};
class KisBufferStreamContigAbove32 : public KisBufferStreamContigBase
{
public:
KisBufferStreamContigAbove32(uint8* src, uint16 depth, uint32 lineSize) : KisBufferStreamContigBase(src, depth, lineSize) { }
public:
virtual ~KisBufferStreamContigAbove32() {}
virtual uint32 nextValue();
};
class KisBufferStreamSeperate : public KisBufferStreamBase
{
public:
KisBufferStreamSeperate(uint8** srcs, uint8 nb_samples , uint16 depth, uint32* lineSize);
virtual ~KisBufferStreamSeperate();
virtual uint32 nextValue();
virtual void restart();
virtual void moveToLine(uint32 lineNumber);
private:
KisBufferStreamContigBase** streams;
uint8 m_current_sample, m_nb_samples;
};
#endif