]> git.ipfire.org Git - thirdparty/cups.git/blob - pdftops/SplashPattern.cxx
Load cups into easysw/current.
[thirdparty/cups.git] / pdftops / SplashPattern.cxx
1 //========================================================================
2 //
3 // SplashPattern.cc
4 //
5 //========================================================================
6
7 #include <config.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(SplashColorPtr colorA) {
32 splashColorCopy(color, colorA);
33 }
34
35 SplashSolidColor::~SplashSolidColor() {
36 }
37
38 void SplashSolidColor::getColor(int x, int y, SplashColorPtr c) {
39 splashColorCopy(c, color);
40 }
41
42 //------------------------------------------------------------------------
43 // SplashHalftone
44 //------------------------------------------------------------------------
45
46 SplashHalftone::SplashHalftone(SplashColorPtr color0A, SplashColorPtr color1A,
47 SplashScreen *screenA, SplashCoord valueA) {
48 splashColorCopy(color0, color0A);
49 splashColorCopy(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 void SplashHalftone::getColor(int x, int y, SplashColorPtr c) {
63 splashColorCopy(c, screen->test(x, y, value) ? color1 : color0);
64 }
65
66 GBool SplashHalftone::isStatic() {
67 return screen->isStatic(value);
68 }