From c645f00b93bbf88a257f4416931815193246f984 Mon Sep 17 00:00:00 2001 From: josh Date: Sat, 25 Oct 2008 21:55:23 +0000 Subject: [PATCH] added some comments git-svn-id: svn://anubis/gvsu@208 45c1a28c-8058-47b2-ae61-ca45b979098e --- cs677/pa3/edge-detect.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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) {