The latest version of this document can be found at www.broad.ology.org.uk/amiga/sketchblock/arexx.html

SketchBlock 3.4 - Digital Sketching For The Amiga

Arexx Commands

The arexx port name is SKETCHBLOCK

Error Numbers
Error NameError Number
ERROR_INVALID_PROJECTID1(2^0)
ERROR_INVALID_LAYERID2 (2^1)
ERROR_OUTOFBOUNDS4 (2^2)
ERROR_INCOMPLETEARGS8 (2^3)
ERROR_USERCANCELLED16 (2^4)
ERROR_UNKNOWNATTRIBUTE32 (2^5)
ERROR_BADFILE64 (2^6)
ERROR_UNKNOWN_ERROR 2147483648 (2^31)

HELP

COMMAND/K

Obtain some help on the ARexx commands available.

No arguments
When called with no arguments a space seperated list of all available commands is returned

COMMAND/K
Specify which commands you want help on, returns the command template.

GADGETHELP

SHOWHELP/S,HIDEHELP/S

Switch gadget help strings on and off in the GUI.
SHOWHELP/S
HIDEHELP/S

ABOUT

Display an 'about' window, showing version info.
No Args

SETPROGRESS

PROGRESS/K/N/A,LABEL/K

Set the progress as displysed in the application progress bar.
PROGRESS/K/N/A
Numerical progress value as a percentage 0 - 100 set to -1 to clear
LABEL/K
Text Lable to display in Progress bar.

GETAPPLICATIONINFO

ATTR/K,STEM/K

Get some informatin about the application.
ATTR/K
The attribute to query.
  • SCREENNAME - The name of public screen that sketchblock has opened on.
  • VERSION - Return version of SketchBlock
  • LASTFILE - returns the name of the last file loaded
  • ACTIVEPROJECT - retusn the ID of the active project
STEM/K
Provide a stem varaiable to retrieve the above info plus info on the projects. STEM.PROJECTS.0 give the number of projects and STEM.PROJECTS.n.ID retrieves the ID for a given project.

LOAD

FILE

Load a sketch project file in a new window.
No arguments
If no arguments are specified, a file requester is opened to allow the user to choose a file.
FILE
Specify the file to be opened.

Result

Returns RC=0 on success and puts the Project ID in RESULT

returns RC=5 on error and returns either ERROR_USERCANCELLED or ERROR_BADFILE in RC2

IMPORT

FILE,BUFFERTYPE/K/N

FILE
Name of file to import, opens requester if not supplied.
BUFFERTYPE
Type of buffer defaults to 0 Or with 1 for 32bit buffer (default floating point)

SAVE

PRJID/N/K,FILE/K

PRJID/N/K
FILE/K

SAVEAS

PRJID/N/K,FILE

PRJID/N/K
FILE

SAVEASBRUSH

PRJID/N/K,TYPE/K/N/A,OPACITY/N/K,STAMP/N/K,USECOLOR/S,FILE

Save the specified project as brush. The name of the brush is taken from the project.
PRJID/N/K
Specify the project to save via it's ID. If not provided the currently active project is saved.
TYPE/K/N/A
REQUIRED. Specify the type of brush to create. Currently only type '1' Single Bitmap brushes are supported.
OPACITY/N/K
Specify the opacity of the brush. Value is expressed at a percentage from 0 to 100. Default is 100
STAMP/N/K
Specify the stamp intervale of the brush. Value is a expressed as a percenateg from 1 to 500
COLOR/N/K
Determines how to use the colour in the brush.
  • 0: (default) Use alpha component only
  • 1: Use colour imagery
  • 2: Use the value of the colour channels to blend between the Main and Alternate Colours. This allows very powerful multi colour brushes.
FILE
Specify the filename if the brush. If not provided a file requester will open.

EXPORT

PRJID/N/K,FILE/K,TYPE/K

PRJID/N/K
Project to export or currently active project when not specified
FILE/K
Name of file to save to, file requester wil open when not specified.
TYPE/K
Specify the file type to export to. eg PPM for portable pixmap

PSPRINT

PRJID/N/K,FILE/K,PAGEWIDTH/K/N,PAGEHEIGHT/K/N,IMAGEWIDTH/K/N,IMAGEHEIGHT/K/N,IMAGEX/K/N,IMAGEY/K/N,EPS/S

"Print" the project. Saves the project to a file as postscript. Can be sent to postscript printer for printing or processed with ghostscript. All sizes defined below are in postscript points. 72 points per inch. Defaults are currently set to A4 (595 * 842)
PRJID/N/K
ID of project to print or current project if omited
FILE/K
DEVICE or file to print to.
PAGEWIDTH/K/N
Width of page in points (defaults to 595)
PAGEHEIGHT/K/N
Height of page in points (defaults to 842)
IMAGEWIDTH/K/N
Width of image in points (defaults to 555)
IMAGEHEIGHT/K/N
Heigh of image in points (defaults to 800)
IMAGEX/K/N
X offset in points (defaults to 20)
IMAGEY/K/N
Y offset in points (defaults to 21)
EPS/S
Save as EPS instead. The dimensions above are ignored and the image is saved as an ascii EPS. (no preview at present)

CLOSE

PRJID/N/K,FORCE/S,NOASK/S

PRJID/N/K
FORCE/S
NOASK/S

QUIT

FORCE/S

FORCE/S

ICONIFY

SHOW

SETAPPLICATIONBUSY

Sets a busy pointer and block user input to all application windows.

UNSETAPPLICATIONBUSY

Removes the busy pointer and allow user input.

STARTMACRORECORD

MACROFILE,TIME/S,PYTHON/S,WEDGES/S

Record all actions to a macro file. A powerful debugging feature and also simplifies writing scripts.
MACROFILE
File to record to, will be overwritten.
TIME
Insert timestamsp as comments before each command
PYTHON
Output python code instead of ARexx
WEDGES
Output commands sent to wedges (port based only)

STOPMACRORECORD

Stop recording the macro.

NEWPROJECT

WIDTH/N/K/,HEIGHT/N/K/,NAME/K,RED/N/K,GREEN/N/K,BLUE/N/K

WIDTH/N/K/
HEIGHT/N/K/
NAME/K
RED/N/K
GREEN/N/K
BLUE/N/K

SETCHANNELLOCKS

PRJID/K/N,ALPHA/S,RED/S,GREEN/S,BLUE/S

Lock or unlock the colour / alpha channels.
PRJID/N/K
ID of project whoes channel locks are to chnaged or the active project if ommited
ALPHA/S
Lock the alpha channel when present, nock when ommited
REDS
Lock the red channel when present, nock when ommited
GREEN/S
Lock the green channel when present, nock when ommited
BLUE/S
Lock the blue channel when present, nock when ommited

GETPROJECTINFO

PRJID/N/K,ATTR/K,STEM/K

