]> git.sesse.net Git - nageru/blobdiff - image_input.h
Fix so one can use images with other resolutions than 1280x720.
[nageru] / image_input.h
index 11c94ce9b626ce65f5fde9a2af895e1fa35de8ad..df25a9ff5eb3a89a4196aac75354d16846c90bec 100644 (file)
@@ -17,7 +17,7 @@
 // from disk about every second.
 class ImageInput : public movit::FlatInput {
 public:
-       ImageInput(const std::string &pathname);
+       ImageInput(const std::string &filename);
 
        std::string effect_type_id() const override { return "ImageInput"; }
        void set_gl_state(GLuint glsl_program_num, const std::string& prefix, unsigned *sampler_num) override;
@@ -25,16 +25,17 @@ public:
        
 private:
        struct Image {
+               unsigned width, height;
                std::unique_ptr<uint8_t[]> pixels;
                timespec last_modified;
        };
 
-       std::string pathname;
+       std::string filename, pathname;
        std::shared_ptr<const Image> current_image;
 
-       static std::shared_ptr<const Image> load_image(const std::string &pathname);
+       static std::shared_ptr<const Image> load_image(const std::string &filename, const std::string &pathname);
        static std::shared_ptr<const Image> load_image_raw(const std::string &pathname);
-       static void update_thread_func(const std::string &pathname, const timespec &first_modified);
+       static void update_thread_func(const std::string &filename, const std::string &pathname, const timespec &first_modified);
        static std::mutex all_images_lock;
        static std::map<std::string, std::shared_ptr<const Image>> all_images;
        static std::map<std::string, std::thread> update_threads;