63 template <class T> class
QList;
64 template <class T> class
QVector;
68 #ifndef QT_NO_IMAGE_TEXT
78 {
return key < other.
key || (key==other.
key && lang < other.
lang); }
80 {
return key==other.
key && lang==other.
lang; }
84 #endif //QT_NO_IMAGE_TEXT
114 Format_Grayscale4LSB,
131 #ifndef QT_NO_IMAGEFORMAT_XPM
132 explicit QImage(
const char *
const xpm[]);
135 #ifndef QT_NO_CAST_FROM_ASCII
136 explicit QImage(
const char *fileName,
const char *
format = 0);
143 #ifdef Q_COMPILER_RVALUE_REFS
145 {
qSwap(d, other.d);
return *
this; }
155 operator QVariant()
const;
157 bool isDetached()
const;
161 {
return copy(
QRect(x, y, w, h)); }
166 QImage convertToFormat(Format f, const QVector<
QRgb> &colorTable,
Qt::ImageConversionFlags flags =
Qt::
AutoColor) const Q_REQUIRED_RESULT;
175 QT_DEPRECATED
int numColors()
const;
178 int bitPlaneCount()
const;
181 void setColor(
int i,
QRgb c);
183 QT_DEPRECATED
void setNumColors(
int);
185 void setColorCount(
int);
187 bool allGray()
const;
188 bool isGrayscale()
const;
191 const uchar *bits()
const;
192 const uchar *constBits()
const;
194 QT_DEPRECATED
int numBytes()
const;
196 int byteCount()
const;
198 uchar *scanLine(
int);
199 const uchar *scanLine(
int)
const;
200 const uchar *constScanLine(
int)
const;
201 int bytesPerLine()
const;
203 bool valid(
int x,
int y)
const;
204 bool valid(
const QPoint &pt)
const;
206 int pixelIndex(
int x,
int y)
const;
207 int pixelIndex(
const QPoint &pt)
const;
209 QRgb pixel(
int x,
int y)
const;
212 void setPixel(
int x,
int y, uint index_or_rgb);
213 void setPixel(
const QPoint &pt, uint index_or_rgb);
218 void fill(uint pixel);
223 bool hasAlphaChannel()
const;
224 void setAlphaChannel(
const QImage &alphaChannel);
225 QImage alphaChannel()
const;
227 #ifndef QT_NO_IMAGE_HEURISTIC_MASK
228 QImage createHeuristicMask(
bool clipTight =
true)
const;
234 {
return scaled(
QSize(w, h), aspectMode,
mode); }
240 static QMatrix trueMatrix(
const QMatrix &,
int w,
int h);
242 static QTransform trueMatrix(
const QTransform &,
int w,
int h);
243 QImage mirrored(
bool horizontally =
false,
bool vertically =
true)
const;
244 QImage rgbSwapped()
const;
245 void invertPixels(InvertMode = InvertRgb);
248 bool load(QIODevice *device,
const char*
format);
250 bool loadFromData(
const uchar *buf,
int len,
const char *
format = 0);
252 {
return loadFromData(reinterpret_cast<const uchar *>(data.
constData()), data.
size(), aformat); }
254 bool save(
const QString &fileName,
const char*
format=0,
int quality=-1)
const;
255 bool save(QIODevice *device,
const char*
format=0,
int quality=-1)
const;
259 {
return fromData(reinterpret_cast<const uchar *>(data.
constData()), data.
size(),
format); }
261 int serialNumber()
const;
267 int dotsPerMeterX()
const;
268 int dotsPerMeterY()
const;
269 void setDotsPerMeterX(
int);
270 void setDotsPerMeterY(
int);
272 void setOffset(
const QPoint&);
273 #ifndef QT_NO_IMAGE_TEXT
274 QStringList textKeys()
const;
279 QT_DEPRECATED
QString text(
const char* key,
const char* lang=0)
const;
281 QT_DEPRECATED QStringList textLanguages()
const;
283 QT_DEPRECATED
void setText(
const char* key,
const char* lang,
const QString&);
288 enum Endian { BigEndian, LittleEndian, IgnoreEndian };
289 QT3_SUPPORT_CONSTRUCTOR
QImage(
int width,
int height,
int depth,
int numColors=0, Endian bitOrder=IgnoreEndian);
290 QT3_SUPPORT_CONSTRUCTOR
QImage(
const QSize&,
int depth,
int numColors=0, Endian bitOrder=IgnoreEndian);
291 QT3_SUPPORT_CONSTRUCTOR
QImage(uchar *
data,
int w,
int h,
int depth,
const QRgb *colortable,
int numColors, Endian bitOrder);
293 QT3_SUPPORT_CONSTRUCTOR
QImage(uchar *
data,
int w,
int h,
int depth,
int pbl,
const QRgb *colortable,
int numColors, Endian bitOrder);
295 inline QT3_SUPPORT Endian bitOrder()
const {
297 return f == Format_Mono ? BigEndian : (f == Format_MonoLSB ? LittleEndian : IgnoreEndian);
299 QT3_SUPPORT
QImage convertDepth(
int, Qt::ImageConversionFlags flags =
Qt::AutoColor)
const;
300 QT3_SUPPORT
QImage convertDepthWithPalette(
int,
QRgb*
p,
int pc, Qt::ImageConversionFlags flags =
Qt::AutoColor)
const;
301 QT3_SUPPORT
QImage convertBitOrder(Endian)
const;
302 QT3_SUPPORT
bool hasAlphaBuffer()
const;
303 QT3_SUPPORT
void setAlphaBuffer(
bool);
304 QT3_SUPPORT uchar **jumpTable();
305 QT3_SUPPORT
const uchar *
const *jumpTable()
const;
306 inline QT3_SUPPORT
void reset() { *
this =
QImage(); }
307 static inline QT3_SUPPORT Endian systemByteOrder()
308 {
return QSysInfo::ByteOrder == QSysInfo::BigEndian ? BigEndian : LittleEndian; }
309 inline QT3_SUPPORT
QImage swapRGB()
const {
return rgbSwapped(); }
310 inline QT3_SUPPORT
QImage mirror(
bool horizontally =
false,
bool vertically =
true)
const
311 {
return mirrored(horizontally, vertically); }
312 QT3_SUPPORT
bool create(
const QSize&,
int depth,
int numColors=0, Endian bitOrder=IgnoreEndian);
313 QT3_SUPPORT
bool create(
int width,
int height,
int depth,
int numColors=0, Endian bitOrder=IgnoreEndian);
314 inline QT3_SUPPORT
QImage xForm(
const QMatrix &
matrix)
const {
return transformed(QTransform(matrix)); }
319 inline QT3_SUPPORT
QImage scaleWidth(
int w)
const {
return scaledToWidth(w); }
320 inline QT3_SUPPORT
QImage scaleHeight(
int h)
const {
return scaledToHeight(h); }
321 inline QT3_SUPPORT
void invertPixels(
bool invertAlpha) { invertAlpha ? invertPixels(InvertRgba) : invertPixels(InvertRgb); }
322 inline QT3_SUPPORT
QImage copy(
int x,
int y,
int w,
int h, Qt::ImageConversionFlags)
const
323 {
return copy(
QRect(x, y, w, h)); }
324 inline QT3_SUPPORT
QImage copy(
const QRect &rect, Qt::ImageConversionFlags)
const
325 {
return copy(rect); }
326 static QT3_SUPPORT Endian systemBitOrder();
332 virtual int metric(PaintDeviceMetric metric)
const;
335 friend class QWSOnScreenSurface;
338 friend class QRasterPixmapData;
339 friend class QBlittablePixmapData;
340 friend class QPixmapCacheEntry;
354 Q_GUI_EXPORT_INLINE
bool QImage::valid(const
QPoint &pt)
const {
return valid(pt.x(), pt.y()); }
361 #if !defined(QT_NO_DATASTREAM)
368 int sx=0,
int sy=0,
int sw=-1,
int sh=-1, Qt::ImageConversionFlags flags =
Qt::AutoColor);
Q_GUI_EXPORT QDataStream & operator<<(QDataStream &, const QImage &)
QRgb pixel(int x, int y) const
virtual QPaintEngine * paintEngine() const =0
Q_GUI_EXPORT QDataStream & operator>>(QDataStream &, QImage &)
bool loadFromData(const QByteArray &data, const char *aformat=0)
void setPixel(int x, int y, uint index_or_rgb)
GLenum GLsizei GLenum GLenum const GLvoid * image
virtual int devType() const
QT_BEGIN_HEADER QT_BEGIN_NAMESPACE typedef unsigned int QRgb
const char * constData() const
bool operator==(const Attribute &cA, const AttributeInstance< type > &cB)
This operator compares the two attributes and NOT their values.
static QImage fromData(const QByteArray &data, const char *format=0)
#define QT_BEGIN_NAMESPACE
GLsizei GLsizei GLenum GLenum const GLvoid * data
GLenum GLsizei GLenum format
QImage scaled(int w, int h, Qt::AspectRatioMode aspectMode=Qt::IgnoreAspectRatio, Qt::TransformationMode mode=Qt::FastTransformation) const
Q_INLINE_TEMPLATE void qSwap(QScopedPointer< T, Cleanup > &p1, QScopedPointer< T, Cleanup > &p2)
QImage copy(int x, int y, int w, int h) const
GLenum GLsizei GLsizei height
static QImage fromData(const uchar *data, int size, const char *format=0)
bool operator!=(const QByteArray &a1, const QByteArray &a2)
QImageTextKeyLang(const char *k, const char *l)
int pixelIndex(int x, int y) const
#define Q_REQUIRED_RESULT
GLsizei const GLfloat * value
GLint GLint GLsizei GLsizei GLsizei depth
int int int int int int h
bool operator<(const QByteArray &a1, const QByteArray &a2)
Q_DECLARE_TYPEINFO(QImage, Q_MOVABLE_TYPE)
GLubyte GLubyte GLubyte GLubyte w
virtual int metric(PaintDeviceMetric metric) const