KPixmap Class Reference
Off-screen paint device with extended features. More...
#include <kpixmap.h>
Inheritance diagram for KPixmap:

Public Types | |
enum | ColorMode { Auto, Color, Mono, LowColor, WebColor } |
enum | GradientMode { Horizontal, Vertical, Diagonal, CrossDiagonal } |
Public Member Functions | |
KPixmap () | |
Constructs a null pixmap. | |
~KPixmap () | |
Destructs the pixmap. | |
KPixmap (const QPixmap &pix) | |
Copies the QPixmap pix . | |
bool | convertFromImage (const QImage &img, int conversion_flags) |
Converts an image and sets this pixmap. | |
bool | convertFromImage (const QImage &img, ColorMode mode=WebColor) |
This is an overloaded member function, provided for convenience. | |
bool | load (const QString &fileName, const char *format, int conversion_flags) |
Loads a pixmap from the file fileName . | |
bool | load (const QString &fileName, const char *format=0, ColorMode mode=WebColor) |
This is an overloaded member function, provided for convenience. | |
bool | checkColorTable (const QImage &image) |
Returns true if the image posesses a color table that matches the Icon palette or false otherwise. |
Detailed Description
Off-screen paint device with extended features.KPixmap has two new color modes, WebColor and LowColor, applicable to 8bpp displays.
In WebColor mode all images are dithered to the Netscape palette, even when they have their own color table. WebColor is the default mode for KPixmap so that standard applications can share the Netscape palette across the desktop.
In LowColor mode images are checked to see if their color table matches the KDE icon palette. If the color tables do not match, the images are dithered to a minimal 3x3x3 color cube. LowColor mode can be used to load icons, background images etc. so that components of the desktop which are always present use no more than 40 colors.
- Author:
- Mark Donohoe (donohoe@kde.org)
- Version:
- Id
- kpixmap.h,v 1.27 2002/07/31 23:14:10 orlovich Exp
Definition at line 55 of file kpixmap.h.
Constructor & Destructor Documentation
|
Constructs a null pixmap.
|
|
Destructs the pixmap.
|
|
Copies the QPixmap
Definition at line 409 of file kpixmap.cpp. |
Member Function Documentation
|
Converts an image and sets this pixmap. The conversion_flags argument is a bitwise-OR from the following choices. The options marked (default) are the choice if no other choice from the list is included (they are zero): Color/Mono preference
conversion_flags gives all the default options.
Reimplemented from QPixmap. Definition at line 246 of file kpixmap.cpp. References checkColorTable(), QImage::convertDepth(), QPixmap::convertFromImage(), QImage::createAlphaMask(), QPixmap::defaultDepth(), QPixmap::detach(), QImage::hasAlphaBuffer(), QImage::height(), QImage::isNull(), QPixmap::mask(), QImage::numColors(), QImage::setAlphaBuffer(), QPixmap::setMask(), and QImage::width(). Referenced by KPixmapEffect::blend(), KPixmapEffect::channelIntensity(), KPixmapEffect::contrast(), convertFromImage(), KPixmapEffect::desaturate(), KPixmapEffect::dither(), KPixmapEffect::fade(), KPixmapEffect::gradient(), KPixmapEffect::hash(), KPixmapEffect::intensity(), load(), KPixmapEffect::pattern(), KPixmapEffect::selectedPixmap(), KPixmapEffect::toGray(), and KPixmapEffect::unbalancedGradient(). |
|
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Reimplemented from QPixmap. Definition at line 224 of file kpixmap.cpp. References convertFromImage(). |
|
Loads a pixmap from the file If format is specified, the loader attempts to read the pixmap using the specified format. If format is not specified (default), the loader reads a few bytes from the header to guess the file format. See the convertFromImage() documentation for a description of the conversion_flags argument. The QImageIO documentation lists the supported image formats and explains how to add extra formats.
Reimplemented from QPixmap. Definition at line 187 of file kpixmap.cpp. References convertFromImage(), QPixmap::detach(), QImageIO::image(), and QImageIO::read(). Referenced by load(). |
|
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Reimplemented from QPixmap. Definition at line 201 of file kpixmap.cpp. References load(). |
|
Returns true if the image posesses a color table that matches the Icon palette or false otherwise. An image with one color not found in the Icon palette is considered to be a match, since this extra color may be a transparent background. Definition at line 314 of file kpixmap.cpp. References QColor::blue(), QImage::colorTable(), QColor::green(), QImage::numColors(), and QColor::red(). Referenced by convertFromImage(). |
The documentation for this class was generated from the following files: