[poppler] Branch 'poppler-0.12' - configure.ac splash/SplashMath.h splash/SplashScreen.cc splash/SplashScreen.h utils/pdftoppm.cc
Albert Astals Cid
aacid at kemper.freedesktop.org
Tue Nov 17 11:45:58 PST 2009
configure.ac | 60 +++++++++++++++++++++++++------------------------
splash/SplashMath.h | 5 +---
splash/SplashScreen.cc | 21 +----------------
splash/SplashScreen.h | 3 --
utils/pdftoppm.cc | 8 ------
5 files changed, 35 insertions(+), 62 deletions(-)
New commits:
commit 781e1bfb5eeb6b41b0bcb0eea5e595f02c66b035
Author: Albert Astals Cid <aacid at kde.org>
Date: Tue Nov 17 20:45:42 2009 +0100
i didn't want to commit this
diff --git a/configure.ac b/configure.ac
index 608467d..6593cfd 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 3b72f74..7a8c8e3 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 168022f..f6be968 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 07243ef..92639a5 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 3a511c7..38c26fd 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);
More information about the poppler
mailing list