Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

/home/landauf/painter/miniproject/effects/classes.h

Go to the documentation of this file.
00001 #include "includes.h"
00002 
00003 #ifndef __CLASSES_H__
00004 #define __CLASSES_H__
00005 
00006 class point
00007 {
00008     public:
00009         point(int _x = 0, int _y = 0);
00010         ~point() {}
00011         bool checkArea(point _low, point _high);
00012         void set(int _x = 0, int _y = 0);
00013         
00014         int x;
00015         int y;
00016 };
00017 
00018 class limit
00019 {
00020     public:
00021         limit(int _low = 0, int _high = 0);
00022         ~limit() {}
00023         bool checkLimit(float _value);
00024         float forceLimit(float _value);
00025         int intForceLimit(float _value);
00026         void set(int _low = 0, int _high = 0);
00027         
00028         int low;
00029         int high;
00030 };
00031 
00032 class matrix
00033 {
00034     public:
00035         matrix(float *_E, char _dimension = 1, short int _division = 1);
00036         ~matrix();
00037         void convertMatrix(float *_E);
00038         short int division;
00039         float E[11][11];
00040         char dimension;
00041 };
00042 
00043 Rgba applyMatrix(ImageRGBA *_img, matrix *_M, int _x, int _y, point _lowArea, point _highArea);
00044 
00045 // Effect:
00046 // Basisklasse aller folgenden Klassen
00047 // Enthält die grundlegensten Funktionen und Variabeln
00048 class effect
00049 {
00050     public:
00051         effect(ImageRGBA *_img = 0, ImageRGBA *_temp = 0, ImageRGBA *_temp2 = 0, ImageRGBA *_hud = 0, ImageRGBA *_menu = 0, bool _bArea = false, point _lowArea = 0, point _highArea = 0);
00052         virtual ~effect();
00053         virtual void startup(ImageRGBA *_img, ImageRGBA *_temp, ImageRGBA *_temp2, ImageRGBA *_hud, ImageRGBA *_menu, bool _bArea, point _lowArea, point _highArea);
00054         virtual void idle();
00055         virtual void idleAction();
00056         virtual void move();
00057         virtual void moveAction();
00058         virtual void LB(bool _state);
00059         virtual void LBAction();
00060         virtual void RB(bool _state);
00061         virtual void RBAction();
00062         virtual void colorChangeAction();
00063         virtual void key(unsigned char _key);
00064         virtual void specialKey(int _key);
00065         virtual void setXY(float _x, float _y);
00066         virtual void changeMode(char _mode);
00067         virtual void changeValue(char _key);
00068         virtual void showArea();
00069         virtual void showMenu();
00070 //        virtual void showBar();
00071         virtual bool useMenu(bool firstClick);
00072         virtual void showHud();
00073         virtual void refreshImage();
00074         
00075         ImageRGBA *img;     // the image
00076         ImageRGBA *temp;    // a temporary image for various reasons
00077         ImageRGBA *temp2;   // sometimes we need two
00078         ImageRGBA *hud;     // the 'heads up display' image
00079         ImageRGBA *display; // a pointer to the displayed image (usually *img, sometimes *hud)
00080         ImageRGBA *menu;    // the menu-buttons
00081         point mouse;        // the mouse location
00082         bool LBpressed;     // Left Mousebutton pressed?
00083         bool RBpressed;     // Right Mousebutton pressed?
00084         bool inAction;      // pressed key
00085         bool inActionState; // state while in action (default: true)
00086         point startArea;    // the starting edge of the selected area
00087         point endArea;      // the ending edge of the selected area
00088         point lowArea;      // the lower edge of the selected area
00089         point highArea;     // the higher edge of the selected area
00090         int areaColorOffset;// startcolor for the area-outlines
00091         bool bArea;         // have we set an area?
00092         bool bMenu;         // menu open?
00093         bool bColorMenu;    // show color menu
00094         Rgba myColor;       // a color value for several reasons
00095 //        bool bProgressBar;  // show the progress bar (0-100%)
00096 //        char progress;      // progress (0-100)
00097         char mode;          // effect mode (accessed by F1 - F8)
00098         char numModes;      // amount of supported modes
00099         float value1;       // a variable value to change strengh or size of effects
00100         float value2;       // a variable value to change strengh or size of effects
00101         limit limitValue1;  // the limits of value1
00102         limit limitValue2;  // the limits of value2
00103         limit limitX;       // image limit for the x-axis
00104         limit limitY;       // image limit for the y-axis
00105         limit limitRGBA;    // the RGBA value limit (0, 255)
00106 
00107         point start;
00108         point end;
00109         bool finalDraw;
00110         bool breakDraw;
00111 
00112         bool refresh;
00113         bool interpolate;
00114 
00115         matrix *M[10];
00116         int strength;
00117 
00118         float myAngleXY;
00119         float myAngleZ;
00120         float myStrength;
00121 
00122         float opacity;
00123 };
00124 
00125 class tools : public effect
00126 {
00127 };
00128 
00129 class color : public effect
00130 {
00131     public:
00132         void LBAction();
00133         void RBAction();
00134         void changeValue(char _key);
00135         virtual void action(int location);
00136 };
00137 
00138 class geometric : public effect
00139 {
00140     public:
00141         void RBAction();
00142         void specialKey(int _key);
00143         virtual void idleAction();
00144         virtual void changeValue(char _key);
00145         virtual void keyRIGHT();
00146         virtual void keyLEFT();
00147         virtual void keyUP();
00148         virtual void keyDOWN();
00149 };
00150 
00151 class distort : public effect
00152 {
00153     public:
00154         void RBAction();
00155         void changeValue(char _key);
00156         virtual void LBAction();
00157 };
00158 
00159 class matrices : public effect
00160 {
00161     public:
00162         void RBAction();
00163         void changeValue(char _key);
00164         void key(unsigned char _key);
00165         void specialKey(int _key);
00166         virtual void LBAction();
00167         virtual void matrixAction(int _x, int _y);
00168 };
00169 
00170 class artistic : public effect
00171 {
00172     public:
00173         void RBAction();
00174         void key(unsigned char _key);
00175         void specialKey(int _key);
00176         virtual void changeValue(char _key);
00177 };
00178 
00179 #endif

Generated on Mon Jan 30 09:13:01 2006 for Painter Framework by doxygen1.2.18