Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qjpeghandler.cpp File Reference

(7f51608013ba4352d6c5acf77172a7929d7cfdb6)

#include "qjpeghandler_p.h"
#include <qbuffer.h>
#include <qcolorspace.h>
#include <qcolortransform.h>
#include <qdebug.h>
#include <qimage.h>
#include <qlist.h>
#include <qloggingcategory.h>
#include <qmath.h>
#include <qvariant.h>
#include <private/qicc_p.h>
#include <private/qsimd_p.h>
#include <private/qimage_p.h>
#include <stdio.h>
#include <setjmp.h>
#include <jpeglib.h>
Include dependency graph for qjpeghandler.cpp:

Go to the source code of this file.

Classes

struct  my_error_mgr
struct  my_jpeg_source_mgr
struct  my_jpeg_destination_mgr
class  QJpegHandlerPrivate

Macros

#define XMD_H
#define HIGH_QUALITY_THRESHOLD   50

Typedefs

typedef void(QT_FASTCALLRgb888ToRgb32Converter) (quint32 *dst, const uchar *src, int len)

Functions

QT_BEGIN_NAMESPACE Q_GUI_EXPORT void QT_FASTCALL qt_convert_rgb888_to_rgb32 (quint32 *dst, const uchar *src, int len)
static void my_error_exit (j_common_ptr cinfo)
static void my_output_message (j_common_ptr cinfo)
static void qt_init_source (j_decompress_ptr)
static boolean qt_fill_input_buffer (j_decompress_ptr cinfo)
static void qt_skip_input_data (j_decompress_ptr cinfo, long num_bytes)
static void qt_term_source (j_decompress_ptr cinfo)
static bool read_jpeg_size (int &w, int &h, j_decompress_ptr cinfo)
static bool read_jpeg_format (QImage::Format &format, j_decompress_ptr cinfo)
static bool ensureValidImage (QImage *dest, struct jpeg_decompress_struct *info, const QSize &size)
static bool read_jpeg_image (QImage *outImage, QSize scaledSize, QRect scaledClipRect, QRect clipRect, int quality, Rgb888ToRgb32Converter converter, j_decompress_ptr info, struct my_error_mgr *err, bool invertCMYK)
static void qt_init_destination (j_compress_ptr)
static boolean qt_empty_output_buffer (j_compress_ptr cinfo)
static void qt_term_destination (j_compress_ptr cinfo)
static void set_text (const QImage &image, j_compress_ptr cinfo, const QString &description)
static void write_icc_profile (const QImage &image, j_compress_ptr cinfo)
static bool do_write_jpeg_image (struct jpeg_compress_struct &cinfo, JSAMPROW *row_pointer, const QImage &image, QIODevice *device, int sourceQuality, const QString &description, bool optimize, bool progressive, bool invertCMYK)
static bool write_jpeg_image (const QImage &image, QIODevice *device, int sourceQuality, const QString &description, bool optimize, bool progressive, bool invertCMYK)
static bool readExifHeader (QDataStream &stream)
static int getExifOrientation (QByteArray &exifData)
static QImageIOHandler::Transformations exif2Qt (int exifOrientation)
Q_GUI_EXPORT void QT_FASTCALL qt_convert_rgb888_to_rgb32_neon (quint32 *dst, const uchar *src, int len)
Q_GUI_EXPORT void QT_FASTCALL qt_convert_rgb888_to_rgb32_ssse3 (quint32 *dst, const uchar *src, int len)
void qt_convert_rgb888_to_rgb32_mips_dspr2_asm (quint32 *dst, const uchar *src, int len)
void qt_imageTransform (QImage &src, QImageIOHandler::Transformations orient)

Variables

static const int max_buf = 4096
static constexpr int maxMarkerSize = 65533
static const char SupportedJPEGSubtypes [][14]

Macro Definition Documentation

◆ HIGH_QUALITY_THRESHOLD

