comparison layer/ImageLayer.h @ 1608:6616e1899daa

Make ImageLayer able to report whether an image format can be opened
author Chris Cannam
date Mon, 11 May 2020 17:28:12 +0100
parents e6362cf5ff1d
children
comparison
equal deleted inserted replaced
1607:52d4bfba5b3d 1608:6616e1899daa
96 96
97 void setLayerDormant(const LayerGeometryProvider *v, bool dormant) override; 97 void setLayerDormant(const LayerGeometryProvider *v, bool dormant) override;
98 98
99 void setProperties(const QXmlAttributes &attributes) override; 99 void setProperties(const QXmlAttributes &attributes) override;
100 100
101 static bool isImageFileSupported(QString url); // based on extension alone
102
101 virtual bool addImage(sv_frame_t frame, QString url); // using a command 103 virtual bool addImage(sv_frame_t frame, QString url); // using a command
102 104
103 protected slots: 105 protected slots:
104 void checkAddSources(); 106 void checkAddSources();
105 void fileSourceReady(); 107 void fileSourceReady();
118 typedef std::map<QString, QImage> ImageMap; 120 typedef std::map<QString, QImage> ImageMap;
119 typedef std::map<const LayerGeometryProvider *, ImageMap> ViewImageMap; 121 typedef std::map<const LayerGeometryProvider *, ImageMap> ViewImageMap;
120 typedef std::map<QString, FileSource *> FileSourceMap; 122 typedef std::map<QString, FileSource *> FileSourceMap;
121 123
122 static ImageMap m_images; 124 static ImageMap m_images;
123 static QMutex m_imageMapMutex; 125 static FileSourceMap m_fileSources;
126 static QMutex m_staticMutex;
127
124 mutable ViewImageMap m_scaled; 128 mutable ViewImageMap m_scaled;
125 mutable FileSourceMap m_fileSources;
126 129
127 QString getLocalFilename(QString img) const; 130 static QString getLocalFilename(QString img);
128 void checkAddSource(QString img) const; 131 static void checkAddSource(QString img, bool synchronise);
132 void checkAddSourceAndConnect(QString img);
129 133
130 ModelId m_model; // an ImageModel 134 ModelId m_model; // an ImageModel
131 bool m_editing; 135 bool m_editing;
132 QPoint m_editOrigin; 136 QPoint m_editOrigin;
133 Event m_originalPoint; 137 Event m_originalPoint;