Lens Flare Macro Language

A complete lens flare is composed of one or more "spots" or Flares arranged along the Flare Axis. The Lens Flare Macro (LFM) language allows the description of a complete flare by positioning, coloring and shaping these individual flare elements.

These flare elements (Flare Types) can be anything from a simple spot to a polygon to a complex star or other image. The language allows the creation ("registering") of new Flare Types using Windows BMP files. All Flare Types must be registered before first being used, with the exception of Pre-Registered Flare Types which are automatically generated and can be referred to without explicit registering (see the RegisterFlare command below).

For reasons of flexibility, the language was made so that the complete Lens Flare will appear as identically as possible on all images and screens no matter the resolution. Because of this, you may notice that there is no absolute coordinate system, but most commands requiring coordinates accept them in terms of normalized screen or axis coordinates using decimal numbers.

Important: Keep in mind that the Lens Flare Macro language is extremely case-sensitive. DRAWFLARE is not the same as DrawFlare! Also make sure that Flares are referred to by the exact name they were registered with.

Comments
Comments are ignored sections of code. There are two types of comment: single-line and multi-line:
 ; This is a comment.
 { This is a comment.
   This, too. }
Multi-line comments encapsulate all text enclosed in the { }. Single-line comments need only have a ; character before the line. It is illegal to have either kind of comment on a line with any other command, however:
 DrawFlare SimpleSpot  ; This is illegal!

 { This is
   illegal! } RegisterFlare MyStar
 c:\Flares\star.bmp    { This is illegal! }
Registering Flares
Before any non-pre-registered Flares can be drawn, they need to be registered. The command for registering a flare is:
The Flare Name is a single word (ex. LittleStar) used to refer to the Flare later on in DrawFlare commands (see below). The BMP Image should be the complete path and filename of a BMP image to use for this flare (ex. C:\FLARES\LITTLESTAR.BMP). Spaces are allowed for long filenames, but keep in mind this filename and path must be the only thing on the line immediately following the RegisterFlare command. The BMP should be a standard 24-bit (TrueColor) square bitmap. Colors are ignored since color is controlled using the Color command (see below). Though the BMP must be square, the flare inside need not be, or use the Aspect command to change the shape of the Flare.

The pre-registered Flares are: Drawing Flares
The command to draw a Flare is:
Where Flare Name is the name the Flare was registered under or the name of the pre-registered Flare. Remember that commands affecting the appearance of the Flare should be executed before the Flare is drawn!

Commands
All Flare commands can be used in any order in a Lens Flare Macro file and are executed in order. Flare commands modify the appearance of all Flares coming after them and are not changed when Flares are drawn. Though most Flare parameters have defaults, it is still important for most Flare commands to be executed before using the DrawFlare command. For instance, while the Aspect Ratio has a default of 1.0 and may not be necessary to change before drawing the first flare, it is almost certainly necessary to change the Color before drawing the first flare. (In fact, the default color may be [0,0,0] and no Flare will appear!) The same goes for commands like Location, Size and others critical to the appearance of the Flare.