#
(which
must be the first non-whitespace character on the line) and ends at the
input line end
/*
and ends
with */
{
and }
can delimit
arithmetic expressions. These expressions are fed to the Perl evaluator
and replaced by the result. This happens after the pre-processing stage
(if there is one), but before the actual processing of the imc
commands. Between the braces only numbers, brackets and the characters +,
-, / and * are allowed. The result is automatically rounded to the nearest
integer.
ORIGIN
command can change this
default).
ANGLES
command can change this default).
TRANSPARENT
or has the
form: model args
.
(Note that some tools, notably xv, don't take transparency into account, so that images may seem wrong on these tools; also, some versions of Netscape don't render PNG images with transparency correctly; however, GQview shows PNG images as they should be...).
The model
is the
color model used; the following color models are supported at the moment:
RGB
args
should be three integers between 0 and
255 (bounds included) and specify the red, green and blue component of
the color.X11
args
should be 1 argument, which can be a
color name or a numeric specification in the form:
#RGB
#RRGGBB
#RRRGGGBBB
#RRRRGGGGBBBB
rgb.txt
file to map
it to an RGB color. The rgb.txt
file is
looked for in the following directories:
/etc/X11
/usr/lib/X11
COLOR
can be replaced by
COLOUR
.
ORIGIN
ORIGIN spec
Sets the orientation of the vertical axis. The spec can be:
TOP
: sets the origin to the top left (and thus the vertical
axis oriented downwards). This is the default value.
BOTTOM
: sets the origin to the bottom left (vertical axis
oriented upwards).
Example:
ORIGIN bottom
ANGLES
ANGLES spec
Sets the orientation of angles. The spec can be:
CLOCKWISE
(this is the default value)
ANTICLOCKWISE
(or its synonym COUNTERCLOCKWISE
)
Example:
ANGLES counterclockwise
SIZE
SIZE width height
Fixes the size of the image to width, height. If this command is not specified in the input file, the image is just big enough to contain all drawed items.
Example:
SIZE 200 300
MOVETO
MOVETO x y
Moves the current position to the point with
coordinates (x, y).
Initially, the current position is at (0, 0).
Example:
MOVETO 10 100
LINETO
LINETO x y [COLOR colorspec] [WIDTH width]
Draws a line from the current position to the point with
coordinates
(x, y). Makes the end point the new current position. The
color and
width may be specified in the command; if not specified, the current values
are used (see LINECOLOR
and
LINEWIDTH
).
Example:
LINETO 20 100 COLOR RGB 100 100 100
LINE
LINE x1 y1 x2 y2 [COLOR colorspec] [WIDTH width]
As LINETO
, but draws a line from the
coordinates
(x1, y1) to (x2, y2). The current position is not changed.
TEXT
TEXT string [COLOR colorspec] [SIZE size]
[ALIGN [valign] [halign]] [ROTATE angle]
[MIRROR]
Prints the given text (case sensitive, of course) on the current position.
The relative position of the current position to the text depends on the
current alignment. The current position is not changed.
If the text contains whitespace, it has to be completely enclosed in quotes.
The text color, size, alignment and rotation, and
whether it should be mirrored, can
be specified on the command; if omitted, the current values are used (see
TEXTCOLOR
,
TEXTSIZE
,
TEXTALIGN
,
TEXTROTATE
and
TEXTMIRROR
).
Note that the alignment is always relative to the bounding rectangle (with horizontal and vertical edges) of the text, also when it is rotated. Mirroring is always horizontal and is done before rotating.
Example:
TEXT "This is a test" SIZE large ALIGN top center
TEXTAT
TEXTAT x y string [COLOR colorspec] [SIZE size]
[ALIGN [valign] [halign]] [ROTATE angle]
[MIRROR]
As TEXT
, but prints the text at the
coordinates (x, y).
The current position is not changed.
CIRCLE
CIRCLE x y radius [FILLED [colorspec]] [COLOR colorspec]
[WIDTH width]
Draws a circle with the given radius around the point with
coordinates (x, y). The current
position is not changed.
If the FILLED
specification is given, the circle is filled with
the given color. If the color is
omitted, the current fill color is used (see
FILLCOLOR
).
The drawing color and width can be specified on the command; if omitted,
the current values are used (see LINECOLOR
and LINEWIDTH
).
Example:
CIRCLE 100 100 50 FILLED RGB 0 0 20
ELLIPSE
ELLIPSE x y h_radius v_radius
[FILLED [colorspec]] [COLOR colorspec]
[WIDTH width]
Draws an ellipse with the given horizontal and vertical radius around the
point with coordinates (x, y). The current
position is not changed.
If the FILLED
specification is given, the ellipse is filled with
the given color. If the color is
omitted, the current fill color is used (see
FILLCOLOR
).
The drawing color and width can be specified on the command; if omitted,
the current values are used (see LINECOLOR
and LINEWIDTH
).
Example:
ELLIPSE 100 100 50 100 FILLED
ARC
ARC x y h_radius v_radius start_angle end_angle
[COLOR colorspec] [WIDTH width] [CLOSED [PIE|SEGMENT]]
[FILLED [colorspec]]
Draws an arc with the given horizontal and vertical radius around the point
with coordinates (x, y) over an
angle starting from start_angle to
end_angle. The current position is not changed.
The drawing color and width can be specified on the command; if omitted,
the current values are used (see LINECOLOR
and LINEWIDTH
).
When CLOSED
or CLOSED PIE
is specified, lines
are drawn from the end points
of the arc to the center of the arc, which can be interesting for pie charts.
When CLOSED SEGMENT
is specified, a line is drawn between the
two end points of the arc.
When the arc is closed, the keyword FILLED
will cause the closed
arc to be filled with the given color. If the color
is omitted, the current fill color is used (see
FILLCOLOR
).
Example:
ARC 100 100 50 100 -20 40
RECTANGLE
RECTANGLE x1 y1 x2 y2 [FILLED [colorspec]]
[COLOR colorspec] [WIDTH width]
Draws a rectangle between the points with
coordinates (x1, y1) and (x2, y2).
The current position is not changed.
If the FILLED
specification is given, the rectangle is filled with
the given color. If the color is
omitted, the current fill color is used (see
FILLCOLOR
).
The drawing color and width can be specified on the command; if omitted,
the current values are used (see LINECOLOR
and LINEWIDTH
).
Example:
RECTANGLE 100 100 200 200 FILLED X11 Blue
IMAGE
IMAGE x y [filename] [SIZE width height]
[ALIGN [valign] [halign]] [ROTATE angle]
[MIRROR]
Imports the PNG, JPG, X Bitmap or X Pixmap image stored in the given file
(case sensitive)
on the position
given by the coordinates (x, y). The relative
position of
the current position to the image depends on the
current alignment. The current position is not changed.
When the filename is omitted, the previously used filename is used (if, of course, there was one; if not, an error message is generated). This allows to use the same image again and again without having to load it every time.
A size can be specified to scale the image to the given size. An integer
bigger than 0 specifies an absolute size, a floating point percentage
bigger than 0 (ending with %
) specifies a relative size.
The alignment, rotation angle and whether the image has to be mirrored
can be specified on the command; if omitted, the current
values are used (see IMAGEALIGN
,
IMAGEROTATE
and
IMAGEMIRROR
).
Note that the alignment is always relative to the bounding rectangle (with horizontal and vertical edges) of the resulting image, also when it is rotated. Mirroring is always horizontal and is done before rotating, but after resizing.
Example:
IMAGE 10 10 oldfile.png ALIGN middle center MIRROR
FILL
FILL x y [BORDER colorspec] [COLOR colorspec]
Flood-fills a region that contains the point with
coordinates (x, y). If the BORDER
color is given, filling stops when it hits the
color specified by the border color; else filling stops when it hits a point
of a different color than the starting point.
If the COLOR
specification is given, the region is filled with
the given color. If the color is omitted, the current fill color is used
(see FILLCOLOR
).
Example:
FILL 10 10 BORDER X11 red
BACKGROUND
BACKGROUND colorspec
Sets the background color to the given
colorspec. The default background color is white.
Example:
BACKGROUND X11 #13A13A13A
LINECOLOR
LINECOLOR colorspec
Sets the current drawing color to the given
colorspec. The default drawing color is black.
Example:
LINECOLOR RGB 0 0 0
LINEWIDTH
LINEWIDTH width
Sets the current drawing width. The width must be given in pixels
and should be at least 1. The default drawing width is 1.
Example:
LINEWIDTH 5
FILLCOLOR
FILLCOLOR colorspec
Sets the current fill color to the given
colorspec. The default fill color is black.
Example:
FILLCOLOR RGB 0 0 0
TEXTCOLOR
TEXTCOLOR colorspec
Sets the current text color to the given
colorspec. The default text color is black.
Example:
TEXTCOLOR X11 Yellow
TEXTALIGN
TEXTALIGN [valign] [halign]
Sets the text alignment to valign halign.
TOP, MIDDLE, BOTTOM
(default is TOP
)
LEFT, CENTER, RIGHT
(default is LEFT
)
TOP LEFT
means that the coordinates that are
given to a text command will be at the top left of the bounding rectangle
(with horizontal and vertical edges) of the text, independent of
whether the origin of the images is at the bottom or the top.
At least one of the arguments must be given, and they must be in the order valign halign if both given.
Example:
TEXTALIGN top center
IMAGEALIGN
IMAGEALIGN [valign] [halign]
Sets the image alignment to valign halign. The syntax is as for the
TEXTALIGN
command.
Example:
IMAGEALIGN middle center
TEXTROTATE
TEXTROTATE angle
Sets the text rotation to angle. The default is no
rotation (angle = 0).
Example:
TEXTROTATE -95
TEXTSIZE
TEXTSIZE size
Sets the current text size. Possible values for size are:
5x8
(or TINY
)
6x12
(or SMALL
)
7x13
(or MEDIUM
)
8x16
(or LARGE
)
9x15
(or GIANT
)
SMALL
.
Example:
TEXTSIZE large
INTERLACED
INTERLACED
Defines the image as interlaced. This gives a fading-in effect
on some browsers. By default this setting is disabled.
TEXTMIRROR
TEXTMIRROR
Specifies that text should be mirrored. By default this setting is disabled.
IMAGEROTATE
IMAGEROTATE angle
Sets the image rotation to angle. The default is no
rotation (angle = 0).
Example:
IMAGEROTATE 135
IMAGEMIRROR
IMAGEMIRROR
Specifies that images should be mirrored. By default this setting is disabled.