00001
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef IMAGE_SUB_WINDOW_H
00024 #define IMAGE_SUB_WINDOW_H
00025
00026 #include <GL/gl.h>
00027 #include <GL/glu.h>
00028 #include <glow.h>
00029
00030 #include "Image.h"
00031
00032
00033 GLOW_NAMESPACE_USING
00034
00035 #include <ImageWindow.h>
00036
00037 class ImageSubWindow : public GlowSubwindow
00047 {
00048 public:
00049
00051 void (*mouse_press)(Glow::MouseButton button,int x,
00052 int y,
00053 Glow::Modifiers modifiers,
00054 MouseActionType action);
00055
00057 void (*graphics_callback)(GlowComponent *parent);
00058
00059 protected:
00060
00061
00062
00063 unsigned int width;
00064 unsigned int height;
00065 unsigned int size;
00066 float scalefactor;
00067 bool size_changed;
00068
00069 Image::Type type;
00070 GLint *pixels;
00071 GLubyte *data;
00072 GLubyte *data_bk;
00073
00074 GlowComponent* parent_obj ;
00075 public:
00076
00077
00078 ImageSubWindow(GlowComponent* parent,
00079 int x, int y,
00080 int width, int height);
00081 ~ImageSubWindow();
00082
00083 void set_display_type(Image::Type t){ type = t; };
00084 void set_zoom(float zoom) ;
00085 void operator << (ImageRGB&);
00086 void operator << (ImageGrey&);
00087 void operator << (Image&);
00088
00089 protected:
00090
00091 virtual void OnEndPaint();
00092 virtual void OnMouseDown(Glow::MouseButton button,
00093 int x, int y,
00094 Glow::Modifiers modifiers);
00095 virtual void OnMouseUp(Glow::MouseButton button,
00096 int x, int y,
00097 Glow::Modifiers modifiers);
00098
00099 void repackRGB();
00100 void repackGrey();
00101 };
00102
00103
00104 #endif // IMAGE_WINDOW_H