class display {

		pixels: pixeltype[IMAX,JMAX];

	public:

		display() { } /* a constructor used to create an instance of the class */

		pixeltype pixel(int i, int j) { return pixels[i,j]; /* no bounds checking for clarity */ }

		void set_pixel(pixeltype val, int i, int j) { pixels[i,j] = val; }

	};

display d1;

apixel = d1.pixel(0,0); /* get the value of pixel [0,0] */

/* these operations are performed on a two-dimensional array of pixels */

pixel pixelval(pixel *px, int i, int j) { return px[i,j]; }



void set_pixel(pixel *px, pixeltype val, int i, int j) { px[i,j] = val; }

pixel d1_pixels[IMAX,JMAX];

apixel = pixelval(d1_pixel,0,0); /* get the [0,0] pixel from the d1_array; */