Retrieves information about a project.
PRJID/N/K
The ID of the project. If not supplied the currently active project is used.
ATTR/K
The Attribute to retrieve
  • NAME - The name of the project. Not the same as the filename!
  • FILENAME - The filename the project was last saved too. If not saved then will return RC 5
  • PRJID - The ID of this project (useful if the ID wasn't supplied to the function ... )
  • WIDTH - Width of the Project in pixels.
  • HEIGHT - Height of the project in pixels
  • ZOOM - Projects zoom factor in percent
  • XOFFSET - The offset with the project of the left edge of the displayed portion of the project
  • YOFFSET - The offset with the project of the top edge of the displayed portion of the project
  • DISABLEDISPLAY - Whether or not the updating of the project display is disabled or not.(see ENABLEDISPLAYPROJECT and DISABLEDISPLAYPROJECT
  • LAYERS - The number of layers in the project
  • LAYERID <index>: - The ID of the indexed layer. Index start from 1 .This attribute takes an index and so must be quoted into single string to be corectly recognised.
  • CHANNELLOCK - returns which channels if any are locked as a string ALPHA RED GREEN BLUE
STEM/K
Pass a stem variable for the above attributes to be added too. The stem vars are the same as above excpet for LAYERS. STEM.Layers.0 gives the number of layers and then STEM.LAYERS.n.ID gives the ID for each layer.
/**/
OPTIONS RESULTS
ADDRESS SKETCHBLOCK

GETPROJECTINFO ATTR LAYERS

SAY "project has " RESULT "Layers"

GETPROJECTINFO ATTR "LAYERID 1"

SAY "Layer 1 has ID " RESULT 

GETPROJECTINFO STEM MYPROJECT

SAY "Project has " MYPROJECT.LAYERS.0 "Layers"
SAY "Layer 1 has ID " MYPROJECT.LAYERS.1.ID 


RESIZEPROJECTWINDOW

PRJID/N/K,WINDOWLEFT/N/K/A,WINDOWTOP/N/K/A,WINDOWWIDTH/K/N/A,WINDOWHEIGHT/K/N/A

Resize the projects window. Does not affect project.
PRJID/N/K
WINDOWLEFT/N/K/A
WINDOWTOP/N/K/A
WINDOWWIDTH/K/N/A
WINDOWHEIGHT/K/N/A

SETWINDOWTITLE

PRJID/N/K,NEWTITLE/K

Sets the extebded window title of a project. Can be used to display useful information about plugins tools etc.
PRJID/N/K
NEWTITLE/K

RESIZEPROJECT

PRJID/N/K,NEWWIDTH/K/N,NEWHEIGHT/K/N

Change the dimensions of the specified project. Note this does not scale any image data (use SCALELAYERfor that). If only width or hight is pecified that the project size is scaled keeping the aspect ration constant.
PRJID/N/K
Specify project ID of project to resize, if omited use currently active project.
NEWWIDTH/K/N
The new width in pixels.
NEWHEIGHT/K/N
The new height in pixels.

RENAMEPROJECT

PRJID/N/K,NAME/A

Rename the specified project

PRJID/N/K
Specify the project to rename, if this option is omited then the currently active project is renamed.
NAME/A
Specify the new name.

MAPPROJECTTOWINDOW

PRJID/N/K,X/K/N/A,Y/K/N/A

Map a coordinate in "Project Space" into "Window Space" taking account of scrolling, zoom and rotation.
PRJID/N/K
Specify ID of project or if omited use currently active project.
X/K/N/A
X coordinated.
Y/K/N/A
Y coordinate

MAPWINDOWTOPROJECT

PRJID/N/K,X/K/N/A,Y/K/N/A

Map and (x,y) coordinate in the sketch window, to the corresponding project coordinate, taking into account scrolling, scaling, rotation etc.
PRJID/N/K
Specify the project, if this option is omited the currently active project is used.
X/K/N/A
The X coordinate in "window space"
Y/K/N/A
The Y coordinate in "window space"

Result

The result is put into RESULT as "<project xvalue> <project yvalue<"
	MAPWINDOWTOPROJECT 'X' windowX 'Y' windowY
	parse var result projectX projectY

SELECTIONTOALPHA

PRJID/N/K,LAYID/N/K

Create an alpha channel in the specified layer from the current slection.
PRJID/N/K
Project ID or active if omited
LAYID/N/K or active if omited
Layer ID

ALPHATOSELECTION

PRJID/N/K,LAYID/N/K,ACTION/K

Create a slection mask from the alpha channel of the specified layer.
PRJID/N/K
Project ID or active if omited
LAYID/N/K or active if omited
Layer ID
ACTION/K
The action can be one of:
  • REPLACE - Replace slection
  • ADD
  • SUBTRACT
  • INTERSECT

CLEARSELECTION

PRJID/K/N

Clear and disbable the selection mask.
PRJID/N/K
Project ID or active if omited

INVERTSELECTION

PRJID/K/N

Invert the slection mask if it exists.
PRJID/K/N

GETSELECTIONBOUNDS

PRJID/K/N,THRESHOLD/K/A

Return the bounding box of the current selection mask.
PRJID/K/N
Project whos mask you want to bound
THRESHOLD/K/A
The threshold to use for bound calculation. 0.0 to 1.0

Result

Returns the bounding rectangle in the form Left Top Right Bottom.

INPUTWEDGE

PRJID/N/K,WEDGENAME,PORTNAME/K,SELECTUP/S,SELECTDOWN/S,MOUSEMOVE/S,DELAYMOUSEMOVE/K/N,RAWKEY/K,PROJECTACTIVE/S,PROJECTINACTIVE/S,DISPLAYPROJECT/S

Insert a 'wedge' into the input event stream. A wedge is a script that is called every time the specified event occurs. When a wedge has been inserted no input events are passed to the currently active plugin.

Each project may have it's own wedge but only one wedge is possible per project, inserting a new one will remove the previous one.

Calls to the wedges are made asynchronously so that the wedge scripts may in term call other SketchBlock ARexx commands. You must be aware though that in a multitasking environment scripts may not be executed ot finsih executing in strictly the same order they were launched.

Wedge scripts will be called with the arguments:

PRJID <ID>>EVENTNUMBER <unique number> <eventtype> [<eventdata>[...]]
For example for the selectdown event:
sketchblock:Rexx/wedge_lines.rexx  PRJID 42 EVENTNUMBER 1234 SELECTDOWN MOUSEX 123 MOUSEY 456

When a wedge has been inserted into a project '[W]' will be added to the start of the window title.

PRJID/N/K
Specify the project to wedged, if this option is omited the currently active project is used
WEDGENAME
The name of the wedge script to insert. This must be a fully qualified script name, that is visible to ARexx. Call with no name to remove the existing wedge and reenable normal event processing.
PORTNAME/K
If present this is a port based wedge, The ARexx specified by name must exist. Rememebr portnames are case sensitive.
SELECTUP/S
The wedge wants to listen to SELECTUP (LMB released) events. Data will passed as
 SELECTUP MOUSEX <mouse x value> MOUSEY <mouse y value>
 
SELECTDOWN/S
The wedge wants to listen to SELECTDOWN (LMB pressed) events. Data will passed as
 SELECTDOWN MOUSEX <mouse x value> MOUSEY <mouse y value>
 
MOUSEMOVE/S
The wedge wants to listen to MOUSEMOVE events. Data will passed as
 MOUSEMOVE MOUSEX <mous x value> MOUSEY <mouse y value>
 
There will likely be alot of these so the script will need to be short. It's recomended to only use this option if you must get all of the mouse movement information.
DELAYMOUSEMOVE/K/N
The wedge wants to listen to a reduce number of MOUSEMOVE events. Data will passed as
 DELAYMOUSEMOVE MOUSEX <mous x value> MOUSEY <mouse y value>
 
The parameter for this option is the number of events to skip.
RAWKEY/K
Listen to rawkey events.
 RAWKEY CODE < Keycode > QUALIFIER < qualifier >
 

SETPOINTER

PRJID/N/K,POINTERNAME/K,POINTERID/K/N

Set the mouse pointer for the projects window to a preloaded custom pointer. Pointer can be specified by name or ID.
PRJID/N/K
Specify ID of project or if omited use currently active project.
POINTERNAME/K
Name of pointer.
POINTERID/K/N
ID of pointer. Pass -1 for system default pointer.

GETPOINTER

PRJID/N/K,POINTERNAME/S,POINTERID/S

Retreive the name or ID of the current pointer. Only one of POINTERNAME and POINTERID can be specified.
PRJID/N/K
Specify ID of project or if omited use currently active project.
POINTERNAME/S
Request pointer name. The name is return in RESULT if the RESULT is the empty string then the pointer is the system default pointer.
POINTERID/S
Request pointer ID if RESULT is < 0 then pointer is system default pointer.

Result

Returns name or ID in result, depending on specified option.

ADDPOINTER

POINTERNAME/K/A,IMAGEFILE/K/A,HOTX/K/N/A,HOTY/K/N/A

Add a new custom pointer defined by a image file.
POINTERNAME/K/A
The name of the new pointer.
IMAGEFILE/K/A
Datatypes loadable file container the new pointer image.
HOTX/K/N/A
The X coordinate of the hot point relative to the top left of the image.
HOTY/K/N/A
The Y coordinate of the hot point relative to the top left of the image.

Result

Returns the ID of the new pointer in RESULT.

REMOVEPOINTER

POINTERNAME/K,POINTERID/K/N

Remove a loaded custom pointer and free up any resources.
POINTERNAME/K
Name of pointer to remove.
POINTERID/K/N
ID of pointer to remove.

Result

RC 5 indicates pointer not found.

RENAMELAYER

PRJID/N/K, LAYID/N/K, NAME/A

Rename a layer.
PRJID/N/K
Specify the project if omited use the layers project.
LAYID/N/K
Specify the layer if omited use the active layer of the project, if no project specified use the active layer of the active project. If the layer and project don't match return with error.
NAME/A
The new name for the layer.

IMPORTLAYER

PRJID/N/K,CLIP/K/N,FILE

Import an image from file via the datatypes library and add it to a project as a new layer.
PRJID/N/K
Specify the project to add the layer too, if ths option is omited use the active project.
CLIP/K/N
Specify a clipboard unit to import from instead of a file
FILE
The filename to load.

Result

The ID of the new layer is return in the RESULT variable.

IMPORTLAYERPROJECT

PRJID/N/K,INDEX/N/K/A,FILE

Import a layer from a sketchblock project file.
PRJID/N/K
Specify the project to add the layer too, if ths option is omited use the active project.
INDEX/N/K/A
The index of the layer to be loaded
FILE
The filename of the project to load the layer from

Result

The ID of the new layer is return in the RESULT variable.

EXPORTLAYER

PRJID/N/K,LAYID/K/N,CLIP/K/N,FILE,TYPE/K,OPTIONS/K

Exports the chosen layer as a 32 ILBM via the Datatypes Library or via the exporter plugin chosen via the TYPE keyword. The layer is unmodified after the operation and the 'modified' status of the project is unchanged.
PRJID/N/K
Specify project or if omitted use currently active project.
LAYID/K/N
Specify layer or if omited use activelayer of specified project.
CLIP/K/N
Specify the number of a clipboard unit to export to. If CLIP is specified the exporter TYPE option will be ignored
FILE
Filename to save to if omited a file reuester in saveMode is opened to choose the file name.
TYPE/K
Specify the file type to export to. eg PPM for portable pixmap
OPTIONS/K
Specify some options to pass through to the export plugin specified by type. THis is currently experimental and the format will change so is not documented for now

ACTIVATELAYER

PRJID/N/K,LAYID/N/K,INDEX/N/K

Activate a given layer. Either one of LAYID or INDEX must be given.
PRJID/N/K
ID of Project which owns layer. Currently active if omited
LAYID/N/K
ID of layer
INDEX/N/K
Index of layer

LAYERALPHA

PRJID/N/K,LAYID/N/K,ALPHAON/S,ALPHAOFF/S,FILLALPHA/S

Change the alpha behaviour (or transparency) of a layer, optionally filling the previously transparent areas with the current background colour
PRJID/N/K
Specify the project.
LAYID/N/K
Specify the layer
ALPHAON/S
Switch Alpha ON (mutually exclusive with ALPHAOFF).
ALPHAOFF/S
Switch Alpha OFF (utually exclusive with ALPHAON).
FILLALPHA/S
When switching alpha off, fill the previously transparent areas with the current background colour, taking alpha levels into account

COLORTOALPHA

PRJID/N/K,LAYID/N/K,COLOR

Replace the given colour in the layer with transparency, so that if overlayed on a layer with that color the original image is reproduced.
PRJID/N/K
Specify project
LAYID/N/K
Specify layer
COLOR
The colour to replace given as a ARGB Hex string eg FFABC123. Alpha part is ignored in this context.

FLATTENPROJECT

PRJID/N/K,COLOR

Flattens the project. This means merging all layers into one layer the same size as the project dimensions, and replacing the alpha parts with the specified colour.

Merged layers are discarded.

PRJID/N/K
Specify the project, if this option is omited use the currebtly active project.
COLOR
The colour to use for replaceing alpha, use current background colour if not specified.

MERGEVISIBLE

PRJID/N/K,DISCARDNONVIS/S,MODE/N

Similar to the above except that only visible layers are merged, and alpha information is retained.
PRJID/N/K
Specifies the project to merge, if this option is omited use the currently active peoject.
DISCARDNONVIS/S
Set this switch if the non visible layers should be discarded as well as the visible.
MODE/N
Set whether to use project dimensions expand or use lowest layer dimensions. Options are:
  • MVL_EXPAND 0
    Expand to largest layer.
  • MVL_CLIPIMAGE 1
    Clip to image / project size
  • MVL_CLIPBOTTOM 2
    Clip to bottom layer
  • MVL_CLIPSMALLEST 3
    Clip to smalles layer

NEWLAYER

PRJID/N/K,WIDTH/N/K/,HEIGHT/N/K/,NAME/K,RED/N/K,GREEN/N/K,BLUE/N/K,ALPHA/N/K,HASALPHA/S/K

PRJID/N/K
WIDTH/N/K/
HEIGHT/N/K/
NAME/K
RED/N/K
GREEN/N/K
BLUE/N/K
ALPHA/N/K
HASALPHA/S/K

REMOVELAYER

PRJID/N/K,LAYID/N/K

PRJID/N/K
LAYID/N/K

RAISELAYER

PRJID/N/K,LAYID/N/K

PRJID/N/K
LAYID/N/K

LOWERLAYER

PRJID/N/K,LAYID/N/K

PRJID/N/K
LAYID/N/K

SHOWLAYER

PRJID/N/K,LAYID/N/K

PRJID/N/K
LAYID/N/K

HIDELAYER

PRJID/N/K,LAYID/N/K

PRJID/N/K
LAYID/N/K

MOVELAYER

PRJID/N/K,LAYID/N/K,X/N/A,Y/N/A

PRJID/N/K
LAYID/N/K
X/N/A
Y/N/A

COPYLAYER

PRJID/N/K,LAYID/N/K,X/K/N,Y/K/N,WIDTH/K/N,HEIGHT/K/N,SHRINK/S,PLACE/S

Copy a layer or section of a layer into a new layer.
If X Y WIDTH HEIGHT are provided copy the specifed rectangle from the layer otherwise copy the whole layer.
PRJID/N/K
Specify project if omitted use active project
LAYID/N/K
Specify layer if ommitted use active poject of specified layer.
X/K/N
X offset of section to copy
Y/K/N
Y offset of section to copy
WIDTH/K/N
Width of section to copy
HEIGHT/K/N
Height of section to copy
SHRINK/S
If this switch is applied the new layer shrink fits to thw size of the coppied scetion, other wise a new layer the size theoriginal is created.
PLACE/S
If this switch is provided line the bew layer up with the old one. Otherwise set LaywerX and LayerY to 0,0. (relative to the Project)

SCALELAYER

PRJID/N/K,LAYID/N/K,NEWWIDTH/K/N,NEWHEIGHT/K/N

Scale the layer using a smooth scaling alogorithm. The current algorthm is inspired by the "mixing algorthm" from NetPBM and is a form of linear interpolation.
PRJID/N/K
Specify the project or if omited use active project.
LAYID/N/K
Specify layer or if omited use active layer of selected projecxt.
NEWWIDTH/K/N
New width for the layer
NEWHEIGHT/K/N
New height for the layer

Result

RESIZELAYER

PRJID/N/K,LAYID/N/K,XOFFSET/K/N,YOFFSET/K/N,NEWWIDTH/K/N,NEWHEIGHT/K/N

Resize an exiting layer, cropping or expand the image data as reuired, contrast with SCALELAYER above.
PRJID/N/K
LAYID/N/K
XOFFSET/K/N
YOFFSET/K/N
NEWWIDTH/K/N
NEWHEIGHT/K/N
For example to crop the active layer 500 px square, removing 100px from each edge do
RESIZELAYER XOFFSET 100 YOFFSET 100 NEWIDTH 300 NEWHEIGHT 300
To expand the layer by 100px in all directions
RESIZELAYER XOFFSET -100 YOFFSET -100 NEWIDTH 700 NEWHEIGHT 700

CONVOLVELAYER

PRJID/N/K,LAYID/N/K,NORMALISE/S,ABS/S,DIMX/K/N/A,DIMY/K/N/A,MATRIX/K/A

Apply a convolution matrix to a layer.
PRJID/N/K
Specify Project or use active project.
LAYID/N/K
Specify layer or use active layer of active project.
NORMALISE/S
Normalise the values in the convolution matrix.
ABS/S
Negative convultion results are inverted before merging with the layer.
DIMX/K/N/A
X Dimension of matrix
DIMY/K/N/A
Y Dimension of matrix
MATRIX/K/A
Matrix data asa string of space seperated floating point values.

TRANSFORMLAYER

PRJID/N/K,LAYID/N/K,SRCLAYID/N/K,TRANSFORMFUNCTION/K/A,BLENDFUNCTION/K,X/K/N,Y/K/N,WIDTH/K/N,HEIGHT/K/N,SRCX/K/N,SRCY/K/N,ALPHA/K/N,ARGS/M

A powerful function enables 'transforming' one layer into another, tansform function may work in "geometric space" (rotate flip etc) or "colour space" (gama rgbadjust etc) or any combination / novel concept the function author can think up.

Functions are provided by the plugins found in the PROGDIR:transforms directory.

To add further flexibilty the transformed data may be blended with the destination layer using any of the available blend functions.

PRJID/N/K
The ID of the project to work on if omited the active project is chosen.
LAYID/N/K
The ID of the destination aleyr or the active layer if omited.
SRCLAYID/N/K
The ID of the source layer or the active layer if omited. If SRC and DEST match then a temporary layer is created.
TRANSFORMFUNCTION/K/A
The name of the transform function to use.
  • "Translate": - provided by translate.ptf. Translates the pixels by the spevified offset
    • LONG - x offset
    • LONG - y offset
  • "FlipVert": - provided by flipvert.ptf. Flips the layer in the vertical axis.
    • LONG - Y Offset of flip axis.
  • "FlipHoriz": - provided by fliphorix.ptf. Flips the layer in the horizontal axis.
    • LONG - X Offset of flip axis.
  • "Rotate": - provided by rotate.ptf. Rotates Layer.
    • LONG - X Coord of centre of rotation.
    • LONG - Y Coord of centre of rotation.
    • FLOAT - Angle to rotate in radians.
  • "GammaAdjust": - provided by gamma.ptf. Perform a gamma correction yother colour intensities...
    • FLOAT - Gamma adjustment 0.0 to 1.0 darken 1.0 no change 1.0 -> INF brighten. (output values clamped to 1.0)
  • "RGBAdjust": - provided by rgb.ptf. Adjust RGB values of layer colour by a linear factor.
    • FLOAT - Red adjustment factor 1.0 = no change. .
    • FLOAT - Green adjustment factor 1.0 = no change. .
    • FLOAT - Blue adjustment factor 1.0 = no change. .
  • "ContrastAdjust": - provided by contrast.ptf. AdjustContrast.
    • FLOAT - contrast factor.
  • "SaturationAdjust": - provided by saturation.ptf. Adjust Saturation.
    • FLOAT - saturation factor. 0.0 -> 1.0 desaturate 1.0 -> INF saturate.
  • "GradientFill": - provided by gradient.ptf. Fill the layer with a gradient between two points. Gradient goes between Colour and AltColour.
    • LONG - X1
    • LONG - Y1
    • LONG - X2
    • LONG - Y2
    • FLOAT - Alpha - Blend Fill with this alpha value
    • LONG - CycleMode
      • 0 RGB
      • 1 HSV
      • >1 palette ID
      • -1 Use current paletter
  • "RadialFill": - provided by radial.ptf. Fill the layer with a radial gradient. Gradient goes between Colour and AltColour. Radius 1 and Radius 2 define how the gradient behaves.
    • LONG - X
    • LONG - Y
    • LONG - Radius 1
    • LONG - Radius 2
    • FLOAT - Alpha - Blend Fill with this alpha value
    • LONG - CycleMode
      • 0 RGB
      • 1 HSV
      • >1 palette ID
      • -1 Use current paletter
  • "Ripples": - provided by ripples.ptf. Distort the layer to simultate rippling surface.
    • LONG - Centre X
    • LONG - Centre Y
    • LONG - Period. Period of ripples in pixels out from the centre
    • LONG - Amplitude. Amplitude of ripple
    • FLOAT - Decay. Rate at which riples rduce over distance 1.0 constant > 1.0 grows < 1.0 decays.
    • FLOAT - Delay. Delay in periods for umtil rippling starts. 0.0 = no delay
  • "Posterise": replace the colours in a layer with the closest from the provided palette.
    • LONG - ID of palette, 0 for current palette.
  • "Julia": generate Fractal images based on Julia sets.
    The Fractal image generated are based on the equation f(z) = z * z + c, where z = x + iy and c is complex. If that maths is two 'complex' for you, all you need to know is that the two numbers REAL and IMAGINARY should vary in a range of + or - 2 and determine what the pattern looks like. The image uses the current foreground and background colours.
    • LONG - Centre X
    • LONG - Centre Y
    • FLOAT - SCALE - Zoom in or out on the fractal image.
    • FLOAT - REAL - Real part of c.
    • FLOAT - IMAGINARY - Imaginary part of c
    • ULONG - Max iterations
  • "Unsharp": An UnsharpMask type filter.
    • FLOAT - Contrast - The increase in contrst of the edge pixels. Useful Values between 1.0 and 4.0. Values < 1.0 actually soften!.
    • FLOAT - Radius - The Radius or sigma value of the blur kernel that creates the unsharp mask.
    • FLOAT - Threshold - The threshold at which replacement of the pixels occurs, values between 0.0 and 1.0 but generally should be low in 0.1 region.
  • "Gaussian": A simple gaussian blur.
    • FLOAT - Radius or sigma value for the guassian kernel, larger is more blurring but slower
  • "BiLateral": A bilateral filter
    Uses both the spacial distance and colour distance to create a smoothing function with better edge preservation.
    • FLOAT - Radius - Radius or sigma value for the guassian kernel, larger is more blurring but slower
    • FLOAT - Colour Factor - the rate of fall of pixels colour, larger gives sharper edges.
  • "Erase": Erases the layer,

    This means for a layer with alpha the pixels alpha are set to 0.0 and for layer without alpha they are set to the current background colour.

    Intended to be used in conjunction with selection masks to erase areas of the image.

BLENDFUNCTION/K
Name of blend function required
X/K/N
X coord of destination rectangle
Y/K/N
Y coord of destination rectangle
WIDTH/K/N
Width of destination rectangle
HEIGHT/K/N
Height of destination rectangle
SRCX/K/N
X offset of src data.
SRCY/K/N
Y offset of src data.
ALPHA/K/N
Alpha vakue to use while blending result (0.0 -> 1.0)
ARGS/M
List of args as described above

MERGELAYERS

PRJID/N/K,LAYID/N/K,LAY2ID/N/K,VISIBLE/S

Merge one layer into another.
PRJID/N/K
Specify Project or if omited use active project.
LAYID/N/K
Specify layer to merge or if omited use active layer of specified porject.
LAY2ID/N/K
Specify the layer to merge with. If Omited merges into the next layer down in the stack.
VISIBLE/S
If the switch is provided and LAY2ID is not, merge inot the next visible layer in the stack.

GETLAYERINFO

PRJID/N/K,LAYID/N/K,ATTR/K,STEM/K

Get information about the specified layer.
PRJID/N/K
Specify Project is omited use active project.
LAYID/N/K
Specify layer if omited uase active layer of specified project.
ATTR/K
Specify the attribute so retrieve the result is placed in the RESULT variable.
  • NAME - The name of the layer.
  • PRJID - The ID of the project this layer is part of (useful if the ID wasn't supplied to the function ... )
  • LAYID - The ID of this layer (useful if the ID wasn't supplied to the function ... )
  • WIDTH - Width of the Layer in pixels.
  • HEIGHT - Height of the Layer in pixels
  • X - X offset of the layer relative to the project origin.
  • Y - Y offset of the project relative to the project origin
  • HASALPAH - Whther the alpha channel of this layer is active
STEM/K
Retrieves all the above results as component of the specified STEM var

ZOOM

PRJID/N/K,ZOOM/N,RESET/S,XOFFSET/K/N,YOFFSET/K?N

PRJID/N/K
The ID of the project to "ZOOM" if omited the currently active project is used.
ZOOM/N
ZOOM factor in percent.
RESET/S
If this option is provided all other argumants are ignored and the zoom is reset to 100%
XOFFSET
The offset in project pixels of the left edge of thedisplayed portion of the project
YOFFSET
The offset in project pixels of the top edge of the displayed portion of the project

SETBRUSH

BRID/N/K,ATTR/K,STEM/K,VALUE

BRID/N/K
ATTR/K
  • STAMP
  • SCALE
  • OPACITY
  • USECOLOR
STEM/K
VALUE

REFRESHCLIPBRUSH

SETLAYERMODE

PRJID/N/K,LAYID/N/K,LAYERMODE/K

Set the blending mode of the specified layer.
PRJID/N/K
LAYID/N/K
LAYERMODE/K
The mode to set examples are "Normal", "Multiply" etc. Mode name is case sensitive.

SETLAYEROPACITY

PRJID/N/K,LAYID/N/K,OPACITY/K/N/A

Set the opacity of the given layer.
PRJID/N/K
LAYID/N/K
OPACITY/K/N/A

SETCURRENTBRUSH

BRID/N/K,BRUSHNAME/K

Set the current brush for painting / erasing operations. Either the BRID or BRUSHNAME keywords must be specified. (But not both!).
BRID/N/K
Select the brush with ID given.
 ADDRESS SKETCHBLOCK
 'SETCURRENTBRUSH BRID=42'
 IF RC = 0 THEN SAY 'Brush If 42 Selected'
  
BRUSHNAME/K
Select the first brush in the list with the name given.
 ADDRESS SKETCHBLOCK
 'SETCURRENTBRUSH BRUSHNAME="The Answer"'
 IF RC = 0 THEN SAY 'BrushNamed "The Answer" Selected'
  
Selecting by ID is slightly faster than by name, however ID is not guaranteed to remain the same across two session of SketchBlock. Whereas the name of a Brush will remain constant.

GETCURRENTBRUSH

BRID/S,BRUSHNAME/S

Get the name of ID of the currently selected brush. Only one of BRID and BRUSHNAME can be asked for.
BRID/S
Ask for ID
BRUSHNAME/S
Ask For Brush Name

SETCOLOR

COLOR/A,A=ALPHA/K/A,R=RED/K/A,G=GREEN/K/A,B=BLUE/K/A,ALT/S

A=ALPHA
Alpga value as float 0.0 to 1.0 (usually should be 1.0)
R=RED
Red value as float 0.0 -> 1.0
G=GREEN
Greem value as float 0.0 -> 1.0
B=BLUE
Blue value as float 0.0 -> 1.0
ALT/S
Set Alternamte (background colour)

GETCOLOR

ALT/S

Retrieve currenmt colour value/
ALT/S
Get Alt Colour
Colour value is returned as 4 floats in RESULT A R G B eg 1.0 0.9 0.1 0.1 would be a brightish red.

SWAPCOLORS

No Arguments
Swaps the primaray (forground) and alternate (background) colours

GETBRUSHINFO

BRID/N/K,ATTR/K,STEM/K

Obtain information about a brush
BRID/N/K
ATTR/K
The attribute to query
  • BRUSHNAME
  • BRUSHTYPE
  • WIDTH
  • HEIGHT
  • STAMP
  • SCALE
  • OPACITY
  • USECOLOR
  • SEQUENTIAL
  • DIRECTIONAL
  • RANDOM
STEM/K
Pass a stem variable to access the above attributes

GETWINDOWDIMENSIONS

PROJECT/S,PRJID/K,LAYERS/S,TOOLS/S

Gets the dimensions of various windows. One of PROJECT LAYERS or TOOLS must be supplied.
PROJECT/S
Return dimensions of a project window.
PRJID/K
If PROJECT is set specify the project to get the window dimension from, if omited use the active project.
LAYERS/S
Get the dimension of the layers window
TOOLS/S
Get the dimenions of the tools window.

Result

If successful RC is set 0 and the dimension are place in the result variable.
"<LEFT> <TOP> <WIDTH> <HEIGH>
'GETWINDOWDIMENSIONS PROJECT PRJID=42"
if(rc = 0) then do
parse var result left top width height
end

SETWINDOWDIMENSIONS

PROJECT/S,PRJID/K,LAYERS/S,TOOLS/S,LEFT/N/K,TOP/N/K,WIDTH/N/K,HEIGHT/N/K

Set the dimensions and position of a window. Again only one of PROJECT LAYERS or TOOLS must be provided. Not all the dimension need be changed at one time you might only choose to set the TOP for instance.
PROJECT/S
Modify a project window
PRJID/K
With the above specify a project window to modify
LAYERS/S
Modify the layers window
TOOLS/S
Modify the Tools window
LEFT/N/K
The new offset from the left side of the screen.
TOP/N/K
The new offset from the top of the screen
WIDTH/N/K
The new width of the window
HEIGHT/N/K
The new height of the window

GETPIXEL

PRJID/K/N,LAYID/K/N,X/N,Y/N,PROJECT/S,RADIUS/N/K

PRJID/K/N
LAYID/K/N
X/N
Y/N
PROJECT/S
Get the value of the fully blended project pixel rather than a specific layer
RADIUS/K/N
If supplied and > 0 then colour avarage over am area of radius pixels centred on X Y

Result

Returns the ARGB value as a string of 4 floating point numbers eg "1.0 0.0 0.5 0.3" in the RESULT variable.

SETPIXEL

PRJID/K/N,LAYID/K/N,X/K/N/A,Y/K/N/A,A=ALPHA/K,R=RED/K,G=GREEN/K,B=BLUE/K

PRJID/K/N
LAYID/K/N
X/N
Y/N
A=ALPHA
Alpga value as float 0.0 to 1.0 (usually should be 1.0)
R=RED
Red value as float 0.0 -> 1.0
G=GREEN
Greem value as float 0.0 -> 1.0
B=BLUE
Blue value as float 0.0 -> 1.0

READPIXELS

PRJID/K/N,LAYID/K/N,X/N/A,Y/N/A,COUNT/N/A

Read an array of pixel data from a spscified layer. This function reads Count pixels starting at coordinate specified by X,Y. It does not check boundaries and will read past the end of the buffer so do ypour maths before calling!
PRJID/K/N
Specify project
LAYID/K/N
Specify layer or use active layer of project.
X/N/A
X coordinate in layer
Y/N/A
Y coordinate in layer
COUNT/N/A
Number of pixels to read.

Result

The pixels data is written to the result variable as a sequence of floating point values represnting the ARGB data.
1.0 1.0 1.0 1.0 1.0 0.0 0.0 0.0
represnt 1 white followed by 1 black pixel.

WRITEPIXELS

PRJID/K/N,LAYID/K/N,X/N/A,Y/N/A,PIXELDATA

Write an array of pixel data two a specified layer. This function writes the passed pixeldata starting at coordinate specified by X,Y. It does not check boundaries and will read past the end of the buffer so do ypour maths before calling!
PRJID/K/N
Specify Project or use active
LAYID/K/N
Specify Layer or use active.
X/N/A
X Coord to start writing at.
Y/N/A
Y coord to start writing at
PIXELDATA
Pixeldata, ARGB data expressed as a sequqnce of floating point values

SETSELECTIONPIXEL

PRJID/K/N,X/N/K/A,Y/N/K/A,VALUE/K/A

Set the value of the selection mask for a given pixel, creates a mask if not maks not allready active.
PRJID/N/K
Project ID or active if omited
X/N/K/A
X coord of pixel
Y/N/K/A
Y coord of pixel
VALUE/K/A
Value of selection expressed as a float 0.0 -> 1.0.
1.0 = fully selected
0.0 = fully masked

GETSELECTIONPIXEL

PRJID/K/N,X/N/K/A,Y/N/K/A

Retrieve the value of a selection pixel.
PRJID/K/N
X/N/K/A
Y/N/K/A

OPENTOOLS

CLOSETOOLS

TOGGLETOOLS

GETTOOLSINFO

INDEX/K/N,ATTR/K,STEM/K

Get information about the tools loaded.

No arguments
When called with no arguments the total number of tools is returned
INDEX/K/N
The index of the tool to be queried
ATTR/K
Name of the attribute to be fetched

Valid attributes are:

  • NAME: (string) The name of the tool
  • CURRENT: (boolean) Whether the tool is the currently active tool

SETCURRENTTOOL

TOOLID/K/N,TOOLNAME/K

Set the current tool either by name or ID, very useful in "presets" etc. NB the ID of a tool may vary from session to session, but the name will likely remain the same. Setting by ID is slightly faste if known.
TOOLID/K/N
Specify the numerical ID
TOOLNAME/K
Specify the toolname.

Result

If the operation is succesful RC will be 0

COMMANDTOOL

INDEX/K/N,TOOLNAME/K,COMMAND/A

Pass a command through to a tool plugin. Plugin may be selected either by current index or by name. The result of the command if any is return via the standard ARexx result variable RC RC2 and RESULT. One or the other of INDEX and TOOLNAME must be provided.
INDEX/K/N
Specify the tool to command via the index as derived from the info retrieved by GETTOOLSINFO
TOOLNAME/K
Specify tool to command via it's "Name".
COMMAND/A
The Command to executed.
OPTIONS RESULTS
ADDRESS SKETCHBLOCK

COMMANDTOOL NAME="Paint" COMMAND="SET PRESSUREOPACITY OPACITY=80 SCALE=200"

Paint Tool ARexx Commands

OPENLAYERS

CLOSELAYERS

TOGGLELAYERS

OPENCOLOR

Open the advanced colour window.

CLOSECOLOR

TOGGLECOLOR

STAMPBRUSH

BRID/N/K,PRJID/K/N,LAYID/K/N,X/N/A,Y/N/A,PRESSURE/K/N,SCALE/N/K,OPACITY/N/K,COLOR/K,ALTCOLOR/K,PRESSUREFLAGS/K/N

BRID/N/K
PRJID/K/N
LAYID/K/N
X/N/A,Y/N/A
PRESSURE/K/N
SCALE/N/K
OPACITY/N/K
COLOR/K
ALTCOLOR/K
PRESSUREFLAGS/K/N

STROKEBRUSH

BRID/N/K,PRJID/K/N,LAYID/K/N,X/N/A,Y/N/A,PRESSURE/N/K,SCALE/N/K,OPACITY/N/K,COLOR/K,ALTCOLOR/K,PRESSUREFLAGS/K/N

BRID/N/K
PRJID/K/N
LAYID/K/N
X/N/A
Y/N/A
PRESSURE/N/K
SCALE/N/K
OPACITY/N/K
COLOR/K
ALTCOLOR/K
PRESSUREFLAGS/K/N

STROKEBRUSHBEGIN

BRID/N/K,PRJID/K/N,LAYID/K/N,X/N/A,Y/N/A,PRESSURE/N/K,SCALE/N/K,OPACITY/N/K,COLOR/K,ALTCOLOR/K,PRESSUREFLAGS/K/N

BRID/N/K
PRJID/K/N
LAYID/K/N
X/N/A
Y/N/A
PRESSURE/N/K
SCALE/N/K
OPACITY/N/K
COLOR/K
ALTCOLOR/K
PRESSUREFLAGS/K/N

STROKEBRUSHEND

BRID/N/K,PRJID/K/N,LAYID/K/N,X/N/A,Y/N/A,PRESSURE/N/K,SCALE/N/K,OPACITY/N/K,COLOR/K,ALTCOLOR/K,PRESSUREFLAGS/K/N

BRID/N/K
PRJID/K/N
LAYID/K/N
X/N/A
Y/N/A
PRESSURE/N/K
SCALE/N/K
OPACITY/N/K
COLOR/K
ALTCOLOR/K
PRESSUREFLAGS/K/N

DISPLAYPROJECT

PRJID/K/N,DAMAGE/S

Cause all or part of the project to be redisplayed.
PRJID/K/N
Specify Project or if omited use active project.
DAMAGE/S
If present this swith limits update to the damage area only.

DISABLEDISPLAYPROJECT

Prevent updating of the Project Display.
Updating the project display is potentialy quite and expensive task, particularly id there are many layers, therefore a script may want to temporarily disable updates, so as to increase overall execution speed. the script restore updates afterwards with ENABLEDISPLAYPROJECT

PRJID/K/N

PRJID/K/N
Specify the project or if omited use the currently active project.
Enable updating of the project display.

ENABLEDISPLAYPROJECT

PRJID/K/N

PRJID/K/N
Specify the project or if omited use the currently active project

ISMAGIC

SNAPSHOT

FILE

FILE

UNDO

PRJID/K/N,LEVEL/N

Undo one step on the "Master Undo" list for a given project.
PRJID/K/N
Specify the project or if omited use active project.
LEVEL/N
Rather than undo one step, undo down to this level. 0 will undo all changes to the project.

REDO

PRJID/K/N,LEVEL/N

Redo one undone step.
PRJID/K/N
Specify project
LEVEL/N
Redo down to this level.

LAYERUNDO

PRJID/K/N,LAYID/K/N

Undo one action on a layer, will always be the most recent action applied to the layer, but need not be the most recent action on the project as a whole.
PRJID/K/N
LAYID/K/N

PROJECTUNDO

PRJID/K/N

Undo action on the project.
PRJID/K/N

LAYERREDO

PRJID/K/N,LAYID/K/N

Redo undone action.
PRJID/K/N
LAYID/K/N

PROJECTREDO

PRJID/K/N

Redo undone action.
PRJID/K/N

FIXUNDOLEVEL

PRJID/K/N

Hold the current undo level, so that al subsequent actions are added to the undo stack at this level, until ReleaseUndoLevel is called. This allows scripst to group actions togther into a single convenient undo operation.
PRJID/K/N
Specify the project or use the active project.

RELEASEUNDOLEVEL

PRJID/K/N

Allows normal incrementing of the master undo level.
PRJID/K/N

ADDTODAMAGE

PRJID/K/N,X/K/N/A,Y/K/N/A,WIDTH/K/N/A,HEIGHT/K/N/A

Add a box of the specified dimensions to the projects DamageBox. The DamageBox is that area of the prject that has been altered by drawing erasing etc.
PRJID/K/N
Specify the project or use the active project if omited.
X/K/N/A
The X offset of the DamageBox in project coords.
Y/K/N/A
The Y Offset of the DamageBox in project coords.
WIDTH/K/N/A
The Width of the DamageBox in project coords.
HEIGHT/K/N/A
The Heigh of the DamageBox in project coords.

RESETDAMAGE

PRJID/K/N

Reset the DamageBox of a project.
PRJID/K/N
Specify the project whos damagebox is to be reset, use the currently active project if omited

RPORTDRAWLINE

PRJID/K/N,STARTX/K/N/A,STARTY/K/N/A,ENDX/K/N/A,ENDY/K/N/A,DOTTED/S,COLORA/K,COLORB/K,MODE/K

Draw a line in the rastport of te projects window. Useful for InputWedge scripts that want to create GUI elements, and guides such as a box that shows the area of a proposed action.
PRJID/K/N
Specify the projects window to draw in, use the currently active project if omited.
STARTX/K/N/A
Starting X ordinate of the line in RastPort coordinates(Window coords)
STARTY/K/N/A
Starting Y ordinate of the line in RastPort coordinates(Window coords)
ENDX/K/N/A
Ending X ordinate of the line in RastPort coordinates(Window coords)
ENDY/K/N/A
Ending Y ordinate of the line in RastPort coordinates(Window coords)
DOTTED/S
Specify if a dotted / dashed line is required.
COLORA/K
The A colour of the line (8 bytes ARGB hex FFFF0000 for red)
COLORB/K
The B colour of the line (8 bytes ARGB hex FF00FF00 for green)
MODE/K
The RastPort Drawing Mode expressed as a delimited string of terms defineing the desired mode. Any delimiter may be used but a space (with quotes) or perhaps a '|' is recomended. Terms are:
  • JAM1
    jam 1 color into raster
  • JAM2
    jam 2 colors into raster
  • COMPLEMENT
    XOR bits into raster
  • INVERSVID
    inverse video for drawing modes
  • BGBACKFILL
    use backfill instead of BgPen
  • FILLALPHA
    draw background under alpha pixels
  • LEVELS
    fill text extent with alpha levels
For consistancy with other functions all the above are recognised but not all may affect line drawing and not all are sensible at the same time.

RPORTDRAWLIST

PRJID/K/N,DRAWLIST/K/A,DOTTED/S,COLORA/K,COLORB/K,MODE/K

Draw multiple lines in the sketchwindows rastport. Similar to the above RPORTDRAWLINE but allows specifying more than one line at once improving efficiency.
PRJID/K/N
Project whose window to draw to.
DRAWLIST/K/A
Drawlist defined as alist of M (move) and D ( draw instructions) finish bt END
 	"M,20,30,D,30,50,END" // move to 20,30 and draw a line to 30,50
 
DOTTED/S
Draw adotted line
COLORA/K
Set The A Pen colour, expressed as ARGB Hex value
COLORB/K
Set the B Pen Colour, expressed as AREGB Hex value
MODE/K
The draw mode see above...

RPORTDRAWPATH

PRJID/K/N,PATHID/K/N,DOTTED/S,COLORA/K,COLORB/K,MODE/K,DRAWPOINTS/S

Draw the specified path in the project windows rastport.
PRJID/K/N
PATHID/K/N
DOTTED/S
Specify if a dotted / dashed line is required.
COLORA/K
The A colour of the line (8 bytes ARGB hex FFFF0000 for red)
COLORB/K
The B colour of the line (8 bytes ARGB hex FF00FF00 for green)
MODE/K
The RastPort Drawing Mode expressed as a delimited string of terms defineing the desired mode. Any delimiter may be used but a space (with quotes) or perhaps a '|' is recomended. Terms are:
  • JAM1
    jam 1 color into raster
  • JAM2
    jam 2 colors into raster
  • COMPLEMENT
    XOR bits into raster
  • INVERSVID
    inverse video for drawing modes
  • BGBACKFILL
    use backfill instead of BgPen
  • FILLALPHA
    draw background under alpha pixels
  • LEVELS
    fill text extent with alpha levels
For consistancy with other functions all the above are recognised but not all may affect line drawing and not all are sensible at the same time.
DRAWPOINTS/S
Display the points as well as the line of the path. Online points are shown as a solid square, and control points as an "empty" square.

RPORTDRAWPOLYGON

PRJID/K/N,PATHID/K/N,POLYID/K/N,DOTTED/S,COLORA/K,COLORB/K,MODE/K,DRAWPOINTS/S

Draw an individual polygon.
PRJID/K/N
PATHID/K/N
POLYID/K/N
DOTTED/S
COLORA/K
COLORB/K
MODE/K
DRAWPOINTS/S

RPORTBLTPROJECT

PRJID/K/N

Copies the Projects temporary RastPort to the window rastport.
PRJID/K/N
Specify Project or use the active peoject if not specified.

NEWBITMAP

WIDTH/K/N/A,HEIGHT/K/N/A

Create a graphics.library bitmap, this can be blitted into the RastPort for creating previews etc.
WIDTH/K/N/A
Width of desired bitmap
HEIGHT/K/N/A
Height of desired bitmap.
The result is an ID handle on the bit map object.

GETBITMAPINFO

BMID/K/N/A,ATTR/K,STEM/K

Get information about a SketchBitMap object.

BMID/K/N/A
The ID of the BitMap object
ATTR/K
Name of the attribute to be fetched

Valid attributes are:

  • ADDRESS: (hexnumber) The address of the struct BitMap as a hex string
  • WIDTH: (number)The width of the bitmap
  • HEIGHT: (number)The height of the bitmap

STEM/K
If provided the above attributes will be returned as elements of the requested STEM variable.

BITMAPFROMLAYER

PRJID/K/N,LAYID/K/N,WIDTH/K/N,HEIGHT/K/N

Suimilar to above but use a scaled copy of a layers imagery.
PRJID/K/N
Project or active project
LAYID/K/N
layer or active layer.
WIDTH/K/N
Width of desire bitmap
HEIGHT/K/N
Wisth of desired bitmap
the BitMapID is returned in RESULT

BITMAPFROMPROJECTRPORT

PRJID/K/N,X/K/N/A,Y/K/N/A,WIDTH/K/N/A,HEIGHT/K/N/A

Generate abitmap from a section of the projects rastport (as opposed to the windo rsatport).
PRJID/K/N
X/K/N/A
Y/K/N/A
WIDTH/K/N/A
HEIGHT/K/N/A

FREEBITMAP

BMID/K/N/A

Free the memeory and imagery associated with abitmap.
BMID/K/N/A
ID of the bitmap

SETBITMAPCOLOR

BMID/K/N/A,COLOR/K/A

Set bitmap to agivent colour.
BMID/K/N/A
Bitmap ID
COLOR/K/A
ARGB colour

RPORTBLITBITMAP

PRJID/K/N,BMID/K/N/A,X/K/N,Y/K/N

Blit the bitmap into the projects Window Rastport.
PRJID/K/N
Project ID
BMID/K/N/A
BmapID
X/K/N
X Coord for blit
Y/K/N
Y coord f0r blit

COMPOSITEBITMAPBITMAP

DESTBMID/K/N/A,SRCBMID/K/N/A,X1/K/N/A,Y1/K/N/A,X2/K/N/A,Y2/K/N/A,X3/K/N/A,Y3/K/N/A,X4/K/N/A,Y4/K/N/A,ALPHA/K/N

Composite one bitmap into another. Uses hardware acceaeration when available. The bitmap is mapped onto the double triangle with points defined by x1,y1 x2.y2 x3, y3 and x3,y3 x4,y4 x1,y1.
DESTBMID/K/N/A
Dest BMID
SRCBMID/K/N/A
Source Bitmap
X1/K/N/A
Y1/K/N/A
X2/K/N/A
Y2/K/N/A
X3/K/N/A
Y3/K/N/A
X4/K/N/A
Y4/K/N/A
ALPHA/K/N
Alpha factor for composite 0 to 255

NEWPATH

PRJID/K/N,NAME/K/A

Creates a new path object. A path consists of a set of polygons.
PRJID/K/N
The project to associate the path with
NAME/K/A
The name of the path.

Result

The PATHID is return in the RESULT variable.

COPYPATH

PRJID/K/N,PATHID/K/N,NAME/K/A

Copies an existing path object, along with it's polygons.
PRJID/K/N
The project to associate the path with or the active prject if not present
PATHID/K/N
The path to copy or the active path if not present
NAME/K/A
The name of the new path.

Result

The PATHID is return in the RESULT variable.

DELETEPATH

PRJID/K/N,PATHID/K/N/A

Delete a path from a project.
PRJID/K/N
Specify project
PATHID/K/N/A
Specify the ID of the path to delete or delete the active path.

APPENDPATH

PRJID/K/N,PATHID/K/N,APPENDPATHID/K/N/A,APPLYOFFSET/S

Appends one path to another, by transfersing te polygons to the new path. The original now empty will be removed and destroyed, it's ID no longer valid.
PRJID/K/N
Specify project
PATHID/K/N/A
Specify the ID of the path to append to or append to the active path.
APPENDPATHID/K/N/A
Specify the ID of the path to append.
APPLYOFFSET/S
Take account of any relative translation of the paths when appending

PATHFROMTEXT

PRJID/K/N,NAME/K/A,FONT/K/A,GLYPHHEIGHT/K/N/A,BASELINE/K/N/A,LEFT/S,RIGHT/S,CENTRE/S,CHARSET/K,TEXT/K/A

Generate a path from a piece of text, supports justification.
PRJID/K/N
Project to add the path to or active project if omited.
NAME/K/A
Name of the path.
FONT/K/A
Font to sue. This must be the full path to a true type or postscript font.
GLYPHHEIGHT/K/N/A
Height of the lines of text.
BASELINE/K/N/A
Spacing of the lines of text.
LEFT/S
Left justify text (default)
RIGHT/S
Right justify the text.
CENTRE/S
Centre justify
CHARSET/K
Charset to use when converting text to unicode.
TEXT/K/A
Text to create path from. Use *N for a new line.
'PATHFROMTEXT NAME "text" FONT "FONTS:_TrueType/Arial.TTF" GLYPHHEIGHT 60 BASELINE 75 CENTRE TEXT "Gone Fishing*NBack Tuesday"' 

Result

The PATHID is return in the RESULT variable.

SAVEPATH

PRJID/N/K,PATHID/K/N,FILENAME/K

Save a path to disk.
PRJID/N/K
PATHID/K/N
FILENAME/K

LOADPATH

PRJID/N/K,FILENAME/K

Load a path from disk and make it active n the current project.
PRJID/N/K
Project to load path into, Active Project is not specified.
FILENAME/K
Filename to load from, file requester opens if file not specified.

Result

The ID of the path is returned in the RESULT variable.

PATHFROMSELECTION

PRJID/K/N,NAME/K/A

Create a new path from the selection mask, using an algorithm to trace the outlines.
PRJID/K/N
Project ID, uses active project if not provided.
NAME/K/A
Name for the path.

Result

The ID of the path is returned in the RESULT variable.

ADDPOLYGON

PRJID/K/N,PATHID/K/N,CLOSED/S

Adds a new polygon to the specified path.
PRJID/K/N
PATHID/K/N
CLOSED/S
The added polygon is closed.

COPYPOLYGON

PRJID/K/N,PATHID/K/N,POLYID/K/N/A,DESTPATHID/K/N

Copy the specified polygon and append to the spscified path.
PRJID/K/N
PATHID/K/N
POLYID
Polygon to copy
DESTPATHID
Path to append copy to or add to original path of omitted

DELETEPOLYGON

PRJID/K/N,PATHID/K/N,POLYID/K/N

Delete the specified polygon.
PRJID/K/N
PATHID/K/N
POLYID/K/N

SETPOLYGON

PRJID/K/N,PATHID/K/N,POLYID/K/N,CLOSE/S,OPEN/S,NAME/K

Set various polyon attributes
PRJID/K/N
PATHID/K/N
POLYID/K/N
CLOSE/S
Set polygon as closed
OPEN/S
Set polygon as open
NAME/K
Set the name of the polygon

ADDPOINT

PRJID/K/N,PATHID/K/N,POLYID/K/N,X/N/A,Y/N/A,Z/N/A,CONTROL/S

Add a new point to the paths current polygon.
PRJID/K/N
PATHID/K/N
POLYID/K/N
X/N/A
Y/N/A
Z/N/A
CONTROL/S
This is a spline control point. Current 'conic' (one control between each pair of online curve points) and 'cubic' (two control points) are supported.

INSERTPOINT

PRJID/K/N,PATHID/K/N,POLYID/K/N,AFTER/K/N/A,X/A,Y/A,Z/A,CONTROL/S

Similar to above but inserts the new point after the point specified.
PRJID/K/N
PATHID/K/N
POLYID/K/N
AFTER/K/N/A
ID of point to insert after.
X/A
Y/A
Z/A
CONTROL/S
This is a spline control point. Current 'conic' (one control between each pair of online curve points) and 'cubic' (two control points) are supported.

SETPOINT

PRJID/K/N,PATHID/K/N,POLYID/K/N,PTID/K/N,X/N,Y/N,Z/N,CONTROL/S,IGNORECONTROL/S

Modify the values of an existing point.
PRJID/K/N
PATHID/K/N
POLYID/K/N
PTID/K/N
X/N
Y/N
Z/N
CONTROL/S
IGNORECONTROL/S

DELETEPOINT

PRJID/K/N,PATHID/K/N,POLYID/K/N,PTID/K/N

Delete the specified point from the path.
PRJID/K/N
PATHID/K/N
POLYID/K/N
PTID/K/N

FINDCLOSESTPOINT

PRJID/K/N,PATHID/K/N,X/N/A,Y/N/A,Z/N/A,MAXDIST/K/N

Find the point in the specified path that is closest to the given coordinates. Z axis is taken into account....
PRJID/K/N
PATHID/K/N
X/N/A
Y/N/A
Z/N/A
MAXDIST/K/N
Fail if no points are in range MAXDIST from the test coordinates.

GETPATHINFO

PRJID/N/K,PATHID/N/K,ATTR/K,STEM/K

Retrieve information about a path. Passed a single attribute to retrieve 1 bit of data in the result varaiable, pass stem to retrieve all data.
PRJID/N/K
PATHID/N/K
ATTR/K
Attribute to retrieve:
  • NAME: name ofr path.
  • PATHID: ID of path
  • PRJID: ID of Project to which path is attached
  • X: X offset of path origin
  • Y: Y offsset of path origin
  • LIMITS: bounding box of path relative to the paths origin. LEFT TOP WIDTH HEIGHT
  • POLYGONS: Number of polygons in the path
  • POLYID <n>: ID of polygon at index "n".
STEM/K
Above data as a stemvar Except polygon data is retirved via tye POLYGONS sub stem with STEM.POLYGONS.0 giving number of polygons and STEM.POLYGON.i.ID giving the ID of the polygon at index "i".

GETPOLYGONINFO

PRJID/N/K,PATHID/N/K,POLYID/N/K,ATTR/K,STEM/K

Retrieve some information about a given polygon.
PRJID/N/K
PATHID/N/K
POLYID/N/K
ATTR/K
Attribute to retrieve.
  • NAME: name of polygon
  • LIMITS: bounding box of polygon relative to the parent paths origin. LEFT TOP WIDTH HEIGHT
  • POLYID: The ID of this polygon (useful retrieving active polygon)
  • PATHID: The ID of the path this polygon id attached to
  • PRJID: The ID of the project this polygon is attached to
  • INDEX: Index of the polygon in the path.
  • POINTS: Number of points in the polygon. PTS CTRLPTS
  • POINTID: Id of a point at given index. eg GETPOLYGONINFO ATTR "POINTID <n>"
STEM/K
Except point data is retrieved via tye POINTS sub stem with STEM.POINTS.0 giving number of points and STEM.POINTS.i.ID giving the ID of the point at index "i".

Result

ATTR result is placed in RESULT variable.

GETPOINTINFO

PRJID/N/K,PATHID/N/K,POLYID/N/K,PTID/K/N/A,ATTR/K,STEM/K

Reteive information about a point.
PRJID/N/K
PATHID/N/K
POLYID/N/K
PTID/K/N/A
ATTR/K
Attribute to query:
  • PRJID: ID of project this point belogs to
  • PATHID: ID of pathy this point belongs to
  • POLYID: ID of polygon this point belongs to
  • INDEX: INdex of point
  • X: X coord of point (floating point number)
  • Y: Y coords of point
  • Z: Z Coord of point
  • CONTROL: i this a control point or ordinary point
STEM/K
Above attributes retrieved vai the named stem var

MOVEPATH

PRJID/N/K,PATHID/N/K,X/N/A,Y/N/A

Move the root position of the path relative to the project.
PRJID/N/K
PATHID/N/K
X/N/A
Y/N/A

MOVEPATHORIGIN

PRJID/N/K,PATHID/N/K,X/N/A,Y/N/A

Move the position of the paths origin relative to the path. This effectively moves all the points in the path in the opposite direction.
PRJID/N/K
PATHID/N/K
X/N/A
Y/N/A

MOVEPOLYGON

PRJID/N/K,PATHID/N/K,X/A,Y/A,Z/A

Move the position of all the points in the polygon relative to the parent path,
PRJID/N/K
PATHID/N/K
POLYID/N/K
X/A
Distance to move in X direction (horizontal) expressed as a float
Y/A
Distance to move in Y direction (Vertical) expressed as a float
Z/A
Distance to move in Y direction (perpendicular to plane) expressed as a float

ROTATEPATH

PRJID/N/K,PATHID/N/K,ANGLE/A

Rotate the paths points arround it's origin by Angle raddians.
PRJID/N/K
PATHID/N/K
ANGLE/A
Angle to rotate by in radians as a floating point number

SCALEPATH

PRJID/N/K,PATHID/N/K,XFACTOR/K/A,YFACTOR/K/A,ZFACTOR/K/A

Scale the path by the given factors.
PRJID/N/K
PATHID/N/K
XFACTOR
YFACTOR
ZFACTOR
Scaling factors expressed as floating point numbers where 1.0 is no chnage

SCALEPOLYGON

PRJID/N/K,PATHID/N/K,POLYID/K/N,XFACTOR/K/A,YFACTOR/K/A,ZFACTOR/K/A

Scale the path by the given factors.
PRJID/N/K
PATHID/N/K
POLYID/N/K
XFACTOR
YFACTOR
ZFACTOR
Scaling factors expressed as floating point numbers where 1.0 is no chnage

STROKEPATH

PRJID/K/N,PATHID/K/N,BLENDMODE/K,OPACITY/K/N,FIXCORNERS/S,PRESSUREFLAGS/K/N

Stroke along the polygon edges in the path using the current brush.
PRJID/K/N
Specify Project
PATHID/K/N
Specify Brush
BLENDMODE
The desired blendmode for the path stroke, ie "Normal","Multiply" etc. If the mode isn't recognised it will be set to "Normal"
OPACITY
Opacity of the stroke in % ie 1 faint to 100 fully opaque
FIXCORNERS/S
Ensure that the vertexes are excatly rendered. When this switch is not present angles less 90 degrees may be rendered slightly of depening on the size of the brush.
PRESSUREFLAGS
When these flags are set the Z value of the points ion the past are taken as a pressure. The value is number created by adding ( logical OR ) the folowing terms PRESSURE SIZE 1 PRESSURE ALPHA 2 PRESSURE HARD 4 PRESSURE COLOR 8

FILLPATH

PRJID/K/N,PATHID/K/N

PRJID/K/N
PATHID/K/N
BLENDMODE
The desired blendmode for the fill stroke, ie "Normal","Multiply" etc. If the mode isn't recognised it will be set to "Normal"
OPACITY
Opacity of the fill in % ie 1 faint to 100 fully opaque

NEWPALETTE

NAME/K/A

Creates a new empty Palette and adds it to the applications list of palettes.
NAME/K/A
The name of the palette.

Result

The ID of the palette is returned in the result variable.

ADDPALETTEENTRY

PALID/K/N,RED/K,GREEN/K,BLUE/K,ALPHA/K

Add a new entry in the palette, the default is white with 100% opacity.
PALID/K/N
The ID of the palette to add this entry too or current palette if omited.
RED/K
The RED colour value (0.0 to 1.0) Deafaults to 1.0.
GREEN/K
The GREEN colour value (0.0 to 1.0) Deafaults to 1.0.
BLUE/K
The BLUE colour value (0.0 to 1.0) Deafaults to 1.0.
ALPHA/K
The ALPHA colour value (0.0 to 1.0) Deafaults to 1.0.

Result

The ID of the palette entry is returned in the result variable.

DELETEPALETTE

PALID/K/N

Deletes a loaded palette. (In memory only, the original remains on disk).
PALID/K/N
ID of the palette to delete or current palette if omited.

SETCOLORFROMPALETTE

PALID/K/N,PALENTID/K/N,INDEX/K/N,ALT/S

Set the current drawing colour (or alt colour) from the given entry in the palette. The entry may be identified by index or by ID or both but if both index and ID are given they must refer to the same palette entry.
PALID/K/N
ID of the palette or current palette
PALENTID/K/N
ID od entry.
INDEX/K/N
ALT/S
Set the alternate colour.

SAVEPALETTE

PALID/N/K,FILE/K

Save a palette to disk.
PALID/N/K
ID of the palette to save or current palette
FILE/K
File to save too (.skpl extention will be added if not present).

LOADPALETTE

FILE/K

Load a palette from a file.
FILE/K
Name of filwe to load.

RENAMEPALETTE

PALID/N/K,NAME/A

Change the name of a palette
PALID/N/K
ID
NAME/A
New name.

OPENPALETTE

Open the palette window.

CLOSEPALETTE

Close the palette window.

TOGGLEPALETTE

Toggle the open / close status of the palette window.

GETTHEMEIMAGE

NAME/A

NAME/A

PARSEPROJECT

FILENAME/A,STEM/K/A

Get information about a project on disk, withot loading the project. (For example used in the load project as layers script to offer a list of layers to load).
FILENAME/A
Filename of project
STEM/K/A
A stem variable to place the data into.

GETEXPORTERINFO

STEM/K/A

Gets information about the available exporters.
STEM/K/A

NEWTEXTURE

LAYID/K/N/A,NAME/K,X/K/N,Y/K/N,ALPHA/S,RED/S,GREEN/S,BLUE/S,TILEX/S,TILEY/S,BLENDFACTOR/K/N,BLENDFUNCTION/K

Create a new texture from a layer.
LAYID/K/N/A
LayerID, need not be in currently active project.
NAME/K
Name of texture
X/K/N
X origin of texture in src layer
Y/K/N
Y Origin of texture in src layer
ALPHA/S
Apply txeture to alpha component
RED/S
Apply texture to Red component
GREEN/S
Apply texture to green component
BLUE/S
Apply texture to blue component
TILEX/S
Tile the texture in the X direction
TILEY/S
Tile texture in the Y direction
BLENDFACTOR/K/N
The blend factor for mixing the texture with the destination 0 to 100
BLENDFUNCTION/K
Name of the blkend function to use (currently ignored at 3.3)
Returns the ID of the new texture in RESULT

REMOVETEXTURE

TEXID/K/N

Delete a texture with the given ID
TEXID/K/N
The ID of the texture to be deleted

SETTEXTURE

TEXID/N/K,ATTR/K,STEM/K,VALUE

Modify the textures settings, see new texture for list of attibutes.
TEXID/N/K
ATTR/K
STEM/K
VALUE

GETTEXTUREINFO

TEXID/N/K,ATTR/K,STEM/K

Retrieve information about the texture
TEXID/N/K
ATTR/K
STEM/K

IMPORTTEXTURELAYER

CLIP/K/N,FILE

Load a dedicated texture layer. This layer will not be part of a project and can be used for global textures.
CLIP/K/N
FILE

GETTEXTUREBYNAME

NAME/K

Find a specific texture by name rather than ID
NAME/K
Returns the textures ID in RESULT of non zero RC if not found.

GETTEXTURELAYERBYNAME

NAME/K

Find a named texture layer.
NAME/K

SETCURRENTTEXTURE

TEXID/N/K/A

Set the currently active texture.
TEXID/N/K/A

The latest version of this document can be found at www.broad.ology.org.uk/amiga/sketchblock/arexx.html