summaryrefslogtreecommitdiffstats
path: root/doc/photo.n
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2010-01-08 10:31:40 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2010-01-08 10:31:40 (GMT)
commit2feda836da6d55ba87a093fe45cfe178a6ff1f7e (patch)
treeaebfd0df4348f73d49245842a25001bf48629496 /doc/photo.n
parentccaed146a6262119e850912a4010a200dfe0a0ea (diff)
downloadtk-2feda836da6d55ba87a093fe45cfe178a6ff1f7e.zip
tk-2feda836da6d55ba87a093fe45cfe178a6ff1f7e.tar.gz
tk-2feda836da6d55ba87a093fe45cfe178a6ff1f7e.tar.bz2
Minor formatting fix
Diffstat (limited to 'doc/photo.n')
-rw-r--r--doc/photo.n46
1 files changed, 43 insertions, 3 deletions
diff --git a/doc/photo.n b/doc/photo.n
index 6288b64..5e526a1 100644
--- a/doc/photo.n
+++ b/doc/photo.n
@@ -9,7 +9,7 @@
'\" Department of Computer Science,
'\" Australian National University.
'\"
-'\" RCS: @(#) $Id: photo.n,v 1.26 2010/01/08 00:28:17 patthoyts Exp $
+'\" RCS: @(#) $Id: photo.n,v 1.27 2010/01/08 10:31:40 dkf Exp $
'\"
.so man.macros
.TH photo n 4.0 Tk "Tk Built-In Commands"
@@ -44,6 +44,7 @@ command.
Photos support the following \fIoptions\fR:
.TP
\fB\-data \fIstring\fR
+.
Specifies the contents of the image as a string. The string should
contain binary data or, for some formats, base64-encoded data (this is
currently guaranteed to be supported for PNG and GIF images). The
@@ -54,15 +55,18 @@ and \fB\-file\fR options are specified, the \fB\-file\fR option takes
precedence.
.TP
\fB\-format \fIformat-name\fR
+.
Specifies the name of the file format for the data specified with the
\fB\-data\fR or \fB\-file\fR option.
.TP
\fB\-file \fIname\fR
+.
\fIname\fR gives the name of a file that is to be read to supply data
for the photo image. The file format must be one of those for which
there is an image file format handler that can read data.
.TP
\fB\-gamma \fIvalue\fR
+.
Specifies that the colors allocated for displaying this image in a
window should be corrected for a non-linear display with the specified
gamma exponent value. (The intensity produced by most
@@ -74,12 +78,14 @@ will make the image lighter, and values less than one will make it
darker.
.TP
\fB\-height \fInumber\fR
+.
Specifies the height of the image, in pixels. This option is useful
primarily in situations where the user wishes to build up the contents
of the image piece by piece. A value of zero (the default) allows the
image to expand or shrink vertically to fit the data stored in it.
.TP
\fB\-palette \fIpalette-spec\fR
+.
Specifies the resolution of the color cube to be allocated for
displaying this image, and thus the number of colors used from the
colormaps of the windows where it is displayed. The
@@ -91,6 +97,7 @@ number) is used, the image will be displayed in monochrome (i.e.,
grayscale).
.TP
\fB\-width \fInumber\fR
+.
Specifies the width of the image, in pixels. This option is useful
primarily in situations where the user wishes to build up the contents
of the image piece by piece. A value of zero (the default) allows the
@@ -118,17 +125,20 @@ changed.
The following commands are possible for photo images:
.TP
\fIimageName \fBblank\fR
+.
Blank the image; that is, set the entire image to have no data, so it
will be displayed as transparent, and the background of whatever
window it is displayed in will show through.
.TP
\fIimageName \fBcget\fR \fIoption\fR
+.
Returns the current value of the configuration option given
by \fIoption\fR.
\fIOption\fR may have any of the values accepted by the
\fBimage create photo\fR command.
.TP
\fIimageName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
+.
Query or modify the configuration options for the image.
If no \fIoption\fR is specified, returns a list describing all of
the available options for \fIimageName\fR (see \fBTk_ConfigureInfo\fR for
@@ -143,6 +153,7 @@ this case the command returns an empty string.
\fBimage create photo\fR command.
.TP
\fIimageName \fBcopy\fR \fIsourceImage\fR ?\fIoption value(s) ...\fR?
+.
Copies a region from the image called \fIsourceImage\fR (which must
be a photo image) to the image called \fIimageName\fR, possibly with
pixel zooming and/or subsampling. If no options are specified, this
@@ -152,6 +163,7 @@ options may be specified:
.RS
.TP
\fB\-from \fIx1 y1 x2 y2\fR
+.
Specifies a rectangular sub-region of the source image to be copied.
(\fIx1,y1\fR) and (\fIx2,y2\fR) specify diagonally opposite corners of
the rectangle. If \fIx2\fR and \fIy2\fR are not specified, the
@@ -161,6 +173,7 @@ rectangle but not the bottom or right edges. If the \fB\-from\fR
option is not given, the default is the whole source image.
.TP
\fB\-to \fIx1 y1 x2 y2\fR
+.
Specifies a rectangular sub-region of the destination image to be
affected. (\fIx1,y1\fR) and (\fIx2,y2\fR) specify diagonally opposite
corners of the rectangle. If \fIx2\fR and \fIy2\fR are not specified,
@@ -170,6 +183,7 @@ region (after subsampling and zooming, if specified). If \fIx2\fR and
necessary to fill the destination region in a tiled fashion.
.TP
\fB\-shrink\fR
+.
Specifies that the size of the destination image should be reduced, if
necessary, so that the region being copied into is at the bottom-right
corner of the image. This option will not affect the width or height
@@ -177,6 +191,7 @@ of the image if the user has specified a non-zero value for the
\fB\-width\fR or \fB\-height\fR configuration option, respectively.
.TP
\fB\-zoom \fIx y\fR
+.
Specifies that the source region should be magnified by a factor of
\fIx\fR in the X direction and \fIy\fR in the Y direction. If \fIy\fR
is not given, the default value is the same as \fIx\fR. With this
@@ -185,6 +200,7 @@ of \fIx\fR x \fIy\fR pixels in the destination image, all the same
color. \fIx\fR and \fIy\fR must be greater than 0.
.TP
\fB\-subsample \fIx y\fR
+.
Specifies that the source image should be reduced in size by using
only every \fIx\fRth pixel in the X direction and \fIy\fRth pixel in
the Y direction. Negative values will cause the image to be flipped
@@ -192,6 +208,7 @@ about the Y or X axes, respectively. If \fIy\fR is not given, the
default value is the same as \fIx\fR.
.TP
\fB\-compositingrule \fIrule\fR
+.
Specifies how transparent pixels in the source image are combined with
the destination image. When a compositing rule of \fIoverlay\fR is
set, the old contents of the destination image are visible, as if the
@@ -202,17 +219,20 @@ the source image is used as-is. The default compositing rule is
\fIoverlay\fR.
.RE
.TP
-\fIimageName \fBdata ?\fIoption value(s) ...\fR?
+\fIimageName \fBdata\fR ?\fIoption value(s) ...\fR?
+.
Returns image data in the form of a string. The following options
may be specified:
.RS
.TP
\fB\-background\fI color\fR
+.
If the color is specified, the data will not contain any transparency
information. In all transparent pixels the color will be replaced by
the specified color.
.TP
\fB\-format\fI format-name\fR
+.
Specifies the name of the image file format handler to be used.
Specifically, this subcommand searches
for the first handler whose name matches an initial substring of
@@ -221,6 +241,7 @@ If this option is not given, this subcommand uses the first
handler that has the capability to read the image data.
.TP
\fB\-from \fIx1 y1 x2 y2\fR
+.
Specifies a rectangular region of \fIimageName\fR to be returned.
If only \fIx1\fR and \fIy1\fR are specified, the region
extends from \fI(x1,y1)\fR to the bottom-right corner of
@@ -230,16 +251,19 @@ and excluding x2,y2. The default, if this option is not given, is the
whole image.
.TP
\fB\-grayscale\fR
+.
If this options is specified, the data will not contain color
information. All pixel data will be transformed into grayscale.
.RE
.TP
\fIimageName \fBget\fR \fIx y\fR
+.
Returns the color of the pixel at coordinates (\fIx\fR,\fIy\fR) in the
image as a list of three integers between 0 and 255, representing the
red, green and blue components respectively.
.TP
\fIimageName \fBput\fR \fIdata\fR ?\fIoption value(s) ...\fR?
+.
Sets pixels in \fI imageName\fR to the data specified in \fIdata\fR.
This command first searches the list of image file format handlers for
a handler that can interpret the data in \fIdata\fR, and then reads
@@ -254,12 +278,14 @@ that color. The following options may be specified:
.RS
.TP
\fB\-format \fIformat-name\fR
+.
Specifies the format of the image data in \fIdata\fR.
Specifically, only image file format handlers whose names begin with
\fIformat-name\fR will be used while searching for an image data
format handler to read the data.
.TP
\fB\-to \fIx1 y1\fR ?\fIx2 y2\fR?
+.
Specifies the coordinates of the top-left corner (\fIx1\fR,\fIy1\fR)
of the region of \fIimageName\fR into which the image data will be
copied. The default position is (0,0). If \fIx2\fR,\fIy2\fR is given
@@ -271,6 +297,7 @@ represented by (\fIx2\fR,\fIy2\fR) will be filled with that color.
.RE
.TP
\fIimageName \fBread\fR \fIfilename\fR ?\fIoption value(s) ...\fR?
+.
Reads image data from the file named \fIfilename\fR into the image.
This command first searches the list of
image file format handlers for a handler that can interpret the data
@@ -280,12 +307,14 @@ specified:
.RS
.TP
\fB\-format \fIformat-name\fR
+.
Specifies the format of the image data in \fIfilename\fR.
Specifically, only image file format handlers whose names begin with
\fIformat-name\fR will be used while searching for an image data
format handler to read the data.
.TP
\fB\-from \fIx1 y1 x2 y2\fR
+.
Specifies a rectangular sub-region of the image file data to be copied
to the destination image. If only \fIx1\fR and \fIy1\fR are
specified, the region extends from (\fIx1,y1\fR) to the bottom-right
@@ -295,6 +324,7 @@ The default, if this option is not specified, is the whole of the
image in the image file.
.TP
\fB\-shrink\fR
+.
If this option, the size of \fIimageName\fR will be reduced, if
necessary, so that the region into which the image file data are read
is at the bottom-right corner of the \fIimageName\fR. This option
@@ -303,12 +333,14 @@ specified a non-zero value for the \fB\-width\fR or \fB\-height\fR
configuration option, respectively.
.TP
\fB\-to \fIx y\fR
+.
Specifies the coordinates of the top-left corner of the region of
\fIimageName\fR into which data from \fIfilename\fR are to be read.
The default is (0,0).
.RE
.TP
\fIimageName \fBredither\fR
+.
The dithering algorithm used in displaying photo images propagates
quantization errors from one pixel to its neighbors.
If the image data for \fIimageName\fR is supplied in pieces, the
@@ -317,31 +349,37 @@ not noticeable, but if it is a problem, this command can be used to
recalculate the dithered image in each window where the image is
displayed.
.TP
-\fIimageName \fBtransparency \fIsubcommand ?arg arg ...?\fR
+\fIimageName \fBtransparency \fIsubcommand \fR?\fIarg arg ...\fR?
+.
Allows examination and manipulation of the transparency information in
the photo image. Several subcommands are available:
.RS
.TP
\fIimageName \fBtransparency get \fIx y\fR
+.
Returns a boolean indicating if the pixel at (\fIx\fR,\fIy\fR) is
transparent.
.TP
\fIimageName \fBtransparency set \fIx y boolean\fR
+.
Makes the pixel at (\fIx\fR,\fIy\fR) transparent if \fIboolean\fR is
true, and makes that pixel opaque otherwise.
.RE
.TP
\fIimageName \fBwrite \fIfilename\fR ?\fIoption value(s) ...\fR?
+.
Writes image data from \fIimageName\fR to a file named \fIfilename\fR.
The following options may be specified:
.RS
.TP
\fB\-background\fI color\fR
+.
If the color is specified, the data will not contain any transparency
information. In all transparent pixels the color will be replaced by
the specified color.
.TP
\fB\-format\fI format-name\fR
+.
Specifies the name of the image file format handler to be used to
write the data to the file. Specifically, this subcommand searches
for the first handler whose name matches an initial substring of
@@ -350,6 +388,7 @@ file. If this option is not given, this subcommand uses the first
handler that has the capability to write an image file.
.TP
\fB\-from \fIx1 y1 x2 y2\fR
+.
Specifies a rectangular region of \fIimageName\fR to be written to the
image file. If only \fIx1\fR and \fIy1\fR are specified, the region
extends from \fI(x1,y1)\fR to the bottom-right corner of
@@ -358,6 +397,7 @@ diagonally opposite corners of the rectangular region. The default,
if this option is not given, is the whole image.
.TP
\fB\-grayscale\fR
+.
If this options is specified, the data will not contain color
information. All pixel data will be transformed into grayscale.
.RE