diff --git a/defines.h b/defines.h index 0ba7200..6cc18aa 100644 --- a/defines.h +++ b/defines.h @@ -86,7 +86,7 @@ #define ADJUST_GREY (1<<6) #define DEBUG_OUTPUT (1<<7) -/* colours used by ssocr */ +/* colors used by ssocr */ #define SSOCR_BLACK 0 #define SSOCR_WHITE 255 diff --git a/help.c b/help.c index 09492a0..9f9500c 100644 --- a/help.c +++ b/help.c @@ -98,7 +98,7 @@ void usage(char *name, FILE *f) fprintf(f, " -f, --foreground=COLOR set foreground color (black or white)\n"); fprintf(f, " -b, --background=COLOR set foreground color (black or white)\n"); fprintf(f, " -I, --print-info print image dimensions and used lum values\n"); - fprintf(f, " -g, --adjust-grey use T1 and T2 as percentages of used values\n"); + fprintf(f, " -g, --adjust-gray use T1 and T2 as percentages of used values\n"); fprintf(f, " -l, --luminance=KEYWORD compute luminance using formula KEYWORD\n"); fprintf(f, " use -l help for list of KEYWORDS\n"); fprintf(f, "\nCommands: dilation dilation algorithm (with mask of 1 pixel)\n"); @@ -109,9 +109,9 @@ void usage(char *name, FILE *f) fprintf(f, " ([N times] erosion then [N times] dilation)\n"); fprintf(f, " remove_isolated remove isolated pixels\n"); fprintf(f, " make_mono make image monochrome\n"); - fprintf(f, " greyscale transform image to greyscale\n"); + fprintf(f, " grayscale transform image to grayscale\n"); fprintf(f, " invert make inverted monochrome image\n"); - fprintf(f, " grey_stretch T1 T2 stretch luminance values\n"); + fprintf(f, " gray_stretch T1 T2 stretch luminance values\n"); fprintf(f, " from [T1,T2] to [0,255]\n"); fprintf(f, " dynamic_threshold W H make image monochrome w. dynamic thresholding\n"); fprintf(f, " with a window of width W and height H\n"); diff --git a/imgproc.c b/imgproc.c index fff3d7b..4d38a5c 100644 --- a/imgproc.c +++ b/imgproc.c @@ -307,9 +307,9 @@ Imlib_Image remove_isolated(Imlib_Image *source_image, double thresh, return keep_pixels_filter(source_image, thresh, lt, 1); } -/* grey stretching, i.e. lum lum=0, lum>t2 => lum=100, +/* gray stretching, i.e. lum lum=0, lum>t2 => lum=100, * else lum=((lum-t1)*MAXRGB)/(t2-t1) */ -Imlib_Image grey_stretch(Imlib_Image *source_image, double t1, double t2, +Imlib_Image gray_stretch(Imlib_Image *source_image, double t1, double t2, luminance_t lt) { Imlib_Image new_image; /* construct filtered image here */ @@ -321,17 +321,17 @@ Imlib_Image grey_stretch(Imlib_Image *source_image, double t1, double t2, /* do nothing if t1>=t2 */ if(t1 >= t2) { - fprintf(stderr, "error: grey_stretch(): t1=%.2f >= t2=%.2f\n", t1, t2); + fprintf(stderr, "error: gray_stretch(): t1=%.2f >= t2=%.2f\n", t1, t2); exit(99); } /* check if 0 < t1,t2 < MAXRGB */ if(t1 <= 0.0) { - fprintf(stderr, "error: grey_stretch(): t1=%.2f <= 0.0\n", t1); + fprintf(stderr, "error: gray_stretch(): t1=%.2f <= 0.0\n", t1); exit(99); } if(t2 >= MAXRGB) { - fprintf(stderr, "error: grey_stretch(): t2=%.2f >= %d.0\n", t2, MAXRGB); + fprintf(stderr, "error: gray_stretch(): t2=%.2f >= %d.0\n", t2, MAXRGB); exit(99); } @@ -344,7 +344,7 @@ Imlib_Image grey_stretch(Imlib_Image *source_image, double t1, double t2, width = imlib_image_get_width(); new_image = imlib_clone_image(); - /* grey stretch image */ + /* gray stretch image */ for(x=0; x lum=0, lum>t2 => lum=100, +/* gray stretching, i.e. lum lum=0, lum>t2 => lum=100, * else lum=((lum-t1)*MAXRGB)/(t2-t1) */ -Imlib_Image grey_stretch(Imlib_Image *source_image, double t1, double t2, +Imlib_Image gray_stretch(Imlib_Image *source_image, double t1, double t2, luminance_t lt); /* use dynamic (aka adaptive) local thresholding to create monochrome image */ @@ -114,8 +114,8 @@ Imlib_Image shear(Imlib_Image *source_image, int offset); /* rotate the image */ Imlib_Image rotate(Imlib_Image *source_image, double theta); -/* turn image to greyscale */ -Imlib_Image greyscale(Imlib_Image *source_image, luminance_t lt); +/* turn image to grayscale */ +Imlib_Image grayscale(Imlib_Image *source_image, luminance_t lt); /* crop image */ Imlib_Image crop(Imlib_Image *source_image, int x, int y, int w, int h); @@ -133,11 +133,11 @@ double get_threshold(Imlib_Image *source_image, double fraction, luminance_t lt, double iterative_threshold(Imlib_Image *source_image, double thresh, luminance_t lt, int x, int y, int w, int h); -/* get minimum grey value */ +/* get minimum gray value */ double get_minval(Imlib_Image *source_image, int x, int y, int w, int h, luminance_t lt); -/* get maximum grey value */ +/* get maximum gray value */ double get_maxval(Imlib_Image *source_image, int x, int y, int w, int h, luminance_t lt); diff --git a/ssocr.1.in b/ssocr.1.in index 57ad257..82a4dc3 100644 --- a/ssocr.1.in +++ b/ssocr.1.in @@ -108,13 +108,13 @@ Default is .IR white . .SS -I, --print-info Prints image dimensions and range of used luminance values to standard error. -.SS -g, --adjust-grey +.SS -g, --adjust-gray Interpret the values .B T1 and .B T2 given to the command -.B grey_stretch +.B gray_stretch as percentages instead of absolut luminance values. .SS -l, --luminance KEYWORD Choose the type of luminace computation. @@ -167,13 +167,13 @@ The threshold can be specified with option and is adjusted to the used luminance interval of the image unless option .B --absolute-threshold is used. -.SS greyscale -Transform image to grey values using luminance. +.SS grayscale +Transform image to gray values using luminance. The formula to compute luminance can be specified using option .BR --luminance . .SS invert Set every foreground pixel to background color and vice versa. -.SS grey_stretch T1 T2 +.SS gray_stretch T1 T2 Transform image so that the luminance interval [ .BR T1 , T2 ] is projected to [ diff --git a/ssocr.c b/ssocr.c index 848b3ee..12776c0 100644 --- a/ssocr.c +++ b/ssocr.c @@ -95,7 +95,7 @@ int main(int argc, char **argv) {"foreground", 1, 0, 'f'}, /* set foreground color */ {"background", 1, 0, 'b'}, /* set background color */ {"print-info", 0, 0, 'I'}, /* print image info */ - {"adjust-grey", 0, 0, 'g'}, /* use T1 and T2 as perecntages of used vals*/ + {"adjust-gray", 0, 0, 'g'}, /* use T1 and T2 as perecntages of used vals*/ {"luminance", 1, 0, 'l'}, /* luminance formula */ {0, 0, 0, 0} /* terminate long options */ }; @@ -552,13 +552,13 @@ int main(int argc, char **argv) imlib_context_set_image(image); imlib_free_image(); image = new_image; - } else if(strcasecmp("grey_stretch",argv[i]) == 0) { + } else if(strcasecmp("gray_stretch",argv[i]) == 0) { if(i+2