// Computergrafik I // Prof. Dr. Juergen Doellner // Sommersemester 2001 // // Programmrahmen fuer Aufgabe 5 // Stephan Brumme, 702544 // last changes: May 01, 2001 #ifndef CG_BRUSH_H #define CG_BRUSH_H #include "cgapplication.h" class CGAirbrush : public CGApplication { public: CGAirbrush(unsigned int brushPatternSize); virtual ~CGAirbrush(); // Auf folgende Ereignisse soll reagiert werden: virtual void onInit(); virtual void onDraw(); virtual void onSize(unsigned int newWidth, unsigned int newHeight); virtual void onButton(MouseButton button, int x, int y); virtual void onMove(int x, int y); virtual void onKey(unsigned char key); void setArbitraryPattern(); void setConstantPattern(float fOpacity); void setRadialPattern(); void setColor(GLfloat red, GLfloat green, GLfloat blue); private: // Eine Hilfsklasse, die eine Farbe als // Tupel (r, g, b, alpha) darstellt. struct Color { GLfloat r; GLfloat g; GLfloat b; GLfloat alpha; }; // Speichert die Groesse der Schablone. // Die Schablone ist quadratisch. unsigned int m_brushPatternSize; // Enthaelt die Farbinformationen der einzelnen Pixel // der Schablone. Color* m_brushPattern; }; #endif // CG_BRUSH_H