Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qpnghandler.cpp File Reference

(003cef9d40f2e840f2690bd465994deaab5c2b95)

#include "private/qpnghandler_p.h"
#include <qcoreapplication.h>
#include <qdebug.h>
#include <qiodevice.h>
#include <qimage.h>
#include <qloggingcategory.h>
#include <qvariant.h>
#include <private/qimage_p.h>
#include <qcolorspace.h>
#include <private/qcolorspace_p.h>
#include <png.h>
#include <pngconf.h>
+ Include dependency graph for qpnghandler.cpp:

Go to the source code of this file.

Classes

class  QPngHandlerPrivate
 
struct  QPngHandlerPrivate::AllocatedMemoryPointers
 
class  QPNGImageWriter
 

Macros

#define FAST_SCAN_LINE(data, bpl, y)   (data + (y) * bpl)
 

Functions

static void iod_read_fn (png_structp png_ptr, png_bytep data, png_size_t length)
 
static void qpiw_write_fn (png_structp png_ptr, png_bytep data, png_size_t length)
 
static void qpiw_flush_fn (png_structp)
 
static bool setup_qt (QImage &image, png_structp png_ptr, png_infop info_ptr, QSize scaledSize, bool *doScaledRead)
 
static void read_image_scaled (QImage *outImage, png_structp png_ptr, png_infop info_ptr, QPngHandlerPrivate::AllocatedMemoryPointers &amp, QSize scaledSize)
 
static void qt_png_warning (png_structp, png_const_charp message)
 
static void set_text (const QImage &image, png_structp png_ptr, png_infop info_ptr, const QString &description)
 
static bool write_png_image (const QImage &image, QIODevice *device, int compression, int quality, float gamma, const QString &description)
 

Macro Definition Documentation

◆ FAST_SCAN_LINE

#define FAST_SCAN_LINE ( data,
bpl,
y )   (data + (y) * bpl)

Definition at line 53 of file qpnghandler.cpp.

Referenced by QPngHandlerPrivate::readPngImage().

Function Documentation

◆ iod_read_fn()

static void iod_read_fn ( png_structp png_ptr,
png_bytep data,
png_size_t length )
static

Definition at line 163 of file qpnghandler.cpp.

References d, and QPngHandlerPrivate::ReadingEnd.

Referenced by QPngHandlerPrivate::readPngHeader().

+ Here is the caller graph for this function:

◆ qpiw_flush_fn()

static void qpiw_flush_fn ( png_structp )
static

Definition at line 202 of file qpnghandler.cpp.

Referenced by QPNGImageWriter::writeImage().

+ Here is the caller graph for this function:

◆ qpiw_write_fn()

static void qpiw_write_fn ( png_structp png_ptr,
png_bytep data,
png_size_t length )
static

Definition at line 188 of file qpnghandler.cpp.

References out.

Referenced by QPNGImageWriter::writeImage().

+ Here is the caller graph for this function:

◆ qt_png_warning()

static void qt_png_warning ( png_structp ,
png_const_charp message )
static

Definition at line 467 of file qpnghandler.cpp.

References qCInfo.

Referenced by QPngHandlerPrivate::readPngHeader(), and QPNGImageWriter::writeImage().

+ Here is the caller graph for this function:

◆ read_image_scaled()

static void read_image_scaled ( QImage * outImage,
png_structp png_ptr,
png_infop info_ptr,
QPngHandlerPrivate::AllocatedMemoryPointers & amp,
QSize scaledSize )
static

Definition at line 387 of file qpnghandler.cpp.

References QPngHandlerPrivate::AllocatedMemoryPointers::accRow, QPngHandlerPrivate::AllocatedMemoryPointers::deallocate(), QSize::height(), i, QPngHandlerPrivate::AllocatedMemoryPointers::inRow, QSize::isEmpty(), QPngHandlerPrivate::AllocatedMemoryPointers::outRow, qMin(), and QSize::width().

Referenced by QPngHandlerPrivate::readPngImage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set_text()

static void set_text ( const QImage & image,
png_structp png_ptr,
png_infop info_ptr,
const QString & description )
static

Definition at line 786 of file qpnghandler.cpp.

References ch, QString::constBegin(), QString::constEnd(), i, QString::isEmpty(), it, qstrdup(), qt_getImageText(), QSet< T >::size(), QString::size(), and text.

Referenced by QPNGImageWriter::writeImage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setup_qt()

static bool setup_qt ( QImage & image,
png_structp png_ptr,
png_infop info_ptr,
QSize scaledSize,
bool * doScaledRead )
static

Definition at line 209 of file qpnghandler.cpp.

References QImageIOHandler::allocateImage(), QSysInfo::BigEndian, QSysInfo::ByteOrder, QImage::Format_ARGB32, QImage::Format_Grayscale16, QImage::Format_Grayscale8, QImage::Format_Indexed8, QImage::Format_Mono, QImage::Format_RGB32, QImage::Format_RGBA64, QImage::Format_RGBX64, QSize::height(), i, QSize::isEmpty(), QSysInfo::LittleEndian, palette, qRgb(), qRgba(), red, and QSize::width().

Referenced by QPngHandlerPrivate::readPngImage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ write_png_image()

static bool write_png_image ( const QImage & image,
QIODevice * device,
int compression,
int quality,
float gamma,
const QString & description )
static

Definition at line 1130 of file qpnghandler.cpp.

References device, and qMin().

Referenced by QPngHandler::write().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: