#include "qtiffhandler_p.h"
#include <qvariant.h>
#include <qdebug.h>
#include <qimage.h>
#include <qglobal.h>
#include "tiffio.h"
Go to the source code of this file.
|
static bool | checkGrayscale (const QVector< QRgb > &colorTable) |
|
int | qtiffCloseProc (thandle_t) |
|
int | qtiffMapProc (thandle_t, tdata_t *, toff_t *) |
|
tsize_t | qtiffReadProc (thandle_t fd, tdata_t buf, tsize_t size) |
|
toff_t | qtiffSeekProc (thandle_t fd, toff_t off, int whence) |
|
toff_t | qtiffSizeProc (thandle_t fd) |
|
void | qtiffUnmapProc (thandle_t, tdata_t, toff_t) |
|
tsize_t | qtiffWriteProc (thandle_t fd, tdata_t buf, tsize_t size) |
|
void | rotate_right_mirror_horizontal (QImage *const image) |
|
void | rotate_right_mirror_vertical (QImage *const image) |
|
◆ checkGrayscale()
static bool checkGrayscale |
( |
const QVector< QRgb > & |
colorTable | ) |
|
|
static |
Definition at line 391 of file qtiffhandler.cpp.
Referenced by QTiffHandler::write().
393 if (colorTable.
size() != 256)
396 const bool increasing = (colorTable.
at(0) == 0xff000000);
397 for (
int i = 0; i < 256; ++i) {
398 if ((increasing && colorTable.
at(i) !=
qRgb(i, i, i))
399 || (!increasing && colorTable.
at(i) !=
qRgb(255 - i, 255 - i, 255 - i)))
const T & at(int i) const
Returns the item at index position i in the vector.
QRgb qRgb(int r, int g, int b)
Returns the ARGB quadruplet (255, {r}, {g}, {b}).
int size() const
Returns the number of items in the vector.
◆ qtiffCloseProc()
int qtiffCloseProc |
( |
thandle_t |
| ) |
|
◆ qtiffMapProc()
int qtiffMapProc |
( |
thandle_t |
, |
|
|
tdata_t * |
, |
|
|
toff_t * |
|
|
) |
| |
◆ qtiffReadProc()
tsize_t qtiffReadProc |
( |
thandle_t |
fd, |
|
|
tdata_t |
buf, |
|
|
tsize_t |
size |
|
) |
| |
Definition at line 53 of file qtiffhandler.cpp.
Referenced by QTiffHandler::option(), QTiffHandler::read(), and QTiffHandler::write().
56 return device->
isReadable() ? device->
read(static_cast<char *>(buf), size) : -1;
bool isReadable() const
Returns true if data can be read from the device; otherwise returns false.
qint64 read(char *data, qint64 maxlen)
Reads at most maxSize bytes from the device into data, and returns the number of bytes read...
The QIODevice class is the base interface class of all I/O devices in Qt.
◆ qtiffSeekProc()
toff_t qtiffSeekProc |
( |
thandle_t |
fd, |
|
|
toff_t |
off, |
|
|
int |
whence |
|
) |
| |
Definition at line 64 of file qtiffhandler.cpp.
Referenced by QTiffHandler::option(), QTiffHandler::read(), and QTiffHandler::write().
72 device->
seek(device->
pos() + off);
virtual qint64 size() const
For open random-access devices, this function returns the size of the device.
virtual qint64 pos() const
For random-access devices, this function returns the position that data is written to or read from...
The QIODevice class is the base interface class of all I/O devices in Qt.
virtual bool seek(qint64 pos)
For random-access devices, this function sets the current position to pos, returning true on success...
◆ qtiffSizeProc()
toff_t qtiffSizeProc |
( |
thandle_t |
fd | ) |
|
◆ qtiffUnmapProc()
void qtiffUnmapProc |
( |
thandle_t |
, |
|
|
tdata_t |
, |
|
|
toff_t |
|
|
) |
| |
◆ qtiffWriteProc()
tsize_t qtiffWriteProc |
( |
thandle_t |
fd, |
|
|
tdata_t |
buf, |
|
|
tsize_t |
size |
|
) |
| |
◆ rotate_right_mirror_horizontal()
void rotate_right_mirror_horizontal |
( |
QImage *const |
image | ) |
|
|
inline |
Definition at line 102 of file qtiffhandler.cpp.
Referenced by QTiffHandler::read().
104 const int height = image->
height();
105 const int width = image->
width();
107 const uint32 *originalPixel =
reinterpret_cast<const uint32*
>(image->
bits());
108 uint32 *
const generatedPixels =
reinterpret_cast<uint32*
>(generated.bits());
109 for (
int row=0; row < height; ++row) {
110 for (
int col=0; col < width; ++col) {
111 int idx = col * height + row;
112 generatedPixels[idx] = *originalPixel;
Format format() const
Returns the format of the image.
The QImage class provides a hardware-independent image representation that allows direct access to th...
uchar * bits()
Returns a pointer to the first pixel data.
int width() const
Returns the width of the image.
int height() const
Returns the height of the image.
◆ rotate_right_mirror_vertical()
void rotate_right_mirror_vertical |
( |
QImage *const |
image | ) |
|
|
inline |
Definition at line 119 of file qtiffhandler.cpp.
Referenced by QTiffHandler::read().
121 const int height = image->
height();
122 const int width = image->
width();
124 const int lastCol = width - 1;
125 const int lastRow = height - 1;
126 const uint32 *pixel =
reinterpret_cast<const uint32*
>(image->
bits());
127 uint32 *
const generatedBits =
reinterpret_cast<uint32*
>(generated.bits());
128 for (
int row=0; row < height; ++row) {
129 for (
int col=0; col < width; ++col) {
130 int idx = (lastCol - col) * height + (lastRow - row);
131 generatedBits[idx] = *pixel;
Format format() const
Returns the format of the image.
The QImage class provides a hardware-independent image representation that allows direct access to th...
uchar * bits()
Returns a pointer to the first pixel data.
int width() const
Returns the width of the image.
int height() const
Returns the height of the image.