FrameAway

Composition guide


FrameAway is a transparent composition guide that helps you frame your photographs in different sizes, aspect ratios and layouts.

Plug-in API

This page describes the FrameAway plugin api, i.e. the variables and functions you can set or call from the Lua plugin to instruct FrameAway on how to draw certain frame types

The frameaway plugin can contain two blocks of code: one block that is executed once, when FrameAway starts and reads its plugin list, and another block that is executed each time FrameAway needs to draw a shape

Plugin structure


-- FrameAway plugin
-- http://frameaway.dv8.ro
-- (c) Modulo Consulting 2007

-- This plugin draws a frame called "Kiva", 
-- a play on circles and squares.

Comments about the plugin

-- the register function is called once 
-- per each plugin, at startup time
function register()
        constrainedAspectRatio = "1:1";
end

The function register() is called by FrameAway at startup time. You use the function only if you need to set some register-time variables (such as constraining aspect ratio).

-- first the rectangle that makes the frame

fp:moveTo__(originX, originY);
fp:lineTo__(originX + width, originY);
fp:lineTo__(originX + width, originY-height);
fp:lineTo__(originX, originY-height);
fp:lineTo__(originX, originY);
And finally the drawing code. This gets called each time FrameAway needs to redraw the frame.

FrameAway Proxy Methods

Method NameDescription
moveTo__(x, y)More cursor to point X, Y
lineTo__(x, y)Draw a line from current point to point(X, Y)
curveTo______(p1x, p1y, p2x, p2y, p3x, p3y)Draw cubic bezier curve to point (p1x, p1y) with control points (p2x, p2y), (p3x, p3y)
appendBezierPathWithArcWithCenter______(c1x, c2x, radius, startAngle, endAngle, clockwise)Append an arc to FP's bezier path. The new arc is centered in (c1x, c2x), with radius, startAngle and endAngle. For clockwise arcs clockwise needs to be 1; counter-clockwise arcs are obtained with clockwise set to 0

Global variables

Variable NameTypeRead/WriteEvaluatedDescription
constrainedAspectRatioStringYESAt startupWhen the user selects the plugin frame type, FrameAway will set the aspect ration to the value specified by this variable
widthFloatNOWhen frame shape changesThe width of the frame
heightFloatNOWhen frame shape changesThe height of the frame
originXFloatNOWhen frame shape changesX coordinate of top left corner
originYFloatNOWhen frame shape changesY coordinate of top left corner
fpObjectNONot applicableDrawing object proxy, allows you to call its methods for draw operations

Functions

Function NameTypeCalledDescription
register()GlobalAt startupPlugin initialization function, allows you to initialize variables such as constrainedAspectRatio