Diffstat (limited to 'noncore/unsupported/qpdf/QOutputDev.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/unsupported/qpdf/QOutputDev.cpp | 131 |
1 files changed, 64 insertions, 67 deletions
diff --git a/noncore/unsupported/qpdf/QOutputDev.cpp b/noncore/unsupported/qpdf/QOutputDev.cpp index 02f269d..15a58b1 100644 --- a/noncore/unsupported/qpdf/QOutputDev.cpp +++ b/noncore/unsupported/qpdf/QOutputDev.cpp | |||
@@ -42,4 +42,7 @@ | |||
42 | #include <qclipboard.h> | 42 | #include <qclipboard.h> |
43 | 43 | ||
44 | //#define QPDFDBG(x) x // special debug mode | ||
45 | #define QPDFDBG(x) // normal compilation | ||
46 | |||
44 | 47 | ||
45 | //------------------------------------------------------------------------ | 48 | //------------------------------------------------------------------------ |
@@ -48,14 +51,7 @@ | |||
48 | 51 | ||
49 | 52 | ||
50 | static inline int q_rnd ( fp_t d ) | ||
51 | { | ||
52 | //qDebug ( "Q_RND: %f -> %d\n", (double) d, (int) ( d >= 0 ? d +0.5 : d - 0.5 )); | ||
53 | |||
54 | return (int) ( d >= 0 ? d + 0.5 : d - 0.5 ); | ||
55 | } | ||
56 | |||
57 | static inline QColor q_col ( const GfxRGB &rgb ) | 53 | static inline QColor q_col ( const GfxRGB &rgb ) |
58 | { | 54 | { |
59 | return QColor ( q_rnd ( rgb. r * 255 ), q_rnd ( rgb. g * 255 ), q_rnd ( rgb. b * 255 )); | 55 | return QColor ( lrint ( rgb. r * 255 ), lrint ( rgb. g * 255 ), lrint ( rgb. b * 255 )); |
60 | } | 56 | } |
61 | 57 | ||
@@ -111,7 +107,7 @@ QFont QOutputDev::matchFont ( GfxFont *gfxFont, fp_t m11, fp_t m12, fp_t m21, fp | |||
111 | 107 | ||
112 | // compute size and normalized transform matrix | 108 | // compute size and normalized transform matrix |
113 | int size = q_rnd ( sqrt ( m21 * m21 + m22 * m22 )); | 109 | int size = lrint ( sqrt ( m21 * m21 + m22 * m22 )); |
114 | 110 | ||
115 | /*qDebug ( "SET FONT: Name=%s, Size=%d, Bold=%d, Italic=%d, Mono=%d, Serif=%d, Symbol=%d, CID=%d, EmbFN=%s, M=(%f,%f,%f,%f)\n", | 111 | QPDFDBG( printf ( "SET FONT: Name=%s, Size=%d, Bold=%d, Italic=%d, Mono=%d, Serif=%d, Symbol=%d, CID=%d, EmbFN=%s, M=(%f,%f,%f,%f)\n", |
116 | (( gfxFont-> getName ( )) ? gfxFont-> getName ( )-> getCString ( ) : "<n/a>" ), | 112 | (( gfxFont-> getName ( )) ? gfxFont-> getName ( )-> getCString ( ) : "<n/a>" ), |
117 | size, | 113 | size, |
@@ -123,6 +119,6 @@ QFont QOutputDev::matchFont ( GfxFont *gfxFont, fp_t m11, fp_t m12, fp_t m21, fp | |||
123 | gfxFont-> isCIDFont ( ), | 119 | gfxFont-> isCIDFont ( ), |
124 | ( gfxFont-> getEmbeddedFontName ( ) ? gfxFont-> getEmbeddedFontName ( ) : "<n/a>" ), | 120 | ( gfxFont-> getEmbeddedFontName ( ) ? gfxFont-> getEmbeddedFontName ( ) : "<n/a>" ), |
125 | (double) m11, (double) m12, (double) m21, (double) m22 ); | 121 | (double) m11, (double) m12, (double) m21, (double) m22 )); |
126 | */ | 122 | |
127 | 123 | ||
128 | QString fname (( gfxFont-> getName ( )) ? gfxFont-> getName ( )-> getCString ( ) : "<n/a>" ); | 124 | QString fname (( gfxFont-> getName ( )) ? gfxFont-> getName ( )-> getCString ( ) : "<n/a>" ); |
@@ -186,4 +182,6 @@ QOutputDev::QOutputDev ( QWidget *parent, const char *name, int flags ) : QScrol | |||
186 | m_painter = 0; | 182 | m_painter = 0; |
187 | 183 | ||
184 | m_use_string = true; | ||
185 | |||
188 | // create text object | 186 | // create text object |
189 | m_text = new TextPage ( gFalse ); | 187 | m_text = new TextPage ( gFalse ); |
@@ -203,8 +201,8 @@ void QOutputDev::startPage ( int /*pageNum*/, GfxState *state ) | |||
203 | delete m_painter; | 201 | delete m_painter; |
204 | 202 | ||
205 | m_pixmap = new QPixmap ( q_rnd ( state-> getPageWidth ( )), q_rnd ( state-> getPageHeight ( ))); | 203 | m_pixmap = new QPixmap ( lrint ( state-> getPageWidth ( )), lrint ( state-> getPageHeight ( ))); |
206 | m_painter = new QPainter ( m_pixmap ); | 204 | m_painter = new QPainter ( m_pixmap ); |
207 | 205 | ||
208 | //qDebug ( "NEW PIXMAP (%d x %d)\n", q_rnd ( state-> getPageWidth ( )), q_rnd ( state-> getPageHeight ( ))); | 206 | QPDFDBG( printf ( "NEW PIXMAP (%ld x %ld)\n", lrint ( state-> getPageWidth ( )), lrint ( state-> getPageHeight ( )))); |
209 | 207 | ||
210 | resizeContents ( m_pixmap-> width ( ), m_pixmap-> height ( )); | 208 | resizeContents ( m_pixmap-> width ( ), m_pixmap-> height ( )); |
@@ -247,5 +245,5 @@ void QOutputDev::drawLink ( Link *link, Catalog */*catalog*/ ) | |||
247 | void QOutputDev::saveState ( GfxState */*state*/ ) | 245 | void QOutputDev::saveState ( GfxState */*state*/ ) |
248 | { | 246 | { |
249 | //qDebug ( "SAVE (CLIP=%d/%d)\n", m_painter-> hasClipping ( ), !m_painter-> clipRegion ( ). isEmpty ( )); | 247 | QPDFDBG( printf ( "SAVE (CLIP=%d/%d)\n", m_painter-> hasClipping ( ), !m_painter-> clipRegion ( ). isEmpty ( ))); |
250 | 248 | ||
251 | m_painter-> save ( ); | 249 | m_painter-> save ( ); |
@@ -258,5 +256,5 @@ void QOutputDev::restoreState ( GfxState */*state*/ ) | |||
258 | //m_painter-> setClipRegion ( QRect ( 0, 0, m_pixmap-> width ( ), m_pixmap-> height ( ))); | 256 | //m_painter-> setClipRegion ( QRect ( 0, 0, m_pixmap-> width ( ), m_pixmap-> height ( ))); |
259 | //m_painter-> setClipping ( false ); | 257 | //m_painter-> setClipping ( false ); |
260 | //qDebug ( "RESTORE (CLIP=%d/%d)\n", m_painter-> hasClipping ( ), !m_painter-> clipRegion ( ). isEmpty ( )); | 258 | QPDFDBG ( printf ( "RESTORE (CLIP=%d/%d)\n", m_painter-> hasClipping ( ), !m_painter-> clipRegion ( ). isEmpty ( ))); |
261 | } | 259 | } |
262 | 260 | ||
@@ -284,5 +282,5 @@ void QOutputDev::updateFlatness ( GfxState */*state*/ ) | |||
284 | { | 282 | { |
285 | // not supported | 283 | // not supported |
286 | //qDebug ( "updateFlatness not supported !\n" ); | 284 | QPDFDBG( printf ( "updateFlatness not supported !\n" )); |
287 | } | 285 | } |
288 | 286 | ||
@@ -300,5 +298,5 @@ void QOutputDev::updateLineCap ( GfxState *state ) | |||
300 | void QOutputDev::updateMiterLimit ( GfxState */*state*/ ) | 298 | void QOutputDev::updateMiterLimit ( GfxState */*state*/ ) |
301 | { | 299 | { |
302 | //qDebug ( "updateMiterLimit not supported !\n" ); | 300 | QPDFDBG( printf ( "updateMiterLimit not supported !\n" )); |
303 | } | 301 | } |
304 | 302 | ||
@@ -318,5 +316,5 @@ void QOutputDev::updateLineAttrs ( GfxState *state, GBool updateDash ) | |||
318 | int width; | 316 | int width; |
319 | 317 | ||
320 | width = q_rnd ( state-> getTransformedLineWidth ( )); | 318 | width = lrint ( state-> getTransformedLineWidth ( )); |
321 | 319 | ||
322 | switch ( state-> getLineCap ( )) { | 320 | switch ( state-> getLineCap ( )) { |
@@ -410,5 +408,5 @@ void QOutputDev::stroke ( GfxState *state ) | |||
410 | int n = convertPath ( state, points, lengths ); | 408 | int n = convertPath ( state, points, lengths ); |
411 | 409 | ||
412 | //qDebug ( "DRAWING: %d POLYS\n", n ); | 410 | QPDFDBG( printf ( "DRAWING: %d POLYS\n", n )); |
413 | 411 | ||
414 | // draw each subpath | 412 | // draw each subpath |
@@ -418,8 +416,8 @@ void QOutputDev::stroke ( GfxState *state ) | |||
418 | 416 | ||
419 | if ( len >= 2 ) { | 417 | if ( len >= 2 ) { |
420 | // qDebug ( " - POLY %d: ", i ); | 418 | QPDFDBG( printf ( " - POLY %d: ", i )); |
421 | // for ( int ii = 0; ii < len; ii++ ) | 419 | QPDFDBG( for ( int ii = 0; ii < len; ii++ )) |
422 | // qDebug ( "(%d/%d) ", points [j+ii]. x ( ), points [j+ii]. y ( )); | 420 | QPDFDBG( printf ( "(%d/%d) ", points [j+ii]. x ( ), points [j+ii]. y ( ))); |
423 | // qDebug ( "\n" ); | 421 | QPDFDBG( printf ( "\n" )); |
424 | 422 | ||
425 | m_painter-> drawPolyline ( points, j, len ); | 423 | m_painter-> drawPolyline ( points, j, len ); |
@@ -457,5 +455,5 @@ void QOutputDev::doFill ( GfxState *state, bool winding ) | |||
457 | int n = convertPath ( state, points, lengths ); | 455 | int n = convertPath ( state, points, lengths ); |
458 | 456 | ||
459 | //qDebug ( "FILLING: %d POLYS\n", n ); | 457 | QPDFDBG( printf ( "FILLING: %d POLYS\n", n )); |
460 | 458 | ||
461 | QPen oldpen = m_painter-> pen ( ); | 459 | QPen oldpen = m_painter-> pen ( ); |
@@ -468,8 +466,8 @@ void QOutputDev::doFill ( GfxState *state, bool winding ) | |||
468 | 466 | ||
469 | if ( len >= 3 ) { | 467 | if ( len >= 3 ) { |
470 | // qDebug ( " - POLY %d: ", i ); | 468 | QPDFDBG( printf ( " - POLY %d: ", i )); |
471 | // for ( int ii = 0; ii < len; ii++ ) | 469 | QPDFDBG( for ( int ii = 0; ii < len; ii++ )) |
472 | // qDebug ( "(%d/%d) ", points [j+ii]. x ( ), points [j+ii]. y ( )); | 470 | QPDFDBG( printf ( "(%d/%d) ", points [j+ii]. x ( ), points [j+ii]. y ( ))); |
473 | // qDebug ( "\n" ); | 471 | QPDFDBG( printf ( "\n" )); |
474 | 472 | ||
475 | m_painter-> drawPolygon ( points, winding, j, len ); | 473 | m_painter-> drawPolygon ( points, winding, j, len ); |
@@ -502,5 +500,5 @@ void QOutputDev::doClip ( GfxState *state, bool winding ) | |||
502 | QRegion region; | 500 | QRegion region; |
503 | 501 | ||
504 | //qDebug ( "CLIPPING: %d POLYS\n", n ); | 502 | QPDFDBG( printf ( "CLIPPING: %d POLYS\n", n )); |
505 | 503 | ||
506 | // draw each subpath | 504 | // draw each subpath |
@@ -513,8 +511,7 @@ void QOutputDev::doClip ( GfxState *state, bool winding ) | |||
513 | dummy. setRawData ( points. data ( ) + j, len ); | 511 | dummy. setRawData ( points. data ( ) + j, len ); |
514 | 512 | ||
515 | // qDebug ( " - POLY %d: ", i ); | 513 | QPDFDBG( printf ( " - POLY %d: ", i )); |
516 | // for ( int ii = 0; ii < len; ii++ ) | 514 | QPDFDBG( for ( int ii = 0; ii < len; ii++ ) printf ( "(%d/%d) ", points [j+ii]. x ( ), points [j+ii]. y ( ))); |
517 | // qDebug ( "(%d/%d) ", points [j+ii]. x ( ), points [j+ii]. y ( )); | 515 | QPDFDBG( printf ( "\n" )); |
518 | // qDebug ( "\n" ); | ||
519 | 516 | ||
520 | region |= QRegion ( dummy, winding ); | 517 | region |= QRegion ( dummy, winding ); |
@@ -582,6 +579,6 @@ int QOutputDev::convertSubpath ( GfxState *state, GfxSubpath *subpath, QPointArr | |||
582 | 579 | ||
583 | QPointArray tmp; | 580 | QPointArray tmp; |
584 | tmp. setPoints ( 4, q_rnd ( x0 ), q_rnd ( y0 ), q_rnd ( x1 ), q_rnd ( y1 ), | 581 | tmp. setPoints ( 4, lrint ( x0 ), lrint ( y0 ), lrint ( x1 ), lrint ( y1 ), |
585 | q_rnd ( x2 ), q_rnd ( y2 ), q_rnd ( x3 ), q_rnd ( y3 )); | 582 | lrint ( x2 ), lrint ( y2 ), lrint ( x3 ), lrint ( y3 )); |
586 | 583 | ||
587 | #if QT_VERSION < 300 | 584 | #if QT_VERSION < 300 |
@@ -602,5 +599,5 @@ int QOutputDev::convertSubpath ( GfxState *state, GfxSubpath *subpath, QPointArr | |||
602 | state-> transform ( subpath-> getX ( i ), subpath-> getY ( i ), &x1, &y1 ); | 599 | state-> transform ( subpath-> getX ( i ), subpath-> getY ( i ), &x1, &y1 ); |
603 | 600 | ||
604 | points. putPoints ( points. count ( ), 1, q_rnd ( x1 ), q_rnd ( y1 )); | 601 | points. putPoints ( points. count ( ), 1, lrint ( x1 ), lrint ( y1 )); |
605 | ++i; | 602 | ++i; |
606 | } | 603 | } |
@@ -626,7 +623,7 @@ void QOutputDev::drawChar ( GfxState *state, fp_t x, fp_t y, | |||
626 | fp_t x1, y1, dx1, dy1; | 623 | fp_t x1, y1, dx1, dy1; |
627 | 624 | ||
625 | if ( uLen > 0 ) | ||
628 | m_text-> addChar ( state, x, y, dx, dy, u, uLen ); | 626 | m_text-> addChar ( state, x, y, dx, dy, u, uLen ); |
629 | 627 | ||
630 | |||
631 | // check for invisible text -- this is used by Acrobat Capture | 628 | // check for invisible text -- this is used by Acrobat Capture |
632 | if (( state-> getRender ( ) & 3 ) == 3 ) { | 629 | if (( state-> getRender ( ) & 3 ) == 3 ) { |
@@ -652,5 +649,5 @@ void QOutputDev::drawChar ( GfxState *state, fp_t x, fp_t y, | |||
652 | else { | 649 | else { |
653 | str [i] = ' '; | 650 | str [i] = ' '; |
654 | // qDebug ( "CHARACTER NOT IN FONT: %hx\n", c. unicode ( )); | 651 | QPDFDBG( printf ( "CHARACTER NOT IN FONT: %hx\n", c. unicode ( ))); |
655 | } | 652 | } |
656 | } | 653 | } |
@@ -678,5 +675,5 @@ void QOutputDev::drawChar ( GfxState *state, fp_t x, fp_t y, | |||
678 | cerr << endl << "ROTATED: " << m11 << ", " << m12 << ", " << m21 << ", " << m22 << " / SIZE: " << fsize << " / TEXT: " << str. local8Bit ( ) << endl << endl; | 675 | cerr << endl << "ROTATED: " << m11 << ", " << m12 << ", " << m21 << ", " << m22 << " / SIZE: " << fsize << " / TEXT: " << str. local8Bit ( ) << endl << endl; |
679 | 676 | ||
680 | QWMatrix mat ( q_rnd ( m11 / fsize ), q_rnd ( m12 / fsize ), -q_rnd ( m21 / fsize ), -q_rnd ( m22 / fsize ), q_rnd ( x1 ), q_rnd ( y1 )); | 677 | QWMatrix mat ( lrint ( m11 / fsize ), lrint ( m12 / fsize ), -lrint ( m21 / fsize ), -lrint ( m22 / fsize ), lrint ( x1 ), lrint ( y1 )); |
681 | 678 | ||
682 | m_painter-> setWorldMatrix ( mat ); | 679 | m_painter-> setWorldMatrix ( mat ); |
@@ -697,7 +694,7 @@ void QOutputDev::drawChar ( GfxState *state, fp_t x, fp_t y, | |||
697 | 694 | ||
698 | if ( fsize > 5 ) | 695 | if ( fsize > 5 ) |
699 | m_painter-> drawText ( q_rnd ( x1 ), q_rnd ( y1 ), str ); | 696 | m_painter-> drawText ( lrint ( x1 ), lrint ( y1 ), str ); |
700 | else | 697 | else |
701 | m_painter-> fillRect ( q_rnd ( x1 ), q_rnd ( y1 ), q_rnd ( QMAX( fp_t(1), dx1 )), q_rnd ( QMAX( fsize, dy1 )), m_painter-> pen ( ). color ( )); | 698 | m_painter-> fillRect ( lrint ( x1 ), lrint ( y1 ), lrint ( QMAX( fp_t(1), dx1 )), lrint ( QMAX( fsize, dy1 )), m_painter-> pen ( ). color ( )); |
702 | 699 | ||
703 | m_painter-> setPen ( oldpen ); | 700 | m_painter-> setPen ( oldpen ); |
@@ -708,5 +705,5 @@ void QOutputDev::drawChar ( GfxState *state, fp_t x, fp_t y, | |||
708 | #endif | 705 | #endif |
709 | 706 | ||
710 | // qDebug ( "DRAW TEXT: \"%s\" at (%d/%d)\n", str. local8Bit ( ). data ( ), q_rnd ( x1 ), q_rnd ( y1 )); | 707 | QPDFDBG( printf ( "DRAW TEXT: \"%s\" at (%ld/%ld)\n", str. local8Bit ( ). data ( ), lrint ( x1 ), lrint ( y1 ))); |
711 | } | 708 | } |
712 | else if ( code != 0 ) { | 709 | else if ( code != 0 ) { |
@@ -740,5 +737,5 @@ void QOutputDev::drawImageMask ( GfxState *state, Object */*ref*/, Stream *str, | |||
740 | GfxRGB rgb; | 737 | GfxRGB rgb; |
741 | state-> getFillRGB ( &rgb ); | 738 | state-> getFillRGB ( &rgb ); |
742 | uint val = ( q_rnd ( rgb. r * 255 ) & 0xff ) << 16 | ( q_rnd ( rgb. g * 255 ) & 0xff ) << 8 | ( q_rnd ( rgb. b * 255 ) & 0xff ); | 739 | uint val = ( lrint ( rgb. r * 255 ) & 0xff ) << 16 | ( lrint ( rgb. g * 255 ) & 0xff ) << 8 | ( lrint ( rgb. b * 255 ) & 0xff ); |
743 | 740 | ||
744 | 741 | ||
@@ -746,5 +743,5 @@ void QOutputDev::drawImageMask ( GfxState *state, Object */*ref*/, Stream *str, | |||
746 | img. setAlphaBuffer ( true ); | 743 | img. setAlphaBuffer ( true ); |
747 | 744 | ||
748 | //qDebug ( "IMAGE MASK (%dx%d)\n", width, height ); | 745 | QPDFDBG( printf ( "IMAGE MASK (%dx%d)\n", width, height )); |
749 | 746 | ||
750 | // initialize the image stream | 747 | // initialize the image stream |
@@ -801,12 +798,12 @@ void QOutputDev::drawImageMask ( GfxState *state, Object */*ref*/, Stream *str, | |||
801 | #else | 798 | #else |
802 | if (( ctm [1] < -0.1 ) || ( ctm [1] > 0.1 ) || ( ctm [2] < -0.1 ) || ( ctm [2] > 0.1 )) { | 799 | if (( ctm [1] < -0.1 ) || ( ctm [1] > 0.1 ) || ( ctm [2] < -0.1 ) || ( ctm [2] > 0.1 )) { |
803 | qDebug ( "### ROTATED / SHEARED / ETC -- CANNOT DISPLAY THIS IMAGE\n" ); | 800 | QPDFDBG( printf ( "### ROTATED / SHEARED / ETC -- CANNOT DISPLAY THIS IMAGE\n" )); |
804 | } | 801 | } |
805 | else { | 802 | else { |
806 | int x = q_rnd ( ctm [4] ); | 803 | int x = lrint ( ctm [4] ); |
807 | int y = q_rnd ( ctm [5] ); | 804 | int y = lrint ( ctm [5] ); |
808 | 805 | ||
809 | int w = q_rnd ( ctm [0] ); | 806 | int w = lrint ( ctm [0] ); |
810 | int h = q_rnd ( ctm [3] ); | 807 | int h = lrint ( ctm [3] ); |
811 | 808 | ||
812 | if ( w < 0 ) { | 809 | if ( w < 0 ) { |
@@ -819,5 +816,5 @@ void QOutputDev::drawImageMask ( GfxState *state, Object */*ref*/, Stream *str, | |||
819 | } | 816 | } |
820 | 817 | ||
821 | // qDebug ( "DRAWING IMAGE MASKED: %d/%d - %dx%d\n", x, y, w, h ); | 818 | QPDFDBG( printf ( "DRAWING IMAGE MASKED: %d/%d - %dx%d\n", x, y, w, h )); |
822 | 819 | ||
823 | img = img. smoothScale ( w, h ); | 820 | img = img. smoothScale ( w, h ); |
@@ -864,5 +861,5 @@ void QOutputDev::drawImage(GfxState *state, Object */*ref*/, Stream *str, int wi | |||
864 | img. setAlphaBuffer ( true ); | 861 | img. setAlphaBuffer ( true ); |
865 | 862 | ||
866 | //qDebug ( "IMAGE (%dx%d)\n", width, height ); | 863 | QPDFDBG( printf ( "IMAGE (%dx%d)\n", width, height )); |
867 | 864 | ||
868 | // initialize the image stream | 865 | // initialize the image stream |
@@ -889,5 +886,5 @@ void QOutputDev::drawImage(GfxState *state, Object */*ref*/, Stream *str, int wi | |||
889 | colorMap-> getRGB ( pixBuf, &rgb ); | 886 | colorMap-> getRGB ( pixBuf, &rgb ); |
890 | 887 | ||
891 | uint val = ( q_rnd ( rgb. r * 255 ) & 0xff ) << 16 | ( q_rnd ( rgb. g * 255 ) & 0xff ) << 8 | ( q_rnd ( rgb. b * 255 ) & 0xff ); | 888 | uint val = ( lrint ( rgb. r * 255 ) & 0xff ) << 16 | ( lrint ( rgb. g * 255 ) & 0xff ) << 8 | ( lrint ( rgb. b * 255 ) & 0xff ); |
892 | 889 | ||
893 | if ( maskColors ) { | 890 | if ( maskColors ) { |
@@ -931,12 +928,12 @@ void QOutputDev::drawImage(GfxState *state, Object */*ref*/, Stream *str, int wi | |||
931 | 928 | ||
932 | if (( ctm [1] < -0.1 ) || ( ctm [1] > 0.1 ) || ( ctm [2] < -0.1 ) || ( ctm [2] > 0.1 )) { | 929 | if (( ctm [1] < -0.1 ) || ( ctm [1] > 0.1 ) || ( ctm [2] < -0.1 ) || ( ctm [2] > 0.1 )) { |
933 | qDebug ( "### ROTATED / SHEARED / ETC -- CANNOT DISPLAY THIS IMAGE\n" ); | 930 | QPDFDBG( printf ( "### ROTATED / SHEARED / ETC -- CANNOT DISPLAY THIS IMAGE\n" )); |
934 | } | 931 | } |
935 | else { | 932 | else { |
936 | int x = q_rnd ( ctm [4] ); | 933 | int x = lrint ( ctm [4] ); |
937 | int y = q_rnd ( ctm [5] ); | 934 | int y = lrint ( ctm [5] ); |
938 | 935 | ||
939 | int w = q_rnd ( ctm [0] ); | 936 | int w = lrint ( ctm [0] ); |
940 | int h = q_rnd ( ctm [3] ); | 937 | int h = lrint ( ctm [3] ); |
941 | 938 | ||
942 | if ( w < 0 ) { | 939 | if ( w < 0 ) { |
@@ -949,5 +946,5 @@ void QOutputDev::drawImage(GfxState *state, Object */*ref*/, Stream *str, int wi | |||
949 | } | 946 | } |
950 | 947 | ||
951 | // qDebug ( "DRAWING IMAGE: %d/%d - %dx%d\n", x, y, w, h ); | 948 | QPDFDBG( printf ( "DRAWING IMAGE: %d/%d - %dx%d\n", x, y, w, h )); |
952 | 949 | ||
953 | img = img. smoothScale ( w, h ); | 950 | img = img. smoothScale ( w, h ); |
@@ -991,8 +988,8 @@ bool QOutputDev::findText ( const QString &str, int &l, int &t, int &w, int &h, | |||
991 | 988 | ||
992 | if ( m_text-> findText ( s, len, top, bottom, &x1, &y1, &x2, &y2 )) { | 989 | if ( m_text-> findText ( s, len, top, bottom, &x1, &y1, &x2, &y2 )) { |
993 | l = q_rnd ( x1 ); | 990 | l = lrint ( x1 ); |
994 | t = q_rnd ( y1 ); | 991 | t = lrint ( y1 ); |
995 | w = q_rnd ( x2 ) - l + 1; | 992 | w = lrint ( x2 ) - l + 1; |
996 | h = q_rnd ( y2 ) - t + 1; | 993 | h = lrint ( y2 ) - t + 1; |
997 | found = true; | 994 | found = true; |
998 | } | 995 | } |
@@ -1011,8 +1008,8 @@ GBool QOutputDev::findText ( Unicode *s, int len, GBool top, GBool bottom, int * | |||
1011 | 1008 | ||
1012 | if ( m_text-> findText ( s, len, top, bottom, &xMin1, &yMin1, &xMax1, &yMax1 )) { | 1009 | if ( m_text-> findText ( s, len, top, bottom, &xMin1, &yMin1, &xMax1, &yMax1 )) { |
1013 | *xMin = q_rnd ( xMin1 ); | 1010 | *xMin = lrint ( xMin1 ); |
1014 | *xMax = q_rnd ( xMax1 ); | 1011 | *xMax = lrint ( xMax1 ); |
1015 | *yMin = q_rnd ( yMin1 ); | 1012 | *yMin = lrint ( yMin1 ); |
1016 | *yMax = q_rnd ( yMax1 ); | 1013 | *yMax = lrint ( yMax1 ); |
1017 | found = true; | 1014 | found = true; |
1018 | } | 1015 | } |