aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index 370ece8..add73f7 100644
--- a/src/main.c
+++ b/src/main.c
@@ -15,10 +15,36 @@ static void usage(void);
void
usage(void)
{
- fprintf(stderr, "Usage: dsco [INPUT] -f [edge|blur] [-o OUTPUT]\n");
+ fprintf(stderr, "Usage: dsco [INPUT] -f [edge|blur|sharpen] [-o OUTPUT]\n");
exit(1);
}
+void
+help(void)
+{
+ fprintf(stdout,
+ "Usage:\n"
+ " dsco [INPUT] -f [edge|blur|sharpen] [-o OUTPUT]\n"
+ "\n"
+ "Options:\n"
+ " -o output file [default: /dev/stdout] \n"
+ " -f filter to use\n"
+ "\n"
+ " edge: -1 -1 -1\n"
+ " -1 8 -1\n"
+ " -1 -1 -1\n"
+ "\n"
+ " sharpen: 0 -1 0\n"
+ " -1 5 -1\n"
+ " 0 -1 0\n"
+ "\n"
+ " blur: 1 2 1\n"
+ " 1/16 2 4 2\n"
+ " 1 2 1\n"
+ );
+ exit(0);
+}
+
Image
image_convolution(Image input, float kernel[9])
{
@@ -138,6 +164,8 @@ int main(int argc, char *argv[])
case 0:
in_file = cli_arg;
break;
+ case 'h':
+ help();
default:
usage();
}
Feel free to download, copy and edit any repo