File indexing completed on 2024-12-22 04:17:17

0001 /***************************************************************************
0002  *                                                                         *
0003  *   copyright : (C) 2005 C. Barth Netterfield                             *
0004  *                   netterfield@astro.utoronto.ca                         *
0005  *                                                                         *
0006  *   This program is free software; you can redistribute it and/or modify  *
0007  *   it under the terms of the GNU General Public License as published by  *
0008  *   the Free Software Foundation; either version 2 of the License, or     *
0009  *   (at your option) any later version.                                   *
0010  *                                                                         *
0011  ***************************************************************************/
0012 
0013 
0014 #ifndef TIFF16SOURCE_H
0015 #define TIFF16SOURCE_H
0016 
0017 #include <datasource.h>
0018 #include <dataplugin.h>
0019 
0020 class DataInterfaceTiff16Vector;
0021 class DataInterfaceTiff16Matrix;
0022   
0023 class Tiff16Source : public Kst::DataSource 
0024 {
0025   Q_OBJECT
0026 
0027   public:
0028     Tiff16Source(Kst::ObjectStore *store, QSettings *cfg, const QString& filename, const QString& type, const QDomElement& e);
0029 
0030     ~Tiff16Source();
0031 
0032     bool init();
0033     virtual void reset();
0034 
0035     Kst::Object::UpdateType internalDataSourceUpdate();
0036 
0037     bool isEmpty() const;
0038     QString fileType() const;
0039 
0040     void save(QXmlStreamWriter &streamWriter);
0041 
0042     virtual const QString& typeString() const;
0043 
0044     class Config;
0045 
0046     //int readScalar(double &S, const QString& scalar);
0047     //int readString(QString &S, const QString& string);
0048 
0049   private:
0050     unsigned short *_z;
0051     int _width;
0052     int _height;
0053     mutable Config *_config;
0054 
0055     DataInterfaceTiff16Vector* iv;
0056     DataInterfaceTiff16Matrix* im;
0057 };
0058 
0059 
0060 class Tiff16SourcePlugin : public QObject, public Kst::DataSourcePluginInterface {
0061     Q_OBJECT
0062     Q_INTERFACES(Kst::DataSourcePluginInterface)
0063     Q_PLUGIN_METADATA(IID "com.kst.DataSourcePluginInterface/2.0")
0064   public:
0065     virtual ~Tiff16SourcePlugin() {}
0066 
0067     virtual QString pluginName() const;
0068     virtual QString pluginDescription() const;
0069 
0070     virtual bool hasConfigWidget() const { return false; }
0071 
0072     virtual Kst::DataSource *create(Kst::ObjectStore *store,
0073                                   QSettings *cfg,
0074                                   const QString &filename,
0075                                   const QString &type,
0076                                   const QDomElement &element) const;
0077 
0078     virtual QStringList matrixList(QSettings *cfg,
0079                                   const QString& filename,
0080                                   const QString& type,
0081                                   QString *typeSuggestion,
0082                                   bool *complete) const;
0083 
0084     virtual QStringList fieldList(QSettings *cfg,
0085                                   const QString& filename,
0086                                   const QString& type,
0087                                   QString *typeSuggestion,
0088                                   bool *complete) const;
0089 
0090     virtual QStringList scalarList(QSettings *cfg,
0091                                   const QString& filename,
0092                                   const QString& type,
0093                                   QString *typeSuggestion,
0094                                   bool *complete) const;
0095 
0096     virtual QStringList stringList(QSettings *cfg,
0097                                   const QString& filename,
0098                                   const QString& type,
0099                                   QString *typeSuggestion,
0100                                   bool *complete) const;
0101 
0102     virtual int understands(QSettings *cfg, const QString& filename) const;
0103 
0104     virtual bool supportsTime(QSettings *cfg, const QString& filename) const;
0105 
0106     virtual QStringList provides() const;
0107 
0108     virtual Kst::DataSourceConfigWidget *configWidget(QSettings *cfg, const QString& filename) const;
0109 };
0110 
0111 
0112 #endif
0113 // vim: ts=2 sw=2 et