File: Geometry.tex

package info (click to toggle)
imagemagick 6:6.0.6.2-2.9
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 33,284 kB
  • ctags: 14,844
  • sloc: ansic: 190,790; cpp: 17,203; sh: 8,740; perl: 4,190; makefile: 1,740; tcl: 459
file content (264 lines) | stat: -rw-r--r-- 8,233 bytes parent folder | download
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
\section{Magick::Geometry}
\scriptsize{
\begin{verbatim}

Geometry provides a convenient means to specify a geometry argument. The
object may be initialized from a C string or C++ string containing a
geometry specification.  It may also be initialized by more efficient
parameterized constructors.

X11 Geometry Specifications

X11 geometry specifications are in the form
"<width>x<height>{+-}<xoffset>{+-}<yoffset>" (where width, height, xoffset,
and yoffset are numbers) for specifying the size and placement location for
an object.

The width and height parts of the geometry specification are measured in
pixels. The xoffset and yoffset parts are also measured in pixels and are
used to specify the distance of the placement coordinate from the left and
top edges of the image, respectively.

 +xoffset The left edge of the object is to be placed xoffset pixels in
          from the left edge of the image.

 -xoffset The left edge of the object is to be placed outside the image,
          xoffset pixels from the left edge of the image.

The Y offset has similar meanings:

 +yoffset The top edge of the object is to be yoffset pixels below the top
          edge of the image.

 -yoffset The top edge of the object is to be outside the image, yoffset
          pixels above the top edge of the image.

Offsets must be given as pairs; in other words, in order to specify either
xoffset or yoffset both must be present.

ImageMagick Extensions To X11 Geometry Specifications

ImageMagick has added a number of qualifiers to the standard geometry string
for use when resizing images. The form of an extended geometry string is
"<width>x<height>{+-}<xoffset>{+-}<yoffset>{%}{!}{<}{>}". Extended geometry
strings should only be used when resizing an image. Using an extended
geometry string for other applications may cause the API call to fail. The
available qualifiers are shown in the following table:


                       ImageMagick Geometry Qualifiers

 Qualifier Description

 %         Interpret width and height as a percentage of the current size.


 !         Resize to width and height exactly, loosing original aspect
           ratio.


 <         Resize only if the image is smaller than the geometry
           specification.


 >         Resize only if the image is greater than the geometry
           specification.


Postscript Page Size Extension To Geometry Specifications

Any geometry string specification supplied to the Geometry contructor is
considered to be a Postscript page size nickname if the first character is
not numeric. The Geometry constructor converts these page size
specifications into the equivalent numeric geometry string specification
(preserving any offset component) prior to conversion to the internal object
format. Postscript page size specifications are short-hand for the pixel
geometry required to fill a page of that size. Since the 11x17 inch page
size used in the US starts with a digit, it is not supported as a Postscript
page size nickname. Instead, substitute the geometry specification
"792x1224>" when 11x17 output is desired.

An example of a Postscript page size specification is "letter+43+43>".

                      Postscript Page Size Nicknames

 Postscript Page Size Nickname Equivalent Extended Geometry Specification

 Ledger                        1224x792>

 Legal                         612x1008>

 Letter                        612x792>

 LetterSmall                   612x792>

 ArchE                         2592x3456>

 ArchD                         1728x2592>

 ArchC                         1296x1728>

 ArchB                         864x1296>

 ArchA                         648x864>

 A0                            2380x3368>

 A1                            1684x2380>

 A2                            1190x1684>

 A3                            842x1190>

 A4                            595x842>

 A4Small                       595x842>

 A5                            421x595>

 A6                            297x421>

 A7                            210x297>

 A8                            148x210>

 A9                            105x148>

 A10                           74x105>

 B0                            2836x4008>

 B1                            2004x2836>

 B2                            1418x2004>

 B3                            1002x1418>

 B4                            709x1002>

 B5                            501x709>

 C0                            2600x3677>

 C1                            1837x2600>

 C2                            1298x1837>

 C3                            918x1298>

 C4                            649x918>

 C5                            459x649>

 C6                            323x459>

 Flsa                          612x936>

 Flse                          612x936>

 HalfLetter                    396x612>


Geometry Methods

Geometry provides methods to initialize its value from strings, from a set
of parameters, or via attributes. The methods available for use in Geometry
are shown in the following table:

                              Geometry Methods

 Method       Return Type   Signature(s)            Description

                            unsigned int width_,
                            unsigned int height_,
                            unsigned int xOff_ = 0, Construct X11 geometry
 Geometry                   unsigned int yOff_ = 0, via explicit
                            bool xNegative_ =       parameters.
                            false, bool yNegative_
                            = false


              const string  Construct geometry from
              geometry_     C++ string


              const char *  Construct geometry from
              geometry_     C string

 width        void          unsigned int width_     Width

              unsigned int  void

 height       void          unsigned int height_    Height

              unsigned int  void

 xOff         void          unsigned int xOff_      X offset from origin

              int           void

 yOff         void          unsigned int yOff_      Y offset from origin

              int           void

                                                    Sign of X offset
 xNegative    void          bool xNegative_         negative? (X origin at
                                                    right)

              bool          void

                                                    Sign of Y offset
 yNegative    void          bool yNegative_         negative? (Y origin at
                                                    bottom)

              bool          void

                                                    Width and height are
 percent      void          bool percent_           expressed as
                                                    percentages

              bool          void

                                                    Resize without
 aspect       void          bool aspect_            preserving aspect ratio
                                                    (!)

              bool          void


 greater      void          bool greater_           Resize if image is
                                                    greater than size (>)

              bool          void


 less         void          bool less_              Resize if image is less
                                                    than size (<)

              bool          void


 isValid      void          bool isValid_           Does object contain
                                                    valid geometry?

              bool          void


 operator =   const         const string geometry_  Set geometry via C++
              Geometry&                             string


 operator =   const         const char * geometry_  Set geometry via C
              Geometry&                             string


 operator                                           Obtain C++ string
 string       string        Geometry&               representation of
                                                    geometry


 operator<<   ostream&      ostream& stream_, const Stream onto ostream
                            Geometry& geometry_

\end{verbatim}
}