]> git.ipfire.org Git - thirdparty/cups.git/blame - pdftops/SplashPattern.cxx
Load cups into easysw/current.
[thirdparty/cups.git] / pdftops / SplashPattern.cxx
CommitLineData
ef416fc2 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
21SplashPattern::SplashPattern() {
22}
23
24SplashPattern::~SplashPattern() {
25}
26
27//------------------------------------------------------------------------
28// SplashSolidColor
29//------------------------------------------------------------------------
30
31SplashSolidColor::SplashSolidColor(SplashColorPtr colorA) {
32 splashColorCopy(color, colorA);
33}
34
35SplashSolidColor::~SplashSolidColor() {
36}
37
38void SplashSolidColor::getColor(int x, int y, SplashColorPtr c) {
39 splashColorCopy(c, color);
40}
41
42//------------------------------------------------------------------------
43// SplashHalftone
44//------------------------------------------------------------------------
45
46SplashHalftone::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
54SplashPattern *SplashHalftone::copy() {
55 return new SplashHalftone(color0, color1, screen->copy(), value);
56}
57
58SplashHalftone::~SplashHalftone() {
59 delete screen;
60}
61
62void SplashHalftone::getColor(int x, int y, SplashColorPtr c) {
63 splashColorCopy(c, screen->test(x, y, value) ? color1 : color0);
64}
65
66GBool SplashHalftone::isStatic() {
67 return screen->isStatic(value);
68}