#define HIGH_QUALITY_THRESHOLD   50

Definition at line 165 of file qjpeghandler.cpp.

◆ XMD_H

#define XMD_H

Definition at line 29 of file qjpeghandler.cpp.

Typedef Documentation

◆ Rgb888ToRgb32Converter

typedef void(QT_FASTCALL * Rgb888ToRgb32Converter) (quint32 *dst, const uchar *src, int len)

Definition at line 43 of file qjpeghandler.cpp.

Function Documentation

◆ do_write_jpeg_image()

bool do_write_jpeg_image ( struct jpeg_compress_struct & cinfo,
JSAMPROW * row_pointer,
const QImage & image,
QIODevice * device,
int sourceQuality,
const QString & description,
bool optimize,
bool progressive,
bool invertCMYK )
static

Definition at line 501 of file qjpeghandler.cpp.

References my_jpeg_destination_mgr::my_jpeg_destination_mgr(), my_error_exit(), and my_output_message().

Here is the call graph for this function:

◆ ensureValidImage()

bool ensureValidImage ( QImage * dest,
struct jpeg_decompress_struct * info,
const QSize & size )
static

Definition at line 192 of file qjpeghandler.cpp.

◆ exif2Qt()

QImageIOHandler::Transformations exif2Qt ( int exifOrientation)
static

Definition at line 923 of file qjpeghandler.cpp.

◆ getExifOrientation()

int getExifOrientation ( QByteArray & exifData)
static

Definition at line 842 of file qjpeghandler.cpp.

◆ my_error_exit()

void my_error_exit ( j_common_ptr cinfo)
static

Definition at line 51 of file qjpeghandler.cpp.

Referenced by do_write_jpeg_image().

Here is the caller graph for this function:

◆ my_output_message()

void my_output_message ( j_common_ptr cinfo)
static

Definition at line 58 of file qjpeghandler.cpp.

Referenced by do_write_jpeg_image(), and QJpegHandlerPrivate::readJpegHeader().

Here is the caller graph for this function:

◆ qt_convert_rgb888_to_rgb32()

QT_BEGIN_NAMESPACE Q_GUI_EXPORT void QT_FASTCALL qt_convert_rgb888_to_rgb32 ( quint32 * dst,
const uchar * src,
int len )

Definition at line 694 of file qimage_conversions.cpp.

◆ qt_convert_rgb888_to_rgb32_mips_dspr2_asm()

void qt_convert_rgb888_to_rgb32_mips_dspr2_asm ( quint32 * dst,
const uchar * src,
int len )

◆ qt_convert_rgb888_to_rgb32_neon()

Q_GUI_EXPORT void QT_FASTCALL qt_convert_rgb888_to_rgb32_neon ( quint32 * dst,
const uchar * src,
int len )

◆ qt_convert_rgb888_to_rgb32_ssse3()

Q_GUI_EXPORT void QT_FASTCALL qt_convert_rgb888_to_rgb32_ssse3 ( quint32 * dst,
const uchar * src,
int len )

◆ qt_empty_output_buffer()

boolean qt_empty_output_buffer ( j_compress_ptr cinfo)
static

Definition at line 428 of file qjpeghandler.cpp.

References my_jpeg_destination_mgr::buffer, my_jpeg_destination_mgr::device, and max_buf.

Referenced by my_jpeg_destination_mgr::my_jpeg_destination_mgr().

Here is the caller graph for this function:

◆ qt_fill_input_buffer()

boolean qt_fill_input_buffer ( j_decompress_ptr cinfo)
static

Definition at line 86 of file qjpeghandler.cpp.

References my_jpeg_source_mgr::buffer, my_jpeg_source_mgr::device, and max_buf.

Referenced by my_jpeg_source_mgr::my_jpeg_source_mgr(), and qt_skip_input_data().

Here is the caller graph for this function:

◆ qt_imageTransform()

void qt_imageTransform ( QImage & src,
QImageIOHandler::Transformations orient )
extern

