diff options
author | Karl Berry <karl@freefriends.org> | 2016-02-15 23:31:35 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-02-15 23:31:35 +0000 |
commit | 08bed0cad41932663940d45d7fcc96986c2cca3c (patch) | |
tree | b54bb3a7f70e6a42b9117173b01db776e7c2ab23 /Build/source/libs/xpdf/xpdf-src/splash/SplashScreen.h | |
parent | f0f9c5a0cfeffd612a08680752e666fcefd170ed (diff) |
rename xpdf-3.04* to xpdf-{src,PATCHES,foolabs} for new convention
git-svn-id: svn://tug.org/texlive/trunk@39736 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/libs/xpdf/xpdf-src/splash/SplashScreen.h')
-rw-r--r-- | Build/source/libs/xpdf/xpdf-src/splash/SplashScreen.h | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashScreen.h b/Build/source/libs/xpdf/xpdf-src/splash/SplashScreen.h new file mode 100644 index 00000000000..4e9767be5f6 --- /dev/null +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashScreen.h @@ -0,0 +1,65 @@ +//======================================================================== +// +// SplashScreen.h +// +// Copyright 2003-2013 Glyph & Cog, LLC +// +//======================================================================== + +#ifndef SPLASHSCREEN_H +#define SPLASHSCREEN_H + +#include <aconf.h> + +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + +#include "SplashTypes.h" + +//------------------------------------------------------------------------ +// SplashScreen +//------------------------------------------------------------------------ + +class SplashScreen { +public: + + SplashScreen(SplashScreenParams *params); + SplashScreen(SplashScreen *screen); + ~SplashScreen(); + + SplashScreen *copy() { return new SplashScreen(this); } + + // Return the computed pixel value (0=black, 1=white) for the gray + // level <value> at (<x>, <y>). + int test(int x, int y, Guchar value) { + int xx, yy; + xx = x & sizeM1; + yy = y & sizeM1; + return value < mat[(yy << log2Size) + xx] ? 0 : 1; + } + + // Returns true if value is above the white threshold or below the + // black threshold, i.e., if the corresponding halftone will be + // solid white or black. + GBool isStatic(Guchar value) { return value < minVal || value >= maxVal; } + +private: + + void buildDispersedMatrix(int i, int j, int val, + int delta, int offset); + void buildClusteredMatrix(); + int distance(int x0, int y0, int x1, int y1); + void buildSCDMatrix(int r); + + Guchar *mat; // threshold matrix + int size; // size of the threshold matrix + int sizeM1; // size - 1 + int log2Size; // log2(size) + Guchar minVal; // any pixel value below minVal generates + // solid black + Guchar maxVal; // any pixel value above maxVal generates + // solid white +}; + +#endif |