⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 photo.n

📁 linux系统下的音频通信
💻 N
📖 第 1 页 / 共 2 页
字号:
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\fRis not given, the default value is the same as \fIx\fR.  With thisoption, each pixel in the source image will be expanded into a blockof \fIx\fR x \fIy\fR pixels in the destination image, all the samecolor.  \fIx\fR and \fIy\fR must be greater than 0..TP\fB\-subsample \fIx y\fRSpecifies that the source image should be reduced in size by usingonly every \fIx\fRth pixel in the X direction and \fIy\fRth pixel inthe Y direction.  Negative values will cause the image to be flippedabout the Y or X axes, respectively.  If \fIy\fR is not given, thedefault value is the same as \fIx\fR..RE.TP\fIimageName \fBget\fR \fIx y\fRReturns the color of the pixel at coordinates (\fIx\fR,\fIy\fR) in theimage as a list of three integers between 0 and 255, representing thered, green and blue components respectively..TP\fIimageName \fBput \fIdata\fR ?\fB\-to\fI x1 y1 x2 y2\fR?Sets pixels in \fIimageName\fR to the colors specified in \fIdata\fR.\fIdata\fR is used to form a two-dimensional array of pixels that arethen copied into the \fIimageName\fR.  \fIdata\fR is structured as alist of horizontal rows, from top to bottom, each of which is a listof colors, listed from left to right.  Each color may be specified by name(e.g., blue) or in hexadecimal form (e.g., #2376af).  The\fB\-to\fR option can be used to specify the area of \fIimageName\fR to beaffected.  If only \fIx1\fR and \fIy1\fR are given, the area affectedhas its top-left corner at (\fIx1,y1\fR) and is the same size as thearray given in \fIdata\fR.  If all four coordinates are given, theyspecify diagonally opposite corners of the affected rectangle, and thearray given in \fIdata\fR will be replicated as necessary in the X andY directions to fill the rectangle..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 ofimage file format handlers for a handler that can interpret the datain \fIfilename\fR, and then reads the image in \fIfilename\fR into\fIimageName\fR (the destination image).  The following options may bespecified:.RS.TP\fB\-format \fIformat-name\fRSpecifies 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 dataformat handler to read the data..TP\fB\-from \fIx1 y1 x2 y2\fRSpecifies a rectangular sub-region of the image file data to be copiedto the destination image.  If only \fIx1\fR and \fIy1\fR arespecified, the region extends from (\fIx1,y1\fR) to the bottom-rightcorner of the image in the image file.  If all four coordinates arespecified, they specify diagonally opposite corners or the region.The default, if this option is not specified, is the whole of theimage in the image file..TP\fB\-shrink\fRIf this option, the size of \fIimageName\fR will be reduced, ifnecessary, so that the region into which the image file data are readis at the bottom-right corner of the \fIimageName\fR.  This optionwill not affect the width or height of the image if the user hasspecified a non-zero value for the \fB\-width\fR or \fB\-height\fRconfiguration option, respectively..TP\fB\-to \fIx y\fRSpecifies 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\fRThe dithering algorithm used in displaying photo images propagatesquantization errors from one pixel to its neighbors.If the image data for \fIimageName\fR is supplied in pieces, thedithered image may not be exactly correct.  Normally the difference isnot noticeable, but if it is a problem, this command can be used torecalculate the dithered image in each window where the image isdisplayed..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\-format\fI format-name\fRSpecifies the name of the image file format handler to be used towrite the data to the file.  Specifically, this subcommand searchesfor the first handler whose name matches a initial substring of\fIformat-name\fR and which has the capability to write an imagefile.  If this option is not given, this subcommand uses the firsthandler that has the capability to write an image file..TP\fB\-from \fIx1 y1 x2 y2\fRSpecifies a rectangular region of \fIimageName\fR to be written to theimage file.  If only \fIx1\fR and \fIy1\fR are specified, the regionextends from \fI(x1,y1)\fR to the bottom-right corner of\fIimageName\fR.  If all four coordinates are given, they specifydiagonally opposite corners of the rectangular region.  The default,if this option is not given, is the whole image..RE.SH "IMAGE FORMATS".PPThe photo image code is structured to allow handlers for additionalimage file formats to be added easily.  The photo image code maintainsa list of these handlers.  Handlers are added to the list byregistering them with a call to \fBTk_CreatePhotoImageFormat\fR.  Thestandard Tk distribution comes with handlers for PPM/PGM and GIF formats,which are automatically registered on initialization..PPWhen reading an image file or processingstring data specified with the \fB\-data\fR configuration option, thephoto image code invokes each handler in turn until one isfound that claims to be able to read the data in the file or string.Usually this will find the correct handler, but if it doesn't, theuser may give a format name with the \fB\-format\fR option to specifywhich handler to use.  In fact the photo image code will try thosehandlers whose names begin with the string specified for the\fB\-format\fR option (the comparison is case-insensitive).  Forexample, if the user specifies \fB\-format gif\fR, then a handlernamed GIF87 or GIF89 may be invoked, but a handlernamed JPEG may not (assuming that such handlers had beenregistered)..PPWhen writing image data to a file, the processing of the\fB\-format\fR option is slightly different: the string value givenfor the \fB\-format\fR option must begin with the complete name of therequested handler, and may contain additional information followingthat, which the handler can use, for example, to specify which variantto use of the formats supported by the handler..SH "COLOR ALLOCATION".PPWhen a photo image is displayed in a window, the photo image codeallocates colors to use to display the image and dithers the image, ifnecessary, to display a reasonable approximation to the image usingthe colors that are available.  The colors are allocated as a colorcube, that is, the number of colors allocated is the product of thenumber of shades of red, green and blue..PPNormally, the number ofcolors allocated is chosen based on the depth of the window.  Forexample, in an 8-bit PseudoColor window, the photo image code willattempt to allocate seven shades of red, seven shades of green andfour shades of blue, for a total of 198 colors.  In a 1-bit StaticGray(monochrome) window, it will allocate two colors, black and white.  Ina 24-bit DirectColor or TrueColor window, it will allocate 256 shadeseach of red, green and blue.  Fortunately, because of the way thatpixel values can be combined in DirectColor and TrueColor windows,this only requires 256 colors to be allocated.  If not all of thecolors can be allocated, the photo image code reduces the number ofshades of each primary color and tries again..PPThe user can exercise some control over the number of colors that aphoto image uses with the \fB\-palette\fR configuration option.  Ifthis option is used, it specifies the maximum number of shades ofeach primary color to try to allocate.  It can also be used to forcethe image to be displayed in shades of gray, even on a color display,by giving a single number rather than three numbers separated byslashes..SH CREDITS.PPThe photo image type was designed and implemented by Paul Mackerras,based on his earlier photo widget and some suggestions fromJohn Ousterhout..SH KEYWORDSphoto, image, color

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -