summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2009-11-17 20:45:42 +0100
committerAlbert Astals Cid <aacid@kde.org>2009-11-17 20:45:42 +0100
commit781e1bfb5eeb6b41b0bcb0eea5e595f02c66b035 (patch)
tree551c61378c1400241aec6e5ace38952e3fdcd44d
parent3e59f5666c0521db85b3a8a6f05ecb07e45c1b87 (diff)
i didn't want to commit this
-rw-r--r--configure.ac60
-rw-r--r--splash/SplashMath.h5
-rw-r--r--splash/SplashScreen.cc21
-rw-r--r--splash/SplashScreen.h3
-rw-r--r--utils/pdftoppm.cc8
5 files changed, 35 insertions, 62 deletions
diff --git a/configure.ac b/configure.ac
index 608467d6..6593cfd9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -109,35 +109,6 @@ fi
dnl ##### Checks for library functions.
AC_CHECK_FUNCS(popen mkstemp mkstemps)
-dnl Test for libopenjpeg
-AC_ARG_ENABLE(libopenjpeg,
- AC_HELP_STRING([--disable-libopenjpeg],
- [Don't build against libopenjpeg.]),
- enable_libopenjpeg=$enableval,
- enable_libopenjpeg="try")
-if test x$enable_libopenjpeg = xyes; then
- AC_CHECK_LIB([openjpeg], [opj_cio_open],,
- AC_MSG_ERROR("*** libopenjpeg library not found ***"))
- AC_CHECK_HEADERS([openjpeg.h],,
- AC_MSG_ERROR("*** libopenjpeg headers not found ***"))
-elif test x$enable_libopenjpeg = xtry; then
- AC_CHECK_LIB([openjpeg], [opj_cio_open],
- [enable_libopenjpeg="yes"],
- [enable_libopenjpeg="no"])
- AC_CHECK_HEADERS([openjpeg.h],,
- [enable_libopenjpeg="no"])
-fi
-
-if test x$enable_libopenjpeg = xyes; then
- LIBOPENJPEG_LIBS="-lopenjpeg"
- AC_SUBST(LIBOPENJPEG_LIBS)
- AC_DEFINE(ENABLE_LIBOPENJPEG)
-fi
-
-AM_CONDITIONAL(BUILD_LIBOPENJPEG, test x$enable_libopenjpeg = xyes)
-AH_TEMPLATE([ENABLE_LIBOPENJPEG],
- [Use libopenjpeg instead of builtin jpeg2000 decoder.])
-
dnl ##### Back to C for the library tests.
AC_LANG_C
@@ -179,6 +150,37 @@ AH_TEMPLATE([ENABLE_ZLIB],
[Use zlib instead of builtin zlib decoder.])
+dnl Test for libopenjpeg
+AC_ARG_ENABLE(libopenjpeg,
+ AC_HELP_STRING([--disable-libopenjpeg],
+ [Don't build against libopenjpeg.]),
+ enable_libopenjpeg=$enableval,
+ enable_libopenjpeg="try")
+if test x$enable_libopenjpeg = xyes; then
+ AC_CHECK_LIB([openjpeg], [opj_cio_open],,
+ AC_MSG_ERROR("*** libopenjpeg library not found ***"))
+ AC_CHECK_HEADERS([openjpeg.h],,
+ AC_MSG_ERROR("*** libopenjpeg headers not found ***"))
+elif test x$enable_libopenjpeg = xtry; then
+ AC_CHECK_LIB([openjpeg], [opj_cio_open],
+ [enable_libopenjpeg="yes"],
+ [enable_libopenjpeg="no"])
+ AC_CHECK_HEADERS([openjpeg.h],,
+ [enable_libopenjpeg="no"])
+fi
+
+if test x$enable_libopenjpeg = xyes; then
+ LIBOPENJPEG_LIBS="-lopenjpeg"
+ AC_SUBST(LIBOPENJPEG_LIBS)
+ AC_DEFINE(ENABLE_LIBOPENJPEG)
+fi
+
+AM_CONDITIONAL(BUILD_LIBOPENJPEG, test x$enable_libopenjpeg = xyes)
+AH_TEMPLATE([ENABLE_LIBOPENJPEG],
+ [Use libopenjpeg instead of builtin jpeg2000 decoder.])
+
+
+
dnl Test for libjpeg
AC_ARG_ENABLE(libjpeg,
AC_HELP_STRING([--disable-libjpeg],
diff --git a/splash/SplashMath.h b/splash/SplashMath.h
index 3b72f74f..7a8c8e31 100644
--- a/splash/SplashMath.h
+++ b/splash/SplashMath.h
@@ -26,8 +26,7 @@ static inline int splashFloor(SplashCoord x) {
#if USE_FIXEDPOINT
return FixedPoint::floor(x);
#else
- if (x > 0) return (int)x;
- else return (int)floor(x);
+ return (int)floor(x);
#endif
}
@@ -43,7 +42,7 @@ static inline int splashRound(SplashCoord x) {
#if USE_FIXEDPOINT
return FixedPoint::round(x);
#else
- return (int)splashFloor(x + 0.5);
+ return (int)floor(x + 0.5);
#endif
}
diff --git a/splash/SplashScreen.cc b/splash/SplashScreen.cc
index 168022f0..f6be968f 100644
--- a/splash/SplashScreen.cc
+++ b/splash/SplashScreen.cc
@@ -46,25 +46,13 @@ static int cmpDistances(const void *p0, const void *p1) {
// threshold matrix using recursive tesselation. Gamma correction
// (gamma = 1 / 1.33) is also computed here.
SplashScreen::SplashScreen(SplashScreenParams *params) {
+ Guchar u, black, white;
+ int i;
if (!params) {
params = &defaultParams;
}
- screenParams = params;
- mat = NULL;
- size = 0;
- maxVal = 0;
- minVal = 0;
-}
-
-void SplashScreen::createMatrix()
-{
- Guchar u, black, white;
- int i;
-
- SplashScreenParams *params = screenParams;
-
switch (params->type) {
case splashScreenDispersed:
@@ -361,7 +349,6 @@ void SplashScreen::buildSCDMatrix(int r) {
}
SplashScreen::SplashScreen(SplashScreen *screen) {
- screenParams = screen->screenParams;
size = screen->size;
mat = (Guchar *)gmallocn(size * size, sizeof(Guchar));
memcpy(mat, screen->mat, size * size * sizeof(Guchar));
@@ -376,8 +363,6 @@ SplashScreen::~SplashScreen() {
int SplashScreen::test(int x, int y, Guchar value) {
int xx, yy;
- if (mat == NULL) createMatrix();
-
if (value < minVal) {
return 0;
}
@@ -394,7 +379,5 @@ int SplashScreen::test(int x, int y, Guchar value) {
}
GBool SplashScreen::isStatic(Guchar value) {
- if (mat == NULL) createMatrix();
-
return value < minVal || value >= maxVal;
}
diff --git a/splash/SplashScreen.h b/splash/SplashScreen.h
index 07243ef2..92639a56 100644
--- a/splash/SplashScreen.h
+++ b/splash/SplashScreen.h
@@ -36,15 +36,12 @@ public:
GBool isStatic(Guchar value);
private:
- void createMatrix();
-
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);
- SplashScreenParams *screenParams; // params to create the other members
Guchar *mat; // threshold matrix
int size; // size of the threshold matrix
Guchar minVal; // any pixel value below minVal generates
diff --git a/utils/pdftoppm.cc b/utils/pdftoppm.cc
index 3a511c7e..38c26fd7 100644
--- a/utils/pdftoppm.cc
+++ b/utils/pdftoppm.cc
@@ -41,8 +41,6 @@
static int firstPage = 1;
static int lastPage = 0;
-static GBool printOnlyOdd = gFalse;
-static GBool printOnlyEven = gFalse;
static double resolution = 0.0;
static double x_resolution = 150.0;
static double y_resolution = 150.0;
@@ -72,10 +70,6 @@ static const ArgDesc argDesc[] = {
"first page to print"},
{"-l", argInt, &lastPage, 0,
"last page to print"},
- {"-o", argFlag, &printOnlyOdd, 0,
- "print only odd pages"},
- {"-e", argFlag, &printOnlyEven, 0,
- "print only even pages"},
{"-r", argFP, &resolution, 0,
"resolution, in DPI (default is 150)"},
@@ -278,8 +272,6 @@ int main(int argc, char *argv[]) {
if (sz != 0) w = h = sz;
pg_num_len = (int)ceil(log((double)doc->getNumPages()) / log((double)10));
for (pg = firstPage; pg <= lastPage; ++pg) {
- if (printOnlyEven && pg % 2 == 0) continue;
- if (printOnlyOdd && pg % 2 == 1) continue;
if (useCropBox) {
pg_w = doc->getPageCropWidth(pg);
pg_h = doc->getPageCropHeight(pg);