#ifndef TARGAWINDOW_H #define TARGAWINDOW_H #include #include "libtarga.h" /* TargaWindow.h Loads a targa image and displays it to the screen. User can draw on image, and write modified image out to new file. Origional Author: Alex Mohr, Mark Pingel, and Mike Gleicher ChangeLog: Added header comment Deimplemented default copy constructor and assignment operator Changed to use fltk event_inside - Adam Hupp */ class TargaWindow: public Fl_Window { unsigned char *targaimage; // Holds the R,G,B,A data of the targa image // we are going to draw uint32 imgWidth; // The width of the targa image uint32 imgHeight; // The height of the targa image void rvrsRow(); // Reverse the order of the rows. This accounts for // targa images having the point 0,0 in the lower-left // corner of the picture instead of the upper-left // corner where the fl_draw_image function begins // WARNING: this moves the data to a // new place (it does not work in // place). This is bad, but easy. void draw(); // Draws the targa image to the screen // Defaults are dangerous when data member is a pointer TargaWindow(const TargaWindow&); TargaWindow& operator=(const TargaWindow&); public: // CONSTRUCTORS TargaWindow(int width, int height); // DESTRUCTOR ~TargaWindow() { delete [] targaimage; } int handle(int e); // Overloaded handle function void setImage(const char* name); // Takes as an argument the name of the // targa image to be drawn void writeImage(const char* name); // Writes the current targa image out to // a file name that the user specifies }; #endif // TARGAWINDOW_H