/* Image.h * * CSE 326, Spring 2000 * Project 1 * * class image * The main class for this application, containing all data defining a PGM * image, and associated methods * * You are given: * * - method readImage(...) which reads pixel data from PGM file. * - operator [] which will allow you to reference pixels. e.g. if x is * an image object, x[0][0] is its first pixel. * - some access methods * - conversion method that takes labelled image object and scales pixel * values. * * You need to write: * * - constructor for image that takes title object as argument and * dynamically allocates 2-dimensional array of correct size * - method or methods to recursively identify connected components and * label them as described in project description. * - you may find it convenient to negate the input image before searching * and labelling. Write a method for this. * - method writeImage that creates appropriately-named output file from an * image object that has been labelled. */ #ifndef _IMAGE_H_ #define _IMAGE_H_ #include "Title.h" class title; class image { public: image(title tl); ~image(); void readImage(string input_file); void convertPGM(int num_components); int* operator[](int row_index) const{ return array[row_index]; } int getRow(){ return row; } int getCol(){ return col; } int getMaxValue(){ return max_value; } private: int row; int col; int max_value; int **array; }; #endif