Quick Nav Bar | |||||||
---|---|---|---|---|---|---|---|
<< Previous | Contents |
Op Index |
Parent | User Notes |
Index |
Glossary |
Next >> |
If the parameter is in double quotes, then the parameter is a string.
All other parameters are numeric. If WinImages F/x needs a floating point number, then that's how the number will be treated. If WinImages F/x needs an integer, any fractional part of the number will be discarded. So 1.5 is the same as 1 for an integer value.
Returns 0-255 value from the action image alpha channel.
Returns 0-255 value from the alpha channel of the unmodified copy of the action image in the undo buffer.
Returns 0-255 value from the action image blue channel.
Returns 0-255 value from the blue channel of the unmodified copy of the action image in the undo buffer.
Returns 0-255 value from the action image green channel.
Returns 0-255 value from the green channel of the unmodified copy of the action image in the undo buffer.
Returns 0-359 degrees from the action image pixel.
Returns 0-359 degrees from the pixel in the unmodified copy of the action image in the undo buffer.
0=X1
1=Y1
2=X2
3=Y1
This function allows you to retrieve the two endpoints of a freehand area selection; that is, where you start drawing, and where you stop drawing.
Returns luma level as 0-255 from action image pixel.
Returns luma level as 0-255 from unmodified copy of the action image in the undo buffer.
Returns the red, green or blue component of the specified palette entry as 0-255.
Returns the number of colors in the specified palette.
Returns as 0-255 the value of the named profile at position "index".
Returns 0-255 value from the action image red channel.
Returns 0-255 value from the red channel of the unmodified copy of the action image in the undo buffer.
Returns saturation as 0-100 from the action image.
Returns saturation as 0-100 from the unmodified copy of the action image in the undo buffer.
Returns left edge of area selection rectangle.
Returns right edge of area selection rectangle.
Returns total width of the action image.
Returns top edge of area selection rectangle.
Returns bottom edge of area selection rectangle.
Returns total height of the action image.
When a script is invoked, WinImages takes note of the vertical extent of the area selection the user makes. It sets the progress bar so that the bar will respond from zero to the number of Y lines selected. There are several ways this can be used, but the most straightforward is to get the Y selection extents, and then process the selection, passing (Y-Y1) to the progress function. You'll find an example of exactly this type of use in the scripted Image Negative Operator, here.
Writes alpha as 0-255 to the action image.
Writes blue channel as 0-255 to the action image.
Writes green channel as 0-255 to the action image.
Writes hue as 0-359 to the action image.
Writes luma as 0-255 to the action image.
Writes red channel as 0-255 to the action image.
Writes saturation as 0-100 to the action image.
This over-rides the area selection the user made and creates an oval area selection as specified. Once used, the original area selection is discarded.
This over-rides the area selection the user made and creates a rectangular area selection as specified. Once used, the original area selection is discarded. Note that the order of x1,x2 and y1,y2 does not matter; they are sorted before being used so that x1 and y1 are left and top, so you can supply them in any order. That means this produces legal rectangles:
10 xw = GETXW(0) 20 yw = GETYW(0) 30 FOR i=1 TO 100 40 x1 = RND()*xw 50 x2 = RND()*xw 60 y1 = RND()*yw 70 y2 = RND()*yw 80 a=SELRECT(x1,y1,x2,y2) 90 a=COLORFILL(RND()*255,RND()*255,RND()*255) 100 NEXT i
This sets the red, green or blue portion of the requested palette. It will return the value of this entry prior to the modification you made.
This sets the entry specified by the index of the requested profile. It will return the value of this entry prior to the modification you made.
This function returns "n" times the position of the timeline as a function of 0 to almost 1; so it will be zero at the first frame, and almost "n" at the last frame. This is intended to produce loops where the 0=1, such as rotation, where 0=360. In that case, you want the last frame of (for instance) of a 30 frame sequence to return 29/30ths instead of 30/30ths. This is because 30/30ths is technically the same thing as 0/30ths. So
10 A=ASTERIZE(0,0,255,0,20,TLPOS(360),7,0,1,1)
This function returns "n" times the position of the timeline as a function of 0 to 1; so it will be zero at the first frame, and exactly "n" at the last frame. For looping animations,
10 A=BRIGHT(TPOS(100))
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
(see the LANDSCAPE() operator)
(see the LANDSCAPE() operator)
(see the LANDSCAPE() operator)
(see the LANDSCAPE() operator)
LANDSCAPE() is the command that actually runs the operator. Before you call LANDSCAPE(), you should call these functions that set up the other LANDSCAPE() variables:
LANDWATER()
LANDTEXT()
LANDSCALE()
LANDROT()
LANDHAZE()
LANDCLIFF()
These functions may be called in any order, except that LANDSCAPE() must be called last.
See the Operator Documentation
(see the LANDSCAPE() operator)
(see the LANDSCAPE() operator)
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
Since a plug-in may have up to 67 parameters (though this is unlikely), we use a fairly flexible approach to get at individual parameters without getting too complex with function arguments.
With the exception of the radio button sets, the various types of plug-in settings are arranged either left to right or top to bottom. The "which" parameters below specify which unit, left to right or top to bottom. For instance, a=PUCHECK(2,1) checks the second checkmark from the left.
The radio buttons are arranged as the set of 8, the two sets of four, and the two sets of two. Left-to right ordering applies to both the sets of four and the sets of two.
The following functions may be used to set up any portion of a plug-in function:
a=LOADPLUG("path_and_file.wis")
a=PUPALNC(Number_of_Colors_In_Palette[2-1024])
a=PUSTRING(which_string[0-1],"string")
a=PURADIO(which_radio[0-4],selection[0-7]) (selection may be [0-3] or [0-1])
a=PUCHECK(which_check[0-7],VALUE)
a=PUFLOAT(which_float[0-7],value)
a=PUINTEGER(which_int[0-7],value)
a=PUPROFILE(which_profile[0-11],index[0-200],value[0-255])
a=PURGBA(which_rgba[0-3],r,g,b,a)
a=PUPALRGB(which_palette[0-1],index[0-1023],r,g,b)
a=PUCMD(command_number[0-29]) (immediately executes command button)
Once the plug-in function is set up, call this to run it:
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
Note that only when the EDGES SETTING is set to 0 will the colors make a difference, but the scripting engine requires all parameters so these must be set.
See the Operator Documentation
(see the STROKE() operator)
(see the STROKE() operator)
(see the STROKE() operator)
(see the STROKE() operator)
(see the STROKE() operator)
(see the STROKE() operator)
STROKE() is the command that actually runs the operator. Before you call STROKE(), you should call these functions that set up the other STROKE() variables:
STAPP()
STBARREL()
STFADE()
STFLIP()
STPAL()
STPOS()
STROTATE()
STSHADOW()
STSIZING()
See the Operator Documentation
(see the STROKE() operator)
(see the STROKE() operator)
(see the STROKE() operator)
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
See the Operator Documentation
Returns the absolute value of the parameter (a positive number.)
Returns the ASCII code for the character in the string.
Returns the arc-tangent of the parameter in radians.
Brings in new program lines. The old program data is discarded. Variables that have been marked by the use of the COMMON statement are retained, other variables are discarded.
Returns the ASCII character represented by the numeric parameter.
Resets all numeric variables to zero and text variables to empty.
Closes the open file by its channel number.
This identifies a variable as one that gets passed along to a program that you bring in using the CHAINP command.
Returns the cosine of the paramater in radians.
Stores constant values for use with the READ function.
Returns the current date as a string.
Returns the day (1-31) as a string.
DEF UFfunction-name([arg[,arg...]])
Defines a function that you construct. The function name must begin with the capital letters UF (for User Function). The variables named in the left side of the statement control what is passed to the function.
The following simple example implements a negative function using inverse luma:
10 REM shows how to use DEF
20 DEF UFNUG(uuu,vvv) = 255-GETLUMA(uuu,vvv)
40 X1=GETX1(0): Y1=GETY1(0): X2=GETX2(0): Y2=GETY2(0)
50 FOR Y=Y1 TO Y2
60 A=PROGRESS(Y-Y1): IF A=1 THEN END
70 FOR X=X1 TO X2
80 a = PUTLUMA(X,Y,UFNUG(X,Y))
90 NEXT X
100 NEXT Y
Returns the degree value equivalent to the specified number in radians.
Examples:
10 DIM a(10,20)
20 DIM B$(100,3)
This command terminates the script immediately.
Returns -1 if the device referenced is at the end-of-file, otherwise returns zero.
Erases variables.
Returns exponential of parameter.
FIELD #n, o AS s$ [, p AS t$...]
This allocates space in a random file buffer for device indicated by #n, allocating o bytes and assigning the bytes at this position to the variable s$, etc.
Example:
10 FOR I=0 to 10 STEP 2
20 print "The number is ";I
30 NEXT I
GET reads the next record from a random-access file or device into the buffer associated with that file. If record number is specified, GET reads the specified record.
This jumps to the specified line and begins execution. However, when it jumps, it remembers where it was when it jumped; when, at the new location, it encounters a RETURN statement, the script will resume execution at the statement or line immediately following the GOSUB statement.
This jumps to the specified line and begins execution there.
Returns a string which is the base-16 equivalent of the parameter n.
Returns the current hour as a string 0-23.
IF expression THEN statement [ELSE statement]
Example:
10 A=5
20 IF A=5 THEN PRINT "it was 5" ELSE PRINT "it was something else"
INSTR([start,] string, pattern)
Used to search for the pattern in the string. If found, will return the character position in the string where it exists; otherwise, it will return 0.
Discards the fractional part of the number, if any, and returns the integer part.
Deletes the specified file.
Returns the leftmost n characters of the string.
Returns the length of the string.
LET variable=expression (OPTIONAL)
Optional assignment statement. These do the same thing:
10 LET A=5
20 A=5
LOC returns the next record that GET or PUT statements will use.
Returns the length of the file specified by #n (see OPEN)
Returns natural log of parameter.
Transfers data from expression to the left hand side of a string variable or random access buffer field.
Brings in new program lines from a file. The current program is retained, and varables are not reset. To reset variables and discard the current program, use CHAIN instead.
Returns a substring of len length (if provided) starting at start.
Returns a string of minutes 0-59.
Returns a string for month, 1-12
Renames the specified file.
Used with FOR
Allows you to associate a series of subroutines with different values of a variable. Example:
10 A=2
20 ON A GOSUB 100,200,300
30 PRINT "We're back..."
40 END
100 PRINT "sub 1":RETURN
200 PRINT "sub 2":RETURN
300 PRINT "sub 3":RETURN
Allows you to associate a series of jump-out targets with different values of a variable. Example:
10 A=2
20 ON A GOTO 100,200,300
30 PRINT "Whoops - A was not matched!"
40 END
100 PRINT "target 1":END
200 PRINT "target 2":END
300 PRINT "target 3":END
OPEN "O"|"I"|"R", #n, filename, [,recordlength] filename FOR INPUT|OUTPUT|APPEND AS #n [,LEN=recordlength]
You can actually use OPEN two ways:
The first form, with the O/I/R options, allows you to select sequential or random file access. The R option is the random access option, while I and O are sequential.
The second form allows only sequential file access.
See the PRINT statement for an example of the use of the second form.
Controls the referencing of arrays. With OPTION BASE 1 in effect (the default), this statement:
10 DIM A(10)
…will result in array elements from A(1) through A(10).
With OPTION BASE 0 in effect, this statement:
10 DIM A(10)
…will result in array elements from A(0) through A(9).
Returns a number represeting the character position on the output (PRINT) line.
PRINT [#n]|[USING format] expressions
PRINT is the means to write information to dialogs in WinImages F/x, and also to files. Used by itself as PRINT expression, output is sent to WinImages F/x. Used with a device number and an open file, you can write almost anything to the file.
PRINT expressions are text strings or variables separated either by commas, which act as TABs, or by semicolons, which act to juxtapose one portion of an expression next to the next portion. Examples:
10 PRINT "This is a test."
20 A=5
30 PRINT "The value of A is ";A
40 B=7
50 PRINT A,B
60 OPEN "c:\scripttest.txt" FOR OUTPUT AS #1
70 PRINT #1,"Data for the file"
80 PRINT #1,"A+B=";A+B
90 CLOSE #1
PUT outputs the next available record or the record specified by recordnumber to the specified channel.
Returns the radian value equivalent to the specified number in degrees.
Seeds the script language random number generator.
Reads information contained in DATA statements.
Resets the READ statement so that it points back to the beginning of the information contained in the DATA statements.
This statement is only used in subroutines. When you call a subroutine with GOSUB, this statement causes execution to result at the line or statement following the GOSUB call.
Returns the rightmost n characters of string.
Returns a random number ranging from zero to 1.
Places the data specified by expression into the right side of a string variable or random access buffer field.
Returns a string representing seconds in the range 0-59.
Returns either -1, 0 or 1, depending on the sign of the argument.
Argument n is in radians.
Returns a string with n spaces in it.
Square root function.
Returns a string of the number.
Removes all leading and trailing spaces and tabs from a string, but does not remove any that are "interior" elements, that is, that might be separating words or numbers interior to the string.
Swaps two variables of identical types.
Sends spaces until the column indicated by n is reached. Intended to be used with PRINT.
Argument is in radians.
Returns the current time as a text string.
Returns the value (a number) of a string that contains a text representation of a number.
Ends a WHILE loop, see WHILE.
Will loop as long as the expression evaluates as true (-1).
Sets the number of columns assumed to the be the full width of the specified output channel.
WRITE #n,expression[,expression]
Somewhat like print; outputs variables in a formatted manner.
Returns a string containing the year.
Quick Nav Bar | |||||||
---|---|---|---|---|---|---|---|
<< Previous | Contents |
Op Index |
Parent | User Notes |
Index |
Glossary |
Next >> |
WinImages F/x Manual Version 7, Revision 0 |