.TH "KPixmap" 3 "28 Jan 2004" "kdefx Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KPixmap \- Off-screen paint device with extended features.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kpixmap.h>\fP
.PP
Inherits \fBQPixmap\fP.
.PP
.SS "Public Types"

.in +1c
.ti -1c
.RI "enum \fBColorMode\fP { \fBAuto\fP, \fBColor\fP, \fBMono\fP, \fBLowColor\fP, \fBWebColor\fP }"
.br
.ti -1c
.RI "enum \fBGradientMode\fP { \fBHorizontal\fP, \fBVertical\fP, \fBDiagonal\fP, \fBCrossDiagonal\fP }"
.br
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKPixmap\fP ()"
.br
.RI "\fIConstructs a null pixmap. \fP"
.ti -1c
.RI "\fB~KPixmap\fP ()"
.br
.RI "\fIDestructs the pixmap. \fP"
.ti -1c
.RI "\fBKPixmap\fP (const  \fBQPixmap\fP &pix)"
.br
.RI "\fICopies the \fBQPixmap\fP \fCpix\fP. \fP"
.ti -1c
.RI "bool \fBconvertFromImage\fP (const  \fBQImage\fP &img, int conversion_flags)"
.br
.RI "\fIConverts an image and sets this pixmap. \fP"
.ti -1c
.RI "bool \fBconvertFromImage\fP (const  \fBQImage\fP &img, ColorMode mode=WebColor)"
.br
.RI "\fIThis is an overloaded member function, provided for convenience. \fP"
.ti -1c
.RI "bool \fBload\fP (const  \fBQString\fP &fileName, const  char *format, int conversion_flags)"
.br
.RI "\fILoads a pixmap from the file \fCfileName\fP. \fP"
.ti -1c
.RI "bool \fBload\fP (const  \fBQString\fP &fileName, const  char *format=0, ColorMode mode=WebColor)"
.br
.RI "\fIThis is an overloaded member function, provided for convenience. \fP"
.ti -1c
.RI "bool \fBcheckColorTable\fP (const  \fBQImage\fP &image)"
.br
.RI "\fIReturns true if the image posesses a color table that matches the Icon palette or false otherwise. \fP"
.in -1c
.SH "Detailed Description"
.PP 
Off-screen paint device with extended features. 

KPixmap has two new color modes, WebColor and LowColor, applicable to 8bpp displays.
.PP
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.
.PP
In LowColor mode images are checked to see if their color table matches the \fBKDE\fP 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.
.PP
\fBAuthor:\fP
.RS 4
Mark Donohoe (donohoe@kde.org) 
.RE
.PP
\fBVersion:\fP
.RS 4
\fBId\fP.RS 4
\fBkpixmap.h\fP,v 1.27 2002/07/31 23:14:10 orlovich Exp 
.RE
.PP
.RE
.PP

.PP
Definition at line 55 of file kpixmap.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KPixmap::KPixmap ()\fC [inline]\fP"
.PP
Constructs a null pixmap. Definition at line 64 of file kpixmap.h.
.SS "KPixmap::~\fBKPixmap\fP ()\fC [inline]\fP"
.PP
Destructs the pixmap. Definition at line 69 of file kpixmap.h.
.SS "KPixmap::KPixmap (const \fBQPixmap\fP & pix)"
.PP
Copies the \fBQPixmap\fP \fCpix\fP. Definition at line 409 of file kpixmap.cpp.
.SH "Member Function Documentation"
.PP 
.SS "bool KPixmap::convertFromImage (const \fBQImage\fP & img, int conversion_flags)"
.PP
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):
.PP
Color/Mono preference
.PP
.IP "\(bu" 2
WebColor - If the image has depth 1 and contains only black and white pixels then the pixmap becomes monochrome. If the pixmap has a depth of 8 bits per pixel then the Netscape palette is used for the pixmap color table. 
.IP "\(bu" 2
LowColor - If the image has depth 1 and contains only black and white pixels then the pixmap becomes monochrome. If the pixmap has a depth of 8 bits per pixel and the image does not posess a color table that matches the Icon palette a 3x3x3 color cube is used for the pixmap color table. 
.IP "\(bu" 2
AutoColor (default) - If the image has depth 1 and contains only black and white pixels, then the pixmap becomes monochrome. 
.IP "\(bu" 2
ColorOnly - The pixmap is dithered/converted to the native display depth. 
.IP "\(bu" 2
MonoOnly - The pixmap becomes monochrome. If necessary, it is dithered using the chosen dithering algorithm.
.PP
Dithering mode preference, for RGB channels
.PP
.IP "\(bu" 2
DiffuseDither (default) - A high quality dither. 
.IP "\(bu" 2
OrderedDither - A faster more ordered dither. 
.IP "\(bu" 2
ThresholdDither - No dithering, closest color is used.
.PP
Dithering mode preference, for alpha channel
.PP
.IP "\(bu" 2
DiffuseAlphaDither - A high quality dither. 
.IP "\(bu" 2
OrderedAlphaDither - A faster more ordered dither. 
.IP "\(bu" 2
ThresholdAlphaDither (default) - No dithering.
.PP
Color matching versus dithering preference
.PP
.IP "\(bu" 2
PreferDither - Always dither 32-bit images when the image is being converted to 8-bits. This is the default when converting to a pixmap. 
.IP "\(bu" 2
AvoidDither - Only dither 32-bit images if the image has more than 256 colours and it is being converted to 8-bits. This is the default when an image is converted for the purpose of saving to a file.
.PP
Passing 0 for \fCconversion_flags\fP gives all the default options. 
.PP
\fBReturns:\fP
.RS 4
\fCtrue\fP if successful. 
.RE
.PP
Reimplemented from \fBQPixmap\fP.
.PP
Definition at line 246 of file kpixmap.cpp.
.PP
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().
.PP
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().
.SS "bool KPixmap::convertFromImage (const \fBQImage\fP & img, ColorMode mode = WebColor)"
.PP
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Reimplemented from \fBQPixmap\fP.
.PP
Definition at line 224 of file kpixmap.cpp.
.PP
References convertFromImage().
.SS "bool KPixmap::load (const \fBQString\fP & fileName, const char * format, int conversion_flags)"
.PP
Loads a pixmap from the file \fCfileName\fP. 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.
.PP
See the \fBconvertFromImage\fP() documentation for a description of the conversion_flags argument.
.PP
The \fBQImageIO\fP documentation lists the supported image formats and explains how to add extra formats.
.PP
\fBReturns:\fP
.RS 4
\fCtrue\fP if successful, or false if the pixmap could not be loaded. 
.RE
.PP
Reimplemented from \fBQPixmap\fP.
.PP
Definition at line 187 of file kpixmap.cpp.
.PP
References convertFromImage(), QPixmap::detach(), QImageIO::image(), and QImageIO::read().
.PP
Referenced by load().
.SS "bool KPixmap::load (const \fBQString\fP & fileName, const char * format = 0, ColorMode mode = WebColor)"
.PP
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Reimplemented from \fBQPixmap\fP.
.PP
Definition at line 201 of file kpixmap.cpp.
.PP
References load().
.SS "bool KPixmap::checkColorTable (const \fBQImage\fP & image)"
.PP
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.
.PP
References QColor::blue(), QImage::colorTable(), QColor::green(), QImage::numColors(), and QColor::red().
.PP
Referenced by convertFromImage().

.SH "Author"
.PP 
Generated automatically by Doxygen for kdefx Library from the source code.