Definition at line 6516 of file qimage.cpp.

◆ qt_init_destination()

void qt_init_destination ( j_compress_ptr )
static

Definition at line 424 of file qjpeghandler.cpp.

Referenced by my_jpeg_destination_mgr::my_jpeg_destination_mgr().

Here is the caller graph for this function:

◆ qt_init_source()

void qt_init_source ( j_decompress_ptr )
static

Definition at line 82 of file qjpeghandler.cpp.

Referenced by my_jpeg_source_mgr::my_jpeg_source_mgr().

Here is the caller graph for this function:

◆ qt_skip_input_data()

void qt_skip_input_data ( j_decompress_ptr cinfo,
long num_bytes )
static

Definition at line 110 of file qjpeghandler.cpp.

References qt_fill_input_buffer().

Referenced by my_jpeg_source_mgr::my_jpeg_source_mgr().

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

◆ qt_term_destination()

void qt_term_destination ( j_compress_ptr cinfo)
static

Definition at line 442 of file qjpeghandler.cpp.

References my_jpeg_destination_mgr::buffer, my_jpeg_destination_mgr::device, and max_buf.

Referenced by my_jpeg_destination_mgr::my_jpeg_destination_mgr().

Here is the caller graph for this function:

◆ qt_term_source()

void qt_term_source ( j_decompress_ptr cinfo)
static

Definition at line 133 of file qjpeghandler.cpp.

References my_jpeg_source_mgr::device.

Referenced by my_jpeg_source_mgr::my_jpeg_source_mgr().

Here is the caller graph for this function:

◆ read_jpeg_format()

bool read_jpeg_format ( QImage::Format & format,
j_decompress_ptr cinfo )
inlinestatic

Definition at line 167 of file qjpeghandler.cpp.

◆ read_jpeg_image()

bool read_jpeg_image ( QImage * outImage,
QSize scaledSize,
QRect scaledClipRect,
QRect clipRect,
int quality,
Rgb888ToRgb32Converter converter,
j_decompress_ptr info,
struct my_error_mgr * err,
bool invertCMYK )
static

Definition at line 216 of file qjpeghandler.cpp.

◆ read_jpeg_size()

bool read_jpeg_size ( int & w,
int & h,
j_decompress_ptr cinfo )
inlinestatic

Definition at line 156 of file qjpeghandler.cpp.

Referenced by QJpegHandlerPrivate::readJpegHeader().

Here is the caller graph for this function:

◆ readExifHeader()

bool readExifHeader ( QDataStream & stream)
static

Definition at line 821 of file qjpeghandler.cpp.

◆ set_text()

void set_text ( const QImage & image,
j_compress_ptr cinfo,
const QString & description )
inlinestatic

Definition at line 466 of file qjpeghandler.cpp.

References maxMarkerSize.

◆ write_icc_profile()

void write_icc_profile ( const QImage & image,
j_compress_ptr cinfo )
inlinestatic

Definition at line 480 of file qjpeghandler.cpp.

References maxMarkerSize.

◆ write_jpeg_image()

bool write_jpeg_image ( const QImage & image,
QIODevice * device,
int sourceQuality,
const QString & description,
bool optimize,
bool progressive,
bool invertCMYK )
static

Definition at line 722 of file qjpeghandler.cpp.

Variable Documentation

◆ max_buf

const int max_buf = 4096
static

◆ maxMarkerSize

constexpr int maxMarkerSize = 65533
staticconstexpr

Definition at line 464 of file qjpeghandler.cpp.

Referenced by set_text(), and write_icc_profile().

◆ SupportedJPEGSubtypes

const char SupportedJPEGSubtypes
static
Initial value:
= {
"Automatic",
"Inverted_CMYK",
"CMYK"
}

Definition at line 813 of file qjpeghandler.cpp.

Referenced by QJpegHandler::option(), and QJpegHandler::setOption().