Lines 953-958
Link Here
|
953 |
bool force_mono = (dd == 1 || isQBitmap() || |
953 |
bool force_mono = (dd == 1 || isQBitmap() || |
954 |
(conversion_flags & ColorMode_Mask)==MonoOnly ); |
954 |
(conversion_flags & ColorMode_Mask)==MonoOnly ); |
955 |
|
955 |
|
|
|
956 |
if ( w >= 32768 || h >= 32768 ) |
957 |
return FALSE; |
958 |
|
956 |
// get rid of the mask |
959 |
// get rid of the mask |
957 |
delete data->mask; |
960 |
delete data->mask; |
958 |
data->mask = 0; |
961 |
data->mask = 0; |
Lines 1678-1688
Link Here
|
1678 |
|
1681 |
|
1679 |
QPixmap QPixmap::xForm( const QWMatrix &matrix ) const |
1682 |
QPixmap QPixmap::xForm( const QWMatrix &matrix ) const |
1680 |
{ |
1683 |
{ |
1681 |
int w = 0; |
1684 |
uint w = 0; |
1682 |
int h = 0; // size of target pixmap |
1685 |
uint h = 0; // size of target pixmap |
1683 |
int ws, hs; // size of source pixmap |
1686 |
uint ws, hs; // size of source pixmap |
1684 |
uchar *dptr; // data in target pixmap |
1687 |
uchar *dptr; // data in target pixmap |
1685 |
int dbpl, dbytes; // bytes per line/bytes total |
1688 |
uint dbpl, dbytes; // bytes per line/bytes total |
1686 |
uchar *sptr; // data in original pixmap |
1689 |
uchar *sptr; // data in original pixmap |
1687 |
int sbpl; // bytes per line in original |
1690 |
int sbpl; // bytes per line in original |
1688 |
int bpp; // bits per pixel |
1691 |
int bpp; // bits per pixel |
Lines 1697-1715
Link Here
|
1697 |
|
1700 |
|
1698 |
QWMatrix mat( matrix.m11(), matrix.m12(), matrix.m21(), matrix.m22(), 0., 0. ); |
1701 |
QWMatrix mat( matrix.m11(), matrix.m12(), matrix.m21(), matrix.m22(), 0., 0. ); |
1699 |
|
1702 |
|
|
|
1703 |
double scaledWidth; |
1704 |
double scaledHeight; |
1705 |
|
1700 |
if ( matrix.m12() == 0.0F && matrix.m21() == 0.0F ) { |
1706 |
if ( matrix.m12() == 0.0F && matrix.m21() == 0.0F ) { |
1701 |
if ( matrix.m11() == 1.0F && matrix.m22() == 1.0F ) |
1707 |
if ( matrix.m11() == 1.0F && matrix.m22() == 1.0F ) |
1702 |
return *this; // identity matrix |
1708 |
return *this; // identity matrix |
1703 |
h = qRound( matrix.m22()*hs ); |
1709 |
scaledHeight = matrix.m22()*hs; |
1704 |
w = qRound( matrix.m11()*ws ); |
1710 |
scaledWidth = matrix.m11()*ws; |
1705 |
h = QABS( h ); |
1711 |
h = QABS( qRound( scaledHeight ) ); |
1706 |
w = QABS( w ); |
1712 |
w = QABS( qRound( scaledWidth ) ); |
1707 |
} else { // rotation or shearing |
1713 |
} else { // rotation or shearing |
1708 |
QPointArray a( QRect(0,0,ws+1,hs+1) ); |
1714 |
QPointArray a( QRect(0,0,ws+1,hs+1) ); |
1709 |
a = mat.map( a ); |
1715 |
a = mat.map( a ); |
1710 |
QRect r = a.boundingRect().normalize(); |
1716 |
QRect r = a.boundingRect().normalize(); |
1711 |
w = r.width()-1; |
1717 |
w = r.width()-1; |
1712 |
h = r.height()-1; |
1718 |
h = r.height()-1; |
|
|
1719 |
scaledWidth = w; |
1720 |
scaledHeight = h; |
1713 |
} |
1721 |
} |
1714 |
|
1722 |
|
1715 |
mat = trueMatrix( mat, ws, hs ); // true matrix |
1723 |
mat = trueMatrix( mat, ws, hs ); // true matrix |
Lines 1718-1724
Link Here
|
1718 |
bool invertible; |
1726 |
bool invertible; |
1719 |
mat = mat.invert( &invertible ); // invert matrix |
1727 |
mat = mat.invert( &invertible ); // invert matrix |
1720 |
|
1728 |
|
1721 |
if ( h == 0 || w == 0 || !invertible ) { // error, return null pixmap |
1729 |
if ( h == 0 || w == 0 || !invertible |
|
|
1730 |
|| QABS(scaledWidth) >= 32768 || QABS(scaledHeight) >= 32768 ) { // error, return null pixmap |
1722 |
QPixmap pm; |
1731 |
QPixmap pm; |
1723 |
pm.data->bitmap = data->bitmap; |
1732 |
pm.data->bitmap = data->bitmap; |
1724 |
return pm; |
1733 |
return pm; |