Compare commits
66 Commits
Author | SHA1 | Date | |
---|---|---|---|
b7910e169e | |||
c27ba814fd | |||
873746d04b | |||
47e8043d45 | |||
ac2b63046f | |||
6b72930cb2 | |||
4cdcf3a98c | |||
88518c5862 | |||
b870e9cd47 | |||
c21fc5982b | |||
8ffd5bb2f7 | |||
5ae66b99d9 | |||
f4bea644eb | |||
415850f3d3 | |||
af19f49711 | |||
3d45b270ea | |||
c9ca1f1862 | |||
a96a255f71 | |||
5b42b3b787 | |||
f98e508da4 | |||
a92540f00d | |||
2ec0d5abc6 | |||
cca4c545a4 | |||
87b545f9ed | |||
1132abbf67 | |||
2a8251c493 | |||
51eca9b6a8 | |||
74906dd3bc | |||
c1a7769ecc | |||
1eb5228cce | |||
889df138bb | |||
101ba47b61 | |||
2ded57d50e | |||
0f795e6625 | |||
895305050c | |||
e29a897cb9 | |||
6d24f585b1 | |||
b4192f9f8b | |||
6375160828 | |||
89a3e64c0e | |||
6272954cc5 | |||
4fbbc75429 | |||
331a813662 | |||
30cff60296 | |||
7177296335 | |||
f490ab0761 | |||
3eafdc861a | |||
18ddd0920f | |||
024db1f42b | |||
14b4932392 | |||
63705e373e | |||
a533bcd418 | |||
bfea0e0e7c | |||
f0f6d14367 | |||
32f7d48b3c | |||
e26bd0891d | |||
b1de3377d0 | |||
d5c589dae3 | |||
b2083df231 | |||
0ee3ffb368 | |||
cd4a2de0c1 | |||
b71ede5c0f | |||
aeff5cca5a | |||
7177dba8db | |||
4998e85b93 | |||
4384f8f5d9 |
@ -2,3 +2,4 @@ REVIEWBOARD_URL = "https://git.reviewboard.kde.org"
|
|||||||
REPOSITORY = 'git://anongit.kde.org/kimageformats'
|
REPOSITORY = 'git://anongit.kde.org/kimageformats'
|
||||||
BRANCH = 'master'
|
BRANCH = 'master'
|
||||||
TARGET_GROUPS = 'kdeframeworks'
|
TARGET_GROUPS = 'kdeframeworks'
|
||||||
|
TARGET_PEOPLE = 'alexmerry'
|
||||||
|
@ -2,10 +2,9 @@ cmake_minimum_required(VERSION 2.8.12)
|
|||||||
|
|
||||||
project(KImageFormats)
|
project(KImageFormats)
|
||||||
|
|
||||||
find_package(ECM 0.0.9 REQUIRED NO_MODULE)
|
find_package(ECM 1.8.0 REQUIRED NO_MODULE)
|
||||||
|
|
||||||
# Add our own CMake dir for FindOpenEXR.cmake
|
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
|
||||||
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
|
||||||
|
|
||||||
include(KDEInstallDirs)
|
include(KDEInstallDirs)
|
||||||
include(KDEFrameworkCompilerSettings)
|
include(KDEFrameworkCompilerSettings)
|
||||||
@ -17,9 +16,42 @@ include(CheckIncludeFiles)
|
|||||||
set(REQUIRED_QT_VERSION 5.2.0)
|
set(REQUIRED_QT_VERSION 5.2.0)
|
||||||
find_package(Qt5Gui ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE)
|
find_package(Qt5Gui ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE)
|
||||||
|
|
||||||
add_subdirectory(src)
|
# EPS support depends on the gs utility; non-UNIX systems are unlikely to have
|
||||||
add_subdirectory(tests)
|
# this available in PATH
|
||||||
|
set(BUILD_EPS_PLUGIN FALSE)
|
||||||
if ("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
|
if (UNIX)
|
||||||
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
|
find_package(Qt5PrintSupport 5.2.0 NO_MODULE)
|
||||||
|
set_package_properties(Qt5PrintSupport PROPERTIES
|
||||||
|
PURPOSE "Required for the QImage plugin for EPS images"
|
||||||
|
TYPE OPTIONAL
|
||||||
|
)
|
||||||
|
if (Qt5PrintSupport_FOUND)
|
||||||
|
set(BUILD_EPS_PLUGIN TRUE)
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# QtImageFormats 5.3 comes with a JPEG-2000 plugin; don't duplicate it here
|
||||||
|
# TODO: remove our JPEG-2000 plugin when we depend on Qt 5.3.
|
||||||
|
if (Qt5Gui_VERSION VERSION_LESS 5.3.0)
|
||||||
|
find_package(Jasper)
|
||||||
|
set_package_properties(Jasper PROPERTIES
|
||||||
|
DESCRIPTION "A library for handling JPEG-2000 images"
|
||||||
|
PURPOSE "Required for the QImage plugin for JPEG-2000 images"
|
||||||
|
URL "http://www.ece.uvic.ca/~mdadams/jasper"
|
||||||
|
TYPE OPTIONAL
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
find_package(OpenEXR)
|
||||||
|
set_package_properties(OpenEXR PROPERTIES
|
||||||
|
TYPE OPTIONAL
|
||||||
|
PURPOSE "Required for the QImage plugin for OpenEXR images"
|
||||||
|
)
|
||||||
|
|
||||||
|
add_subdirectory(src)
|
||||||
|
if (BUILD_TESTING)
|
||||||
|
add_subdirectory(autotests)
|
||||||
|
add_subdirectory(tests)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
|
||||||
|
29
Mainpage.dox
@ -1,29 +0,0 @@
|
|||||||
/** @mainpage ImageFormat Plugins
|
|
||||||
|
|
||||||
Provides imageformat plugins for Qt so that it can read more image file types.
|
|
||||||
|
|
||||||
@authors
|
|
||||||
Sirtaj Singh Kang \<taj@kde.org><br>
|
|
||||||
Dirk Schoenberger<br>
|
|
||||||
Torben Weis \<weis@kde.org><br>
|
|
||||||
Thomas Tanghus \<tanghus@kde.org><br>
|
|
||||||
Antonio Larossa \<larossa@kde.org\><br>
|
|
||||||
Sven Wiegand \<SWiegand@tfh-berlin.de><br>
|
|
||||||
Dominik Seichter \<domseichter@web.de><br>
|
|
||||||
Nadeem Hasan \<nhasan@kde.org><br>
|
|
||||||
Melchior Franz \<mfranz@kde.org><br>
|
|
||||||
Allen Barnett \<allen@lignumcomputing.com><br>
|
|
||||||
Ignacio Castaño \<castano@ludicon.com><br>
|
|
||||||
Christoph Hormann \<chris_hormann@gmx.de><br>
|
|
||||||
Michael Ritzert \<kde@ritzert.de>
|
|
||||||
|
|
||||||
@maintainers
|
|
||||||
[Unknown/None]
|
|
||||||
|
|
||||||
@licenses
|
|
||||||
@lgpl
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
// DOXYGEN_SET_PROJECT_NAME = KImageFormats
|
|
||||||
// vim:ts=4:sw=4:expandtab:filetype=doxygen
|
|
33
README.md
@ -1,5 +1,7 @@
|
|||||||
# KImageFormats
|
# KImageFormats
|
||||||
|
|
||||||
|
Plugins to allow QImage to support extra file formats.
|
||||||
|
|
||||||
## Introduction
|
## Introduction
|
||||||
|
|
||||||
This framework provides additional image format plugins for QtGui. As
|
This framework provides additional image format plugins for QtGui. As
|
||||||
@ -7,7 +9,25 @@ such it is not required for the compilation of any other software, but
|
|||||||
may be a runtime requirement for Qt-based software to support certain
|
may be a runtime requirement for Qt-based software to support certain
|
||||||
image formats.
|
image formats.
|
||||||
|
|
||||||
See the src/imagesformats directory for the provided image formats.
|
## Formats
|
||||||
|
|
||||||
|
The following image formats have read-only support:
|
||||||
|
|
||||||
|
- DirectDraw Surface (dds)
|
||||||
|
- Gimp (xcf)
|
||||||
|
- OpenEXR (exr)
|
||||||
|
- Photoshop documents (psd)
|
||||||
|
- Sun Raster (ras)
|
||||||
|
|
||||||
|
The following image formats have read and write support:
|
||||||
|
|
||||||
|
- Encapsulated PostScript (eps)
|
||||||
|
- JPEG-2000 (jp2)
|
||||||
|
- Personal Computer Exchange (pcx)
|
||||||
|
- SGI images (rgb, rgba, sgi, bw)
|
||||||
|
- Softimage PIC (pic)
|
||||||
|
- Targa (tga): supports more formats than Qt's version
|
||||||
|
- XView (xv)
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
@ -35,8 +55,11 @@ licensing. If anyone were willing to write fresh code to improve Qt's
|
|||||||
TGA plugin, it would allow the TGA plugin in this framework to be
|
TGA plugin, it would allow the TGA plugin in this framework to be
|
||||||
removed.
|
removed.
|
||||||
|
|
||||||
## Links
|
## License
|
||||||
|
|
||||||
|
This framework is licensed under the
|
||||||
|
[LGPLv2.1](http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html#SEC1).
|
||||||
|
|
||||||
|
The CMake code in this framework is licensed under the
|
||||||
|
[BSD license](http://opensource.org/licenses/BSD-3-Clause).
|
||||||
|
|
||||||
- Mailing list: <https://mail.kde.org/mailman/listinfo/kde-frameworks-devel>
|
|
||||||
- IRC channel: #kde-devel on Freenode
|
|
||||||
- Git repository: <https://projects.kde.org/projects/frameworks/kimageformats/repository>
|
|
||||||
|
115
autotests/CMakeLists.txt
Normal file
@ -0,0 +1,115 @@
|
|||||||
|
#find_package(Qt5Test ${REQUIRED_QT_VERSION} NO_MODULE)
|
||||||
|
|
||||||
|
include(ECMMarkAsTest)
|
||||||
|
include(CMakeParseArguments)
|
||||||
|
|
||||||
|
add_definitions(-DPLUGIN_DIR="${CMAKE_CURRENT_BINARY_DIR}/../src")
|
||||||
|
remove_definitions(-DQT_NO_CAST_FROM_ASCII)
|
||||||
|
|
||||||
|
macro(kimageformats_read_tests)
|
||||||
|
cmake_parse_arguments(KIF_RT "" "FUZZ" "" ${ARGN})
|
||||||
|
set(_fuzzarg)
|
||||||
|
if (KIF_RT_FUZZ)
|
||||||
|
set(_fuzzarg -f ${KIF_RT_FUZZ})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (NOT TARGET readtest)
|
||||||
|
add_executable(readtest readtest.cpp)
|
||||||
|
target_link_libraries(readtest Qt5::Gui)
|
||||||
|
target_compile_definitions(readtest
|
||||||
|
PRIVATE IMAGEDIR="${CMAKE_CURRENT_SOURCE_DIR}/read")
|
||||||
|
ecm_mark_as_test(readtest)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
foreach(_testname ${KIF_RT_UNPARSED_ARGUMENTS})
|
||||||
|
add_test(
|
||||||
|
NAME kimageformats-read-${_testname}
|
||||||
|
COMMAND readtest ${_fuzzarg} ${_testname}
|
||||||
|
)
|
||||||
|
endforeach(_testname)
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
macro(kimageformats_write_tests)
|
||||||
|
if (NOT TARGET writetest)
|
||||||
|
add_executable(writetest writetest.cpp)
|
||||||
|
target_link_libraries(writetest Qt5::Gui)
|
||||||
|
target_compile_definitions(writetest
|
||||||
|
PRIVATE IMAGEDIR="${CMAKE_CURRENT_SOURCE_DIR}/write")
|
||||||
|
ecm_mark_as_test(writetest)
|
||||||
|
endif()
|
||||||
|
foreach(_testname ${ARGN})
|
||||||
|
string(REGEX MATCH "-lossless$" _is_lossless "${_testname}")
|
||||||
|
unset(lossless_arg)
|
||||||
|
if (_is_lossless)
|
||||||
|
set(lossless_arg "--lossless")
|
||||||
|
string(REGEX REPLACE "-lossless$" "" _testname "${_testname}")
|
||||||
|
endif()
|
||||||
|
add_test(
|
||||||
|
NAME kimageformats-write-${_testname}
|
||||||
|
COMMAND writetest ${lossless_arg} ${_testname}
|
||||||
|
)
|
||||||
|
endforeach(_testname)
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
# Basic read tests
|
||||||
|
# Loads each <format> image in read/<format>/, and compares the
|
||||||
|
# result against the data read from the corresponding png file
|
||||||
|
kimageformats_read_tests(
|
||||||
|
pcx
|
||||||
|
psd
|
||||||
|
ras
|
||||||
|
rgb
|
||||||
|
tga
|
||||||
|
)
|
||||||
|
# Allow some fuzziness when reading this formats, to allow for
|
||||||
|
# rounding errors (eg: in alpha blending).
|
||||||
|
kimageformats_read_tests(FUZZ 1
|
||||||
|
xcf
|
||||||
|
)
|
||||||
|
|
||||||
|
# Basic write tests
|
||||||
|
# Loads each png image in write/, writes the data out
|
||||||
|
# as a <format> image, and compares the result against the
|
||||||
|
# the corresponding <format> file.
|
||||||
|
# You can append -lossless to the format to indicate that
|
||||||
|
# reading back the image data will result in an identical image.
|
||||||
|
kimageformats_write_tests(
|
||||||
|
pcx-lossless
|
||||||
|
pic-lossless
|
||||||
|
rgb-lossless
|
||||||
|
tga # fixme: the alpha images appear not to be written properly
|
||||||
|
)
|
||||||
|
|
||||||
|
# EPS read tests depend on the vagaries of GhostScript
|
||||||
|
# which we cannot even guarantee to find, so disable them for now
|
||||||
|
#if (BUILD_EPS_PLUGIN)
|
||||||
|
# kimageformats_read_tests(eps)
|
||||||
|
# kimageformats_write_tests(eps)
|
||||||
|
#endif()
|
||||||
|
if (JASPER_FOUND)
|
||||||
|
# FIXME: when we read JPEG2000 files on different architectures
|
||||||
|
# (specifically x86_64 and i386), we get off-by-one errors. The
|
||||||
|
# jasper utility does not have the same problem, so it is not a
|
||||||
|
# problem inherent in the jasper library. For now, we just allow
|
||||||
|
# a little fuzziness to make sure it does not get any worse (being
|
||||||
|
# off by one in an image value is not noticable to the human eye,
|
||||||
|
# so it is not a release-blocking issue).
|
||||||
|
kimageformats_read_tests(FUZZ 1 jp2)
|
||||||
|
kimageformats_write_tests(jp2)
|
||||||
|
endif()
|
||||||
|
if (OpenEXR_FOUND)
|
||||||
|
# FIXME: OpenEXR tests
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
find_package(Qt5Test ${REQUIRED_QT_VERSION} CONFIG QUIET)
|
||||||
|
|
||||||
|
if(NOT Qt5Test_FOUND)
|
||||||
|
message(STATUS "Qt5Test not found, some autotests will not be built.")
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
add_executable(pictest pictest.cpp)
|
||||||
|
target_link_libraries(pictest Qt5::Gui Qt5::Test)
|
||||||
|
ecm_mark_as_test(pictest)
|
||||||
|
add_test(NAME kimageformats-pic COMMAND pictest)
|
BIN
autotests/long-runs.pic
Normal file
BIN
autotests/pic/4x4-alpha-uncompressed.pic
Normal file
BIN
autotests/pic/4x4-alpha.pic
Normal file
BIN
autotests/pic/4x4-alpha.png
Normal file
After Width: | Height: | Size: 98 B |
BIN
autotests/pic/4x4-simple-color-uncompressed.pic
Normal file
BIN
autotests/pic/4x4-simple-color.pic
Normal file
BIN
autotests/pic/4x4-simple-color.png
Normal file
After Width: | Height: | Size: 90 B |
BIN
autotests/pic/long-comment.pic
Normal file
BIN
autotests/pic/long-runs.pic
Normal file
BIN
autotests/pic/long-runs.png
Normal file
After Width: | Height: | Size: 117 B |
BIN
autotests/pic/short-comment.pic
Normal file
277
autotests/pictest.cpp
Normal file
@ -0,0 +1,277 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2014 Alex Merry <alex.merry@kdemail.net>
|
||||||
|
*
|
||||||
|
* 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.1 of the License, or (at your option) version 3, or any
|
||||||
|
* later version accepted by the membership of KDE e.V. (or its
|
||||||
|
* successor approved by the membership of KDE e.V.), which shall
|
||||||
|
* act as a proxy defined in Section 6 of version 3 of the license.
|
||||||
|
*
|
||||||
|
* 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, see
|
||||||
|
* <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#include <QBuffer>
|
||||||
|
#include <QFile>
|
||||||
|
#include <QFileInfo>
|
||||||
|
#include <QImage>
|
||||||
|
#include <QImageReader>
|
||||||
|
#include <QImageWriter>
|
||||||
|
#include <QTest>
|
||||||
|
#include <QUuid>
|
||||||
|
|
||||||
|
Q_DECLARE_METATYPE(QImage::Format)
|
||||||
|
|
||||||
|
class PicTests : public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
private:
|
||||||
|
void common_data()
|
||||||
|
{
|
||||||
|
QTest::addColumn<QString>("picfile");
|
||||||
|
QTest::addColumn<QString>("pngfile");
|
||||||
|
QTest::addColumn<QString>("comment");
|
||||||
|
// whether the pic file has/should have an alpha channel
|
||||||
|
QTest::addColumn<bool>("alpha");
|
||||||
|
// the format to convert the png file to before writing
|
||||||
|
// or comparing to the read image; this can be used to
|
||||||
|
// induce loss of data (eg: make the image monochrome)
|
||||||
|
QTest::addColumn<QImage::Format>("pngformat");
|
||||||
|
QTest::addColumn<bool>("compress");
|
||||||
|
|
||||||
|
QTest::newRow("4x4 no alpha RLE")
|
||||||
|
<< QFINDTESTDATA("pic/4x4-simple-color.pic")
|
||||||
|
<< QFINDTESTDATA("pic/4x4-simple-color.png")
|
||||||
|
<< QString()
|
||||||
|
<< false
|
||||||
|
<< QImage::Format_RGB32
|
||||||
|
<< true;
|
||||||
|
|
||||||
|
QTest::newRow("4x4 no alpha raw")
|
||||||
|
<< QFINDTESTDATA("pic/4x4-simple-color-uncompressed.pic")
|
||||||
|
<< QFINDTESTDATA("pic/4x4-simple-color.png")
|
||||||
|
<< QString()
|
||||||
|
<< false
|
||||||
|
<< QImage::Format_RGB32
|
||||||
|
<< false;
|
||||||
|
|
||||||
|
QTest::newRow("Short comment")
|
||||||
|
<< QFINDTESTDATA("pic/short-comment.pic")
|
||||||
|
<< QFINDTESTDATA("pic/4x4-simple-color.png")
|
||||||
|
<< QStringLiteral("Test comment value")
|
||||||
|
<< false
|
||||||
|
<< QImage::Format_RGB32
|
||||||
|
<< true;
|
||||||
|
|
||||||
|
QTest::newRow("Long comment")
|
||||||
|
<< QFINDTESTDATA("pic/long-comment.pic")
|
||||||
|
<< QFINDTESTDATA("pic/4x4-simple-color.png")
|
||||||
|
<< QStringLiteral("Test comment value that goes right up to the end of the comment field and has no")
|
||||||
|
<< false
|
||||||
|
<< QImage::Format_RGB32
|
||||||
|
<< true;
|
||||||
|
|
||||||
|
QTest::newRow("Long run-lengths")
|
||||||
|
<< QFINDTESTDATA("pic/long-runs.pic")
|
||||||
|
<< QFINDTESTDATA("pic/long-runs.png")
|
||||||
|
<< QString()
|
||||||
|
<< false
|
||||||
|
<< QImage::Format_RGB32
|
||||||
|
<< true;
|
||||||
|
|
||||||
|
QTest::newRow("4x4 with alpha RLE")
|
||||||
|
<< QFINDTESTDATA("pic/4x4-alpha.pic")
|
||||||
|
<< QFINDTESTDATA("pic/4x4-alpha.png")
|
||||||
|
<< QString()
|
||||||
|
<< true
|
||||||
|
<< QImage::Format_ARGB32
|
||||||
|
<< true;
|
||||||
|
|
||||||
|
QTest::newRow("4x4 with alpha raw")
|
||||||
|
<< QFINDTESTDATA("pic/4x4-alpha-uncompressed.pic")
|
||||||
|
<< QFINDTESTDATA("pic/4x4-alpha.png")
|
||||||
|
<< QString()
|
||||||
|
<< true
|
||||||
|
<< QImage::Format_ARGB32
|
||||||
|
<< false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Q_SLOTS:
|
||||||
|
void initTestCase()
|
||||||
|
{
|
||||||
|
QCoreApplication::addLibraryPath(QStringLiteral(PLUGIN_DIR));
|
||||||
|
}
|
||||||
|
|
||||||
|
void testWrite_data()
|
||||||
|
{
|
||||||
|
common_data();
|
||||||
|
|
||||||
|
// NB: 4x4-simple-color only uses solid red, blue, green and white,
|
||||||
|
// so there is no actual data loss in converting to RGB16.
|
||||||
|
// This just tests that the pic plugin can deal with different
|
||||||
|
// input formats.
|
||||||
|
QTest::newRow("altered format")
|
||||||
|
<< QFINDTESTDATA("pic/4x4-simple-color.pic")
|
||||||
|
<< QFINDTESTDATA("pic/4x4-simple-color.png")
|
||||||
|
<< QString()
|
||||||
|
<< false
|
||||||
|
<< QImage::Format_RGB16
|
||||||
|
<< true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void testRead_data()
|
||||||
|
{
|
||||||
|
common_data();
|
||||||
|
|
||||||
|
// TODO: test reading files with unusual channel setups
|
||||||
|
// (eg: one channel for each component)
|
||||||
|
}
|
||||||
|
|
||||||
|
void testWrite()
|
||||||
|
{
|
||||||
|
QFETCH(QString, picfile);
|
||||||
|
QFETCH(QString, pngfile);
|
||||||
|
QFETCH(QString, comment);
|
||||||
|
QFETCH(QImage::Format, pngformat);
|
||||||
|
QFETCH(bool, compress);
|
||||||
|
|
||||||
|
QImageReader pngReader(pngfile, "png");
|
||||||
|
QImage pngImage;
|
||||||
|
QVERIFY2(pngReader.read(&pngImage), qPrintable(pngReader.errorString()));
|
||||||
|
pngImage = pngImage.convertToFormat(pngformat);
|
||||||
|
|
||||||
|
QFile expFile(picfile);
|
||||||
|
QVERIFY2(expFile.open(QIODevice::ReadOnly), qPrintable(expFile.errorString()));
|
||||||
|
QByteArray expData = expFile.readAll();
|
||||||
|
|
||||||
|
QByteArray picData;
|
||||||
|
QBuffer buffer(&picData);
|
||||||
|
QImageWriter imgWriter(&buffer, "pic");
|
||||||
|
imgWriter.setText(QStringLiteral("Description"), comment);
|
||||||
|
imgWriter.setCompression(compress);
|
||||||
|
imgWriter.write(pngImage);
|
||||||
|
|
||||||
|
if (expData != picData) {
|
||||||
|
QString fileNameBase = QUuid::createUuid().toString()
|
||||||
|
.remove(QLatin1Char('{'))
|
||||||
|
.remove(QLatin1Char('}'));
|
||||||
|
QFile dumpFile(fileNameBase + QStringLiteral(".pic"));
|
||||||
|
QVERIFY2(dumpFile.open(QIODevice::WriteOnly), qPrintable(dumpFile.errorString()));
|
||||||
|
dumpFile.write(picData);
|
||||||
|
QString msg = QStringLiteral("Written data (")
|
||||||
|
+ dumpFile.fileName()
|
||||||
|
+ QStringLiteral(") differed from expected data (")
|
||||||
|
+ picfile
|
||||||
|
+ QLatin1Char(')');
|
||||||
|
QFAIL(qPrintable(msg));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void testRead()
|
||||||
|
{
|
||||||
|
QFETCH(QString, picfile);
|
||||||
|
QFETCH(QString, pngfile);
|
||||||
|
QFETCH(bool, alpha);
|
||||||
|
QFETCH(QImage::Format, pngformat);
|
||||||
|
|
||||||
|
QImageReader inputReader(picfile, "pic");
|
||||||
|
QImageReader expReader(pngfile, "png");
|
||||||
|
|
||||||
|
QImage inputImage;
|
||||||
|
QImage expImage;
|
||||||
|
|
||||||
|
QVERIFY2(expReader.read(&expImage), qPrintable(expReader.errorString()));
|
||||||
|
QVERIFY2(inputReader.read(&inputImage), qPrintable(inputReader.errorString()));
|
||||||
|
|
||||||
|
QCOMPARE(inputImage.width(), expImage.width());
|
||||||
|
QCOMPARE(inputImage.height(), expImage.height());
|
||||||
|
QCOMPARE(inputImage.hasAlphaChannel(), alpha);
|
||||||
|
QCOMPARE(inputImage.format(), alpha ? QImage::Format_ARGB32
|
||||||
|
: QImage::Format_RGB32);
|
||||||
|
|
||||||
|
expImage = expImage.convertToFormat(pngformat);
|
||||||
|
expImage = expImage.convertToFormat(alpha ? QImage::Format_ARGB32
|
||||||
|
: QImage::Format_RGB32);
|
||||||
|
if (inputImage != expImage) {
|
||||||
|
QString fileNameBase = QUuid::createUuid().toString()
|
||||||
|
.remove(QLatin1Char('{'))
|
||||||
|
.remove(QLatin1Char('}'));
|
||||||
|
QFile picDumpFile(fileNameBase + QStringLiteral("-expected.data"));
|
||||||
|
QVERIFY2(picDumpFile.open(QIODevice::WriteOnly), qPrintable(picDumpFile.errorString()));
|
||||||
|
picDumpFile.write(reinterpret_cast<const char *>(inputImage.bits()),
|
||||||
|
inputImage.byteCount());
|
||||||
|
QFile pngDumpFile(fileNameBase + QStringLiteral("-actual.data"));
|
||||||
|
QVERIFY2(pngDumpFile.open(QIODevice::WriteOnly), qPrintable(pngDumpFile.errorString()));
|
||||||
|
pngDumpFile.write(reinterpret_cast<const char *>(expImage.bits()),
|
||||||
|
expImage.byteCount());
|
||||||
|
QString msg = QStringLiteral("Read image (")
|
||||||
|
+ picDumpFile.fileName()
|
||||||
|
+ QStringLiteral(") differed from expected image (")
|
||||||
|
+ pngDumpFile.fileName()
|
||||||
|
+ QLatin1Char(')');
|
||||||
|
QFAIL(qPrintable(msg));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void testPreReadComment_data()
|
||||||
|
{
|
||||||
|
testRead_data();
|
||||||
|
}
|
||||||
|
|
||||||
|
void testPreReadComment()
|
||||||
|
{
|
||||||
|
QFETCH(QString, picfile);
|
||||||
|
QFETCH(QString, comment);
|
||||||
|
|
||||||
|
QImageReader inputReader(picfile, "pic");
|
||||||
|
|
||||||
|
QCOMPARE(inputReader.text(QStringLiteral("Description")), comment);
|
||||||
|
}
|
||||||
|
|
||||||
|
void testPreReadSize_data()
|
||||||
|
{
|
||||||
|
testRead_data();
|
||||||
|
}
|
||||||
|
|
||||||
|
void testPreReadSize()
|
||||||
|
{
|
||||||
|
QFETCH(QString, picfile);
|
||||||
|
QFETCH(QString, pngfile);
|
||||||
|
|
||||||
|
QImageReader inputReader(picfile, "pic");
|
||||||
|
QImageReader expReader(pngfile, "png");
|
||||||
|
|
||||||
|
QCOMPARE(inputReader.size(), expReader.size());
|
||||||
|
}
|
||||||
|
|
||||||
|
void testPreReadImageFormat_data()
|
||||||
|
{
|
||||||
|
testRead_data();
|
||||||
|
}
|
||||||
|
|
||||||
|
void testPreReadImageFormat()
|
||||||
|
{
|
||||||
|
QFETCH(QString, picfile);
|
||||||
|
QFETCH(bool, alpha);
|
||||||
|
|
||||||
|
QImageReader inputReader(picfile, "pic");
|
||||||
|
|
||||||
|
QCOMPARE(inputReader.imageFormat(),
|
||||||
|
alpha ? QImage::Format_ARGB32 : QImage::Format_RGB32);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
QTEST_MAIN(PicTests)
|
||||||
|
|
||||||
|
#include "pictest.moc"
|
502
autotests/read/eps/bw.eps
Normal file
@ -0,0 +1,502 @@
|
|||||||
|
%!PS-Adobe-3.0 EPSF-3.0
|
||||||
|
%Produced by poppler pdftops version: 0.24.5 (http://poppler.freedesktop.org)
|
||||||
|
%%Creator: KDE EPS image plugin
|
||||||
|
%%LanguageLevel: 2
|
||||||
|
%%DocumentSuppliedResources: (atend)
|
||||||
|
%%BoundingBox: 0 0 32 32
|
||||||
|
%%HiResBoundingBox: 0 0 32 32
|
||||||
|
%%DocumentSuppliedResources: (atend)
|
||||||
|
%%EndComments
|
||||||
|
%%BeginProlog
|
||||||
|
%%BeginResource: procset xpdf 3.00 0
|
||||||
|
%%Copyright: Copyright 1996-2011 Glyph & Cog, LLC
|
||||||
|
/xpdf 75 dict def xpdf begin
|
||||||
|
% PDF special state
|
||||||
|
/pdfDictSize 15 def
|
||||||
|
/pdfSetup {
|
||||||
|
/setpagedevice where {
|
||||||
|
pop 2 dict begin
|
||||||
|
/Policies 1 dict dup begin /PageSize 6 def end def
|
||||||
|
{ /Duplex true def } if
|
||||||
|
currentdict end setpagedevice
|
||||||
|
} {
|
||||||
|
pop
|
||||||
|
} ifelse
|
||||||
|
} def
|
||||||
|
/pdfSetupPaper {
|
||||||
|
2 array astore
|
||||||
|
/setpagedevice where {
|
||||||
|
pop 2 dict begin
|
||||||
|
/PageSize exch def
|
||||||
|
/ImagingBBox null def
|
||||||
|
currentdict end setpagedevice
|
||||||
|
} {
|
||||||
|
pop
|
||||||
|
} ifelse
|
||||||
|
} def
|
||||||
|
/pdfStartPage {
|
||||||
|
pdfDictSize dict begin
|
||||||
|
/pdfFillCS [] def
|
||||||
|
/pdfFillXform {} def
|
||||||
|
/pdfStrokeCS [] def
|
||||||
|
/pdfStrokeXform {} def
|
||||||
|
/pdfFill [0] def
|
||||||
|
/pdfStroke [0] def
|
||||||
|
/pdfFillOP false def
|
||||||
|
/pdfStrokeOP false def
|
||||||
|
/pdfLastFill false def
|
||||||
|
/pdfLastStroke false def
|
||||||
|
/pdfTextMat [1 0 0 1 0 0] def
|
||||||
|
/pdfFontSize 0 def
|
||||||
|
/pdfCharSpacing 0 def
|
||||||
|
/pdfTextRender 0 def
|
||||||
|
/pdfPatternCS false def
|
||||||
|
/pdfTextRise 0 def
|
||||||
|
/pdfWordSpacing 0 def
|
||||||
|
/pdfHorizScaling 1 def
|
||||||
|
/pdfTextClipPath [] def
|
||||||
|
} def
|
||||||
|
/pdfEndPage { end } def
|
||||||
|
% PDF color state
|
||||||
|
/cs { /pdfFillXform exch def dup /pdfFillCS exch def
|
||||||
|
setcolorspace } def
|
||||||
|
/CS { /pdfStrokeXform exch def dup /pdfStrokeCS exch def
|
||||||
|
setcolorspace } def
|
||||||
|
/sc { pdfLastFill not { pdfFillCS setcolorspace } if
|
||||||
|
dup /pdfFill exch def aload pop pdfFillXform setcolor
|
||||||
|
/pdfLastFill true def /pdfLastStroke false def } def
|
||||||
|
/SC { pdfLastStroke not { pdfStrokeCS setcolorspace } if
|
||||||
|
dup /pdfStroke exch def aload pop pdfStrokeXform setcolor
|
||||||
|
/pdfLastStroke true def /pdfLastFill false def } def
|
||||||
|
/op { /pdfFillOP exch def
|
||||||
|
pdfLastFill { pdfFillOP setoverprint } if } def
|
||||||
|
/OP { /pdfStrokeOP exch def
|
||||||
|
pdfLastStroke { pdfStrokeOP setoverprint } if } def
|
||||||
|
/fCol {
|
||||||
|
pdfLastFill not {
|
||||||
|
pdfFillCS setcolorspace
|
||||||
|
pdfFill aload pop pdfFillXform setcolor
|
||||||
|
pdfFillOP setoverprint
|
||||||
|
/pdfLastFill true def /pdfLastStroke false def
|
||||||
|
} if
|
||||||
|
} def
|
||||||
|
/sCol {
|
||||||
|
pdfLastStroke not {
|
||||||
|
pdfStrokeCS setcolorspace
|
||||||
|
pdfStroke aload pop pdfStrokeXform setcolor
|
||||||
|
pdfStrokeOP setoverprint
|
||||||
|
/pdfLastStroke true def /pdfLastFill false def
|
||||||
|
} if
|
||||||
|
} def
|
||||||
|
% build a font
|
||||||
|
/pdfMakeFont {
|
||||||
|
4 3 roll findfont
|
||||||
|
4 2 roll matrix scale makefont
|
||||||
|
dup length dict begin
|
||||||
|
{ 1 index /FID ne { def } { pop pop } ifelse } forall
|
||||||
|
/Encoding exch def
|
||||||
|
currentdict
|
||||||
|
end
|
||||||
|
definefont pop
|
||||||
|
} def
|
||||||
|
/pdfMakeFont16 {
|
||||||
|
exch findfont
|
||||||
|
dup length dict begin
|
||||||
|
{ 1 index /FID ne { def } { pop pop } ifelse } forall
|
||||||
|
/WMode exch def
|
||||||
|
currentdict
|
||||||
|
end
|
||||||
|
definefont pop
|
||||||
|
} def
|
||||||
|
% graphics state operators
|
||||||
|
/q { gsave pdfDictSize dict begin } def
|
||||||
|
/Q {
|
||||||
|
end grestore
|
||||||
|
/pdfLastFill where {
|
||||||
|
pop
|
||||||
|
pdfLastFill {
|
||||||
|
pdfFillOP setoverprint
|
||||||
|
} {
|
||||||
|
pdfStrokeOP setoverprint
|
||||||
|
} ifelse
|
||||||
|
} if
|
||||||
|
} def
|
||||||
|
/cm { concat } def
|
||||||
|
/d { setdash } def
|
||||||
|
/i { setflat } def
|
||||||
|
/j { setlinejoin } def
|
||||||
|
/J { setlinecap } def
|
||||||
|
/M { setmiterlimit } def
|
||||||
|
/w { setlinewidth } def
|
||||||
|
% path segment operators
|
||||||
|
/m { moveto } def
|
||||||
|
/l { lineto } def
|
||||||
|
/c { curveto } def
|
||||||
|
/re { 4 2 roll moveto 1 index 0 rlineto 0 exch rlineto
|
||||||
|
neg 0 rlineto closepath } def
|
||||||
|
/h { closepath } def
|
||||||
|
% path painting operators
|
||||||
|
/S { sCol stroke } def
|
||||||
|
/Sf { fCol stroke } def
|
||||||
|
/f { fCol fill } def
|
||||||
|
/f* { fCol eofill } def
|
||||||
|
% clipping operators
|
||||||
|
/W { clip newpath } def
|
||||||
|
/W* { eoclip newpath } def
|
||||||
|
/Ws { strokepath clip newpath } def
|
||||||
|
% text state operators
|
||||||
|
/Tc { /pdfCharSpacing exch def } def
|
||||||
|
/Tf { dup /pdfFontSize exch def
|
||||||
|
dup pdfHorizScaling mul exch matrix scale
|
||||||
|
pdfTextMat matrix concatmatrix dup 4 0 put dup 5 0 put
|
||||||
|
exch findfont exch makefont setfont } def
|
||||||
|
/Tr { /pdfTextRender exch def } def
|
||||||
|
/Tp { /pdfPatternCS exch def } def
|
||||||
|
/Ts { /pdfTextRise exch def } def
|
||||||
|
/Tw { /pdfWordSpacing exch def } def
|
||||||
|
/Tz { /pdfHorizScaling exch def } def
|
||||||
|
% text positioning operators
|
||||||
|
/Td { pdfTextMat transform moveto } def
|
||||||
|
/Tm { /pdfTextMat exch def } def
|
||||||
|
% text string operators
|
||||||
|
/xyshow where {
|
||||||
|
pop
|
||||||
|
/xyshow2 {
|
||||||
|
dup length array
|
||||||
|
0 2 2 index length 1 sub {
|
||||||
|
2 index 1 index 2 copy get 3 1 roll 1 add get
|
||||||
|
pdfTextMat dtransform
|
||||||
|
4 2 roll 2 copy 6 5 roll put 1 add 3 1 roll dup 4 2 roll put
|
||||||
|
} for
|
||||||
|
exch pop
|
||||||
|
xyshow
|
||||||
|
} def
|
||||||
|
}{
|
||||||
|
/xyshow2 {
|
||||||
|
currentfont /FontType get 0 eq {
|
||||||
|
0 2 3 index length 1 sub {
|
||||||
|
currentpoint 4 index 3 index 2 getinterval show moveto
|
||||||
|
2 copy get 2 index 3 2 roll 1 add get
|
||||||
|
pdfTextMat dtransform rmoveto
|
||||||
|
} for
|
||||||
|
} {
|
||||||
|
0 1 3 index length 1 sub {
|
||||||
|
currentpoint 4 index 3 index 1 getinterval show moveto
|
||||||
|
2 copy 2 mul get 2 index 3 2 roll 2 mul 1 add get
|
||||||
|
pdfTextMat dtransform rmoveto
|
||||||
|
} for
|
||||||
|
} ifelse
|
||||||
|
pop pop
|
||||||
|
} def
|
||||||
|
} ifelse
|
||||||
|
/cshow where {
|
||||||
|
pop
|
||||||
|
/xycp {
|
||||||
|
0 3 2 roll
|
||||||
|
{
|
||||||
|
pop pop currentpoint 3 2 roll
|
||||||
|
1 string dup 0 4 3 roll put false charpath moveto
|
||||||
|
2 copy get 2 index 2 index 1 add get
|
||||||
|
pdfTextMat dtransform rmoveto
|
||||||
|
2 add
|
||||||
|
} exch cshow
|
||||||
|
pop pop
|
||||||
|
} def
|
||||||
|
}{
|
||||||
|
/xycp {
|
||||||
|
currentfont /FontType get 0 eq {
|
||||||
|
0 2 3 index length 1 sub {
|
||||||
|
currentpoint 4 index 3 index 2 getinterval false charpath moveto
|
||||||
|
2 copy get 2 index 3 2 roll 1 add get
|
||||||
|
pdfTextMat dtransform rmoveto
|
||||||
|
} for
|
||||||
|
} {
|
||||||
|
0 1 3 index length 1 sub {
|
||||||
|
currentpoint 4 index 3 index 1 getinterval false charpath moveto
|
||||||
|
2 copy 2 mul get 2 index 3 2 roll 2 mul 1 add get
|
||||||
|
pdfTextMat dtransform rmoveto
|
||||||
|
} for
|
||||||
|
} ifelse
|
||||||
|
pop pop
|
||||||
|
} def
|
||||||
|
} ifelse
|
||||||
|
/Tj {
|
||||||
|
fCol
|
||||||
|
0 pdfTextRise pdfTextMat dtransform rmoveto
|
||||||
|
currentpoint 4 2 roll
|
||||||
|
pdfTextRender 1 and 0 eq {
|
||||||
|
2 copy xyshow2
|
||||||
|
} if
|
||||||
|
pdfTextRender 3 and dup 1 eq exch 2 eq or {
|
||||||
|
3 index 3 index moveto
|
||||||
|
2 copy
|
||||||
|
currentfont /FontType get 3 eq { fCol } { sCol } ifelse
|
||||||
|
xycp currentpoint stroke moveto
|
||||||
|
} if
|
||||||
|
pdfTextRender 4 and 0 ne {
|
||||||
|
4 2 roll moveto xycp
|
||||||
|
/pdfTextClipPath [ pdfTextClipPath aload pop
|
||||||
|
{/moveto cvx}
|
||||||
|
{/lineto cvx}
|
||||||
|
{/curveto cvx}
|
||||||
|
{/closepath cvx}
|
||||||
|
pathforall ] def
|
||||||
|
currentpoint newpath moveto
|
||||||
|
} {
|
||||||
|
pop pop pop pop
|
||||||
|
} ifelse
|
||||||
|
0 pdfTextRise neg pdfTextMat dtransform rmoveto
|
||||||
|
} def
|
||||||
|
/TJm { 0.001 mul pdfFontSize mul pdfHorizScaling mul neg 0
|
||||||
|
pdfTextMat dtransform rmoveto } def
|
||||||
|
/TJmV { 0.001 mul pdfFontSize mul neg 0 exch
|
||||||
|
pdfTextMat dtransform rmoveto } def
|
||||||
|
/Tclip { pdfTextClipPath cvx exec clip newpath
|
||||||
|
/pdfTextClipPath [] def } def
|
||||||
|
/Tclip* { pdfTextClipPath cvx exec eoclip newpath
|
||||||
|
/pdfTextClipPath [] def } def
|
||||||
|
% Level 2/3 image operators
|
||||||
|
/pdfImBuf 100 string def
|
||||||
|
/pdfImStr {
|
||||||
|
2 copy exch length lt {
|
||||||
|
2 copy get exch 1 add exch
|
||||||
|
} {
|
||||||
|
()
|
||||||
|
} ifelse
|
||||||
|
} def
|
||||||
|
/skipEOD {
|
||||||
|
{ currentfile pdfImBuf readline
|
||||||
|
not { pop exit } if
|
||||||
|
(%-EOD-) eq { exit } if } loop
|
||||||
|
} def
|
||||||
|
/pdfIm { image skipEOD } def
|
||||||
|
/pdfImM { fCol imagemask skipEOD } def
|
||||||
|
/pr { 2 index 2 index 3 2 roll putinterval 4 add } def
|
||||||
|
/pdfImClip {
|
||||||
|
gsave
|
||||||
|
0 2 4 index length 1 sub {
|
||||||
|
dup 4 index exch 2 copy
|
||||||
|
get 5 index div put
|
||||||
|
1 add 3 index exch 2 copy
|
||||||
|
get 3 index div put
|
||||||
|
} for
|
||||||
|
pop pop rectclip
|
||||||
|
} def
|
||||||
|
/pdfImClipEnd { grestore } def
|
||||||
|
% shading operators
|
||||||
|
/colordelta {
|
||||||
|
false 0 1 3 index length 1 sub {
|
||||||
|
dup 4 index exch get 3 index 3 2 roll get sub abs 0.004 gt {
|
||||||
|
pop true
|
||||||
|
} if
|
||||||
|
} for
|
||||||
|
exch pop exch pop
|
||||||
|
} def
|
||||||
|
/funcCol { func n array astore } def
|
||||||
|
/funcSH {
|
||||||
|
dup 0 eq {
|
||||||
|
true
|
||||||
|
} {
|
||||||
|
dup 6 eq {
|
||||||
|
false
|
||||||
|
} {
|
||||||
|
4 index 4 index funcCol dup
|
||||||
|
6 index 4 index funcCol dup
|
||||||
|
3 1 roll colordelta 3 1 roll
|
||||||
|
5 index 5 index funcCol dup
|
||||||
|
3 1 roll colordelta 3 1 roll
|
||||||
|
6 index 8 index funcCol dup
|
||||||
|
3 1 roll colordelta 3 1 roll
|
||||||
|
colordelta or or or
|
||||||
|
} ifelse
|
||||||
|
} ifelse
|
||||||
|
{
|
||||||
|
1 add
|
||||||
|
4 index 3 index add 0.5 mul exch 4 index 3 index add 0.5 mul exch
|
||||||
|
6 index 6 index 4 index 4 index 4 index funcSH
|
||||||
|
2 index 6 index 6 index 4 index 4 index funcSH
|
||||||
|
6 index 2 index 4 index 6 index 4 index funcSH
|
||||||
|
5 3 roll 3 2 roll funcSH pop pop
|
||||||
|
} {
|
||||||
|
pop 3 index 2 index add 0.5 mul 3 index 2 index add 0.5 mul
|
||||||
|
funcCol sc
|
||||||
|
dup 4 index exch mat transform m
|
||||||
|
3 index 3 index mat transform l
|
||||||
|
1 index 3 index mat transform l
|
||||||
|
mat transform l pop pop h f*
|
||||||
|
} ifelse
|
||||||
|
} def
|
||||||
|
/axialCol {
|
||||||
|
dup 0 lt {
|
||||||
|
pop t0
|
||||||
|
} {
|
||||||
|
dup 1 gt {
|
||||||
|
pop t1
|
||||||
|
} {
|
||||||
|
dt mul t0 add
|
||||||
|
} ifelse
|
||||||
|
} ifelse
|
||||||
|
func n array astore
|
||||||
|
} def
|
||||||
|
/axialSH {
|
||||||
|
dup 0 eq {
|
||||||
|
true
|
||||||
|
} {
|
||||||
|
dup 8 eq {
|
||||||
|
false
|
||||||
|
} {
|
||||||
|
2 index axialCol 2 index axialCol colordelta
|
||||||
|
} ifelse
|
||||||
|
} ifelse
|
||||||
|
{
|
||||||
|
1 add 3 1 roll 2 copy add 0.5 mul
|
||||||
|
dup 4 3 roll exch 4 index axialSH
|
||||||
|
exch 3 2 roll axialSH
|
||||||
|
} {
|
||||||
|
pop 2 copy add 0.5 mul
|
||||||
|
axialCol sc
|
||||||
|
exch dup dx mul x0 add exch dy mul y0 add
|
||||||
|
3 2 roll dup dx mul x0 add exch dy mul y0 add
|
||||||
|
dx abs dy abs ge {
|
||||||
|
2 copy yMin sub dy mul dx div add yMin m
|
||||||
|
yMax sub dy mul dx div add yMax l
|
||||||
|
2 copy yMax sub dy mul dx div add yMax l
|
||||||
|
yMin sub dy mul dx div add yMin l
|
||||||
|
h f*
|
||||||
|
} {
|
||||||
|
exch 2 copy xMin sub dx mul dy div add xMin exch m
|
||||||
|
xMax sub dx mul dy div add xMax exch l
|
||||||
|
exch 2 copy xMax sub dx mul dy div add xMax exch l
|
||||||
|
xMin sub dx mul dy div add xMin exch l
|
||||||
|
h f*
|
||||||
|
} ifelse
|
||||||
|
} ifelse
|
||||||
|
} def
|
||||||
|
/radialCol {
|
||||||
|
dup t0 lt {
|
||||||
|
pop t0
|
||||||
|
} {
|
||||||
|
dup t1 gt {
|
||||||
|
pop t1
|
||||||
|
} if
|
||||||
|
} ifelse
|
||||||
|
func n array astore
|
||||||
|
} def
|
||||||
|
/radialSH {
|
||||||
|
dup 0 eq {
|
||||||
|
true
|
||||||
|
} {
|
||||||
|
dup 8 eq {
|
||||||
|
false
|
||||||
|
} {
|
||||||
|
2 index dt mul t0 add radialCol
|
||||||
|
2 index dt mul t0 add radialCol colordelta
|
||||||
|
} ifelse
|
||||||
|
} ifelse
|
||||||
|
{
|
||||||
|
1 add 3 1 roll 2 copy add 0.5 mul
|
||||||
|
dup 4 3 roll exch 4 index radialSH
|
||||||
|
exch 3 2 roll radialSH
|
||||||
|
} {
|
||||||
|
pop 2 copy add 0.5 mul dt mul t0 add
|
||||||
|
radialCol sc
|
||||||
|
encl {
|
||||||
|
exch dup dx mul x0 add exch dup dy mul y0 add exch dr mul r0 add
|
||||||
|
0 360 arc h
|
||||||
|
dup dx mul x0 add exch dup dy mul y0 add exch dr mul r0 add
|
||||||
|
360 0 arcn h f
|
||||||
|
} {
|
||||||
|
2 copy
|
||||||
|
dup dx mul x0 add exch dup dy mul y0 add exch dr mul r0 add
|
||||||
|
a1 a2 arcn
|
||||||
|
dup dx mul x0 add exch dup dy mul y0 add exch dr mul r0 add
|
||||||
|
a2 a1 arcn h
|
||||||
|
dup dx mul x0 add exch dup dy mul y0 add exch dr mul r0 add
|
||||||
|
a1 a2 arc
|
||||||
|
dup dx mul x0 add exch dup dy mul y0 add exch dr mul r0 add
|
||||||
|
a2 a1 arc h f
|
||||||
|
} ifelse
|
||||||
|
} ifelse
|
||||||
|
} def
|
||||||
|
end
|
||||||
|
%%EndResource
|
||||||
|
%%EndProlog
|
||||||
|
%%BeginSetup
|
||||||
|
xpdf begin
|
||||||
|
%%EndSetup
|
||||||
|
pdfStartPage
|
||||||
|
[] 0 d
|
||||||
|
1 i
|
||||||
|
0 j
|
||||||
|
0 J
|
||||||
|
10 M
|
||||||
|
1 w
|
||||||
|
/DeviceGray {} cs
|
||||||
|
[0] sc
|
||||||
|
/DeviceGray {} CS
|
||||||
|
[0] SC
|
||||||
|
false op
|
||||||
|
false OP
|
||||||
|
{} settransfer
|
||||||
|
0 0 32 32 re
|
||||||
|
W
|
||||||
|
q
|
||||||
|
/DeviceRGB {} cs
|
||||||
|
[0 0 0] sc
|
||||||
|
/DeviceRGB {} CS
|
||||||
|
[0 0 0] SC
|
||||||
|
[1 0 0 -1 0 32] cm
|
||||||
|
q
|
||||||
|
q
|
||||||
|
Q
|
||||||
|
Q
|
||||||
|
q
|
||||||
|
q
|
||||||
|
q
|
||||||
|
[1 0 0 1 0 0] cm
|
||||||
|
[32 0 0 -32 0 32] cm
|
||||||
|
/DeviceRGB setcolorspace
|
||||||
|
<<
|
||||||
|
/ImageType 1
|
||||||
|
/Width 32
|
||||||
|
/Height 32
|
||||||
|
/ImageMatrix [32 0 0 -32 0 32]
|
||||||
|
/BitsPerComponent 8
|
||||||
|
/Decode [0 1 0 1 0 1]
|
||||||
|
/DataSource currentfile
|
||||||
|
/ASCII85Decode filter
|
||||||
|
<< >> /DCTDecode filter
|
||||||
|
>>
|
||||||
|
pdfIm
|
||||||
|
s4IA0!"_al8O`[\!<E0k!([(is4[N@!!30%!W`<'!WiE)!WiE*"Tni/!s8`1"9Sf4
|
||||||
|
"pYA<"pYA=#n%%F#RUhB#7:nI$4@7N$k*@I%M'!W%LW[R%0,&^6NI5i!WrN,"p4r3
|
||||||
|
$j[(D$k*OQ$k*OQ$k*OQ$k*OQ$k*OQ$k*OQ$k*OQ$k*OQ$k*OQ$k*OQ$k*OQ$k*OQ
|
||||||
|
$k30O!"fJ:+93Md!?qLF&HMtG!WU(<*rl9A"T\W)!<E3$z!!!!"!WrQ/"pYD?$4Hm
|
||||||
|
P!4<@<!W`B*!X&T/"U"r.!!.KK!WrE*&Hrdj0gQ!W;.0\RE>10ZOeE%*6F"?A;UOt
|
||||||
|
Z1LbBV#mqFa(`=5<-7:2j.Ps"@2`NfY6UX@47n?3D;cHat='/U/@q9._B4u!oF*)P
|
||||||
|
JGBeCZK7nr5LPUeEP*;,qQC!u,R\HRQV5C/hWN*81['d?O\@K2f_o0O6a2lBFdaQ^
|
||||||
|
rf%8R-g>V&OjQ5OekiqC&o(2MHp@n@XqZ"J6*ru?D!<E3%!<E3%!<<*"!!!!"!WrQ
|
||||||
|
/"pYD?$4HmP!4<C=!W`?*"9Sc3"U"r.!<RHF!<N?8"9fr'"qj4!#@VTc+u4]T'LIq
|
||||||
|
UZ,$_k1K*]W@WKj'(*k`q-1Mcg)&ahL-n-W'2E*TU3^Z;(7Rp!@8lJ\h<``C+>%;)
|
||||||
|
SAnPdkC3+K>G'A1VH@gd&KnbA=M2II[Pa.Q$R$jD;USO``Vl6SpZEppG[^WcW]#)A
|
||||||
|
'`Q#s>ai`&\eCE.%f\,!<j5f=akNM0qo(2MHp@n@XqZ#7L$j-M1!YGMH!'^J^BE%s
|
||||||
|
`Q[ch>,l[jrG5O;H4@((,Nu7daD.`FnrL6**b\LH,D=SYd",m^?i=l4k#>Y&g9bUO
|
||||||
|
>MtTa;Y#@t+:FeG9N]V>#1:nBP>^,H<Xa\&[!aI?'6uhG.,.T@e?5D#_rr@Yb0!Ms
|
||||||
|
rN7qV%pM`e<#$Di["F`gj5:Si-rrBm_r]g2Pi93&5#Ca_N')YD#cKpI1VVR`"G%EX
|
||||||
|
@*FZrXV0tH*!!N,t!.q]X8,]]A5(CE_ir9#3PN#*LMfE5YgM6Sih.[I+D+6(5b@cc
|
||||||
|
G]RTni-.='e5N&$f,_@oPe/ga&,EF3"BFt:;l!LD5!,US+f+\4m`r=@l+`@\b!qEF
|
||||||
|
lMI#lQ%eAR[36>9-p&$>GXA=[:$]!_#_qfCOpC4P?DSg0,)pr1_K`8=Zq8`L8#+t-
|
||||||
|
(fDZ)=I=JaBepM&/?8)KLP/oBHd_ANBj^7d-n,*jV<rW/OB`?-fHo]aT7qpscJ%%(
|
||||||
|
R-n[*E0dKT>q+1!H,_-(pWAX?K!.Y%%~>
|
||||||
|
%-EOD-
|
||||||
|
Q
|
||||||
|
Q
|
||||||
|
Q
|
||||||
|
Q
|
||||||
|
showpage
|
||||||
|
%%PageTrailer
|
||||||
|
pdfEndPage
|
||||||
|
%%Trailer
|
||||||
|
end
|
||||||
|
%%DocumentSuppliedResources:
|
||||||
|
%%EOF
|
BIN
autotests/read/eps/bw.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
134
autotests/read/eps/rgb-gimp-2.8.10.eps
Normal file
@ -0,0 +1,134 @@
|
|||||||
|
%!PS-Adobe-3.0 EPSF-3.0
|
||||||
|
%%Creator: GIMP PostScript file plugin V 1.17 by Peter Kirchgessner
|
||||||
|
%%Title: rgb-gimp-2.8.10.eps
|
||||||
|
%%CreationDate: Sun Feb 2 02:52:43 2014
|
||||||
|
%%DocumentData: Clean7Bit
|
||||||
|
%%LanguageLevel: 2
|
||||||
|
%%Pages: 1
|
||||||
|
%%BoundingBox: 14 14 47 47
|
||||||
|
%%EndComments
|
||||||
|
%%BeginProlog
|
||||||
|
% Use own dictionary to avoid conflicts
|
||||||
|
10 dict begin
|
||||||
|
%%EndProlog
|
||||||
|
%%Page: 1 1
|
||||||
|
% Translate for offset
|
||||||
|
14.173228346456694 14.173228346456694 translate
|
||||||
|
% Translate to begin of first scanline
|
||||||
|
0 32 translate
|
||||||
|
32 -32 scale
|
||||||
|
% Image geometry
|
||||||
|
32 32 8
|
||||||
|
% Transformation matrix
|
||||||
|
[ 32 0 0 32 0 0 ]
|
||||||
|
% Strings to hold RGB-samples per scanline
|
||||||
|
/rstr 32 string def
|
||||||
|
/gstr 32 string def
|
||||||
|
/bstr 32 string def
|
||||||
|
{currentfile /ASCII85Decode filter /RunLengthDecode filter rstr readstring pop}
|
||||||
|
{currentfile /ASCII85Decode filter /RunLengthDecode filter gstr readstring pop}
|
||||||
|
{currentfile /ASCII85Decode filter /RunLengthDecode filter bstr readstring pop}
|
||||||
|
true 3
|
||||||
|
%%BeginData: 2062 ASCII Bytes
|
||||||
|
colorimage
|
||||||
|
iW"E~>
|
||||||
|
iW"E~>
|
||||||
|
iW"E~>
|
||||||
|
iW"E~>
|
||||||
|
iW"E~>
|
||||||
|
iW"E~>
|
||||||
|
rr3l8qtTj[qY'@Go(;YFp\t!Umd0N=o(_nMr;Q_H~>
|
||||||
|
rr3i7qYL3ks8Murs8DQZo^(l=rV?9dq>(!grVqB~>
|
||||||
|
r;RQ3p?_#1q>0g\p$Lr7o'Pf>qXX=HmJ?e]J,~>
|
||||||
|
s8O,=nBneOeC:XDIuUA;Vpk(NI>;j;^80&UU>,VGs*t~>
|
||||||
|
s8O#:mE3iKrr2]^qto3FY/,OEk3:(>i7$6GnbW7bJ,~>
|
||||||
|
rVm`6lE4o2NnVdeaJsl,X.4m!h9;V"Fb\WIrr7K~>
|
||||||
|
s8O,:dtV1_a1#Lk*\DP`CmWLr:eDd]L5N6=1n+(:s*t~>
|
||||||
|
s8O,9a`ji]s8DBPr:?UcD3._\p<BGMc*bj_hs^ODs*t~>
|
||||||
|
rVm`2``!BaL!tg.P)5E?Jo4/5k)G";*GsX+rr7K~>
|
||||||
|
s8O,:dtV(?^W)3l,qa=M0ic')HZVDbS;t:!3h5jBs*t~>
|
||||||
|
s8O,9a`jcXrr2Q\rUZO=,XY[bjk[5SdDjJqi:$XEs*t~>
|
||||||
|
rVm`2b&TI#Ia!RuR(;e8\XeMEkdHG>:6"Q8rr7K~>
|
||||||
|
s8O,=nBnbIg$IS)PE2AfH[*g.m,5FVe(Eg,Y20$Us*t~>
|
||||||
|
s8O#:mE3fIrr;omrVXuD-qC)gq"Nk)m-X34oD8IdJ,~>
|
||||||
|
rVm`6m`W8Uc0*E]bh_dWnF>o5qX3(qb0feZrr7K~>
|
||||||
|
rr3l7qY0[\rr)Zao'<Q'S)F8FrqZ9br;QQdr;Q_H~>
|
||||||
|
rr3*!q>(!drsA"DC2M)hs8W&qrr)rurr)kI~>
|
||||||
|
r;QcrrqZotrVH6_nF#iCrVm'#r;HNirr)kI~>
|
||||||
|
o`#*]D]DU%r:L#>~>
|
||||||
|
o`#*gdG)_'rUg,?~>
|
||||||
|
o`#'lkK`2coDa=~>
|
||||||
|
o`#*[H#7uerq-5@~>
|
||||||
|
o`#'no'Z#CoDa=~>
|
||||||
|
o`#*gZ>Z<!rq-5@~>
|
||||||
|
o`#'d]WK!>oDa=~>
|
||||||
|
o`#'i_0NiloDa=~>
|
||||||
|
o`#*aTT+KQr:L#>~>
|
||||||
|
o`#'gaMuR#oDa=~>
|
||||||
|
o`#']HqJeMoDa=~>
|
||||||
|
o`#*f[sXLurUg,?~>
|
||||||
|
o`#'lmdBWBoDa=~>
|
||||||
|
o`#*bTnJ`jrq-5@~>
|
||||||
|
o`#*^Fs'K#qt0o=~>
|
||||||
|
o`#*let9hLrq-5@~>
|
||||||
|
o`#*dRnn@_rUg,?~>
|
||||||
|
o`#*^O+_r,qt0o=~>
|
||||||
|
o`#*e[A0PUr:L#>~>
|
||||||
|
o`#*\D&P^Yqt0o=~>
|
||||||
|
o`#*idD*iirq-5@~>
|
||||||
|
o`#*lkNM+#rq-5@~>
|
||||||
|
o`#*]KlLYGqt0o=~>
|
||||||
|
o`#*fVI,eXrq-5@~>
|
||||||
|
o`#'i_L98qoDa=~>
|
||||||
|
o`#*e]s+j,rq-5@~>
|
||||||
|
o`#']O+WDVoDa=~>
|
||||||
|
o`#'^Mf+C>oDa=~>
|
||||||
|
o`#'hd*U,5oDa=~>
|
||||||
|
o`#'bW,J^-oDa=~>
|
||||||
|
o`#'fb/qQooDa=~>
|
||||||
|
o`#'iiRHrdoDa=~>
|
||||||
|
p&>3phcL\*lLY%+~>
|
||||||
|
o`#'g\8\hKoDa=~>
|
||||||
|
p&>3pn>0Kmp%/36~>
|
||||||
|
p&>3ne9R:Bm.:7-~>
|
||||||
|
o`#*[A///#rq-5@~>
|
||||||
|
o`#*YB.IWRrq-5@~>
|
||||||
|
p&>3pn)*Top[eE8~>
|
||||||
|
o`#*ZH<=7\q=O];~>
|
||||||
|
o`#*[Is$k#r:L#>~>
|
||||||
|
o`#*kdu]gJr:L#>~>
|
||||||
|
o`#*cWIfZ,p@SB8~>
|
||||||
|
o`#*^QC4Ghq=O];~>
|
||||||
|
o`#*dPqb(co^r06~>
|
||||||
|
o`#*j`eT>iq=O];~>
|
||||||
|
o`#*f\#$+Gq"4T:~>
|
||||||
|
o`#*cSRH!"oCW'5~>
|
||||||
|
o`#*eS2)jio^r06~>
|
||||||
|
o`#*nmIB`8rUg,?~>
|
||||||
|
o`#*kcF::.qXjf<~>
|
||||||
|
o`#*eWI&uko^r06~>
|
||||||
|
o`#*op#Y<.rq-5@~>
|
||||||
|
o`#*kcA.2#qXjf<~>
|
||||||
|
o`#*keZlC0qXjf<~>
|
||||||
|
o`#*nldaPOrUg,?~>
|
||||||
|
o`#*eRkZXeo^r06~>
|
||||||
|
o`#*i\R8gUq"4T:~>
|
||||||
|
o`#*lfp\A_qt0o=~>
|
||||||
|
o`#*eWdB)mo^r06~>
|
||||||
|
o`#*fWB32@p%897~>
|
||||||
|
o`#*hZU7*dp[nK9~>
|
||||||
|
o`#*mk2YLar:L#>~>
|
||||||
|
o`#*mh4:+mr:L#>~>
|
||||||
|
o`#*mhO^=qr:L#>~>
|
||||||
|
oD\pjq"XdYs*t~>
|
||||||
|
oD\pjo^r(Qs*t~>
|
||||||
|
oD\pjo^r(Qs*t~>
|
||||||
|
iW"E~>
|
||||||
|
iW"E~>
|
||||||
|
iW"E~>
|
||||||
|
iW"E~>
|
||||||
|
%%EndData
|
||||||
|
showpage
|
||||||
|
%%Trailer
|
||||||
|
end
|
||||||
|
%%EOF
|
BIN
autotests/read/eps/rgb-gimp-2.8.10.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
505
autotests/read/eps/rgb.eps
Normal file
@ -0,0 +1,505 @@
|
|||||||
|
%!PS-Adobe-3.0 EPSF-3.0
|
||||||
|
%Produced by poppler pdftops version: 0.24.5 (http://poppler.freedesktop.org)
|
||||||
|
%%Creator: KDE EPS image plugin
|
||||||
|
%%LanguageLevel: 2
|
||||||
|
%%DocumentSuppliedResources: (atend)
|
||||||
|
%%BoundingBox: 0 0 32 32
|
||||||
|
%%HiResBoundingBox: 0 0 32 32
|
||||||
|
%%DocumentSuppliedResources: (atend)
|
||||||
|
%%EndComments
|
||||||
|
%%BeginProlog
|
||||||
|
%%BeginResource: procset xpdf 3.00 0
|
||||||
|
%%Copyright: Copyright 1996-2011 Glyph & Cog, LLC
|
||||||
|
/xpdf 75 dict def xpdf begin
|
||||||
|
% PDF special state
|
||||||
|
/pdfDictSize 15 def
|
||||||
|
/pdfSetup {
|
||||||
|
/setpagedevice where {
|
||||||
|
pop 2 dict begin
|
||||||
|
/Policies 1 dict dup begin /PageSize 6 def end def
|
||||||
|
{ /Duplex true def } if
|
||||||
|
currentdict end setpagedevice
|
||||||
|
} {
|
||||||
|
pop
|
||||||
|
} ifelse
|
||||||
|
} def
|
||||||
|
/pdfSetupPaper {
|
||||||
|
2 array astore
|
||||||
|
/setpagedevice where {
|
||||||
|
pop 2 dict begin
|
||||||
|
/PageSize exch def
|
||||||
|
/ImagingBBox null def
|
||||||
|
currentdict end setpagedevice
|
||||||
|
} {
|
||||||
|
pop
|
||||||
|
} ifelse
|
||||||
|
} def
|
||||||
|
/pdfStartPage {
|
||||||
|
pdfDictSize dict begin
|
||||||
|
/pdfFillCS [] def
|
||||||
|
/pdfFillXform {} def
|
||||||
|
/pdfStrokeCS [] def
|
||||||
|
/pdfStrokeXform {} def
|
||||||
|
/pdfFill [0] def
|
||||||
|
/pdfStroke [0] def
|
||||||
|
/pdfFillOP false def
|
||||||
|
/pdfStrokeOP false def
|
||||||
|
/pdfLastFill false def
|
||||||
|
/pdfLastStroke false def
|
||||||
|
/pdfTextMat [1 0 0 1 0 0] def
|
||||||
|
/pdfFontSize 0 def
|
||||||
|
/pdfCharSpacing 0 def
|
||||||
|
/pdfTextRender 0 def
|
||||||
|
/pdfPatternCS false def
|
||||||
|
/pdfTextRise 0 def
|
||||||
|
/pdfWordSpacing 0 def
|
||||||
|
/pdfHorizScaling 1 def
|
||||||
|
/pdfTextClipPath [] def
|
||||||
|
} def
|
||||||
|
/pdfEndPage { end } def
|
||||||
|
% PDF color state
|
||||||
|
/cs { /pdfFillXform exch def dup /pdfFillCS exch def
|
||||||
|
setcolorspace } def
|
||||||
|
/CS { /pdfStrokeXform exch def dup /pdfStrokeCS exch def
|
||||||
|
setcolorspace } def
|
||||||
|
/sc { pdfLastFill not { pdfFillCS setcolorspace } if
|
||||||
|
dup /pdfFill exch def aload pop pdfFillXform setcolor
|
||||||
|
/pdfLastFill true def /pdfLastStroke false def } def
|
||||||
|
/SC { pdfLastStroke not { pdfStrokeCS setcolorspace } if
|
||||||
|
dup /pdfStroke exch def aload pop pdfStrokeXform setcolor
|
||||||
|
/pdfLastStroke true def /pdfLastFill false def } def
|
||||||
|
/op { /pdfFillOP exch def
|
||||||
|
pdfLastFill { pdfFillOP setoverprint } if } def
|
||||||
|
/OP { /pdfStrokeOP exch def
|
||||||
|
pdfLastStroke { pdfStrokeOP setoverprint } if } def
|
||||||
|
/fCol {
|
||||||
|
pdfLastFill not {
|
||||||
|
pdfFillCS setcolorspace
|
||||||
|
pdfFill aload pop pdfFillXform setcolor
|
||||||
|
pdfFillOP setoverprint
|
||||||
|
/pdfLastFill true def /pdfLastStroke false def
|
||||||
|
} if
|
||||||
|
} def
|
||||||
|
/sCol {
|
||||||
|
pdfLastStroke not {
|
||||||
|
pdfStrokeCS setcolorspace
|
||||||
|
pdfStroke aload pop pdfStrokeXform setcolor
|
||||||
|
pdfStrokeOP setoverprint
|
||||||
|
/pdfLastStroke true def /pdfLastFill false def
|
||||||
|
} if
|
||||||
|
} def
|
||||||
|
% build a font
|
||||||
|
/pdfMakeFont {
|
||||||
|
4 3 roll findfont
|
||||||
|
4 2 roll matrix scale makefont
|
||||||
|
dup length dict begin
|
||||||
|
{ 1 index /FID ne { def } { pop pop } ifelse } forall
|
||||||
|
/Encoding exch def
|
||||||
|
currentdict
|
||||||
|
end
|
||||||
|
definefont pop
|
||||||
|
} def
|
||||||
|
/pdfMakeFont16 {
|
||||||
|
exch findfont
|
||||||
|
dup length dict begin
|
||||||
|
{ 1 index /FID ne { def } { pop pop } ifelse } forall
|
||||||
|
/WMode exch def
|
||||||
|
currentdict
|
||||||
|
end
|
||||||
|
definefont pop
|
||||||
|
} def
|
||||||
|
% graphics state operators
|
||||||
|
/q { gsave pdfDictSize dict begin } def
|
||||||
|
/Q {
|
||||||
|
end grestore
|
||||||
|
/pdfLastFill where {
|
||||||
|
pop
|
||||||
|
pdfLastFill {
|
||||||
|
pdfFillOP setoverprint
|
||||||
|
} {
|
||||||
|
pdfStrokeOP setoverprint
|
||||||
|
} ifelse
|
||||||
|
} if
|
||||||
|
} def
|
||||||
|
/cm { concat } def
|
||||||
|
/d { setdash } def
|
||||||
|
/i { setflat } def
|
||||||
|
/j { setlinejoin } def
|
||||||
|
/J { setlinecap } def
|
||||||
|
/M { setmiterlimit } def
|
||||||
|
/w { setlinewidth } def
|
||||||
|
% path segment operators
|
||||||
|
/m { moveto } def
|
||||||
|
/l { lineto } def
|
||||||
|
/c { curveto } def
|
||||||
|
/re { 4 2 roll moveto 1 index 0 rlineto 0 exch rlineto
|
||||||
|
neg 0 rlineto closepath } def
|
||||||
|
/h { closepath } def
|
||||||
|
% path painting operators
|
||||||
|
/S { sCol stroke } def
|
||||||
|
/Sf { fCol stroke } def
|
||||||
|
/f { fCol fill } def
|
||||||
|
/f* { fCol eofill } def
|
||||||
|
% clipping operators
|
||||||
|
/W { clip newpath } def
|
||||||
|
/W* { eoclip newpath } def
|
||||||
|
/Ws { strokepath clip newpath } def
|
||||||
|
% text state operators
|
||||||
|
/Tc { /pdfCharSpacing exch def } def
|
||||||
|
/Tf { dup /pdfFontSize exch def
|
||||||
|
dup pdfHorizScaling mul exch matrix scale
|
||||||
|
pdfTextMat matrix concatmatrix dup 4 0 put dup 5 0 put
|
||||||
|
exch findfont exch makefont setfont } def
|
||||||
|
/Tr { /pdfTextRender exch def } def
|
||||||
|
/Tp { /pdfPatternCS exch def } def
|
||||||
|
/Ts { /pdfTextRise exch def } def
|
||||||
|
/Tw { /pdfWordSpacing exch def } def
|
||||||
|
/Tz { /pdfHorizScaling exch def } def
|
||||||
|
% text positioning operators
|
||||||
|
/Td { pdfTextMat transform moveto } def
|
||||||
|
/Tm { /pdfTextMat exch def } def
|
||||||
|
% text string operators
|
||||||
|
/xyshow where {
|
||||||
|
pop
|
||||||
|
/xyshow2 {
|
||||||
|
dup length array
|
||||||
|
0 2 2 index length 1 sub {
|
||||||
|
2 index 1 index 2 copy get 3 1 roll 1 add get
|
||||||
|
pdfTextMat dtransform
|
||||||
|
4 2 roll 2 copy 6 5 roll put 1 add 3 1 roll dup 4 2 roll put
|
||||||
|
} for
|
||||||
|
exch pop
|
||||||
|
xyshow
|
||||||
|
} def
|
||||||
|
}{
|
||||||
|
/xyshow2 {
|
||||||
|
currentfont /FontType get 0 eq {
|
||||||
|
0 2 3 index length 1 sub {
|
||||||
|
currentpoint 4 index 3 index 2 getinterval show moveto
|
||||||
|
2 copy get 2 index 3 2 roll 1 add get
|
||||||
|
pdfTextMat dtransform rmoveto
|
||||||
|
} for
|
||||||
|
} {
|
||||||
|
0 1 3 index length 1 sub {
|
||||||
|
currentpoint 4 index 3 index 1 getinterval show moveto
|
||||||
|
2 copy 2 mul get 2 index 3 2 roll 2 mul 1 add get
|
||||||
|
pdfTextMat dtransform rmoveto
|
||||||
|
} for
|
||||||
|
} ifelse
|
||||||
|
pop pop
|
||||||
|
} def
|
||||||
|
} ifelse
|
||||||
|
/cshow where {
|
||||||
|
pop
|
||||||
|
/xycp {
|
||||||
|
0 3 2 roll
|
||||||
|
{
|
||||||
|
pop pop currentpoint 3 2 roll
|
||||||
|
1 string dup 0 4 3 roll put false charpath moveto
|
||||||
|
2 copy get 2 index 2 index 1 add get
|
||||||
|
pdfTextMat dtransform rmoveto
|
||||||
|
2 add
|
||||||
|
} exch cshow
|
||||||
|
pop pop
|
||||||
|
} def
|
||||||
|
}{
|
||||||
|
/xycp {
|
||||||
|
currentfont /FontType get 0 eq {
|
||||||
|
0 2 3 index length 1 sub {
|
||||||
|
currentpoint 4 index 3 index 2 getinterval false charpath moveto
|
||||||
|
2 copy get 2 index 3 2 roll 1 add get
|
||||||
|
pdfTextMat dtransform rmoveto
|
||||||
|
} for
|
||||||
|
} {
|
||||||
|
0 1 3 index length 1 sub {
|
||||||
|
currentpoint 4 index 3 index 1 getinterval false charpath moveto
|
||||||
|
2 copy 2 mul get 2 index 3 2 roll 2 mul 1 add get
|
||||||
|
pdfTextMat dtransform rmoveto
|
||||||
|
} for
|
||||||
|
} ifelse
|
||||||
|
pop pop
|
||||||
|
} def
|
||||||
|
} ifelse
|
||||||
|
/Tj {
|
||||||
|
fCol
|
||||||
|
0 pdfTextRise pdfTextMat dtransform rmoveto
|
||||||
|
currentpoint 4 2 roll
|
||||||
|
pdfTextRender 1 and 0 eq {
|
||||||
|
2 copy xyshow2
|
||||||
|
} if
|
||||||
|
pdfTextRender 3 and dup 1 eq exch 2 eq or {
|
||||||
|
3 index 3 index moveto
|
||||||
|
2 copy
|
||||||
|
currentfont /FontType get 3 eq { fCol } { sCol } ifelse
|
||||||
|
xycp currentpoint stroke moveto
|
||||||
|
} if
|
||||||
|
pdfTextRender 4 and 0 ne {
|
||||||
|
4 2 roll moveto xycp
|
||||||
|
/pdfTextClipPath [ pdfTextClipPath aload pop
|
||||||
|
{/moveto cvx}
|
||||||
|
{/lineto cvx}
|
||||||
|
{/curveto cvx}
|
||||||
|
{/closepath cvx}
|
||||||
|
pathforall ] def
|
||||||
|
currentpoint newpath moveto
|
||||||
|
} {
|
||||||
|
pop pop pop pop
|
||||||
|
} ifelse
|
||||||
|
0 pdfTextRise neg pdfTextMat dtransform rmoveto
|
||||||
|
} def
|
||||||
|
/TJm { 0.001 mul pdfFontSize mul pdfHorizScaling mul neg 0
|
||||||
|
pdfTextMat dtransform rmoveto } def
|
||||||
|
/TJmV { 0.001 mul pdfFontSize mul neg 0 exch
|
||||||
|
pdfTextMat dtransform rmoveto } def
|
||||||
|
/Tclip { pdfTextClipPath cvx exec clip newpath
|
||||||
|
/pdfTextClipPath [] def } def
|
||||||
|
/Tclip* { pdfTextClipPath cvx exec eoclip newpath
|
||||||
|
/pdfTextClipPath [] def } def
|
||||||
|
% Level 2/3 image operators
|
||||||
|
/pdfImBuf 100 string def
|
||||||
|
/pdfImStr {
|
||||||
|
2 copy exch length lt {
|
||||||
|
2 copy get exch 1 add exch
|
||||||
|
} {
|
||||||
|
()
|
||||||
|
} ifelse
|
||||||
|
} def
|
||||||
|
/skipEOD {
|
||||||
|
{ currentfile pdfImBuf readline
|
||||||
|
not { pop exit } if
|
||||||
|
(%-EOD-) eq { exit } if } loop
|
||||||
|
} def
|
||||||
|
/pdfIm { image skipEOD } def
|
||||||
|
/pdfImM { fCol imagemask skipEOD } def
|
||||||
|
/pr { 2 index 2 index 3 2 roll putinterval 4 add } def
|
||||||
|
/pdfImClip {
|
||||||
|
gsave
|
||||||
|
0 2 4 index length 1 sub {
|
||||||
|
dup 4 index exch 2 copy
|
||||||
|
get 5 index div put
|
||||||
|
1 add 3 index exch 2 copy
|
||||||
|
get 3 index div put
|
||||||
|
} for
|
||||||
|
pop pop rectclip
|
||||||
|
} def
|
||||||
|
/pdfImClipEnd { grestore } def
|
||||||
|
% shading operators
|
||||||
|
/colordelta {
|
||||||
|
false 0 1 3 index length 1 sub {
|
||||||
|
dup 4 index exch get 3 index 3 2 roll get sub abs 0.004 gt {
|
||||||
|
pop true
|
||||||
|
} if
|
||||||
|
} for
|
||||||
|
exch pop exch pop
|
||||||
|
} def
|
||||||
|
/funcCol { func n array astore } def
|
||||||
|
/funcSH {
|
||||||
|
dup 0 eq {
|
||||||
|
true
|
||||||
|
} {
|
||||||
|
dup 6 eq {
|
||||||
|
false
|
||||||
|
} {
|
||||||
|
4 index 4 index funcCol dup
|
||||||
|
6 index 4 index funcCol dup
|
||||||
|
3 1 roll colordelta 3 1 roll
|
||||||
|
5 index 5 index funcCol dup
|
||||||
|
3 1 roll colordelta 3 1 roll
|
||||||
|
6 index 8 index funcCol dup
|
||||||
|
3 1 roll colordelta 3 1 roll
|
||||||
|
colordelta or or or
|
||||||
|
} ifelse
|
||||||
|
} ifelse
|
||||||
|
{
|
||||||
|
1 add
|
||||||
|
4 index 3 index add 0.5 mul exch 4 index 3 index add 0.5 mul exch
|
||||||
|
6 index 6 index 4 index 4 index 4 index funcSH
|
||||||
|
2 index 6 index 6 index 4 index 4 index funcSH
|
||||||
|
6 index 2 index 4 index 6 index 4 index funcSH
|
||||||
|
5 3 roll 3 2 roll funcSH pop pop
|
||||||
|
} {
|
||||||
|
pop 3 index 2 index add 0.5 mul 3 index 2 index add 0.5 mul
|
||||||
|
funcCol sc
|
||||||
|
dup 4 index exch mat transform m
|
||||||
|
3 index 3 index mat transform l
|
||||||
|
1 index 3 index mat transform l
|
||||||
|
mat transform l pop pop h f*
|
||||||
|
} ifelse
|
||||||
|
} def
|
||||||
|
/axialCol {
|
||||||
|
dup 0 lt {
|
||||||
|
pop t0
|
||||||
|
} {
|
||||||
|
dup 1 gt {
|
||||||
|
pop t1
|
||||||
|
} {
|
||||||
|
dt mul t0 add
|
||||||
|
} ifelse
|
||||||
|
} ifelse
|
||||||
|
func n array astore
|
||||||
|
} def
|
||||||
|
/axialSH {
|
||||||
|
dup 0 eq {
|
||||||
|
true
|
||||||
|
} {
|
||||||
|
dup 8 eq {
|
||||||
|
false
|
||||||
|
} {
|
||||||
|
2 index axialCol 2 index axialCol colordelta
|
||||||
|
} ifelse
|
||||||
|
} ifelse
|
||||||
|
{
|
||||||
|
1 add 3 1 roll 2 copy add 0.5 mul
|
||||||
|
dup 4 3 roll exch 4 index axialSH
|
||||||
|
exch 3 2 roll axialSH
|
||||||
|
} {
|
||||||
|
pop 2 copy add 0.5 mul
|
||||||
|
axialCol sc
|
||||||
|
exch dup dx mul x0 add exch dy mul y0 add
|
||||||
|
3 2 roll dup dx mul x0 add exch dy mul y0 add
|
||||||
|
dx abs dy abs ge {
|
||||||
|
2 copy yMin sub dy mul dx div add yMin m
|
||||||
|
yMax sub dy mul dx div add yMax l
|
||||||
|
2 copy yMax sub dy mul dx div add yMax l
|
||||||
|
yMin sub dy mul dx div add yMin l
|
||||||
|
h f*
|
||||||
|
} {
|
||||||
|
exch 2 copy xMin sub dx mul dy div add xMin exch m
|
||||||
|
xMax sub dx mul dy div add xMax exch l
|
||||||
|
exch 2 copy xMax sub dx mul dy div add xMax exch l
|
||||||
|
xMin sub dx mul dy div add xMin exch l
|
||||||
|
h f*
|
||||||
|
} ifelse
|
||||||
|
} ifelse
|
||||||
|
} def
|
||||||
|
/radialCol {
|
||||||
|
dup t0 lt {
|
||||||
|
pop t0
|
||||||
|
} {
|
||||||
|
dup t1 gt {
|
||||||
|
pop t1
|
||||||
|
} if
|
||||||
|
} ifelse
|
||||||
|
func n array astore
|
||||||
|
} def
|
||||||
|
/radialSH {
|
||||||
|
dup 0 eq {
|
||||||
|
true
|
||||||
|
} {
|
||||||
|
dup 8 eq {
|
||||||
|
false
|
||||||
|
} {
|
||||||
|
2 index dt mul t0 add radialCol
|
||||||
|
2 index dt mul t0 add radialCol colordelta
|
||||||
|
} ifelse
|
||||||
|
} ifelse
|
||||||
|
{
|
||||||
|
1 add 3 1 roll 2 copy add 0.5 mul
|
||||||
|
dup 4 3 roll exch 4 index radialSH
|
||||||
|
exch 3 2 roll radialSH
|
||||||
|
} {
|
||||||
|
pop 2 copy add 0.5 mul dt mul t0 add
|
||||||
|
radialCol sc
|
||||||
|
encl {
|
||||||
|
exch dup dx mul x0 add exch dup dy mul y0 add exch dr mul r0 add
|
||||||
|
0 360 arc h
|
||||||
|
dup dx mul x0 add exch dup dy mul y0 add exch dr mul r0 add
|
||||||
|
360 0 arcn h f
|
||||||
|
} {
|
||||||
|
2 copy
|
||||||
|
dup dx mul x0 add exch dup dy mul y0 add exch dr mul r0 add
|
||||||
|
a1 a2 arcn
|
||||||
|
dup dx mul x0 add exch dup dy mul y0 add exch dr mul r0 add
|
||||||
|
a2 a1 arcn h
|
||||||
|
dup dx mul x0 add exch dup dy mul y0 add exch dr mul r0 add
|
||||||
|
a1 a2 arc
|
||||||
|
dup dx mul x0 add exch dup dy mul y0 add exch dr mul r0 add
|
||||||
|
a2 a1 arc h f
|
||||||
|
} ifelse
|
||||||
|
} ifelse
|
||||||
|
} def
|
||||||
|
end
|
||||||
|
%%EndResource
|
||||||
|
%%EndProlog
|
||||||
|
%%BeginSetup
|
||||||
|
xpdf begin
|
||||||
|
%%EndSetup
|
||||||
|
pdfStartPage
|
||||||
|
[] 0 d
|
||||||
|
1 i
|
||||||
|
0 j
|
||||||
|
0 J
|
||||||
|
10 M
|
||||||
|
1 w
|
||||||
|
/DeviceGray {} cs
|
||||||
|
[0] sc
|
||||||
|
/DeviceGray {} CS
|
||||||
|
[0] SC
|
||||||
|
false op
|
||||||
|
false OP
|
||||||
|
{} settransfer
|
||||||
|
0 0 32 32 re
|
||||||
|
W
|
||||||
|
q
|
||||||
|
/DeviceRGB {} cs
|
||||||
|
[0 0 0] sc
|
||||||
|
/DeviceRGB {} CS
|
||||||
|
[0 0 0] SC
|
||||||
|
[1 0 0 -1 0 32] cm
|
||||||
|
q
|
||||||
|
q
|
||||||
|
Q
|
||||||
|
Q
|
||||||
|
q
|
||||||
|
q
|
||||||
|
q
|
||||||
|
[1 0 0 1 0 0] cm
|
||||||
|
[32 0 0 -32 0 32] cm
|
||||||
|
/DeviceRGB setcolorspace
|
||||||
|
<<
|
||||||
|
/ImageType 1
|
||||||
|
/Width 32
|
||||||
|
/Height 32
|
||||||
|
/ImageMatrix [32 0 0 -32 0 32]
|
||||||
|
/BitsPerComponent 8
|
||||||
|
/Decode [0 1 0 1 0 1]
|
||||||
|
/DataSource currentfile
|
||||||
|
/ASCII85Decode filter
|
||||||
|
<< >> /DCTDecode filter
|
||||||
|
>>
|
||||||
|
pdfIm
|
||||||
|
s4IA0!"_al8O`[\!<E0k!([(is4[N@!!30%!W`<'!WiE)!WiE*"Tni/!s8`1"9Sf4
|
||||||
|
"pYA<"pYA=#n%%F#RUhB#7:nI$4@7N$k*@I%M'!W%LW[R%0,&^6NI5i!WrN,"p4r3
|
||||||
|
$j[(D$k*OQ$k*OQ$k*OQ$k*OQ$k*OQ$k*OQ$k*OQ$k*OQ$k*OQ$k*OQ$k*OQ$k*OQ
|
||||||
|
$k30O!"fJ:+93Md!?qLF&HMtG!WU(<*rl9A"T\W)!<E3$z!!!!"!WrQ/"pYD?$4Hm
|
||||||
|
P!4<@<!W`B*!X&T/"U"r.!!.KK!WrE*&Hrdj0gQ!W;.0\RE>10ZOeE%*6F"?A;UOt
|
||||||
|
Z1LbBV#mqFa(`=5<-7:2j.Ps"@2`NfY6UX@47n?3D;cHat='/U/@q9._B4u!oF*)P
|
||||||
|
JGBeCZK7nr5LPUeEP*;,qQC!u,R\HRQV5C/hWN*81['d?O\@K2f_o0O6a2lBFdaQ^
|
||||||
|
rf%8R-g>V&OjQ5OekiqC&o(2MHp@n@XqZ"J6*ru?D!<E3%!<E3%!<<*"!!!!"!WrQ
|
||||||
|
/"pYD?$4HmP!4<C=!W`?*"9Sc3"U"r.!<RHF!<N?8"9fr'"qj4!#@VTc+u4]T'LIq
|
||||||
|
UZ,$_k1K*]W@WKj'(*k`q-1Mcg)&ahL-n-W'2E*TU3^Z;(7Rp!@8lJ\h<``C+>%;)
|
||||||
|
SAnPdkC3+K>G'A1VH@gd&KnbA=M2II[Pa.Q$R$jD;USO``Vl6SpZEppG[^WcW]#)A
|
||||||
|
'`Q#s>ai`&\eCE.%f\,!<j5f=akNM0qo(2MHp@n@XqZ#7L$j-M1!YGMH!'^J^[J7H
|
||||||
|
*)od=>n_Shppj9lmgH&*&Z5`-0!&G^+@?%=sWQn:&Z!JmV>Q3<j(;FIbL>(78UA/^
|
||||||
|
<WG/37&CF$Q0s_&>N/i2JRek1>=8iOIiX'uaq]C(*rY9%6hVL.U[YF1+o2#E2rZgV
|
||||||
|
fAtg!5rLlk%;jl*n<+SZT8_SR;=skUV066U1.p=mFr6"gf2][jPofDZ&\`7@/-r'!
|
||||||
|
;,l&`4))eYGD-KF%4Q#*6m7m-&ibs?(?PB?TXYaa<m(u:lbhFsTbaCt4hKdqnoWN-
|
||||||
|
,-f^7-GbXos*uB0>%2C(@*]]s]E087&>\*L"WW)s0NHRN"Ia3BM^PX0A?"k)FD":7
|
||||||
|
Zape3'Q25[,qME[RXmKi%7R$RY-ahd^2Mq#oHbDPloej\L\<u;(;Pe(roA.6'\>ps
|
||||||
|
H'BN#QqXg'$f%32o+9)<E*7qSo%=Z>=0tktVb?\UUL)@Rm9:'aT6=iISQ2.kIjQ"\
|
||||||
|
%_ROO<=2Wb\MS98hQG^TuG$9X6EFe(Kg?r;t$)Qpec%CS=pnp0%dOlMsGLMhk<;`4
|
||||||
|
`K1YFe4Dk#>F*pbBZ'QZsG'6YnmBb4>:XPI-!+d5f%ibMn4q,rTa=JCm8q9KN(pJ_
|
||||||
|
E6F)2g+:rKf>4``l^LjY[CVCPY(ZDD*'3X"&qXqOb/bQNI^2+A(eWj>@,<bR&bn,Q
|
||||||
|
e'afdE[n5C'ffj+UH1OZ,hW)L6\hS>-V.Fe`[b"_:aa,33f`~>
|
||||||
|
%-EOD-
|
||||||
|
Q
|
||||||
|
Q
|
||||||
|
Q
|
||||||
|
Q
|
||||||
|
showpage
|
||||||
|
%%PageTrailer
|
||||||
|
pdfEndPage
|
||||||
|
%%Trailer
|
||||||
|
end
|
||||||
|
%%DocumentSuppliedResources:
|
||||||
|
%%EOF
|
BIN
autotests/read/eps/rgb.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
autotests/read/jp2/bw.jp2
Normal file
BIN
autotests/read/jp2/bw.png
Normal file
After Width: | Height: | Size: 663 B |
BIN
autotests/read/jp2/rgb.jp2
Normal file
BIN
autotests/read/jp2/rgb.png
Normal file
After Width: | Height: | Size: 510 B |
BIN
autotests/read/pcx/bw.pcx
Normal file
BIN
autotests/read/pcx/bw.png
Normal file
After Width: | Height: | Size: 743 B |
BIN
autotests/read/pcx/rgb-gimp-2.8.10.pcx
Normal file
BIN
autotests/read/pcx/rgb-gimp-2.8.10.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
autotests/read/pcx/rgb.pcx
Normal file
BIN
autotests/read/pcx/rgb.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
autotests/read/psd/rgb-gimp-2.8.10.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
autotests/read/psd/rgb-gimp-2.8.10.psd
Normal file
BIN
autotests/read/ras/rgb-gimp-2.8.10-standard.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
autotests/read/ras/rgb-gimp-2.8.10-standard.ras
Normal file
BIN
autotests/read/rgb/bw.png
Normal file
After Width: | Height: | Size: 743 B |
BIN
autotests/read/rgb/bw.rgb
Normal file
BIN
autotests/read/rgb/rgb-gimp-2.8.10-aggressive-rle.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
autotests/read/rgb/rgb-gimp-2.8.10-aggressive-rle.rgb
Normal file
BIN
autotests/read/rgb/rgb-gimp-2.8.10-rle.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
autotests/read/rgb/rgb-gimp-2.8.10-rle.rgb
Normal file
BIN
autotests/read/rgb/rgb-gimp-2.8.10-uncompressed.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
autotests/read/rgb/rgb-gimp-2.8.10-uncompressed.rgb
Normal file
BIN
autotests/read/rgb/rgb.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
autotests/read/rgb/rgb.rgb
Normal file
BIN
autotests/read/tga/bw.png
Normal file
After Width: | Height: | Size: 763 B |
BIN
autotests/read/tga/bw.tga
Normal file
After Width: | Height: | Size: 3.0 KiB |
BIN
autotests/read/tga/bwa.png
Normal file
After Width: | Height: | Size: 538 B |
BIN
autotests/read/tga/bwa.tga
Normal file
After Width: | Height: | Size: 4.0 KiB |
BIN
autotests/read/tga/rgb-gimp-2.8.10-bottom-left.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
autotests/read/tga/rgb-gimp-2.8.10-bottom-left.tga
Normal file
After Width: | Height: | Size: 3.0 KiB |
BIN
autotests/read/tga/rgb-gimp-2.8.10-rle-bottom-left.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
autotests/read/tga/rgb-gimp-2.8.10-rle-bottom-left.tga
Normal file
BIN
autotests/read/tga/rgb-gimp-2.8.10-rle-top-left.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
autotests/read/tga/rgb-gimp-2.8.10-rle-top-left.tga
Normal file
BIN
autotests/read/tga/rgb-gimp-2.8.10-top-left.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
autotests/read/tga/rgb-gimp-2.8.10-top-left.tga
Normal file
After Width: | Height: | Size: 3.0 KiB |
BIN
autotests/read/tga/rgb.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
autotests/read/tga/rgb.tga
Normal file
After Width: | Height: | Size: 3.0 KiB |
BIN
autotests/read/tga/rgba.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
autotests/read/tga/rgba.tga
Normal file
After Width: | Height: | Size: 4.0 KiB |
BIN
autotests/read/xcf/simple-bw-gimp-2.8.10.png
Normal file
After Width: | Height: | Size: 743 B |
BIN
autotests/read/xcf/simple-bw-gimp-2.8.10.xcf
Normal file
BIN
autotests/read/xcf/simple-bwa-gimp-2.8.10.png
Normal file
After Width: | Height: | Size: 574 B |
BIN
autotests/read/xcf/simple-bwa-gimp-2.8.10.xcf
Normal file
BIN
autotests/read/xcf/simple-rgb-gimp-2.8.10.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
autotests/read/xcf/simple-rgb-gimp-2.8.10.xcf
Normal file
BIN
autotests/read/xcf/simple-rgba-gimp-2.8.10.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
autotests/read/xcf/simple-rgba-gimp-2.8.10.xcf
Normal file
209
autotests/readtest.cpp
Normal file
@ -0,0 +1,209 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2014 Alex Merry <alex.merry@kdemail.net>
|
||||||
|
*
|
||||||
|
* 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.1 of the License, or (at your option) version 3, or any
|
||||||
|
* later version accepted by the membership of KDE e.V. (or its
|
||||||
|
* successor approved by the membership of KDE e.V.), which shall
|
||||||
|
* act as a proxy defined in Section 6 of version 3 of the license.
|
||||||
|
*
|
||||||
|
* 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, see
|
||||||
|
* <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#include <QCommandLineParser>
|
||||||
|
#include <QCoreApplication>
|
||||||
|
#include <QDir>
|
||||||
|
#include <QFileInfo>
|
||||||
|
#include <QImage>
|
||||||
|
#include <QImageReader>
|
||||||
|
#include <QTextStream>
|
||||||
|
|
||||||
|
#include "../tests/format-enum.h"
|
||||||
|
|
||||||
|
static void writeImageData(const char *name, const QString &filename, const QImage &image)
|
||||||
|
{
|
||||||
|
QFile file(filename);
|
||||||
|
if (file.open(QIODevice::WriteOnly)) {
|
||||||
|
qint64 written = file.write(reinterpret_cast<const char *>(image.bits()), image.byteCount());
|
||||||
|
if (written == image.byteCount()) {
|
||||||
|
QTextStream(stdout) << " " << name
|
||||||
|
<< " written to " << filename << "\n";
|
||||||
|
} else {
|
||||||
|
QTextStream(stdout) << " could not write " << name
|
||||||
|
<< " to " << filename << ":"
|
||||||
|
<< file.errorString() << "\n";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
QTextStream(stdout) << " could not open "
|
||||||
|
<< filename << ":"
|
||||||
|
<< file.errorString() << "\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// allow each byte to be different by up to 1, to allow for rounding errors
|
||||||
|
static bool fuzzyeq(const QImage &im1, const QImage &im2, uchar fuzziness)
|
||||||
|
{
|
||||||
|
const int height = im1.height();
|
||||||
|
const int width = im1.width();
|
||||||
|
for (int i = 0; i < height; ++i) {
|
||||||
|
const uchar *line1 = im1.scanLine(i);
|
||||||
|
const uchar *line2 = im2.scanLine(i);
|
||||||
|
for (int j = 0; j < width; ++j) {
|
||||||
|
if (line1[j] > line2[j]) {
|
||||||
|
if (line1[j] - line2[j] > fuzziness)
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
if (line2[j] - line1[j] > fuzziness)
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int argc, char ** argv)
|
||||||
|
{
|
||||||
|
QCoreApplication app(argc, argv);
|
||||||
|
QCoreApplication::addLibraryPath(QStringLiteral(PLUGIN_DIR));
|
||||||
|
QCoreApplication::setApplicationName(QStringLiteral("readtest"));
|
||||||
|
QCoreApplication::setApplicationVersion(QStringLiteral("1.0.0"));
|
||||||
|
|
||||||
|
QCommandLineParser parser;
|
||||||
|
parser.setApplicationDescription(QStringLiteral("Performs basic image conversion checking."));
|
||||||
|
parser.addHelpOption();
|
||||||
|
parser.addVersionOption();
|
||||||
|
parser.addPositionalArgument(QStringLiteral("format"), QStringLiteral("format to test"));
|
||||||
|
QCommandLineOption fuzz(
|
||||||
|
QStringList() << QStringLiteral("f") << QStringLiteral("fuzz"),
|
||||||
|
QStringLiteral("Allow for some deviation in ARGB data."),
|
||||||
|
QStringLiteral("max"));
|
||||||
|
parser.addOption(fuzz);
|
||||||
|
|
||||||
|
parser.process(app);
|
||||||
|
|
||||||
|
const QStringList args = parser.positionalArguments();
|
||||||
|
if (args.count() < 1) {
|
||||||
|
QTextStream(stderr) << "Must provide a format\n";
|
||||||
|
parser.showHelp(1);
|
||||||
|
} else if (args.count() > 1) {
|
||||||
|
QTextStream(stderr) << "Too many arguments\n";
|
||||||
|
parser.showHelp(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
uchar fuzziness = 0;
|
||||||
|
if (parser.isSet(fuzz)) {
|
||||||
|
bool ok;
|
||||||
|
uint fuzzarg = parser.value(fuzz).toUInt(&ok);
|
||||||
|
if (!ok || fuzzarg > 255) {
|
||||||
|
QTextStream(stderr) << "Error: max fuzz argument must be a number between 0 and 255\n";
|
||||||
|
parser.showHelp(1);
|
||||||
|
}
|
||||||
|
fuzziness = uchar(fuzzarg);
|
||||||
|
}
|
||||||
|
|
||||||
|
QString suffix = args.at(0);
|
||||||
|
QByteArray format = suffix.toLatin1();
|
||||||
|
|
||||||
|
QDir imgdir(QLatin1String(IMAGEDIR "/") + suffix);
|
||||||
|
imgdir.setNameFilters(QStringList(QLatin1String("*.") + suffix));
|
||||||
|
imgdir.setFilter(QDir::Files);
|
||||||
|
|
||||||
|
int passed = 0;
|
||||||
|
int failed = 0;
|
||||||
|
|
||||||
|
QTextStream(stdout) << "********* "
|
||||||
|
<< "Starting basic read tests for "
|
||||||
|
<< suffix << " images *********\n";
|
||||||
|
|
||||||
|
foreach (QFileInfo fi, imgdir.entryInfoList()) {
|
||||||
|
int suffixPos = fi.filePath().count() - suffix.count();
|
||||||
|
QString inputfile = fi.filePath();
|
||||||
|
QString expfile = fi.filePath().replace(suffixPos, suffix.count(), "png");
|
||||||
|
QString expfilename = QFileInfo(expfile).fileName();
|
||||||
|
|
||||||
|
QImageReader inputReader(inputfile, format.constData());
|
||||||
|
QImageReader expReader(expfile, "png");
|
||||||
|
|
||||||
|
QImage inputImage;
|
||||||
|
QImage expImage;
|
||||||
|
|
||||||
|
if (!expReader.read(&expImage)) {
|
||||||
|
QTextStream(stdout) << "ERROR: " << fi.fileName()
|
||||||
|
<< ": could not load " << expfilename
|
||||||
|
<< ": " << expReader.errorString()
|
||||||
|
<< "\n";
|
||||||
|
++failed;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!inputReader.read(&inputImage)) {
|
||||||
|
QTextStream(stdout) << "FAIL : " << fi.fileName()
|
||||||
|
<< ": failed to load: "
|
||||||
|
<< inputReader.errorString()
|
||||||
|
<< "\n";
|
||||||
|
++failed;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (expImage.width() != inputImage.width()) {
|
||||||
|
QTextStream(stdout) << "FAIL : " << fi.fileName()
|
||||||
|
<< ": width was " << inputImage.width()
|
||||||
|
<< " but " << expfilename << " width was "
|
||||||
|
<< expImage.width() << "\n";
|
||||||
|
++failed;
|
||||||
|
} else if (expImage.height() != inputImage.height()) {
|
||||||
|
QTextStream(stdout) << "FAIL : " << fi.fileName()
|
||||||
|
<< ": height was " << inputImage.height()
|
||||||
|
<< " but " << expfilename << " height was "
|
||||||
|
<< expImage.height() << "\n";
|
||||||
|
++failed;
|
||||||
|
} else {
|
||||||
|
if (inputImage.format() != QImage::Format_ARGB32) {
|
||||||
|
QTextStream(stdout) << "INFO : " << fi.fileName()
|
||||||
|
<< ": converting " << fi.fileName()
|
||||||
|
<< " from " << formatToString(inputImage.format())
|
||||||
|
<< " to ARGB32\n";
|
||||||
|
inputImage = inputImage.convertToFormat(QImage::Format_ARGB32);
|
||||||
|
}
|
||||||
|
if (expImage.format() != QImage::Format_ARGB32) {
|
||||||
|
QTextStream(stdout) << "INFO : " << fi.fileName()
|
||||||
|
<< ": converting " << expfilename
|
||||||
|
<< " from " << formatToString(expImage.format())
|
||||||
|
<< " to ARGB32\n";
|
||||||
|
expImage = expImage.convertToFormat(QImage::Format_ARGB32);
|
||||||
|
}
|
||||||
|
if (fuzzyeq(inputImage, expImage, fuzziness)) {
|
||||||
|
QTextStream(stdout) << "PASS : " << fi.fileName() << "\n";
|
||||||
|
++passed;
|
||||||
|
} else {
|
||||||
|
QTextStream(stdout) << "FAIL : " << fi.fileName()
|
||||||
|
<< ": differs from " << expfilename << "\n";
|
||||||
|
writeImageData("expected data",
|
||||||
|
fi.fileName() + QLatin1String("-expected.data"),
|
||||||
|
expImage);
|
||||||
|
writeImageData("actual data",
|
||||||
|
fi.fileName() + QLatin1String("-actual.data"),
|
||||||
|
inputImage);
|
||||||
|
++failed;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
QTextStream(stdout) << "Totals: "
|
||||||
|
<< passed << " passed, "
|
||||||
|
<< failed << " failed\n";
|
||||||
|
QTextStream(stdout) << "********* "
|
||||||
|
<< "Finished basic read tests for "
|
||||||
|
<< suffix << " images *********\n";
|
||||||
|
|
||||||
|
return failed == 0 ? 0 : 1;
|
||||||
|
}
|
502
autotests/write/bw.eps
Normal file
@ -0,0 +1,502 @@
|
|||||||
|
%!PS-Adobe-3.0 EPSF-3.0
|
||||||
|
%Produced by poppler pdftops version: 0.24.5 (http://poppler.freedesktop.org)
|
||||||
|
%%Creator: KDE EPS image plugin
|
||||||
|
%%LanguageLevel: 2
|
||||||
|
%%DocumentSuppliedResources: (atend)
|
||||||
|
%%BoundingBox: 0 0 32 32
|
||||||
|
%%HiResBoundingBox: 0 0 32 32
|
||||||
|
%%DocumentSuppliedResources: (atend)
|
||||||
|
%%EndComments
|
||||||
|
%%BeginProlog
|
||||||
|
%%BeginResource: procset xpdf 3.00 0
|
||||||
|
%%Copyright: Copyright 1996-2011 Glyph & Cog, LLC
|
||||||
|
/xpdf 75 dict def xpdf begin
|
||||||
|
% PDF special state
|
||||||
|
/pdfDictSize 15 def
|
||||||
|
/pdfSetup {
|
||||||
|
/setpagedevice where {
|
||||||
|
pop 2 dict begin
|
||||||
|
/Policies 1 dict dup begin /PageSize 6 def end def
|
||||||
|
{ /Duplex true def } if
|
||||||
|
currentdict end setpagedevice
|
||||||
|
} {
|
||||||
|
pop
|
||||||
|
} ifelse
|
||||||
|
} def
|
||||||
|
/pdfSetupPaper {
|
||||||
|
2 array astore
|
||||||
|
/setpagedevice where {
|
||||||
|
pop 2 dict begin
|
||||||
|
/PageSize exch def
|
||||||
|
/ImagingBBox null def
|
||||||
|
currentdict end setpagedevice
|
||||||
|
} {
|
||||||
|
pop
|
||||||
|
} ifelse
|
||||||
|
} def
|
||||||
|
/pdfStartPage {
|
||||||
|
pdfDictSize dict begin
|
||||||
|
/pdfFillCS [] def
|
||||||
|
/pdfFillXform {} def
|
||||||
|
/pdfStrokeCS [] def
|
||||||
|
/pdfStrokeXform {} def
|
||||||
|
/pdfFill [0] def
|
||||||
|
/pdfStroke [0] def
|
||||||
|
/pdfFillOP false def
|
||||||
|
/pdfStrokeOP false def
|
||||||
|
/pdfLastFill false def
|
||||||
|
/pdfLastStroke false def
|
||||||
|
/pdfTextMat [1 0 0 1 0 0] def
|
||||||
|
/pdfFontSize 0 def
|
||||||
|
/pdfCharSpacing 0 def
|
||||||
|
/pdfTextRender 0 def
|
||||||
|
/pdfPatternCS false def
|
||||||
|
/pdfTextRise 0 def
|
||||||
|
/pdfWordSpacing 0 def
|
||||||
|
/pdfHorizScaling 1 def
|
||||||
|
/pdfTextClipPath [] def
|
||||||
|
} def
|
||||||
|
/pdfEndPage { end } def
|
||||||
|
% PDF color state
|
||||||
|
/cs { /pdfFillXform exch def dup /pdfFillCS exch def
|
||||||
|
setcolorspace } def
|
||||||
|
/CS { /pdfStrokeXform exch def dup /pdfStrokeCS exch def
|
||||||
|
setcolorspace } def
|
||||||
|
/sc { pdfLastFill not { pdfFillCS setcolorspace } if
|
||||||
|
dup /pdfFill exch def aload pop pdfFillXform setcolor
|
||||||
|
/pdfLastFill true def /pdfLastStroke false def } def
|
||||||
|
/SC { pdfLastStroke not { pdfStrokeCS setcolorspace } if
|
||||||
|
dup /pdfStroke exch def aload pop pdfStrokeXform setcolor
|
||||||
|
/pdfLastStroke true def /pdfLastFill false def } def
|
||||||
|
/op { /pdfFillOP exch def
|
||||||
|
pdfLastFill { pdfFillOP setoverprint } if } def
|
||||||
|
/OP { /pdfStrokeOP exch def
|
||||||
|
pdfLastStroke { pdfStrokeOP setoverprint } if } def
|
||||||
|
/fCol {
|
||||||
|
pdfLastFill not {
|
||||||
|
pdfFillCS setcolorspace
|
||||||
|
pdfFill aload pop pdfFillXform setcolor
|
||||||
|
pdfFillOP setoverprint
|
||||||
|
/pdfLastFill true def /pdfLastStroke false def
|
||||||
|
} if
|
||||||
|
} def
|
||||||
|
/sCol {
|
||||||
|
pdfLastStroke not {
|
||||||
|
pdfStrokeCS setcolorspace
|
||||||
|
pdfStroke aload pop pdfStrokeXform setcolor
|
||||||
|
pdfStrokeOP setoverprint
|
||||||
|
/pdfLastStroke true def /pdfLastFill false def
|
||||||
|
} if
|
||||||
|
} def
|
||||||
|
% build a font
|
||||||
|
/pdfMakeFont {
|
||||||
|
4 3 roll findfont
|
||||||
|
4 2 roll matrix scale makefont
|
||||||
|
dup length dict begin
|
||||||
|
{ 1 index /FID ne { def } { pop pop } ifelse } forall
|
||||||
|
/Encoding exch def
|
||||||
|
currentdict
|
||||||
|
end
|
||||||
|
definefont pop
|
||||||
|
} def
|
||||||
|
/pdfMakeFont16 {
|
||||||
|
exch findfont
|
||||||
|
dup length dict begin
|
||||||
|
{ 1 index /FID ne { def } { pop pop } ifelse } forall
|
||||||
|
/WMode exch def
|
||||||
|
currentdict
|
||||||
|
end
|
||||||
|
definefont pop
|
||||||
|
} def
|
||||||
|
% graphics state operators
|
||||||
|
/q { gsave pdfDictSize dict begin } def
|
||||||
|
/Q {
|
||||||
|
end grestore
|
||||||
|
/pdfLastFill where {
|
||||||
|
pop
|
||||||
|
pdfLastFill {
|
||||||
|
pdfFillOP setoverprint
|
||||||
|
} {
|
||||||
|
pdfStrokeOP setoverprint
|
||||||
|
} ifelse
|
||||||
|
} if
|
||||||
|
} def
|
||||||
|
/cm { concat } def
|
||||||
|
/d { setdash } def
|
||||||
|
/i { setflat } def
|
||||||
|
/j { setlinejoin } def
|
||||||
|
/J { setlinecap } def
|
||||||
|
/M { setmiterlimit } def
|
||||||
|
/w { setlinewidth } def
|
||||||
|
% path segment operators
|
||||||
|
/m { moveto } def
|
||||||
|
/l { lineto } def
|
||||||
|
/c { curveto } def
|
||||||
|
/re { 4 2 roll moveto 1 index 0 rlineto 0 exch rlineto
|
||||||
|
neg 0 rlineto closepath } def
|
||||||
|
/h { closepath } def
|
||||||
|
% path painting operators
|
||||||
|
/S { sCol stroke } def
|
||||||
|
/Sf { fCol stroke } def
|
||||||
|
/f { fCol fill } def
|
||||||
|
/f* { fCol eofill } def
|
||||||
|
% clipping operators
|
||||||
|
/W { clip newpath } def
|
||||||
|
/W* { eoclip newpath } def
|
||||||
|
/Ws { strokepath clip newpath } def
|
||||||
|
% text state operators
|
||||||
|
/Tc { /pdfCharSpacing exch def } def
|
||||||
|
/Tf { dup /pdfFontSize exch def
|
||||||
|
dup pdfHorizScaling mul exch matrix scale
|
||||||
|
pdfTextMat matrix concatmatrix dup 4 0 put dup 5 0 put
|
||||||
|
exch findfont exch makefont setfont } def
|
||||||
|
/Tr { /pdfTextRender exch def } def
|
||||||
|
/Tp { /pdfPatternCS exch def } def
|
||||||
|
/Ts { /pdfTextRise exch def } def
|
||||||
|
/Tw { /pdfWordSpacing exch def } def
|
||||||
|
/Tz { /pdfHorizScaling exch def } def
|
||||||
|
% text positioning operators
|
||||||
|
/Td { pdfTextMat transform moveto } def
|
||||||
|
/Tm { /pdfTextMat exch def } def
|
||||||
|
% text string operators
|
||||||
|
/xyshow where {
|
||||||
|
pop
|
||||||
|
/xyshow2 {
|
||||||
|
dup length array
|
||||||
|
0 2 2 index length 1 sub {
|
||||||
|
2 index 1 index 2 copy get 3 1 roll 1 add get
|
||||||
|
pdfTextMat dtransform
|
||||||
|
4 2 roll 2 copy 6 5 roll put 1 add 3 1 roll dup 4 2 roll put
|
||||||
|
} for
|
||||||
|
exch pop
|
||||||
|
xyshow
|
||||||
|
} def
|
||||||
|
}{
|
||||||
|
/xyshow2 {
|
||||||
|
currentfont /FontType get 0 eq {
|
||||||
|
0 2 3 index length 1 sub {
|
||||||
|
currentpoint 4 index 3 index 2 getinterval show moveto
|
||||||
|
2 copy get 2 index 3 2 roll 1 add get
|
||||||
|
pdfTextMat dtransform rmoveto
|
||||||
|
} for
|
||||||
|
} {
|
||||||
|
0 1 3 index length 1 sub {
|
||||||
|
currentpoint 4 index 3 index 1 getinterval show moveto
|
||||||
|
2 copy 2 mul get 2 index 3 2 roll 2 mul 1 add get
|
||||||
|
pdfTextMat dtransform rmoveto
|
||||||
|
} for
|
||||||
|
} ifelse
|
||||||
|
pop pop
|
||||||
|
} def
|
||||||
|
} ifelse
|
||||||
|
/cshow where {
|
||||||
|
pop
|
||||||
|
/xycp {
|
||||||
|
0 3 2 roll
|
||||||
|
{
|
||||||
|
pop pop currentpoint 3 2 roll
|
||||||
|
1 string dup 0 4 3 roll put false charpath moveto
|
||||||
|
2 copy get 2 index 2 index 1 add get
|
||||||
|
pdfTextMat dtransform rmoveto
|
||||||
|
2 add
|
||||||
|
} exch cshow
|
||||||
|
pop pop
|
||||||
|
} def
|
||||||
|
}{
|
||||||
|
/xycp {
|
||||||
|
currentfont /FontType get 0 eq {
|
||||||
|
0 2 3 index length 1 sub {
|
||||||
|
currentpoint 4 index 3 index 2 getinterval false charpath moveto
|
||||||
|
2 copy get 2 index 3 2 roll 1 add get
|
||||||
|
pdfTextMat dtransform rmoveto
|
||||||
|
} for
|
||||||
|
} {
|
||||||
|
0 1 3 index length 1 sub {
|
||||||
|
currentpoint 4 index 3 index 1 getinterval false charpath moveto
|
||||||
|
2 copy 2 mul get 2 index 3 2 roll 2 mul 1 add get
|
||||||
|
pdfTextMat dtransform rmoveto
|
||||||
|
} for
|
||||||
|
} ifelse
|
||||||
|
pop pop
|
||||||
|
} def
|
||||||
|
} ifelse
|
||||||
|
/Tj {
|
||||||
|
fCol
|
||||||
|
0 pdfTextRise pdfTextMat dtransform rmoveto
|
||||||
|
currentpoint 4 2 roll
|
||||||
|
pdfTextRender 1 and 0 eq {
|
||||||
|
2 copy xyshow2
|
||||||
|
} if
|
||||||
|
pdfTextRender 3 and dup 1 eq exch 2 eq or {
|
||||||
|
3 index 3 index moveto
|
||||||
|
2 copy
|
||||||
|
currentfont /FontType get 3 eq { fCol } { sCol } ifelse
|
||||||
|
xycp currentpoint stroke moveto
|
||||||
|
} if
|
||||||
|
pdfTextRender 4 and 0 ne {
|
||||||
|
4 2 roll moveto xycp
|
||||||
|
/pdfTextClipPath [ pdfTextClipPath aload pop
|
||||||
|
{/moveto cvx}
|
||||||
|
{/lineto cvx}
|
||||||
|
{/curveto cvx}
|
||||||
|
{/closepath cvx}
|
||||||
|
pathforall ] def
|
||||||
|
currentpoint newpath moveto
|
||||||
|
} {
|
||||||
|
pop pop pop pop
|
||||||
|
} ifelse
|
||||||
|
0 pdfTextRise neg pdfTextMat dtransform rmoveto
|
||||||
|
} def
|
||||||
|
/TJm { 0.001 mul pdfFontSize mul pdfHorizScaling mul neg 0
|
||||||
|
pdfTextMat dtransform rmoveto } def
|
||||||
|
/TJmV { 0.001 mul pdfFontSize mul neg 0 exch
|
||||||
|
pdfTextMat dtransform rmoveto } def
|
||||||
|
/Tclip { pdfTextClipPath cvx exec clip newpath
|
||||||
|
/pdfTextClipPath [] def } def
|
||||||
|
/Tclip* { pdfTextClipPath cvx exec eoclip newpath
|
||||||
|
/pdfTextClipPath [] def } def
|
||||||
|
% Level 2/3 image operators
|
||||||
|
/pdfImBuf 100 string def
|
||||||
|
/pdfImStr {
|
||||||
|
2 copy exch length lt {
|
||||||
|
2 copy get exch 1 add exch
|
||||||
|
} {
|
||||||
|
()
|
||||||
|
} ifelse
|
||||||
|
} def
|
||||||
|
/skipEOD {
|
||||||
|
{ currentfile pdfImBuf readline
|
||||||
|
not { pop exit } if
|
||||||
|
(%-EOD-) eq { exit } if } loop
|
||||||
|
} def
|
||||||
|
/pdfIm { image skipEOD } def
|
||||||
|
/pdfImM { fCol imagemask skipEOD } def
|
||||||
|
/pr { 2 index 2 index 3 2 roll putinterval 4 add } def
|
||||||
|
/pdfImClip {
|
||||||
|
gsave
|
||||||
|
0 2 4 index length 1 sub {
|
||||||
|
dup 4 index exch 2 copy
|
||||||
|
get 5 index div put
|
||||||
|
1 add 3 index exch 2 copy
|
||||||
|
get 3 index div put
|
||||||
|
} for
|
||||||
|
pop pop rectclip
|
||||||
|
} def
|
||||||
|
/pdfImClipEnd { grestore } def
|
||||||
|
% shading operators
|
||||||
|
/colordelta {
|
||||||
|
false 0 1 3 index length 1 sub {
|
||||||
|
dup 4 index exch get 3 index 3 2 roll get sub abs 0.004 gt {
|
||||||
|
pop true
|
||||||
|
} if
|
||||||
|
} for
|
||||||
|
exch pop exch pop
|
||||||
|
} def
|
||||||
|
/funcCol { func n array astore } def
|
||||||
|
/funcSH {
|
||||||
|
dup 0 eq {
|
||||||
|
true
|
||||||
|
} {
|
||||||
|
dup 6 eq {
|
||||||
|
false
|
||||||
|
} {
|
||||||
|
4 index 4 index funcCol dup
|
||||||
|
6 index 4 index funcCol dup
|
||||||
|
3 1 roll colordelta 3 1 roll
|
||||||
|
5 index 5 index funcCol dup
|
||||||
|
3 1 roll colordelta 3 1 roll
|
||||||
|
6 index 8 index funcCol dup
|
||||||
|
3 1 roll colordelta 3 1 roll
|
||||||
|
colordelta or or or
|
||||||
|
} ifelse
|
||||||
|
} ifelse
|
||||||
|
{
|
||||||
|
1 add
|
||||||
|
4 index 3 index add 0.5 mul exch 4 index 3 index add 0.5 mul exch
|
||||||
|
6 index 6 index 4 index 4 index 4 index funcSH
|
||||||
|
2 index 6 index 6 index 4 index 4 index funcSH
|
||||||
|
6 index 2 index 4 index 6 index 4 index funcSH
|
||||||
|
5 3 roll 3 2 roll funcSH pop pop
|
||||||
|
} {
|
||||||
|
pop 3 index 2 index add 0.5 mul 3 index 2 index add 0.5 mul
|
||||||
|
funcCol sc
|
||||||
|
dup 4 index exch mat transform m
|
||||||
|
3 index 3 index mat transform l
|
||||||
|
1 index 3 index mat transform l
|
||||||
|
mat transform l pop pop h f*
|
||||||
|
} ifelse
|
||||||
|
} def
|
||||||
|
/axialCol {
|
||||||
|
dup 0 lt {
|
||||||
|
pop t0
|
||||||
|
} {
|
||||||
|
dup 1 gt {
|
||||||
|
pop t1
|
||||||
|
} {
|
||||||
|
dt mul t0 add
|
||||||
|
} ifelse
|
||||||
|
} ifelse
|
||||||
|
func n array astore
|
||||||
|
} def
|
||||||
|
/axialSH {
|
||||||
|
dup 0 eq {
|
||||||
|
true
|
||||||
|
} {
|
||||||
|
dup 8 eq {
|
||||||
|
false
|
||||||
|
} {
|
||||||
|
2 index axialCol 2 index axialCol colordelta
|
||||||
|
} ifelse
|
||||||
|
} ifelse
|
||||||
|
{
|
||||||
|
1 add 3 1 roll 2 copy add 0.5 mul
|
||||||
|
dup 4 3 roll exch 4 index axialSH
|
||||||
|
exch 3 2 roll axialSH
|
||||||
|
} {
|
||||||
|
pop 2 copy add 0.5 mul
|
||||||
|
axialCol sc
|
||||||
|
exch dup dx mul x0 add exch dy mul y0 add
|
||||||
|
3 2 roll dup dx mul x0 add exch dy mul y0 add
|
||||||
|
dx abs dy abs ge {
|
||||||
|
2 copy yMin sub dy mul dx div add yMin m
|
||||||
|
yMax sub dy mul dx div add yMax l
|
||||||
|
2 copy yMax sub dy mul dx div add yMax l
|
||||||
|
yMin sub dy mul dx div add yMin l
|
||||||
|
h f*
|
||||||
|
} {
|
||||||
|
exch 2 copy xMin sub dx mul dy div add xMin exch m
|
||||||
|
xMax sub dx mul dy div add xMax exch l
|
||||||
|
exch 2 copy xMax sub dx mul dy div add xMax exch l
|
||||||
|
xMin sub dx mul dy div add xMin exch l
|
||||||
|
h f*
|
||||||
|
} ifelse
|
||||||
|
} ifelse
|
||||||
|
} def
|
||||||
|
/radialCol {
|
||||||
|
dup t0 lt {
|
||||||
|
pop t0
|
||||||
|
} {
|
||||||
|
dup t1 gt {
|
||||||
|
pop t1
|
||||||
|
} if
|
||||||
|
} ifelse
|
||||||
|
func n array astore
|
||||||
|
} def
|
||||||
|
/radialSH {
|
||||||
|
dup 0 eq {
|
||||||
|
true
|
||||||
|
} {
|
||||||
|
dup 8 eq {
|
||||||
|
false
|
||||||
|
} {
|
||||||
|
2 index dt mul t0 add radialCol
|
||||||
|
2 index dt mul t0 add radialCol colordelta
|
||||||
|
} ifelse
|
||||||
|
} ifelse
|
||||||
|
{
|
||||||
|
1 add 3 1 roll 2 copy add 0.5 mul
|
||||||
|
dup 4 3 roll exch 4 index radialSH
|
||||||
|
exch 3 2 roll radialSH
|
||||||
|
} {
|
||||||
|
pop 2 copy add 0.5 mul dt mul t0 add
|
||||||
|
radialCol sc
|
||||||
|
encl {
|
||||||
|
exch dup dx mul x0 add exch dup dy mul y0 add exch dr mul r0 add
|
||||||
|
0 360 arc h
|
||||||
|
dup dx mul x0 add exch dup dy mul y0 add exch dr mul r0 add
|
||||||
|
360 0 arcn h f
|
||||||
|
} {
|
||||||
|
2 copy
|
||||||
|
dup dx mul x0 add exch dup dy mul y0 add exch dr mul r0 add
|
||||||
|
a1 a2 arcn
|
||||||
|
dup dx mul x0 add exch dup dy mul y0 add exch dr mul r0 add
|
||||||
|
a2 a1 arcn h
|
||||||
|
dup dx mul x0 add exch dup dy mul y0 add exch dr mul r0 add
|
||||||
|
a1 a2 arc
|
||||||
|
dup dx mul x0 add exch dup dy mul y0 add exch dr mul r0 add
|
||||||
|
a2 a1 arc h f
|
||||||
|
} ifelse
|
||||||
|
} ifelse
|
||||||
|
} def
|
||||||
|
end
|
||||||
|
%%EndResource
|
||||||
|
%%EndProlog
|
||||||
|
%%BeginSetup
|
||||||
|
xpdf begin
|
||||||
|
%%EndSetup
|
||||||
|
pdfStartPage
|
||||||
|
[] 0 d
|
||||||
|
1 i
|
||||||
|
0 j
|
||||||
|
0 J
|
||||||
|
10 M
|
||||||
|
1 w
|
||||||
|
/DeviceGray {} cs
|
||||||
|
[0] sc
|
||||||
|
/DeviceGray {} CS
|
||||||
|
[0] SC
|
||||||
|
false op
|
||||||
|
false OP
|
||||||
|
{} settransfer
|
||||||
|
0 0 32 32 re
|
||||||
|
W
|
||||||
|
q
|
||||||
|
/DeviceRGB {} cs
|
||||||
|
[0 0 0] sc
|
||||||
|
/DeviceRGB {} CS
|
||||||
|
[0 0 0] SC
|
||||||
|
[1 0 0 -1 0 32] cm
|
||||||
|
q
|
||||||
|
q
|
||||||
|
Q
|
||||||
|
Q
|
||||||
|
q
|
||||||
|
q
|
||||||
|
q
|
||||||
|
[1 0 0 1 0 0] cm
|
||||||
|
[32 0 0 -32 0 32] cm
|
||||||
|
/DeviceRGB setcolorspace
|
||||||
|
<<
|
||||||
|
/ImageType 1
|
||||||
|
/Width 32
|
||||||
|
/Height 32
|
||||||
|
/ImageMatrix [32 0 0 -32 0 32]
|
||||||
|
/BitsPerComponent 8
|
||||||
|
/Decode [0 1 0 1 0 1]
|
||||||
|
/DataSource currentfile
|
||||||
|
/ASCII85Decode filter
|
||||||
|
<< >> /DCTDecode filter
|
||||||
|
>>
|
||||||
|
pdfIm
|
||||||
|
s4IA0!"_al8O`[\!<E0k!([(is4[N@!!30%!W`<'!WiE)!WiE*"Tni/!s8`1"9Sf4
|
||||||
|
"pYA<"pYA=#n%%F#RUhB#7:nI$4@7N$k*@I%M'!W%LW[R%0,&^6NI5i!WrN,"p4r3
|
||||||
|
$j[(D$k*OQ$k*OQ$k*OQ$k*OQ$k*OQ$k*OQ$k*OQ$k*OQ$k*OQ$k*OQ$k*OQ$k*OQ
|
||||||
|
$k30O!"fJ:+93Md!?qLF&HMtG!WU(<*rl9A"T\W)!<E3$z!!!!"!WrQ/"pYD?$4Hm
|
||||||
|
P!4<@<!W`B*!X&T/"U"r.!!.KK!WrE*&Hrdj0gQ!W;.0\RE>10ZOeE%*6F"?A;UOt
|
||||||
|
Z1LbBV#mqFa(`=5<-7:2j.Ps"@2`NfY6UX@47n?3D;cHat='/U/@q9._B4u!oF*)P
|
||||||
|
JGBeCZK7nr5LPUeEP*;,qQC!u,R\HRQV5C/hWN*81['d?O\@K2f_o0O6a2lBFdaQ^
|
||||||
|
rf%8R-g>V&OjQ5OekiqC&o(2MHp@n@XqZ"J6*ru?D!<E3%!<E3%!<<*"!!!!"!WrQ
|
||||||
|
/"pYD?$4HmP!4<C=!W`?*"9Sc3"U"r.!<RHF!<N?8"9fr'"qj4!#@VTc+u4]T'LIq
|
||||||
|
UZ,$_k1K*]W@WKj'(*k`q-1Mcg)&ahL-n-W'2E*TU3^Z;(7Rp!@8lJ\h<``C+>%;)
|
||||||
|
SAnPdkC3+K>G'A1VH@gd&KnbA=M2II[Pa.Q$R$jD;USO``Vl6SpZEppG[^WcW]#)A
|
||||||
|
'`Q#s>ai`&\eCE.%f\,!<j5f=akNM0qo(2MHp@n@XqZ#7L$j-M1!YGMH!'^J^BE%s
|
||||||
|
`Q[ch>,l[jrG5O;H4@((,Nu7daD.`FnrL6**b\LH,D=SYd",m^?i=l4k#>Y&g9bUO
|
||||||
|
>MtTa;Y#@t+:FeG9N]V>#1:nBP>^,H<Xa\&[!aI?'6uhG.,.T@e?5D#_rr@Yb0!Ms
|
||||||
|
rN7qV%pM`e<#$Di["F`gj5:Si-rrBm_r]g2Pi93&5#Ca_N')YD#cKpI1VVR`"G%EX
|
||||||
|
@*FZrXV0tH*!!N,t!.q]X8,]]A5(CE_ir9#3PN#*LMfE5YgM6Sih.[I+D+6(5b@cc
|
||||||
|
G]RTni-.='e5N&$f,_@oPe/ga&,EF3"BFt:;l!LD5!,US+f+\4m`r=@l+`@\b!qEF
|
||||||
|
lMI#lQ%eAR[36>9-p&$>GXA=[:$]!_#_qfCOpC4P?DSg0,)pr1_K`8=Zq8`L8#+t-
|
||||||
|
(fDZ)=I=JaBepM&/?8)KLP/oBHd_ANBj^7d-n,*jV<rW/OB`?-fHo]aT7qpscJ%%(
|
||||||
|
R-n[*E0dKT>q+1!H,_-(pWAX?K!.Y%%~>
|
||||||
|
%-EOD-
|
||||||
|
Q
|
||||||
|
Q
|
||||||
|
Q
|
||||||
|
Q
|
||||||
|
showpage
|
||||||
|
%%PageTrailer
|
||||||
|
pdfEndPage
|
||||||
|
%%Trailer
|
||||||
|
end
|
||||||
|
%%DocumentSuppliedResources:
|
||||||
|
%%EOF
|
BIN
autotests/write/bw.jp2
Normal file
BIN
autotests/write/bw.pcx
Normal file
BIN
autotests/write/bw.png
Normal file
After Width: | Height: | Size: 743 B |
BIN
autotests/write/bw.rgb
Normal file
BIN
autotests/write/bw.tga
Normal file
After Width: | Height: | Size: 3.0 KiB |
BIN
autotests/write/bw.xv
Normal file
BIN
autotests/write/bwa.png
Normal file
After Width: | Height: | Size: 574 B |
BIN
autotests/write/bwa.tga
Normal file
After Width: | Height: | Size: 4.0 KiB |
BIN
autotests/write/bwa.xv
Normal file
505
autotests/write/rgb.eps
Normal file
@ -0,0 +1,505 @@
|
|||||||
|
%!PS-Adobe-3.0 EPSF-3.0
|
||||||
|
%Produced by poppler pdftops version: 0.24.5 (http://poppler.freedesktop.org)
|
||||||
|
%%Creator: KDE EPS image plugin
|
||||||
|
%%LanguageLevel: 2
|
||||||
|
%%DocumentSuppliedResources: (atend)
|
||||||
|
%%BoundingBox: 0 0 32 32
|
||||||
|
%%HiResBoundingBox: 0 0 32 32
|
||||||
|
%%DocumentSuppliedResources: (atend)
|
||||||
|
%%EndComments
|
||||||
|
%%BeginProlog
|
||||||
|
%%BeginResource: procset xpdf 3.00 0
|
||||||
|
%%Copyright: Copyright 1996-2011 Glyph & Cog, LLC
|
||||||
|
/xpdf 75 dict def xpdf begin
|
||||||
|
% PDF special state
|
||||||
|
/pdfDictSize 15 def
|
||||||
|
/pdfSetup {
|
||||||
|
/setpagedevice where {
|
||||||
|
pop 2 dict begin
|
||||||
|
/Policies 1 dict dup begin /PageSize 6 def end def
|
||||||
|
{ /Duplex true def } if
|
||||||
|
currentdict end setpagedevice
|
||||||
|
} {
|
||||||
|
pop
|
||||||
|
} ifelse
|
||||||
|
} def
|
||||||
|
/pdfSetupPaper {
|
||||||
|
2 array astore
|
||||||
|
/setpagedevice where {
|
||||||
|
pop 2 dict begin
|
||||||
|
/PageSize exch def
|
||||||
|
/ImagingBBox null def
|
||||||
|
currentdict end setpagedevice
|
||||||
|
} {
|
||||||
|
pop
|
||||||
|
} ifelse
|
||||||
|
} def
|
||||||
|
/pdfStartPage {
|
||||||
|
pdfDictSize dict begin
|
||||||
|
/pdfFillCS [] def
|
||||||
|
/pdfFillXform {} def
|
||||||
|
/pdfStrokeCS [] def
|
||||||
|
/pdfStrokeXform {} def
|
||||||
|
/pdfFill [0] def
|
||||||
|
/pdfStroke [0] def
|
||||||
|
/pdfFillOP false def
|
||||||
|
/pdfStrokeOP false def
|
||||||
|
/pdfLastFill false def
|
||||||
|
/pdfLastStroke false def
|
||||||
|
/pdfTextMat [1 0 0 1 0 0] def
|
||||||
|
/pdfFontSize 0 def
|
||||||
|
/pdfCharSpacing 0 def
|
||||||
|
/pdfTextRender 0 def
|
||||||
|
/pdfPatternCS false def
|
||||||
|
/pdfTextRise 0 def
|
||||||
|
/pdfWordSpacing 0 def
|
||||||
|
/pdfHorizScaling 1 def
|
||||||
|
/pdfTextClipPath [] def
|
||||||
|
} def
|
||||||
|
/pdfEndPage { end } def
|
||||||
|
% PDF color state
|
||||||
|
/cs { /pdfFillXform exch def dup /pdfFillCS exch def
|
||||||
|
setcolorspace } def
|
||||||
|
/CS { /pdfStrokeXform exch def dup /pdfStrokeCS exch def
|
||||||
|
setcolorspace } def
|
||||||
|
/sc { pdfLastFill not { pdfFillCS setcolorspace } if
|
||||||
|
dup /pdfFill exch def aload pop pdfFillXform setcolor
|
||||||
|
/pdfLastFill true def /pdfLastStroke false def } def
|
||||||
|
/SC { pdfLastStroke not { pdfStrokeCS setcolorspace } if
|
||||||
|
dup /pdfStroke exch def aload pop pdfStrokeXform setcolor
|
||||||
|
/pdfLastStroke true def /pdfLastFill false def } def
|
||||||
|
/op { /pdfFillOP exch def
|
||||||
|
pdfLastFill { pdfFillOP setoverprint } if } def
|
||||||
|
/OP { /pdfStrokeOP exch def
|
||||||
|
pdfLastStroke { pdfStrokeOP setoverprint } if } def
|
||||||
|
/fCol {
|
||||||
|
pdfLastFill not {
|
||||||
|
pdfFillCS setcolorspace
|
||||||
|
pdfFill aload pop pdfFillXform setcolor
|
||||||
|
pdfFillOP setoverprint
|
||||||
|
/pdfLastFill true def /pdfLastStroke false def
|
||||||
|
} if
|
||||||
|
} def
|
||||||
|
/sCol {
|
||||||
|
pdfLastStroke not {
|
||||||
|
pdfStrokeCS setcolorspace
|
||||||
|
pdfStroke aload pop pdfStrokeXform setcolor
|
||||||
|
pdfStrokeOP setoverprint
|
||||||
|
/pdfLastStroke true def /pdfLastFill false def
|
||||||
|
} if
|
||||||
|
} def
|
||||||
|
% build a font
|
||||||
|
/pdfMakeFont {
|
||||||
|
4 3 roll findfont
|
||||||
|
4 2 roll matrix scale makefont
|
||||||
|
dup length dict begin
|
||||||
|
{ 1 index /FID ne { def } { pop pop } ifelse } forall
|
||||||
|
/Encoding exch def
|
||||||
|
currentdict
|
||||||
|
end
|
||||||
|
definefont pop
|
||||||
|
} def
|
||||||
|
/pdfMakeFont16 {
|
||||||
|
exch findfont
|
||||||
|
dup length dict begin
|
||||||
|
{ 1 index /FID ne { def } { pop pop } ifelse } forall
|
||||||
|
/WMode exch def
|
||||||
|
currentdict
|
||||||
|
end
|
||||||
|
definefont pop
|
||||||
|
} def
|
||||||
|
% graphics state operators
|
||||||
|
/q { gsave pdfDictSize dict begin } def
|
||||||
|
/Q {
|
||||||
|
end grestore
|
||||||
|
/pdfLastFill where {
|
||||||
|
pop
|
||||||
|
pdfLastFill {
|
||||||
|
pdfFillOP setoverprint
|
||||||
|
} {
|
||||||
|
pdfStrokeOP setoverprint
|
||||||
|
} ifelse
|
||||||
|
} if
|
||||||
|
} def
|
||||||
|
/cm { concat } def
|
||||||
|
/d { setdash } def
|
||||||
|
/i { setflat } def
|
||||||
|
/j { setlinejoin } def
|
||||||
|
/J { setlinecap } def
|
||||||
|
/M { setmiterlimit } def
|
||||||
|
/w { setlinewidth } def
|
||||||
|
% path segment operators
|
||||||
|
/m { moveto } def
|
||||||
|
/l { lineto } def
|
||||||
|
/c { curveto } def
|
||||||
|
/re { 4 2 roll moveto 1 index 0 rlineto 0 exch rlineto
|
||||||
|
neg 0 rlineto closepath } def
|
||||||
|
/h { closepath } def
|
||||||
|
% path painting operators
|
||||||
|
/S { sCol stroke } def
|
||||||
|
/Sf { fCol stroke } def
|
||||||
|
/f { fCol fill } def
|
||||||
|
/f* { fCol eofill } def
|
||||||
|
% clipping operators
|
||||||
|
/W { clip newpath } def
|
||||||
|
/W* { eoclip newpath } def
|
||||||
|
/Ws { strokepath clip newpath } def
|
||||||
|
% text state operators
|
||||||
|
/Tc { /pdfCharSpacing exch def } def
|
||||||
|
/Tf { dup /pdfFontSize exch def
|
||||||
|
dup pdfHorizScaling mul exch matrix scale
|
||||||
|
pdfTextMat matrix concatmatrix dup 4 0 put dup 5 0 put
|
||||||
|
exch findfont exch makefont setfont } def
|
||||||
|
/Tr { /pdfTextRender exch def } def
|
||||||
|
/Tp { /pdfPatternCS exch def } def
|
||||||
|
/Ts { /pdfTextRise exch def } def
|
||||||
|
/Tw { /pdfWordSpacing exch def } def
|
||||||
|
/Tz { /pdfHorizScaling exch def } def
|
||||||
|
% text positioning operators
|
||||||
|
/Td { pdfTextMat transform moveto } def
|
||||||
|
/Tm { /pdfTextMat exch def } def
|
||||||
|
% text string operators
|
||||||
|
/xyshow where {
|
||||||
|
pop
|
||||||
|
/xyshow2 {
|
||||||
|
dup length array
|
||||||
|
0 2 2 index length 1 sub {
|
||||||
|
2 index 1 index 2 copy get 3 1 roll 1 add get
|
||||||
|
pdfTextMat dtransform
|
||||||
|
4 2 roll 2 copy 6 5 roll put 1 add 3 1 roll dup 4 2 roll put
|
||||||
|
} for
|
||||||
|
exch pop
|
||||||
|
xyshow
|
||||||
|
} def
|
||||||
|
}{
|
||||||
|
/xyshow2 {
|
||||||
|
currentfont /FontType get 0 eq {
|
||||||
|
0 2 3 index length 1 sub {
|
||||||
|
currentpoint 4 index 3 index 2 getinterval show moveto
|
||||||
|
2 copy get 2 index 3 2 roll 1 add get
|
||||||
|
pdfTextMat dtransform rmoveto
|
||||||
|
} for
|
||||||
|
} {
|
||||||
|
0 1 3 index length 1 sub {
|
||||||
|
currentpoint 4 index 3 index 1 getinterval show moveto
|
||||||
|
2 copy 2 mul get 2 index 3 2 roll 2 mul 1 add get
|
||||||
|
pdfTextMat dtransform rmoveto
|
||||||
|
} for
|
||||||
|
} ifelse
|
||||||
|
pop pop
|
||||||
|
} def
|
||||||
|
} ifelse
|
||||||
|
/cshow where {
|
||||||
|
pop
|
||||||
|
/xycp {
|
||||||
|
0 3 2 roll
|
||||||
|
{
|
||||||
|
pop pop currentpoint 3 2 roll
|
||||||
|
1 string dup 0 4 3 roll put false charpath moveto
|
||||||
|
2 copy get 2 index 2 index 1 add get
|
||||||
|
pdfTextMat dtransform rmoveto
|
||||||
|
2 add
|
||||||
|
} exch cshow
|
||||||
|
pop pop
|
||||||
|
} def
|
||||||
|
}{
|
||||||
|
/xycp {
|
||||||
|
currentfont /FontType get 0 eq {
|
||||||
|
0 2 3 index length 1 sub {
|
||||||
|
currentpoint 4 index 3 index 2 getinterval false charpath moveto
|
||||||
|
2 copy get 2 index 3 2 roll 1 add get
|
||||||
|
pdfTextMat dtransform rmoveto
|
||||||
|
} for
|
||||||
|
} {
|
||||||
|
0 1 3 index length 1 sub {
|
||||||
|
currentpoint 4 index 3 index 1 getinterval false charpath moveto
|
||||||
|
2 copy 2 mul get 2 index 3 2 roll 2 mul 1 add get
|
||||||
|
pdfTextMat dtransform rmoveto
|
||||||
|
} for
|
||||||
|
} ifelse
|
||||||
|
pop pop
|
||||||
|
} def
|
||||||
|
} ifelse
|
||||||
|
/Tj {
|
||||||
|
fCol
|
||||||
|
0 pdfTextRise pdfTextMat dtransform rmoveto
|
||||||
|
currentpoint 4 2 roll
|
||||||
|
pdfTextRender 1 and 0 eq {
|
||||||
|
2 copy xyshow2
|
||||||
|
} if
|
||||||
|
pdfTextRender 3 and dup 1 eq exch 2 eq or {
|
||||||
|
3 index 3 index moveto
|
||||||
|
2 copy
|
||||||
|
currentfont /FontType get 3 eq { fCol } { sCol } ifelse
|
||||||
|
xycp currentpoint stroke moveto
|
||||||
|
} if
|
||||||
|
pdfTextRender 4 and 0 ne {
|
||||||
|
4 2 roll moveto xycp
|
||||||
|
/pdfTextClipPath [ pdfTextClipPath aload pop
|
||||||
|
{/moveto cvx}
|
||||||
|
{/lineto cvx}
|
||||||
|
{/curveto cvx}
|
||||||
|
{/closepath cvx}
|
||||||
|
pathforall ] def
|
||||||
|
currentpoint newpath moveto
|
||||||
|
} {
|
||||||
|
pop pop pop pop
|
||||||
|
} ifelse
|
||||||
|
0 pdfTextRise neg pdfTextMat dtransform rmoveto
|
||||||
|
} def
|
||||||
|
/TJm { 0.001 mul pdfFontSize mul pdfHorizScaling mul neg 0
|
||||||
|
pdfTextMat dtransform rmoveto } def
|
||||||
|
/TJmV { 0.001 mul pdfFontSize mul neg 0 exch
|
||||||
|
pdfTextMat dtransform rmoveto } def
|
||||||
|
/Tclip { pdfTextClipPath cvx exec clip newpath
|
||||||
|
/pdfTextClipPath [] def } def
|
||||||
|
/Tclip* { pdfTextClipPath cvx exec eoclip newpath
|
||||||
|
/pdfTextClipPath [] def } def
|
||||||
|
% Level 2/3 image operators
|
||||||
|
/pdfImBuf 100 string def
|
||||||
|
/pdfImStr {
|
||||||
|
2 copy exch length lt {
|
||||||
|
2 copy get exch 1 add exch
|
||||||
|
} {
|
||||||
|
()
|
||||||
|
} ifelse
|
||||||
|
} def
|
||||||
|
/skipEOD {
|
||||||
|
{ currentfile pdfImBuf readline
|
||||||
|
not { pop exit } if
|
||||||
|
(%-EOD-) eq { exit } if } loop
|
||||||
|
} def
|
||||||
|
/pdfIm { image skipEOD } def
|
||||||
|
/pdfImM { fCol imagemask skipEOD } def
|
||||||
|
/pr { 2 index 2 index 3 2 roll putinterval 4 add } def
|
||||||
|
/pdfImClip {
|
||||||
|
gsave
|
||||||
|
0 2 4 index length 1 sub {
|
||||||
|
dup 4 index exch 2 copy
|
||||||
|
get 5 index div put
|
||||||
|
1 add 3 index exch 2 copy
|
||||||
|
get 3 index div put
|
||||||
|
} for
|
||||||
|
pop pop rectclip
|
||||||
|
} def
|
||||||
|
/pdfImClipEnd { grestore } def
|
||||||
|
% shading operators
|
||||||
|
/colordelta {
|
||||||
|
false 0 1 3 index length 1 sub {
|
||||||
|
dup 4 index exch get 3 index 3 2 roll get sub abs 0.004 gt {
|
||||||
|
pop true
|
||||||
|
} if
|
||||||
|
} for
|
||||||
|
exch pop exch pop
|
||||||
|
} def
|
||||||
|
/funcCol { func n array astore } def
|
||||||
|
/funcSH {
|
||||||
|
dup 0 eq {
|
||||||
|
true
|
||||||
|
} {
|
||||||
|
dup 6 eq {
|
||||||
|
false
|
||||||
|
} {
|
||||||
|
4 index 4 index funcCol dup
|
||||||
|
6 index 4 index funcCol dup
|
||||||
|
3 1 roll colordelta 3 1 roll
|
||||||
|
5 index 5 index funcCol dup
|
||||||
|
3 1 roll colordelta 3 1 roll
|
||||||
|
6 index 8 index funcCol dup
|
||||||
|
3 1 roll colordelta 3 1 roll
|
||||||
|
colordelta or or or
|
||||||
|
} ifelse
|
||||||
|
} ifelse
|
||||||
|
{
|
||||||
|
1 add
|
||||||
|
4 index 3 index add 0.5 mul exch 4 index 3 index add 0.5 mul exch
|
||||||
|
6 index 6 index 4 index 4 index 4 index funcSH
|
||||||
|
2 index 6 index 6 index 4 index 4 index funcSH
|
||||||
|
6 index 2 index 4 index 6 index 4 index funcSH
|
||||||
|
5 3 roll 3 2 roll funcSH pop pop
|
||||||
|
} {
|
||||||
|
pop 3 index 2 index add 0.5 mul 3 index 2 index add 0.5 mul
|
||||||
|
funcCol sc
|
||||||
|
dup 4 index exch mat transform m
|
||||||
|
3 index 3 index mat transform l
|
||||||
|
1 index 3 index mat transform l
|
||||||
|
mat transform l pop pop h f*
|
||||||
|
} ifelse
|
||||||
|
} def
|
||||||
|
/axialCol {
|
||||||
|
dup 0 lt {
|
||||||
|
pop t0
|
||||||
|
} {
|
||||||
|
dup 1 gt {
|
||||||
|
pop t1
|
||||||
|
} {
|
||||||
|
dt mul t0 add
|
||||||
|
} ifelse
|
||||||
|
} ifelse
|
||||||
|
func n array astore
|
||||||
|
} def
|
||||||
|
/axialSH {
|
||||||
|
dup 0 eq {
|
||||||
|
true
|
||||||
|
} {
|
||||||
|
dup 8 eq {
|
||||||
|
false
|
||||||
|
} {
|
||||||
|
2 index axialCol 2 index axialCol colordelta
|
||||||
|
} ifelse
|
||||||
|
} ifelse
|
||||||
|
{
|
||||||
|
1 add 3 1 roll 2 copy add 0.5 mul
|
||||||
|
dup 4 3 roll exch 4 index axialSH
|
||||||
|
exch 3 2 roll axialSH
|
||||||
|
} {
|
||||||
|
pop 2 copy add 0.5 mul
|
||||||
|
axialCol sc
|
||||||
|
exch dup dx mul x0 add exch dy mul y0 add
|
||||||
|
3 2 roll dup dx mul x0 add exch dy mul y0 add
|
||||||
|
dx abs dy abs ge {
|
||||||
|
2 copy yMin sub dy mul dx div add yMin m
|
||||||
|
yMax sub dy mul dx div add yMax l
|
||||||
|
2 copy yMax sub dy mul dx div add yMax l
|
||||||
|
yMin sub dy mul dx div add yMin l
|
||||||
|
h f*
|
||||||
|
} {
|
||||||
|
exch 2 copy xMin sub dx mul dy div add xMin exch m
|
||||||
|
xMax sub dx mul dy div add xMax exch l
|
||||||
|
exch 2 copy xMax sub dx mul dy div add xMax exch l
|
||||||
|
xMin sub dx mul dy div add xMin exch l
|
||||||
|
h f*
|
||||||
|
} ifelse
|
||||||
|
} ifelse
|
||||||
|
} def
|
||||||
|
/radialCol {
|
||||||
|
dup t0 lt {
|
||||||
|
pop t0
|
||||||
|
} {
|
||||||
|
dup t1 gt {
|
||||||
|
pop t1
|
||||||
|
} if
|
||||||
|
} ifelse
|
||||||
|
func n array astore
|
||||||
|
} def
|
||||||
|
/radialSH {
|
||||||
|
dup 0 eq {
|
||||||
|
true
|
||||||
|
} {
|
||||||
|
dup 8 eq {
|
||||||
|
false
|
||||||
|
} {
|
||||||
|
2 index dt mul t0 add radialCol
|
||||||
|
2 index dt mul t0 add radialCol colordelta
|
||||||
|
} ifelse
|
||||||
|
} ifelse
|
||||||
|
{
|
||||||
|
1 add 3 1 roll 2 copy add 0.5 mul
|
||||||
|
dup 4 3 roll exch 4 index radialSH
|
||||||
|
exch 3 2 roll radialSH
|
||||||
|
} {
|
||||||
|
pop 2 copy add 0.5 mul dt mul t0 add
|
||||||
|
radialCol sc
|
||||||
|
encl {
|
||||||
|
exch dup dx mul x0 add exch dup dy mul y0 add exch dr mul r0 add
|
||||||
|
0 360 arc h
|
||||||
|
dup dx mul x0 add exch dup dy mul y0 add exch dr mul r0 add
|
||||||
|
360 0 arcn h f
|
||||||
|
} {
|
||||||
|
2 copy
|
||||||
|
dup dx mul x0 add exch dup dy mul y0 add exch dr mul r0 add
|
||||||
|
a1 a2 arcn
|
||||||
|
dup dx mul x0 add exch dup dy mul y0 add exch dr mul r0 add
|
||||||
|
a2 a1 arcn h
|
||||||
|
dup dx mul x0 add exch dup dy mul y0 add exch dr mul r0 add
|
||||||
|
a1 a2 arc
|
||||||
|
dup dx mul x0 add exch dup dy mul y0 add exch dr mul r0 add
|
||||||
|
a2 a1 arc h f
|
||||||
|
} ifelse
|
||||||
|
} ifelse
|
||||||
|
} def
|
||||||
|
end
|
||||||
|
%%EndResource
|
||||||
|
%%EndProlog
|
||||||
|
%%BeginSetup
|
||||||
|
xpdf begin
|
||||||
|
%%EndSetup
|
||||||
|
pdfStartPage
|
||||||
|
[] 0 d
|
||||||
|
1 i
|
||||||
|
0 j
|
||||||
|
0 J
|
||||||
|
10 M
|
||||||
|
1 w
|
||||||
|
/DeviceGray {} cs
|
||||||
|
[0] sc
|
||||||
|
/DeviceGray {} CS
|
||||||
|
[0] SC
|
||||||
|
false op
|
||||||
|
false OP
|
||||||
|
{} settransfer
|
||||||
|
0 0 32 32 re
|
||||||
|
W
|
||||||
|
q
|
||||||
|
/DeviceRGB {} cs
|
||||||
|
[0 0 0] sc
|
||||||
|
/DeviceRGB {} CS
|
||||||
|
[0 0 0] SC
|
||||||
|
[1 0 0 -1 0 32] cm
|
||||||
|
q
|
||||||
|
q
|
||||||
|
Q
|
||||||
|
Q
|
||||||
|
q
|
||||||
|
q
|
||||||
|
q
|
||||||
|
[1 0 0 1 0 0] cm
|
||||||
|
[32 0 0 -32 0 32] cm
|
||||||
|
/DeviceRGB setcolorspace
|
||||||
|
<<
|
||||||
|
/ImageType 1
|
||||||
|
/Width 32
|
||||||
|
/Height 32
|
||||||
|
/ImageMatrix [32 0 0 -32 0 32]
|
||||||
|
/BitsPerComponent 8
|
||||||
|
/Decode [0 1 0 1 0 1]
|
||||||
|
/DataSource currentfile
|
||||||
|
/ASCII85Decode filter
|
||||||
|
<< >> /DCTDecode filter
|
||||||
|
>>
|
||||||
|
pdfIm
|
||||||
|
s4IA0!"_al8O`[\!<E0k!([(is4[N@!!30%!W`<'!WiE)!WiE*"Tni/!s8`1"9Sf4
|
||||||
|
"pYA<"pYA=#n%%F#RUhB#7:nI$4@7N$k*@I%M'!W%LW[R%0,&^6NI5i!WrN,"p4r3
|
||||||
|
$j[(D$k*OQ$k*OQ$k*OQ$k*OQ$k*OQ$k*OQ$k*OQ$k*OQ$k*OQ$k*OQ$k*OQ$k*OQ
|
||||||
|
$k30O!"fJ:+93Md!?qLF&HMtG!WU(<*rl9A"T\W)!<E3$z!!!!"!WrQ/"pYD?$4Hm
|
||||||
|
P!4<@<!W`B*!X&T/"U"r.!!.KK!WrE*&Hrdj0gQ!W;.0\RE>10ZOeE%*6F"?A;UOt
|
||||||
|
Z1LbBV#mqFa(`=5<-7:2j.Ps"@2`NfY6UX@47n?3D;cHat='/U/@q9._B4u!oF*)P
|
||||||
|
JGBeCZK7nr5LPUeEP*;,qQC!u,R\HRQV5C/hWN*81['d?O\@K2f_o0O6a2lBFdaQ^
|
||||||
|
rf%8R-g>V&OjQ5OekiqC&o(2MHp@n@XqZ"J6*ru?D!<E3%!<E3%!<<*"!!!!"!WrQ
|
||||||
|
/"pYD?$4HmP!4<C=!W`?*"9Sc3"U"r.!<RHF!<N?8"9fr'"qj4!#@VTc+u4]T'LIq
|
||||||
|
UZ,$_k1K*]W@WKj'(*k`q-1Mcg)&ahL-n-W'2E*TU3^Z;(7Rp!@8lJ\h<``C+>%;)
|
||||||
|
SAnPdkC3+K>G'A1VH@gd&KnbA=M2II[Pa.Q$R$jD;USO``Vl6SpZEppG[^WcW]#)A
|
||||||
|
'`Q#s>ai`&\eCE.%f\,!<j5f=akNM0qo(2MHp@n@XqZ#7L$j-M1!YGMH!'^J^[J7H
|
||||||
|
*)od=>n_Shppj9lmgH&*&Z5`-0!&G^+@?%=sWQn:&Z!JmV>Q3<j(;FIbL>(78UA/^
|
||||||
|
<WG/37&CF$Q0s_&>N/i2JRek1>=8iOIiX'uaq]C(*rY9%6hVL.U[YF1+o2#E2rZgV
|
||||||
|
fAtg!5rLlk%;jl*n<+SZT8_SR;=skUV066U1.p=mFr6"gf2][jPofDZ&\`7@/-r'!
|
||||||
|
;,l&`4))eYGD-KF%4Q#*6m7m-&ibs?(?PB?TXYaa<m(u:lbhFsTbaCt4hKdqnoWN-
|
||||||
|
,-f^7-GbXos*uB0>%2C(@*]]s]E087&>\*L"WW)s0NHRN"Ia3BM^PX0A?"k)FD":7
|
||||||
|
Zape3'Q25[,qME[RXmKi%7R$RY-ahd^2Mq#oHbDPloej\L\<u;(;Pe(roA.6'\>ps
|
||||||
|
H'BN#QqXg'$f%32o+9)<E*7qSo%=Z>=0tktVb?\UUL)@Rm9:'aT6=iISQ2.kIjQ"\
|
||||||
|
%_ROO<=2Wb\MS98hQG^TuG$9X6EFe(Kg?r;t$)Qpec%CS=pnp0%dOlMsGLMhk<;`4
|
||||||
|
`K1YFe4Dk#>F*pbBZ'QZsG'6YnmBb4>:XPI-!+d5f%ibMn4q,rTa=JCm8q9KN(pJ_
|
||||||
|
E6F)2g+:rKf>4``l^LjY[CVCPY(ZDD*'3X"&qXqOb/bQNI^2+A(eWj>@,<bR&bn,Q
|
||||||
|
e'afdE[n5C'ffj+UH1OZ,hW)L6\hS>-V.Fe`[b"_:aa,33f`~>
|
||||||
|
%-EOD-
|
||||||
|
Q
|
||||||
|
Q
|
||||||
|
Q
|
||||||
|
Q
|
||||||
|
showpage
|
||||||
|
%%PageTrailer
|
||||||
|
pdfEndPage
|
||||||
|
%%Trailer
|
||||||
|
end
|
||||||
|
%%DocumentSuppliedResources:
|
||||||
|
%%EOF
|
BIN
autotests/write/rgb.jp2
Normal file
BIN
autotests/write/rgb.pcx
Normal file
BIN
autotests/write/rgb.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
autotests/write/rgb.rgb
Normal file
BIN
autotests/write/rgb.tga
Normal file
After Width: | Height: | Size: 3.0 KiB |
6
autotests/write/rgb.xv
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
P7 332
|
||||||
|
#XVVERSION:
|
||||||
|
#IMGINFO:
|
||||||
|
#END_OF_COMMENTS:
|
||||||
|
32 32 255
|
||||||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ۻ<EFBFBD><EFBFBD>ݾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>~<7E>{<7B><><EFBFBD>پ<EFBFBD><D9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ۏW<DB8F>ܼ~>vjn<6A><6E>q]Z<17><><EFBFBD><EFBFBD>];<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ۏW}<7D>ܝ?>>rf'Kʲ~z7v<37><76><EFBFBD>~?<3F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ۻ<EFBFBD><DBBB><EFBFBD>߿<EFBFBD><DFBF><EFBFBD><EFBFBD>gk<67><6B><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߿<EFBFBD><DFBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>o<EFBFBD><6F><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>{[<5B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>~}~<7E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҋ<EFBFBD><D28A><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>v<EFBFBD><76><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>y<EFBFBD><79><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>j<EFBFBD><6A><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>oO<><4F><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>oNR<4E><52><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֕<EFBFBD><D695><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>~~<7E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><DEB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>qq<71><71><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>++<2B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ۓ<EFBFBD><DB93><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
BIN
autotests/write/rgba.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
autotests/write/rgba.tga
Normal file
After Width: | Height: | Size: 4.0 KiB |
BIN
autotests/write/rgba.xv
Normal file
170
autotests/writetest.cpp
Normal file
@ -0,0 +1,170 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2014 Alex Merry <alex.merry@kdemail.net>
|
||||||
|
*
|
||||||
|
* 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.1 of the License, or (at your option) version 3, or any
|
||||||
|
* later version accepted by the membership of KDE e.V. (or its
|
||||||
|
* successor approved by the membership of KDE e.V.), which shall
|
||||||
|
* act as a proxy defined in Section 6 of version 3 of the license.
|
||||||
|
*
|
||||||
|
* 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, see
|
||||||
|
* <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#include <QBuffer>
|
||||||
|
#include <QCommandLineParser>
|
||||||
|
#include <QCoreApplication>
|
||||||
|
#include <QDir>
|
||||||
|
#include <QFileInfo>
|
||||||
|
#include <QImage>
|
||||||
|
#include <QImageReader>
|
||||||
|
#include <QImageWriter>
|
||||||
|
#include <QTextStream>
|
||||||
|
|
||||||
|
int main(int argc, char ** argv)
|
||||||
|
{
|
||||||
|
QCoreApplication app(argc, argv);
|
||||||
|
QCoreApplication::addLibraryPath(QStringLiteral(PLUGIN_DIR));
|
||||||
|
QCoreApplication::setApplicationName(QStringLiteral("readtest"));
|
||||||
|
QCoreApplication::setApplicationVersion(QStringLiteral("1.0.0"));
|
||||||
|
|
||||||
|
QCommandLineParser parser;
|
||||||
|
parser.setApplicationDescription(QStringLiteral("Performs basic image conversion checking."));
|
||||||
|
parser.addHelpOption();
|
||||||
|
parser.addVersionOption();
|
||||||
|
parser.addPositionalArgument(QStringLiteral("format"), QStringLiteral("format to test."));
|
||||||
|
QCommandLineOption lossless(
|
||||||
|
QStringList() << QStringLiteral("l") << QStringLiteral("lossless"),
|
||||||
|
QStringLiteral("Check that reading back the data gives the same image."));
|
||||||
|
parser.addOption(lossless);
|
||||||
|
|
||||||
|
parser.process(app);
|
||||||
|
|
||||||
|
const QStringList args = parser.positionalArguments();
|
||||||
|
if (args.count() < 1) {
|
||||||
|
QTextStream(stderr) << "Must provide a format\n";
|
||||||
|
parser.showHelp(1);
|
||||||
|
} else if (args.count() > 1) {
|
||||||
|
QTextStream(stderr) << "Too many arguments\n";
|
||||||
|
parser.showHelp(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
QString suffix = args.at(0);
|
||||||
|
QByteArray format = suffix.toLatin1();
|
||||||
|
|
||||||
|
QDir imgdir(QStringLiteral(IMAGEDIR));
|
||||||
|
imgdir.setNameFilters(QStringList(QLatin1String("*.") + suffix));
|
||||||
|
imgdir.setFilter(QDir::Files);
|
||||||
|
|
||||||
|
int passed = 0;
|
||||||
|
int failed = 0;
|
||||||
|
|
||||||
|
QTextStream(stdout) << "********* "
|
||||||
|
<< "Starting basic write tests for "
|
||||||
|
<< suffix << " images *********\n";
|
||||||
|
|
||||||
|
foreach (QFileInfo fi, imgdir.entryInfoList()) {
|
||||||
|
int suffixPos = fi.filePath().count() - suffix.count();
|
||||||
|
QString pngfile = fi.filePath().replace(suffixPos, suffix.count(), "png");
|
||||||
|
QString pngfilename = QFileInfo(pngfile).fileName();
|
||||||
|
|
||||||
|
QImageReader pngReader(pngfile, "png");
|
||||||
|
QImage pngImage;
|
||||||
|
if (!pngReader.read(&pngImage)) {
|
||||||
|
QTextStream(stdout) << "ERROR: " << fi.fileName()
|
||||||
|
<< ": could not load " << pngfilename
|
||||||
|
<< ": " << pngReader.errorString()
|
||||||
|
<< "\n";
|
||||||
|
++failed;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
QFile expFile(fi.filePath());
|
||||||
|
if (!expFile.open(QIODevice::ReadOnly)) {
|
||||||
|
QTextStream(stdout) << "ERROR: " << fi.fileName()
|
||||||
|
<< ": could not open " << fi.fileName()
|
||||||
|
<< ": " << expFile.errorString()
|
||||||
|
<< "\n";
|
||||||
|
++failed;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
QByteArray expData = expFile.readAll();
|
||||||
|
if (expData.isEmpty()) {
|
||||||
|
// check if there was actually anything to read
|
||||||
|
expFile.reset();
|
||||||
|
char buf[1];
|
||||||
|
qint64 result = expFile.read(buf, 1);
|
||||||
|
if (result < 0) {
|
||||||
|
QTextStream(stdout) << "ERROR: " << fi.fileName()
|
||||||
|
<< ": could not load " << fi.fileName()
|
||||||
|
<< ": " << expFile.errorString()
|
||||||
|
<< "\n";
|
||||||
|
++failed;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
QByteArray writtenData;
|
||||||
|
{
|
||||||
|
QBuffer buffer(&writtenData);
|
||||||
|
QImageWriter imgWriter(&buffer, format.constData());
|
||||||
|
if (!imgWriter.write(pngImage)) {
|
||||||
|
QTextStream(stdout) << "FAIL : " << fi.fileName()
|
||||||
|
<< ": failed to write image data\n";
|
||||||
|
++failed;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (expData != writtenData) {
|
||||||
|
QTextStream(stdout) << "FAIL : " << fi.fileName()
|
||||||
|
<< ": written data differs from " << fi.fileName() << "\n";
|
||||||
|
++failed;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
QImage reReadImage;
|
||||||
|
{
|
||||||
|
QBuffer buffer(&writtenData);
|
||||||
|
QImageReader imgReader(&buffer, format.constData());
|
||||||
|
if (!imgReader.read(&reReadImage)) {
|
||||||
|
QTextStream(stdout) << "FAIL : " << fi.fileName()
|
||||||
|
<< ": could not read back the written data\n";
|
||||||
|
++failed;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
reReadImage = reReadImage.convertToFormat(pngImage.format());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (parser.isSet(lossless)) {
|
||||||
|
if (pngImage != reReadImage) {
|
||||||
|
QTextStream(stdout) << "FAIL : " << fi.fileName()
|
||||||
|
<< ": re-reading the data resulted in a different image\n";
|
||||||
|
++failed;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
QTextStream(stdout) << "PASS : " << fi.fileName() << "\n";
|
||||||
|
++passed;
|
||||||
|
}
|
||||||
|
|
||||||
|
QTextStream(stdout) << "Totals: "
|
||||||
|
<< passed << " passed, "
|
||||||
|
<< failed << " failed\n";
|
||||||
|
QTextStream(stdout) << "********* "
|
||||||
|
<< "Finished basic write tests for "
|
||||||
|
<< suffix << " images *********\n";
|
||||||
|
|
||||||
|
return failed == 0 ? 0 : 1;
|
||||||
|
}
|
@ -1,103 +0,0 @@
|
|||||||
# Try to find the OpenEXR libraries
|
|
||||||
#
|
|
||||||
# This will define:
|
|
||||||
#
|
|
||||||
# OpenEXR_FOUND - True if OpenEXR is available
|
|
||||||
# OpenEXR_LIBRARIES - Link to these to use OpenEXR
|
|
||||||
# OpenEXR_INCLUDE_DIRS - Include directory for OpenEXR
|
|
||||||
# OpenEXR_DEFINITIONS - Compiler flags required to link against OpenEXR
|
|
||||||
#
|
|
||||||
# Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org>
|
|
||||||
# Copyright (c) 2013, Alex Merry, <alex.merry@kdemail.net>
|
|
||||||
#
|
|
||||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
|
||||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
|
||||||
|
|
||||||
# use pkg-config to get the directories and then use these values
|
|
||||||
# in the FIND_PATH() and FIND_LIBRARY() calls
|
|
||||||
find_package(PkgConfig)
|
|
||||||
pkg_check_modules(PC_OpenEXR QUIET OpenEXR)
|
|
||||||
|
|
||||||
set(OpenEXR_DEFINITIONS ${PC_OpenEXR_CFLAGS_OTHER})
|
|
||||||
|
|
||||||
find_path(OpenEXR_INCLUDE_DIR ImfRgbaFile.h
|
|
||||||
PATHS
|
|
||||||
${PC_OpenEXR_INCLUDEDIR}
|
|
||||||
${PC_OpenEXR_INCLUDE_DIRS}
|
|
||||||
PATH_SUFFIXES OpenEXR
|
|
||||||
)
|
|
||||||
|
|
||||||
# Required libraries for OpenEXR
|
|
||||||
find_library(OpenEXR_HALF_LIBRARY NAMES Half
|
|
||||||
PATHS
|
|
||||||
${PC_OpenEXR_LIBDIR}
|
|
||||||
${PC_OpenEXR_LIBRARY_DIRS}
|
|
||||||
)
|
|
||||||
find_library(OpenEXR_IEX_LIBRARY NAMES Iex
|
|
||||||
PATHS
|
|
||||||
${PC_OpenEXR_LIBDIR}
|
|
||||||
${PC_OpenEXR_LIBRARY_DIRS}
|
|
||||||
)
|
|
||||||
find_library(OpenEXR_IMATH_LIBRARY NAMES Imath
|
|
||||||
PATHS
|
|
||||||
${PC_OpenEXR_LIBDIR}
|
|
||||||
${PC_OpenEXR_LIBRARY_DIRS}
|
|
||||||
)
|
|
||||||
find_library(OpenEXR_ILMTHREAD_LIBRARY NAMES IlmThread
|
|
||||||
PATHS
|
|
||||||
${PC_OpenEXR_LIBDIR}
|
|
||||||
${PC_OpenEXR_LIBRARY_DIRS}
|
|
||||||
)
|
|
||||||
# This is the actual OpenEXR library
|
|
||||||
find_library(OpenEXR_ILMIMF_LIBRARY NAMES IlmImf
|
|
||||||
PATHS
|
|
||||||
${PC_OpenEXR_LIBDIR}
|
|
||||||
${PC_OpenEXR_LIBRARY_DIRS}
|
|
||||||
)
|
|
||||||
|
|
||||||
set(OpenEXR_LIBRARIES
|
|
||||||
${OpenEXR_HALF_LIBRARY}
|
|
||||||
${OpenEXR_IEX_LIBRARY}
|
|
||||||
${OpenEXR_IMATH_LIBRARY}
|
|
||||||
${OpenEXR_ILMIMF_LIBRARY}
|
|
||||||
${OpenEXR_ILMTHREAD_LIBRARY})
|
|
||||||
|
|
||||||
if (OpenEXR_INCLUDE_DIR AND EXISTS "${OpenEXR_INCLUDE_DIR}/OpenEXRConfig.h")
|
|
||||||
file(STRINGS "${OpenEXR_INCLUDE_DIR}/OpenEXRConfig.h" openexr_version_str
|
|
||||||
REGEX "^#define[\t ]+OPENEXR_VERSION_STRING[\t ]+\"[^\"]*\"")
|
|
||||||
string(REGEX REPLACE "^#define[\t ]+OPENEXR_VERSION_STRING[\t ]+\"([^\"]*).*"
|
|
||||||
"\\1" OpenEXR_VERSION_STRING "${openexr_version_str}")
|
|
||||||
unset(openexr_version_str)
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
include(FindPackageHandleStandardArgs)
|
|
||||||
# find_package_handle_standard_args reports the value of the first variable
|
|
||||||
# on success, so make sure this is the actual OpenEXR library
|
|
||||||
find_package_handle_standard_args(OpenEXR
|
|
||||||
FOUND_VAR OpenEXR_FOUND
|
|
||||||
REQUIRED_VARS
|
|
||||||
OpenEXR_ILMIMF_LIBRARY
|
|
||||||
OpenEXR_HALF_LIBRARY
|
|
||||||
OpenEXR_IEX_LIBRARY
|
|
||||||
OpenEXR_IMATH_LIBRARY
|
|
||||||
OpenEXR_ILMTHREAD_LIBRARY
|
|
||||||
OpenEXR_INCLUDE_DIR
|
|
||||||
VERSION_VAR OpenEXR_VERSION_STRING)
|
|
||||||
|
|
||||||
set(OpenEXR_INCLUDE_DIRS ${OpenEXR_INCLUDE_DIR})
|
|
||||||
|
|
||||||
include(FeatureSummary)
|
|
||||||
set_package_properties(OpenEXR PROPERTIES
|
|
||||||
URL http://www.openexr.com/
|
|
||||||
DESCRIPTION "A library for reading and writing OpenEXR high dynamic-range image files")
|
|
||||||
|
|
||||||
mark_as_advanced(
|
|
||||||
OpenEXR_INCLUDE_DIR
|
|
||||||
OpenEXR_LIBRARIES
|
|
||||||
OpenEXR_DEFINITIONS
|
|
||||||
OpenEXR_ILMIMF_LIBRARY
|
|
||||||
OpenEXR_ILMTHREAD_LIBRARY
|
|
||||||
OpenEXR_IMATH_LIBRARY
|
|
||||||
OpenEXR_IEX_LIBRARY
|
|
||||||
OpenEXR_HALF_LIBRARY
|
|
||||||
)
|
|
@ -1 +0,0 @@
|
|||||||
tier: 1
|
|
12
metainfo.yaml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
maintainer: alexmerry
|
||||||
|
description: Image format plugins for Qt
|
||||||
|
tier: 1
|
||||||
|
type: functional
|
||||||
|
platforms:
|
||||||
|
- name: Linux
|
||||||
|
- name: MacOSX
|
||||||
|
- name: Windows
|
||||||
|
note: No EPS support on Windows
|
||||||
|
portingAid: false
|
||||||
|
deprecated: false
|
||||||
|
release: true
|
@ -1,161 +1,112 @@
|
|||||||
# NB: the desktop files are installed for the benefit of KImageIO in KDE4Support.
|
# NB: the desktop files are installed for the benefit of KImageIO in KDELibs4Support.
|
||||||
|
|
||||||
find_package(Jasper)
|
|
||||||
set_package_properties(Jasper PROPERTIES DESCRIPTION "Support for JPEG-2000 images"
|
|
||||||
URL "http://www.ece.uvic.ca/~mdadams/jasper"
|
|
||||||
TYPE OPTIONAL
|
|
||||||
)
|
|
||||||
|
|
||||||
find_package(OpenEXR)
|
|
||||||
set_package_properties(OpenEXR PROPERTIES
|
|
||||||
TYPE OPTIONAL
|
|
||||||
PURPOSE "QImage plugin for OpenEXR images"
|
|
||||||
)
|
|
||||||
|
|
||||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${KDE_ENABLE_EXCEPTIONS}")
|
|
||||||
|
|
||||||
configure_file(config-kimgio.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kimgio.h )
|
|
||||||
check_include_files(sys/types.h HAVE_SYS_TYPES_H)
|
|
||||||
check_include_files(stdint.h HAVE_STDINT_H)
|
|
||||||
|
|
||||||
if(JASPER_FOUND)
|
|
||||||
|
|
||||||
include_directories( ${JASPER_INCLUDE_DIR} )
|
|
||||||
set(kimg_jp2_LIB_SRCS jp2.cpp)
|
|
||||||
add_library(kimg_jp2 MODULE ${kimg_jp2_LIB_SRCS})
|
|
||||||
set_target_properties(kimg_jp2 PROPERTIES PREFIX "")
|
|
||||||
target_link_libraries(kimg_jp2 Qt5::Gui ${JASPER_LIBRARIES} )
|
|
||||||
|
|
||||||
install(TARGETS kimg_jp2 DESTINATION ${QT_PLUGIN_INSTALL_DIR}/imageformats/ )
|
|
||||||
install(FILES jp2.desktop DESTINATION ${SERVICES_INSTALL_DIR}/qimageioplugins/ )
|
|
||||||
|
|
||||||
endif()
|
|
||||||
|
|
||||||
##################################
|
##################################
|
||||||
|
|
||||||
# EPS support depends on the gs utility; non-UNIX systems are unlikely to have
|
if (Qt5Gui_VERSION VERSION_LESS 5.3.0)
|
||||||
# this available in PATH
|
add_library(kimg_dds MODULE dds.cpp)
|
||||||
if (UNIX)
|
|
||||||
find_package(Qt5PrintSupport 5.2.0 NO_MODULE)
|
|
||||||
set_package_properties(Qt5PrintSupport PROPERTIES
|
|
||||||
DESCRIPTION "Support for Qt printing, necessary for the EPS format"
|
|
||||||
TYPE OPTIONAL
|
|
||||||
)
|
|
||||||
|
|
||||||
if (Qt5PrintSupport_FOUND)
|
|
||||||
set(kimg_eps_LIB_SRCS eps.cpp)
|
|
||||||
add_library(kimg_eps MODULE ${kimg_eps_LIB_SRCS})
|
|
||||||
set_target_properties(kimg_eps PROPERTIES PREFIX "")
|
|
||||||
target_link_libraries(kimg_eps Qt5::Gui Qt5::PrintSupport)
|
|
||||||
|
|
||||||
install(TARGETS kimg_eps DESTINATION ${QT_PLUGIN_INSTALL_DIR}/imageformats/)
|
|
||||||
install(FILES eps.desktop DESTINATION ${SERVICES_INSTALL_DIR}/qimageioplugins/)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
##################################
|
|
||||||
|
|
||||||
set(kimg_pcx_LIB_SRCS pcx.cpp)
|
|
||||||
add_library(kimg_pcx MODULE ${kimg_pcx_LIB_SRCS})
|
|
||||||
set_target_properties(kimg_pcx PROPERTIES PREFIX "")
|
|
||||||
target_link_libraries(kimg_pcx Qt5::Gui)
|
|
||||||
|
|
||||||
install(TARGETS kimg_pcx DESTINATION ${QT_PLUGIN_INSTALL_DIR}/imageformats/ )
|
|
||||||
install(FILES pcx.desktop DESTINATION ${SERVICES_INSTALL_DIR}/qimageioplugins/ )
|
|
||||||
|
|
||||||
##################################
|
|
||||||
|
|
||||||
set(kimg_tga_LIB_SRCS tga.cpp)
|
|
||||||
add_library(kimg_tga MODULE ${kimg_tga_LIB_SRCS})
|
|
||||||
set_target_properties(kimg_tga PROPERTIES PREFIX "")
|
|
||||||
target_link_libraries(kimg_tga Qt5::Gui)
|
|
||||||
|
|
||||||
install(TARGETS kimg_tga DESTINATION ${QT_PLUGIN_INSTALL_DIR}/imageformats/ )
|
|
||||||
install(FILES tga.desktop DESTINATION ${SERVICES_INSTALL_DIR}/qimageioplugins/ )
|
|
||||||
|
|
||||||
##################################
|
|
||||||
|
|
||||||
set(kimg_ras_LIB_SRCS ras.cpp)
|
|
||||||
add_library(kimg_ras MODULE ${kimg_ras_LIB_SRCS})
|
|
||||||
set_target_properties(kimg_ras PROPERTIES PREFIX "")
|
|
||||||
target_link_libraries(kimg_ras Qt5::Gui)
|
|
||||||
|
|
||||||
install(TARGETS kimg_ras DESTINATION ${QT_PLUGIN_INSTALL_DIR}/imageformats/ )
|
|
||||||
install(FILES ras.desktop DESTINATION ${SERVICES_INSTALL_DIR}/qimageioplugins/ )
|
|
||||||
|
|
||||||
##################################
|
|
||||||
|
|
||||||
set(kimg_rgb_LIB_SRCS rgb.cpp)
|
|
||||||
add_library(kimg_rgb MODULE ${kimg_rgb_LIB_SRCS})
|
|
||||||
set_target_properties(kimg_rgb PROPERTIES PREFIX "")
|
|
||||||
target_link_libraries(kimg_rgb Qt5::Gui)
|
|
||||||
|
|
||||||
install(TARGETS kimg_rgb DESTINATION ${QT_PLUGIN_INSTALL_DIR}/imageformats/ )
|
|
||||||
install(FILES rgb.desktop DESTINATION ${SERVICES_INSTALL_DIR}/qimageioplugins/ )
|
|
||||||
|
|
||||||
##################################
|
|
||||||
|
|
||||||
set(kimg_xcf_LIB_SRCS xcf.cpp)
|
|
||||||
add_library(kimg_xcf MODULE ${kimg_xcf_LIB_SRCS})
|
|
||||||
set_target_properties(kimg_xcf PROPERTIES PREFIX "")
|
|
||||||
target_link_libraries(kimg_xcf Qt5::Gui)
|
|
||||||
|
|
||||||
install(TARGETS kimg_xcf DESTINATION ${QT_PLUGIN_INSTALL_DIR}/imageformats/ )
|
|
||||||
install(FILES xcf.desktop DESTINATION ${SERVICES_INSTALL_DIR}/qimageioplugins/ )
|
|
||||||
|
|
||||||
##################################
|
|
||||||
|
|
||||||
set(kimg_dds_LIB_SRCS dds.cpp)
|
|
||||||
add_library(kimg_dds MODULE ${kimg_dds_LIB_SRCS})
|
|
||||||
set_target_properties(kimg_dds PROPERTIES PREFIX "")
|
|
||||||
target_link_libraries(kimg_dds Qt5::Gui)
|
target_link_libraries(kimg_dds Qt5::Gui)
|
||||||
|
|
||||||
install(TARGETS kimg_dds DESTINATION ${QT_PLUGIN_INSTALL_DIR}/imageformats/ )
|
install(TARGETS kimg_dds DESTINATION ${KDE_INSTALL_QTPLUGINDIR}/imageformats/)
|
||||||
install(FILES dds.desktop DESTINATION ${SERVICES_INSTALL_DIR}/qimageioplugins/ )
|
install(FILES dds.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR}/qimageioplugins/)
|
||||||
|
else()
|
||||||
|
install(FILES dds-qt.desktop RENAME dds.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR}/qimageioplugins/)
|
||||||
|
endif()
|
||||||
|
|
||||||
##################################
|
##################################
|
||||||
|
|
||||||
set(kimg_psd_LIB_SRCS psd.cpp)
|
if (BUILD_EPS_PLUGIN)
|
||||||
add_library(kimg_psd MODULE ${kimg_psd_LIB_SRCS})
|
if (Qt5PrintSupport_FOUND)
|
||||||
set_target_properties(kimg_psd PROPERTIES PREFIX "")
|
add_library(kimg_eps MODULE eps.cpp)
|
||||||
target_link_libraries(kimg_psd Qt5::Gui)
|
target_link_libraries(kimg_eps Qt5::Gui Qt5::PrintSupport)
|
||||||
|
|
||||||
install(TARGETS kimg_psd DESTINATION ${QT_PLUGIN_INSTALL_DIR}/imageformats/ )
|
install(TARGETS kimg_eps DESTINATION ${KDE_INSTALL_QTPLUGINDIR}/imageformats/)
|
||||||
install(FILES psd.desktop DESTINATION ${SERVICES_INSTALL_DIR}/qimageioplugins/ )
|
install(FILES eps.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR}/qimageioplugins/)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
##################################
|
##################################
|
||||||
|
|
||||||
set(kimg_xview_LIB_SRCS xview.cpp)
|
check_include_files(sys/types.h HAVE_SYS_TYPES_H)
|
||||||
add_library(kimg_xview MODULE ${kimg_xview_LIB_SRCS})
|
check_include_files(stdint.h HAVE_STDINT_H)
|
||||||
set_target_properties(kimg_xview PROPERTIES PREFIX "")
|
configure_file(config-jp2.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-jp2.h)
|
||||||
target_link_libraries(kimg_xview Qt5::Gui)
|
|
||||||
|
|
||||||
install(TARGETS kimg_xview DESTINATION ${QT_PLUGIN_INSTALL_DIR}/imageformats/ )
|
if(JASPER_FOUND)
|
||||||
install(FILES xv.desktop DESTINATION ${SERVICES_INSTALL_DIR}/qimageioplugins/ )
|
add_library(kimg_jp2 MODULE jp2.cpp)
|
||||||
|
target_compile_options(kimg_jp2 PRIVATE ${JASPER_DEFINITIONS})
|
||||||
|
target_include_directories(kimg_jp2 PRIVATE ${JASPER_INCLUDE_DIR})
|
||||||
|
target_link_libraries(kimg_jp2 Qt5::Gui ${JASPER_LIBRARIES})
|
||||||
|
|
||||||
|
install(TARGETS kimg_jp2 DESTINATION ${KDE_INSTALL_QTPLUGINDIR}/imageformats/)
|
||||||
|
install(FILES jp2.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR}/qimageioplugins/)
|
||||||
|
elseif (NOT Qt5Gui_VERSION VERSION_LESS 5.3.0)
|
||||||
|
# need this for Qt's version of the plugin
|
||||||
|
install(FILES jp2.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR}/qimageioplugins/)
|
||||||
|
endif()
|
||||||
|
|
||||||
##################################
|
##################################
|
||||||
|
|
||||||
if(OpenEXR_FOUND)
|
if(OpenEXR_FOUND)
|
||||||
|
add_library(kimg_exr MODULE exr.cpp)
|
||||||
|
target_link_libraries(kimg_exr Qt5::Gui OpenEXR::IlmImf)
|
||||||
|
kde_target_enable_exceptions(kimg_exr PRIVATE)
|
||||||
|
|
||||||
include_directories(${OpenEXR_INCLUDE_DIR})
|
install(TARGETS kimg_exr DESTINATION ${KDE_INSTALL_QTPLUGINDIR}/imageformats/)
|
||||||
add_definitions(${OpenEXR_DEFINITIONS})
|
install(FILES exr.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR}/qimageioplugins/)
|
||||||
set(kimg_exr_LIB_SRCS exr.cpp)
|
|
||||||
add_library(kimg_exr MODULE ${kimg_exr_LIB_SRCS})
|
|
||||||
set_target_properties(kimg_exr PROPERTIES PREFIX "")
|
|
||||||
target_link_libraries(kimg_exr Qt5::Gui ${OpenEXR_LIBRARIES})
|
|
||||||
|
|
||||||
install(TARGETS kimg_exr DESTINATION ${QT_PLUGIN_INSTALL_DIR}/imageformats/ )
|
|
||||||
install(FILES exr.desktop DESTINATION ${SERVICES_INSTALL_DIR}/qimageioplugins/ )
|
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
##################################
|
##################################
|
||||||
|
|
||||||
set(kimg_pic_LIB_SRCS pic_read.cpp pic_write.cpp pic.cpp)
|
add_library(kimg_pcx MODULE pcx.cpp)
|
||||||
add_library(kimg_pic MODULE ${kimg_pic_LIB_SRCS})
|
target_link_libraries(kimg_pcx Qt5::Gui)
|
||||||
set_target_properties(kimg_pic PROPERTIES PREFIX "")
|
|
||||||
|
install(TARGETS kimg_pcx DESTINATION ${KDE_INSTALL_QTPLUGINDIR}/imageformats/)
|
||||||
|
install(FILES pcx.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR}/qimageioplugins/)
|
||||||
|
|
||||||
|
##################################
|
||||||
|
|
||||||
|
add_library(kimg_pic MODULE pic.cpp)
|
||||||
target_link_libraries(kimg_pic Qt5::Gui)
|
target_link_libraries(kimg_pic Qt5::Gui)
|
||||||
|
|
||||||
install(TARGETS kimg_pic DESTINATION ${QT_PLUGIN_INSTALL_DIR}/imageformats/ )
|
install(TARGETS kimg_pic DESTINATION ${KDE_INSTALL_QTPLUGINDIR}/imageformats/)
|
||||||
install(FILES pic.desktop DESTINATION ${SERVICES_INSTALL_DIR}/qimageioplugins/ )
|
install(FILES pic.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR}/qimageioplugins/)
|
||||||
|
|
||||||
|
##################################
|
||||||
|
|
||||||
|
add_library(kimg_psd MODULE psd.cpp)
|
||||||
|
target_link_libraries(kimg_psd Qt5::Gui)
|
||||||
|
|
||||||
|
install(TARGETS kimg_psd DESTINATION ${KDE_INSTALL_QTPLUGINDIR}/imageformats/)
|
||||||
|
install(FILES psd.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR}/qimageioplugins/)
|
||||||
|
|
||||||
|
##################################
|
||||||
|
|
||||||
|
add_library(kimg_ras MODULE ras.cpp)
|
||||||
|
target_link_libraries(kimg_ras Qt5::Gui)
|
||||||
|
|
||||||
|
install(TARGETS kimg_ras DESTINATION ${KDE_INSTALL_QTPLUGINDIR}/imageformats/)
|
||||||
|
install(FILES ras.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR}/qimageioplugins/)
|
||||||
|
|
||||||
|
##################################
|
||||||
|
|
||||||
|
add_library(kimg_rgb MODULE rgb.cpp)
|
||||||
|
target_link_libraries(kimg_rgb Qt5::Gui)
|
||||||
|
|
||||||
|
install(TARGETS kimg_rgb DESTINATION ${KDE_INSTALL_QTPLUGINDIR}/imageformats/)
|
||||||
|
install(FILES rgb.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR}/qimageioplugins/)
|
||||||
|
|
||||||
|
##################################
|
||||||
|
|
||||||
|
add_library(kimg_tga MODULE tga.cpp)
|
||||||
|
target_link_libraries(kimg_tga Qt5::Gui)
|
||||||
|
|
||||||
|
install(TARGETS kimg_tga DESTINATION ${KDE_INSTALL_QTPLUGINDIR}/imageformats/)
|
||||||
|
install(FILES tga.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR}/qimageioplugins/)
|
||||||
|
|
||||||
|
##################################
|
||||||
|
|
||||||
|
add_library(kimg_xcf MODULE xcf.cpp)
|
||||||
|
target_link_libraries(kimg_xcf Qt5::Gui)
|
||||||
|
|
||||||
|
install(TARGETS kimg_xcf DESTINATION ${KDE_INSTALL_QTPLUGINDIR}/imageformats/)
|
||||||
|
install(FILES xcf.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR}/qimageioplugins/)
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
[Desktop Entry]
|
[Desktop Entry]
|
||||||
Type=Service
|
Type=Service
|
||||||
X-KDE-ServiceTypes=QImageIOPlugins
|
X-KDE-ServiceTypes=QImageIOPlugins
|
||||||
X-KDE-ImageFormat=xv
|
X-KDE-ImageFormat=dds
|
||||||
X-KDE-MimeType=
|
X-KDE-MimeType=image/x-dds
|
||||||
X-KDE-Read=true
|
X-KDE-Read=true
|
||||||
X-KDE-Write=true
|
X-KDE-Write=true
|
@ -19,7 +19,7 @@
|
|||||||
* rgb dds files only -- TODO
|
* rgb dds files only -- TODO
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "dds.h"
|
#include "dds_p.h"
|
||||||
|
|
||||||
#include <QtCore/QStringList>
|
#include <QtCore/QStringList>
|
||||||
#include <QImage>
|
#include <QImage>
|
||||||
|