// // Image.hpp // c_gtk_image // // Created by Arnaud Blanchard on 23/11/2020. // #ifndef Image_hpp #define Image_hpp #include "blc_array.h" #include #include #include class Image:public blc_array{ bool fit_size=true; public: Image(blc_array const &array); virtual ~Image(); void resize(int allocated_width, int allocated_height); void zoom_original(); void zoom(double factor); void active_fit_size(); /** set pointer position (i, j) in the window. return false if the pointer is not in the window. */ bool get_pointer_position(int &i, int &j); /** Display the new image with the content array.*/ virtual void update()=0; static void resize_cb(GtkWidget *widget, GdkRectangle *allocation, Image *image); std::string pointer_info; double x_scale, y_scale; std::string pixel_info(); cairo_surface_t *surface; GdkDevice* pointer_device; GdkWindow *window; GtkWidget *widget, *image; size_t width, height; }; #endif /* Image_h */