.TH "KPixmap" kde3 "11 Jun 2005" "Version Version 3.4.1" "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
.ti -1c
.RI "\fB~KPixmap\fP ()"
.br
.ti -1c
.RI "\fBKPixmap\fP (const \fBQPixmap\fP &pix)"
.br
.ti -1c
.RI "bool \fBconvertFromImage\fP (const \fBQImage\fP &img, int conversion_flags)"
.br
.ti -1c
.RI "bool \fBconvertFromImage\fP (const \fBQImage\fP &img, \fBColorMode\fP mode=WebColor)"
.br
.ti -1c
.RI "bool \fBload\fP (const \fBQString\fP &fileName, const char *format, int conversion_flags)"
.br
.ti -1c
.RI "bool \fBload\fP (const \fBQString\fP &fileName, const char *format=0, \fBColorMode\fP mode=WebColor)"
.br
.ti -1c
.RI "bool \fBcheckColorTable\fP (const \fBQImage\fP &image)"
.br
.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 345302 2004-09-09 20:44:57Z staniek 
.RE
.PP
.RE
.PP

.PP
Definition at line 57 of file kpixmap.h.
.SH "Member Enumeration Documentation"
.PP 
.SS "\fBenum\fP \fBKPixmap::ColorMode\fP"
.PP
This enumeration provides a color pallete specification. 
.PP
\fBSee also:\fP
.RS 4
\fBKPixmap::convertFromImage()\fP, \fBKPixmap::load()\fP
.RE
.PP

.PP
\fBEnumeration values: \fP
.in +1c
.TP
\fB\fIAuto \fP\fP
Convert to monochrome if possible. 
.TP
\fB\fIColor \fP\fP
Native display depth. 
.TP
\fB\fIMono \fP\fP
Monochrome pixmap. 
.TP
\fB\fILowColor \fP\fP
3x3x3 color cube (or monochrome) 
.TP
\fB\fIWebColor \fP\fP
Netscape pallete (or monochrome). 
.PP
Definition at line 64 of file kpixmap.h.
.SS "\fBenum\fP \fBKPixmap::GradientMode\fP"
.PP
This enumeration provides a gradient mode specification. 
.PP
Definition at line 73 of file kpixmap.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KPixmap::KPixmap ()\fC [inline]\fP"
.PP
Constructs a null pixmap. 
.PP

.PP
Definition at line 82 of file kpixmap.h.
.SS "KPixmap::~\fBKPixmap\fP ()"
.PP
Destructs the pixmap. 
.PP
### \fBKDE\fP 4: remove
.PP
Definition at line 186 of file kpixmap.cpp.
.SS "KPixmap::KPixmap (const \fBQPixmap\fP & pix)"
.PP
Copies the \fBQPixmap\fP \fCpix\fP. 
.PP
Definition at line 412 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. 
.PP
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
.PD 0
.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
.PD 0
.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
.PD 0
.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
.PD 0
.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 colors 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
\fBParameters:\fP
.RS 4
\fIimg\fP the image to convert 
.br
\fIconversion_flags\fP bitmask, described above 
.RE
.PP
\fBReturns:\fP
.RS 4
\fCtrue\fP if successful. 
.RE
.PP

.PP
Reimplemented from \fBQPixmap\fP.
.PP
Definition at line 249 of file kpixmap.cpp.
.PP
References Auto, checkColorTable(), QPixmap::convertFromImage(), QPixmap::defaultDepth(), QPixmap::detach(), QImage::height(), QImage::setAlphaBuffer(), QPixmap::setMask(), and QImage::width().
.PP
Referenced by convertFromImage(), load(), KPixmapEffect::pattern(), and KPixmapEffect::selectedPixmap().
.SS "bool KPixmap::convertFromImage (const \fBQImage\fP & img, \fBColorMode\fP mode = \fCWebColor\fP)"
.PP
This is an overloaded member function, provided for convenience. 
.PP
It differs from the above function only in what argument(s) it accepts. 
.PP
\fBParameters:\fP
.RS 4
\fIimg\fP the image to convert 
.br
\fImode\fP a ColorMode to apply 
.RE
.PP
\fBReturns:\fP
.RS 4
\fCtrue\fP if successful. 
.RE
.PP

.PP
Reimplemented from \fBQPixmap\fP.
.PP
Definition at line 227 of file kpixmap.cpp.
.PP
References Color, convertFromImage(), LowColor, Mono, and WebColor.
.SS "bool KPixmap::load (const \fBQString\fP & fileName, const char * format, int conversion_flags)"
.PP
Loads a pixmap from the file \fCfileName\fP. 
.PP
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
The \fBQImageIO\fP documentation lists the supported image formats and explains how to add extra formats.
.PP
\fBParameters:\fP
.RS 4
\fIfileName\fP the name of the file to load the image from 
.br
\fIformat\fP the format for the image 
.br
\fIconversion_flags\fP a bitmask, as described in \fBconvertFromImage()\fP 
.RE
.PP
\fBReturns:\fP
.RS 4
\fCtrue\fP if successful, or false if the pixmap could not be loaded. 
.RE
.PP

.PP
Reimplemented from \fBQPixmap\fP.
.PP
Definition at line 190 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 = \fC0\fP, \fBColorMode\fP mode = \fCWebColor\fP)"
.PP
This is an overloaded member function, provided for convenience. 
.PP
It differs from the above function only in what argument(s) it accepts. 
.PP
\fBParameters:\fP
.RS 4
\fIfileName\fP the name of the file to load the image from 
.br
\fIformat\fP the format for the image 
.br
\fImode\fP a ColorMode to apply 
.RE
.PP
\fBReturns:\fP
.RS 4
\fCtrue\fP if successful, or false if the pixmap could not be loaded. 
.RE
.PP

.PP
Reimplemented from \fBQPixmap\fP.
.PP
Definition at line 204 of file kpixmap.cpp.
.PP
References Color, load(), LowColor, Mono, and WebColor.
.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. 
.PP
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. 
.PP
\fBParameters:\fP
.RS 4
\fIimage\fP the image to test 
.RE
.PP

.PP
Definition at line 317 of file kpixmap.cpp.
.PP
Referenced by convertFromImage().

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