summaryrefslogtreecommitdiffstats
path: root/plugins/src/imageformats/jpeg
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-11-08 12:31:36 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-11-08 12:31:36 -0600
commitd796c9dd933ab96ec83b9a634feedd5d32e1ba3f (patch)
tree6e3dcca4f77e20ec8966c666aac7c35bd4704053 /plugins/src/imageformats/jpeg
downloadtqt3-d796c9dd933ab96ec83b9a634feedd5d32e1ba3f.tar.gz
tqt3-d796c9dd933ab96ec83b9a634feedd5d32e1ba3f.zip
Test conversion to TQt3 from Qt3 8c6fc1f8e35fd264dd01c582ca5e7549b32ab731
Diffstat (limited to 'plugins/src/imageformats/jpeg')
-rw-r--r--plugins/src/imageformats/jpeg/jpeg.pro68
-rw-r--r--plugins/src/imageformats/jpeg/main.cpp76
2 files changed, 144 insertions, 0 deletions
diff --git a/plugins/src/imageformats/jpeg/jpeg.pro b/plugins/src/imageformats/jpeg/jpeg.pro
new file mode 100644
index 000000000..3bff1e098
--- /dev/null
+++ b/plugins/src/imageformats/jpeg/jpeg.pro
@@ -0,0 +1,68 @@
+TEMPLATE = lib
+TARGET += qjpeg
+
+CONFIG += qt plugin
+DESTDIR = ../../../imageformats
+
+VERSION = 1.0.0
+REQUIRES = !no-jpeg !jpeg
+
+SOURCES += main.cpp
+system-jpeg {
+ unix:LIBS += -ljpeg
+ win32:LIBS += libjpeg.lib
+}
+!system-jpeg {
+ INCLUDEPATH += ../../../../src/3rdparty/libjpeg
+ SOURCES += \
+ ../../../../src/3rdparty/libjpeg/jcapimin.c \
+ ../../../../src/3rdparty/libjpeg/jcapistd.c \
+ ../../../../src/3rdparty/libjpeg/jccoefct.c \
+ ../../../../src/3rdparty/libjpeg/jccolor.c \
+ ../../../../src/3rdparty/libjpeg/jcdctmgr.c \
+ ../../../../src/3rdparty/libjpeg/jchuff.c \
+ ../../../../src/3rdparty/libjpeg/jcinit.c \
+ ../../../../src/3rdparty/libjpeg/jcmainct.c \
+ ../../../../src/3rdparty/libjpeg/jcmarker.c \
+ ../../../../src/3rdparty/libjpeg/jcmaster.c \
+ ../../../../src/3rdparty/libjpeg/jcomapi.c \
+ ../../../../src/3rdparty/libjpeg/jcparam.c \
+ ../../../../src/3rdparty/libjpeg/jcphuff.c \
+ ../../../../src/3rdparty/libjpeg/jcprepct.c \
+ ../../../../src/3rdparty/libjpeg/jcsample.c \
+ ../../../../src/3rdparty/libjpeg/jctrans.c \
+ ../../../../src/3rdparty/libjpeg/jdapimin.c \
+ ../../../../src/3rdparty/libjpeg/jdapistd.c \
+ ../../../../src/3rdparty/libjpeg/jdatadst.c \
+ ../../../../src/3rdparty/libjpeg/jdatasrc.c \
+ ../../../../src/3rdparty/libjpeg/jdcoefct.c \
+ ../../../../src/3rdparty/libjpeg/jdcolor.c \
+ ../../../../src/3rdparty/libjpeg/jddctmgr.c \
+ ../../../../src/3rdparty/libjpeg/jdhuff.c \
+ ../../../../src/3rdparty/libjpeg/jdinput.c \
+ ../../../../src/3rdparty/libjpeg/jdmainct.c \
+ ../../../../src/3rdparty/libjpeg/jdmarker.c \
+ ../../../../src/3rdparty/libjpeg/jdmaster.c \
+ ../../../../src/3rdparty/libjpeg/jdmerge.c \
+ ../../../../src/3rdparty/libjpeg/jdphuff.c \
+ ../../../../src/3rdparty/libjpeg/jdpostct.c \
+ ../../../../src/3rdparty/libjpeg/jdsample.c \
+ ../../../../src/3rdparty/libjpeg/jdtrans.c \
+ ../../../../src/3rdparty/libjpeg/jerror.c \
+ ../../../../src/3rdparty/libjpeg/jfdctflt.c \
+ ../../../../src/3rdparty/libjpeg/jfdctfst.c \
+ ../../../../src/3rdparty/libjpeg/jfdctint.c \
+ ../../../../src/3rdparty/libjpeg/jidctflt.c \
+ ../../../../src/3rdparty/libjpeg/jidctfst.c \
+ ../../../../src/3rdparty/libjpeg/jidctint.c \
+ ../../../../src/3rdparty/libjpeg/jidctred.c \
+ ../../../../src/3rdparty/libjpeg/jmemmgr.c \
+ ../../../../src/3rdparty/libjpeg/jquant1.c \
+ ../../../../src/3rdparty/libjpeg/jquant2.c \
+ ../../../../src/3rdparty/libjpeg/jutils.c \
+ ../../../../src/3rdparty/libjpeg/jmemnobs.c
+}
+
+
+target.path += $$plugins.path/imageformats
+INSTALLS += target
diff --git a/plugins/src/imageformats/jpeg/main.cpp b/plugins/src/imageformats/jpeg/main.cpp
new file mode 100644
index 000000000..691322bf3
--- /dev/null
+++ b/plugins/src/imageformats/jpeg/main.cpp
@@ -0,0 +1,76 @@
+#ifndef QT_CLEAN_NAMESPACE
+#define QT_CLEAN_NAMESPACE
+#endif
+#include <qimageformatplugin.h>
+
+#ifndef QT_NO_IMAGEFORMATPLUGIN
+
+#ifdef QT_NO_IMAGEIO_JPEG
+#undef QT_NO_IMAGEIO_JPEG
+#endif
+#include "../../../../src/kernel/qjpegio.cpp"
+
+class JPEGFormat : public TQImageFormatPlugin
+{
+public:
+ JPEGFormat();
+
+ TQStringList keys() const;
+ bool loadImage( const TQString &format, const TQString &filename, TQImage * );
+ bool saveImage( const TQString &format, const TQString &filename, const TQImage & );
+ bool installIOHandler( const TQString & );
+};
+
+JPEGFormat::JPEGFormat()
+{
+}
+
+
+TQStringList JPEGFormat::keys() const
+{
+ TQStringList list;
+ list << "JPEG";
+
+ return list;
+}
+
+bool JPEGFormat::loadImage( const TQString &format, const TQString &filename, TQImage *image )
+{
+ if ( format != "JPEG" )
+ return FALSE;
+
+ TQImageIO io;
+ io.setFileName( filename );
+ io.setImage( *image );
+
+ read_jpeg_image( &io );
+
+ return TRUE;
+}
+
+bool JPEGFormat::saveImage( const TQString &format, const TQString &filename, const TQImage &image )
+{
+ if ( format != "JPEG" )
+ return FALSE;
+
+ TQImageIO io;
+ io.setFileName( filename );
+ io.setImage( image );
+
+ write_jpeg_image( &io );
+
+ return TRUE;
+}
+
+bool JPEGFormat::installIOHandler( const TQString &name )
+{
+ if ( name.upper() != "JPEG" )
+ return FALSE;
+
+ qInitJpegIO();
+ return TRUE;
+}
+
+Q_EXPORT_PLUGIN( JPEGFormat )
+
+#endif // QT_NO_IMAGEFORMATPLUGIN