]> www.fi.muni.cz Git - evince.git/blob - pdf/splash/SplashPattern.cc
Initial revision
[evince.git] / pdf / splash / SplashPattern.cc
1 //========================================================================
2 //
3 // SplashPattern.cc
4 //
5 //========================================================================
6
7 #include <aconf.h>
8
9 #ifdef USE_GCC_PRAGMAS
10 #pragma implementation
11 #endif
12
13 #include "SplashMath.h"
14 #include "SplashScreen.h"
15 #include "SplashPattern.h"
16
17 //------------------------------------------------------------------------
18 // SplashPattern
19 //------------------------------------------------------------------------
20
21 SplashPattern::SplashPattern() {
22 }
23
24 SplashPattern::~SplashPattern() {
25 }
26
27 //------------------------------------------------------------------------
28 // SplashSolidColor
29 //------------------------------------------------------------------------
30
31 SplashSolidColor::SplashSolidColor(SplashColor colorA) {
32   color = colorA;
33 }
34
35 SplashSolidColor::~SplashSolidColor() {
36 }
37
38 SplashColor SplashSolidColor::getColor(int x, int y) {
39   return color;
40 }
41
42 //------------------------------------------------------------------------
43 // SplashHalftone
44 //------------------------------------------------------------------------
45
46 SplashHalftone::SplashHalftone(SplashColor color0A, SplashColor color1A,
47                                SplashScreen *screenA, SplashCoord valueA) {
48   color0 = color0A;
49   color1 = color1A;
50   screen = screenA;
51   value = valueA;
52 }
53
54 SplashPattern *SplashHalftone::copy() {
55   return new SplashHalftone(color0, color1, screen->copy(), value);
56 }
57
58 SplashHalftone::~SplashHalftone() {
59   delete screen;
60 }
61
62 SplashColor SplashHalftone::getColor(int x, int y) {
63   return screen->test(x, y, value) ? color1 : color0;
64 }