1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
|
/*
SPDX-FileCopyrightText: 2009-2010 Patrick Spendrin <ps_ml@gmx.de>
SPDX-FileCopyrightText: 2007-2018 Gilles Caulier <caulier dot gilles at gmail dot com>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef KIPIWRITEHELP_H
#define KIPIWRITEHELP_H
// C++ includes
#include <cstdio>
// Qt includes
#include <QIODevice>
// C ANSI includes
extern "C"
{
#include <jpeglib.h>
#include <png.h>
}
namespace KXMLKipiCmd
{
/**
* a replacement function for jpeg_stdio_dest
* for convenience reasons, it uses a QIODevice instead of a QFile, but the main advantage is to not give over
* a FILE* pointer on Windows which can break due to different MS C Runtime libraries.
*
* Prepare for output to a QIODevice.
* The caller must have already opened the device, and is responsible
* for closing it after finishing compression.
*/
void kipi_jpeg_qiodevice_dest(j_compress_ptr cinfo, QIODevice* const outfile);
/**
* a replacement function for jpeg_stdio_src
* for convenience reasons, it uses a QIODevice instead of a QFile, but the main advantage is to not give over
* a FILE* pointer on Windows which can break due to different MS C Runtime libraries.
*
* Prepare for input from a QIODevice.
* The caller must have already opened the device, and is responsible
* for closing it after finishing reading.
*/
void kipi_jpeg_qiodevice_src(j_decompress_ptr cinfo, QIODevice* const infile);
/**
* a callback function for writing a png image
*/
void kipi_png_write_fn(png_structp png_ptr, png_bytep data, png_size_t length);
/**
* a callback function for flushing the buffers, currently unused, since no buffering happens
*/
void kipi_png_flush_fn(png_structp png_ptr);
/**
* To manage Errors/Warnings handling provide by libtiff
*/
void kipi_tiff_warning(const char* module, const char* format, va_list warnings);
void kipi_tiff_error(const char* module, const char* format, va_list errors);
} // namespace KXMLKipiCmd
#endif // KIPIWRITEHELP_H
|