KImgIO
#include "pic_rw.h"
#include <netinet/in.h>
#include <iostream>
#include <qimage.h>
#include <algorithm>
Go to the source code of this file.
Macros | |
#define | CHANNEL_BYTE(ch, mask) (( ch & mask) ? 1 : 0) |
#define | FAIL() |
Functions | |
static int | channels2bpp (char channels) |
static int | decodeRLE (QIODevice *dev, void *row, unsigned max, unsigned bpp, unsigned channels) |
static unsigned | getNumChannels (PICChannel *channels) |
bool | hasAlpha (PICChannel *channels) |
static void | makeComponentMap (unsigned channel, unsigned char *cmap) |
static void | pic2RGBA (unsigned char *src_pixel, unsigned char *target_pixel, unsigned char *cmap, unsigned components) |
void | pic_read (QIODevice *dev, QImage *result) |
bool | picReadHeader (QIODevice *dev, PICHeader *hdr, bool peek) |
static bool | readChannels (QIODevice *dev, PICChannel *channels, int &bpp) |
static bool | readRow (QIODevice *dev, unsigned *row, unsigned width, PICChannel *channels) |
Macro Definition Documentation
#define CHANNEL_BYTE | ( | ch, | |
mask | |||
) | (( ch & mask) ? 1 : 0) |
Definition at line 61 of file pic_read.cpp.
#define FAIL | ( | ) |
Definition at line 245 of file pic_read.cpp.
Function Documentation
|
static |
Gets the channels definition and returns the number of bytes per pixel.
- Parameters
-
channels The channels bitfield
- Returns
- The number of bytes per pixel
Definition at line 68 of file pic_read.cpp.
|
static |
Decodes a Run-lenght encoded chunk.
- Parameters
-
dev The device to read from row The row pointer to write to max The maximum length to write channels The channels header
- Returns
- The number of generated pixels
No repetitions
Definition at line 152 of file pic_read.cpp.
|
inlinestatic |
Counts the number of channels in the PICChannel header.
- Parameters
-
channels The header
- Returns
- The number of used channels
Definition at line 132 of file pic_read.cpp.
bool hasAlpha | ( | PICChannel * | channels | ) |
Definition at line 250 of file pic_read.cpp.
|
inlinestatic |
Makes a component map based on the channels info.
- Parameters
-
channels The channel information cmap The component map to be built
Definition at line 101 of file pic_read.cpp.
|
inlinestatic |
Converts a PIC pixel to 32bits RGBA.
- Parameters
-
src_pixel The source PIC pixel as readed from file target_pixel The target buffer where to write the pixel info cmap The component map that maps each component in PIC format to RGBA format components The number of components in the source pixel
Definition at line 121 of file pic_read.cpp.
KDE image reading function.
Pic read handler for Qt / KDE.
Must have this exact name in order to work
Definition at line 264 of file pic_read.cpp.
PIC_RW - Qt PIC Support Copyright (C) 2007 Ruben Lopez r.lop ez@b ren.e s
Reads the PIC header and checks that it is OK.
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Reads the PIC header and checks that it is OK
- Parameters
-
dev The QT device to read from hdr A pointer to the PIC header peek Keep bytes in the device
- Returns
- true on success
Definition at line 41 of file pic_read.cpp.
|
static |
Reads the channels info.
- Parameters
-
dev The QT device to read from channels A pointer to 8 channels
- Returns
- true on success
Definition at line 81 of file pic_read.cpp.
|
static |
Reads a row from the file.
- Parameters
-
dev The device to read from row The row pointer to write to width The image width bpp The bytes per pixel channels The channels header info
Definition at line 215 of file pic_read.cpp.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:22:49 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.