1 //========================================================================
5 //========================================================================
7 //========================================================================
9 // Modified under the Poppler project - http://poppler.freedesktop.org
11 // All changes made under the Poppler project to this file are licensed
12 // under GPL version 2 or later
14 // Copyright (C) 2009 Albert Astals Cid <aacid@kde.org>
16 // To see a description of the changes please see the Changelog file that
17 // came with your tarball or type make ChangeLog if you are building from git
19 //========================================================================
21 #ifndef SPLASHSCREEN_H
22 #define SPLASHSCREEN_H
24 #ifdef USE_GCC_PRAGMAS
28 #include "SplashTypes.h"
32 //------------------------------------------------------------------------
34 //------------------------------------------------------------------------
39 SplashScreen(SplashScreenParams
*params
);
40 SplashScreen(SplashScreen
*screen
);
43 SplashScreen
*copy() { return new SplashScreen(this); }
45 // Return the computed pixel value (0=black, 1=white) for the gray
46 // level <value> at (<x>, <y>).
47 int test(int x
, int y
, Guchar value
) {
49 if (mat
== NULL
) createMatrix();
52 return value
< mat
[(yy
<< log2Size
) + xx
] ? 0 : 1;
55 // Returns true if value is above the white threshold or below the
56 // black threshold, i.e., if the corresponding halftone will be
57 // solid white or black.
58 GBool
isStatic(Guchar value
) { if (mat
== NULL
) createMatrix(); return value
< minVal
|| value
>= maxVal
; }
63 void buildDispersedMatrix(int i
, int j
, int val
,
64 int delta
, int offset
);
65 void buildClusteredMatrix();
66 int distance(int x0
, int y0
, int x1
, int y1
);
67 void buildSCDMatrix(int r
);
69 SplashScreenParams
*screenParams
; // params to create the other members
70 Guchar
*mat
; // threshold matrix
71 int size
; // size of the threshold matrix
72 int sizeM1
; // size - 1
73 int log2Size
; // log2(size)
74 Guchar minVal
; // any pixel value below minVal generates
76 Guchar maxVal
; // any pixel value above maxVal generates