Skip to content
Snippets Groups Projects
Commit 4868a901 authored by Toke Eskildsen's avatar Toke Eskildsen
Browse files

Added requirements to the in-file documentation

parent fc7456f1
No related branches found
No related tags found
No related merge requests found
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
# #
# Statistical helper functions for greyscale images. # Statistical helper functions for greyscale images.
# #
# Requirements: ImageMagick's identify and convert
#
# Input: image # Input: image
# Sample: foo.png # Sample: foo.png
...@@ -21,9 +23,10 @@ function im_identify() { ...@@ -21,9 +23,10 @@ function im_identify() {
rm "$TMP" rm "$TMP"
} }
# Produces a histogram over greyscale intensities in the given image
# Input: image height log # Input: image height log
# Sample: foo.jpg 200 true # Sample: foo.jpg 200 true
# Output: foo.png (256 x height pixels) with the histogram
function histogram() { function histogram() {
local SRC="$1" local SRC="$1"
local HEIGHT=$2 local HEIGHT=$2
...@@ -106,11 +109,10 @@ function histogram() { ...@@ -106,11 +109,10 @@ function histogram() {
echo -n -e \\xff >> $HTMP echo -n -e \\xff >> $HTMP
fi fi
done done
# echo "$G $COUNT $PIXELS $HTMP" echo "$G $COUNT $PIXELS"
done done
convert -rotate 270 $HTMP "$DEST" convert -rotate 270 $HTMP "$DEST"
rm $HTMP rm $HTMP
} }
#histogram $1 200 false #histogram $1 200 false
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment