chalk

kis_substrate.h
1/*
2 * Copyright (c) 2006 Boudewijn Rempt (boud@valdyas.org)
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, Boston, MA 02110-1301, USA.
17 */
18#ifndef KIS_SUBSTRATE_H
19#define KIS_SUBSTRATE_H
20
21#include <tqrect.h>
22#include <ksharedptr.h>
23
24class KisImage;
25
29 float height; // absolute height of the current position
30 float smoothness; // determines how easily the painting tool "slips" over the surface
31 float absorbency; // determines how much wetness the substrate can absorb. XXX: How about speed of absorbing?
32 float density; // XXX?
33 TQ_UINT8 r; //.Red component of reflectivity
34 TQ_UINT8 g; // Green component of reflectivity
35 TQ_UINT8 b; // Blue component of reflectivity
36 TQ_UINT8 alpha; // For composition with the background
37};
38
47class KisSubstrate : public TDEShared {
48
49public:
50
51 KisSubstrate(KisImage * /*img*/) : TDEShared() {};
52 virtual ~KisSubstrate() {};
53
54
59 virtual void getPixels(KisSubstratePixel * substrate, const TQRect & rc) const = 0;
60
65 virtual void writePixels(const KisSubstratePixel * substrate, const TQRect & rc) = 0;
69 virtual void getPixel(KisSubstratePixel * ksp, int x, int y) const = 0;
70
74 virtual void writePixel(const KisSubstratePixel & ksp, int x, int y) = 0;
75
76};
77
78#endif
This abstract class defines the properties of a substrate – that is, the simulation of the paper or c...
virtual void writePixels(const KisSubstratePixel *substrate, const TQRect &rc)=0
Copy the specified rect of substrate pixels onto the substrate.
virtual void getPixel(KisSubstratePixel *ksp, int x, int y) const =0
Read the value at the specified position into the given substrate pixel.
virtual void writePixel(const KisSubstratePixel &ksp, int x, int y)=0
Copy the value of the given substrate pixel to the specified location.
virtual void getPixels(KisSubstratePixel *substrate, const TQRect &rc) const =0
Copy the pixel values in the specified rect into an array of Substrate.
All values are normalized to a range between 0 and 1.