[poppler]
poppler/qt4/src: poppler-page.cc, 1.23, 1.24 poppler-qt4.h,
1.32, 1.33
Albert Astals Cid
aacid at kemper.freedesktop.org
Thu Jun 1 14:03:40 PDT 2006
Update of /cvs/poppler/poppler/qt4/src
In directory kemper:/tmp/cvs-serv27932/qt4/src
Modified Files:
poppler-page.cc poppler-qt4.h
Log Message:
* qt4/src/poppler-qt4.h:
* qt4/src/poppler-page.cc: Add Rotation parameter that is passed
to the respective output devs
Index: poppler-page.cc
===================================================================
RCS file: /cvs/poppler/poppler/qt4/src/poppler-page.cc,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- poppler-page.cc 21 May 2006 18:14:15 -0000 1.23
+++ poppler-page.cc 1 Jun 2006 21:03:38 -0000 1.24
@@ -57,12 +57,14 @@
delete m_page;
}
-QImage Page::splashRenderToImage(double xres, double yres, int x, int y, int w, int h, bool doLinks) const
+QImage Page::splashRenderToImage(double xres, double yres, int x, int y, int w, int h, bool doLinks, Rotation rotate) const
{
SplashOutputDev *output_dev = m_page->parentDoc->m_doc->getSplashOutputDev();
+ int rotation = (int)rotate * 90;
+
m_page->parentDoc->m_doc->doc.displayPageSlice(output_dev, m_page->index + 1, xres, yres,
- 0, false, true, doLinks, x, y, w, h);
+ rotation, false, true, doLinks, x, y, w, h);
SplashBitmap *bitmap = output_dev->getBitmap ();
int bw = bitmap->getWidth();
@@ -95,9 +97,9 @@
return img;
}
-QPixmap *Page::splashRenderToPixmap(double xres, double yres, int x, int y, int w, int h, bool doLinks) const
+QPixmap *Page::splashRenderToPixmap(double xres, double yres, int x, int y, int w, int h, bool doLinks, Rotation rotate) const
{
- QImage img = splashRenderToImage(xres, yres, x, y, w, h, doLinks);
+ QImage img = splashRenderToImage(xres, yres, x, y, w, h, doLinks, rotate);
// Turn the QImage into a QPixmap
QPixmap* out = new QPixmap(QPixmap::fromImage(img));
@@ -159,7 +161,7 @@
return result;
}
-bool Page::search(const QString &text, QRectF &rect, SearchDirection direction, SearchMode caseSensitive) const
+bool Page::search(const QString &text, QRectF &rect, SearchDirection direction, SearchMode caseSensitive, Rotation rotate) const
{
const QChar * str = text.unicode();
int len = text.length();
@@ -177,9 +179,11 @@
sRight = rect.right();
sBottom = rect.bottom();
+ int rotation = (int)rotate * 90;
+
// fetch ourselves a textpage
TextOutputDev td(NULL, gTrue, gFalse, gFalse);
- m_page->parentDoc->m_doc->doc.displayPage( &td, m_page->index + 1, 72, 72, 0, false, true, false );
+ m_page->parentDoc->m_doc->doc.displayPage( &td, m_page->index + 1, 72, 72, rotation, false, true, false );
TextPage *textPage=td.takeText();
if (direction == FromTop)
@@ -202,16 +206,18 @@
return found;
}
-QList<TextBox*> Page::textList() const
+QList<TextBox*> Page::textList(Rotation rotate) const
{
TextOutputDev *output_dev;
QList<TextBox*> output_list;
output_dev = new TextOutputDev(0, gFalse, gFalse, gFalse);
+
+ int rotation = (int)rotate * 90;
m_page->parentDoc->m_doc->doc.displayPageSlice(output_dev, m_page->index + 1, 72, 72,
- 0, false, false, false, -1, -1, -1, -1);
+ rotation, false, false, false, -1, -1, -1, -1);
TextWordList *word_list = output_dev->makeWordList();
Index: poppler-qt4.h
===================================================================
RCS file: /cvs/poppler/poppler/qt4/src/poppler-qt4.h,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- poppler-qt4.h 12 May 2006 20:40:05 -0000 1.32
+++ poppler-qt4.h 1 Jun 2006 21:03:38 -0000 1.33
@@ -222,6 +222,8 @@
public:
~Page();
+ enum Rotation { Rotate0 = 0, Rotate90 = 1, Rotate180 = 2, Rotate270 = 3 };
+
/**
Render the page to a QImage using the Splash renderer
@@ -254,6 +256,8 @@
dots per inch
\param doLinks calculate links
+
+ \param rotate how to rotate the page
\warning The parameter (x,y,w,h) are not
well-tested. Unusual or meaningless parameters may lead to
@@ -261,8 +265,7 @@
\returns a QImage of the page, or a null image on failure.
*/
- QImage splashRenderToImage(double xres=72.0, double yres=72.0, int x=-1, int y=-1, int w=-1, int h=-1, bool doLinks = false) const;
-
+ QImage splashRenderToImage(double xres=72.0, double yres=72.0, int x=-1, int y=-1, int w=-1, int h=-1, bool doLinks = false, Rotation rotate = Rotate0) const;
/**
Render the page to a QPixmap using the Splash renderer
@@ -284,7 +287,8 @@
delete pixmap;
@endcode
*/
- QPixmap *splashRenderToPixmap(double xres=72.0, double yres=72.0, int x=-1, int y=-1, int w=-1, int h=-1, bool doLinks = false) const;
+
+ QPixmap *splashRenderToPixmap(double xres=72.0, double yres=72.0, int x=-1, int y=-1, int w=-1, int h=-1, bool doLinks = false, Rotation rotate = Rotate0) const;
/**
Render the page to a pixmap using the Arthur (Qt4) renderer
@@ -332,7 +336,7 @@
\param direction in which direction do the search
\param caseSensitive be case sensitive?
**/
- bool search(const QString &text, QRectF &rect, SearchDirection direction, SearchMode caseSensitive) const;
+ bool search(const QString &text, QRectF &rect, SearchDirection direction, SearchMode caseSensitive, Rotation rotate = Rotate0) const;
/**
@@ -348,7 +352,7 @@
\warning This method is not tested with Asian scripts
*/
- QList<TextBox*> textList() const;
+ QList<TextBox*> textList(Rotation rotate = Rotate0) const;
/**
\return The dimensions of the page, in points (i.e. 1/72th on an inch)
More information about the poppler
mailing list