#ifndef _PIXMAP_H #define _PIXMAP_H // // // Owen Astrachan: for Duke CPS (10/20/93 -- modified 11/3/93) // modified again on 3/21/94 // modified again on 11/28/94 // modified on 4/13/95 // modified on 9/24/95 (matrix class) // // class for two dimensional array representing pixmap (pixel map) // pixmap is the term used in X-windows programming // // // this program reads and writes maps in the format called P1 (.pbm) // // the program xv can be used to view the pixmaps (see also xpaint) // // #include "matrix.h" class Pixmap { public: Pixmap(); // constructor (0-sized bitmap) Pixmap(int rows, int cols); // Initialize with a size ~Pixmap(); // destructor (nothing needed now) void Read(istream &); // read pixmap from file void HorizReflect(); // reflect pixmap horizontally void VertReflect(); // reflect pixmap vertically void Invert(); // invert pixmap void Enhance(int size); // median filter void Expand(int rowExp,int colExp); // expand pixmap row x column void Write(ostream &) const; // write bitmap to file void Compress(ostream &) const; // write bitmap in compressed form private: void ReadCompressedFile(istream & input); //Read a Compressed File void ReadNormalFile(istream & input); //Read Normal Data File void RandomImage(); //Fill In data with random values string myKind; // P1, C1, P2, etc. string myCreator; // # program that created pixmap int myGrayLevel; // # different grays Matrix myImage; // two-d array of "pixels" }; #endif /* _PIXMAP_H not defined */