diff --git a/cs677/pa3/edge-detect.cc b/cs677/pa3/edge-detect.cc index 6df3d65..fc70e3c 100644 --- a/cs677/pa3/edge-detect.cc +++ b/cs677/pa3/edge-detect.cc @@ -13,6 +13,9 @@ void squashAndPadData(unsigned char * raw_data, unsigned char * padded_data, void applyEdgeDetection(unsigned char * padded_data, unsigned char * edge_data, int width, int height, int threshold); +/************************************************************************** + * Print some basic usage information for the program * + *************************************************************************/ void usage(const char * progName) { cout << "Usage: " << progName << " [options] " << endl; @@ -21,6 +24,9 @@ void usage(const char * progName) exit(42); } +/************************************************************************** + * The main method is the entry point of our program * + *************************************************************************/ int main(int argc, char * argv[]) { int argi; @@ -85,6 +91,10 @@ int main(int argc, char * argv[]) delete[] edge_data; } +/************************************************************************** + * Convert the 24-bpp BMP data pointed to by raw_data to a 8-bpp * + * grayscale representation * + *************************************************************************/ void squashAndPadData(unsigned char * raw_data, unsigned char * padded_data, int width, int height) { @@ -104,6 +114,9 @@ void squashAndPadData(unsigned char * raw_data, unsigned char * padded_data, *padded_data++ = 0; } +/************************************************************************** + * Apply the actual edge detection algorithm on the grayscale data * + *************************************************************************/ void applyEdgeDetection(unsigned char * padded_data, unsigned char * edge_data, int width, int height, int threshold) {