summaryrefslogtreecommitdiff
path: root/doc/imgrotate.texi
blob: 2a48f89df3c204485c4e737ae0ade21a21f418d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
@c Copyright (C) 1992, 2004, 2011 Free Software Foundation, Inc.
@c This is part of the GNU font utilities manual.
@c For copying conditions, see the file fontutil.texi.

@node IMGrotate
@chapter IMGrotate

@pindex imgrotate
@cindex rotation, of images
@cindex image rotation

IMGrotate rotates an IMG file, either 90 or 180 degrees clockwise.  We
call the latter---somewhat inaccurately---a ``flip''.  (We haven't
needed other rotation angles, so we haven't implemented them.)

The IMG format is an image format output by a few programs, including the
one that drives the scanner we have.  (Again, we haven't needed other
image formats, so we haven't implemented them.)

Both the input and output are IMG files.

The current implementation of IMGrotate uses an extremely slow and
stupid algorithm, because it was a quick hack.  It would be useful to
replace it with a better algorithm.  @xref{Program features}, for a
reference.

@menu
* IMGrotate usage::             Doing the image rotation.
* Invoking IMGrotate::          Command-line options.
@end menu


@node IMGrotate usage
@section IMGrotate usage

@cindex IMGrotate usage
@cindex usage of IMGrotate

The physical construction of a source to be scanned may make it hard
or impossible to end up with an upright image.  But the task of
extracting characters from an image is complicated by allowing for a
rotated image.  Hence this program to turn rotated images upright.

@flindex x @r{prefix}
By default, the name of the output file is the same as the input file;
both are extended with @file{.img} if necessary.  If this would result
in the output overwriting the input, @samp{x} is prepended to the output
name.

@menu
* Clockwise rotation::          Rotating clockwise.
* Flip rotation::               FLipping end-for-end.
@end menu


@node Clockwise rotation
@subsection Clockwise rotation

@cindex clockwise rotation
@cindex rotation, clockwise
@opindex -rotate-clockwise

You specify clockwise rotation of an image with the option
@samp{-rotate-clockwise}.  This rotates the input 90 degrees clockwise.
For example, the following (an @samp{h} on its side):

@example
      *****
     *
     *
***********
@end example

@noindent turns upright.


@node Flip rotation
@subsection Flip rotation

@cindex flip rotation
@cindex rotation, flip

You specify ``flip'' rotation of an image with the option @samp{-flip}.
This flips the input end for end and reverses left and right, i.e., does
a 180 degree rotation.  For example, the following (an @samp{h} upside
down and backwards):

@example
  *  *
  *  *
  *  *
   ***
     *
     *
     *
@end example

@noindent turns upright.


@node Invoking IMGrotate
@section Invoking IMGrotate

@cindex IMGrotate options
@cindex invocation of IMGrotate
@cindex options for IMGrotate

This section describes the options that IMGrotate accepts.
@xref{Command-line options}, for general option syntax.

The name of the main input file (@pxref{Main input file}) is called
@var{image-name} below.

@table @samp

@opindex -flip
@item -flip
Rotate the input 180 degrees, i.e., flip it end for end and left to
right.  @xref{Flip rotation}.

@opindex -help
@item -help
Print a usage message.  @xref{Common options}.

@opindex -output-file
@cindex output file, naming
@item -output-file @var{filename}
Write to @var{filename} if @var{filename} has a suffix.  If it doesn't,
write to @file{@var{filename}.img}, unless that would overwrite the
input, in which case write to @file{x@var{filename}.img}.  By default,
use @var{image-name} for @var{filename}.

@opindex -rotate-clockwise
@item -rotate-clockwise
Rotate the input 90 degrees clockwise.  @xref{Clockwise rotation}.

@opindex -verbose
@item -verbose
Output progress reports.  @xref{Common options}.

@opindex -version
@item -version
Print the version number.  @xref{Common options}.

@end table