Classic Master Controllers

Home • Gallery • Tutorials • Download • Purchase • Site Map
 

Classic Master Controllers Overview

Classic Master Controllers are programs (called master controllers hereafter) used by the Fractal Science Kit fractal generator to map sample data collected during the fractal iteration, to colors for display. The master controller has access to the list of controllers that have been added to the parent Controllers properties page.

As the sample points are processed by the Fractal Science Kit fractal generator, each sample is passed to the (single) master controller who calls 0 or more controllers to process the sample. If multiple controllers are called, the master controller combines the resulting set of colors as appropriate. Some master controllers use each color's alpha value (opacity) to combine the colors. Others algorithmically blend the set of colors using user specified options. A different strategy is to use information in the sample to determine which controller from the list should be used to process the sample resulting in strikingly different regions within the fractal display.

See also:

Each program is composed of a set of properties and instructions.

Comments

Always remember to click the Toggle Code View toolbar button at the top of the Program Editor and read the comments given in the comment section of the program's instructions. The comment section contains usage instructions, hints, notes, documentation, and other important information that will help you understand how best to use the program. Once you are done reading the comments, click the Toggle Code View toolbar button again to view the program's properties.

Properties

Fractal Science Kit - Classic Master Controllers Properties

The following properties are supported:

  • Add Trans Array is a checkbox that can be checked to add a Transformation Array editor as one of the program's properties pages. Users can add 1 or more transformations to the editor and your program can access the transformations using the Transformation Functions.

  • Force Execution is a checkbox that can be checked to force execution of the instructions. If Force Execution is unchecked, the instructions will execute only if required based on what changes were made to the fractal's properties since the last time the instructions ran. This is rarely checked.

Instructions

The remainder of this page can be ignored if you are not a programmer.

At the bottom of the window is an editor pane named Instructions. The editor pane is a simple text editor to view/edit your Program Instructions. See Editing Text for details.

The instructions are divided into sections. Within each section are statements that conform to the Programming Language syntax.

In addition to the Standard Sections, Classic Master Controllers support 1 other section:

color:

This section is responsible for setting the color for the current sample point. The color is returned in the built-in variable color.

Built-in Variables

Several built-in variables are available to your instructions:

  • Color color
  • pixel

Master controllers can access the above built-in variables. color is used to return the color computed by the program.

pixel is the location in the complex plane of the current sample point and is read-only.

color is a Color object defined as:

Object Color {
  R|Red  |H|Hue
  G|Green|S|Saturation
  B|Blue |L|Lightness |V|Value
  A|Alpha
}

Each of the fields should be a floating point value between 0 and 1, inclusive. See the Color Functions for details.

The Color object supports the RGB, HSL, and HSV color models but the Fractal Science Kit expects color to conform to the RGB color model. If your program generates a color using the HSL or HSV color model, you must convert the color to the RGB color model prior to returning.

The color's Alpha value is used to set the color's opacity. A value of 0 makes the color totally transparent and a value of 1 makes the color totally opaque. Values between 0 and 1 can be used to define colors that are translucent.

Example:

comment:
 
  Return color computed by 1st controller.
 
color:
 
  color = Controller.Color(0)

This is the Pass Thru master controller. It simply calls controller 0 to map the sample to a color (using the Controller Function Controller.Color) and returns the result. You can use the Pass Thru master controller when you simply want to use a single controller to process every sample. Even if the list has more than 1 controller, Pass Thru only uses controller 0 (the 1st controller in the list). Pass Thru is the default master controller.

Example:

comment:
 
  Return color computed by applying all controllers in series
  and merging the resulting colors based on each color's Alpha.
 
color:
 
  color = Controller.ColorByOpacity()

This example uses the Controller Function Controller.ColorByOpacity to process each sample. Controller.ColorByOpacity calls each controller in the list in order and merges the resulting colors based on each color's Alpha value. Clearly, this is only useful only if the controllers return colors whose Alpha value is less than 1.

Example:

comment:
 
  Return color computed by applying controller 0 to the points
  inside the Mandelbrot set and controller 1 to the points
  outside the set.
 
color:
 
  color = Controller.Color(IIf(Sample.IsInside, 0, 1))

This example uses controller 0 to process inside samples and controller 1 to process outside samples.

Example:

comment:
 
  Return color computed by applying controller N
  where N is based on a sample switch value.
  The total number of controllers in the list
  is usually 2 and this alternates between
  them based on the switch value.
 
color:
 
  color = Controller.Color(Offset + Factor*Value^Power)
 
properties:
 
  option Value {
    type = SamplePointValue
    caption = "Switch Value"
    default = Sample.Angle
  }
  option Power {
    type = Float
    caption = "Power"
    details = "Set value = value ^ Power (0.125 to 8)"
    default = 1
    range = [0.125,8]
  }
  option Factor {
    type = Float
    caption = "Factor"
    details = "Set value = value * Factor (0 to 32)"
    default = 2
    range = (0,32]
  }
  option Offset {
    type = Float
    caption = "Offset"
    details = "Set value = value + Offset"
    default = 0
  }

This example uses a sample switch value (Sample.Angle by default) to choose which controller to call to process each sample. The argument passed to Controller.Color is automatically truncated to an integer and then wrapped within the range 0 to Countroller.Count-1. If there are 2 controllers in the controller list, the default settings above will select either controller 0 or controller 1 based on Sample.Angle and will result in a binary decomposition pattern injected over whatever designs are given by these 2 controllers.

Constants

The following constants are available to your instructions:

  • ViewportMagnification
  • MinimumDwell
  • MaximumDwell

ViewportMagnification is the current fractal's magnification. The magnification can be viewed by executing the Resize command on the View menu of the Fractal Window. MinimumDwell and MaximumDwell give the range of dwells in the image and are only available in the color: section of the program.

Accessing Sample Data

The data associated with the sample being processed is accessed by the master controller using the Sample object. The Sample object is a read-only object that contains all the collected data for the sample point. Many of the fields have been normalized based on normalization settings for the associated field, and the value is between 0 and 1. In some cases both the raw value and the normalized value are available. The fields associated with the Sample object for Classic Master Controllers are the same as for Classic Controllers.

 

Copyright © 2004-2016 Hilbert, LLC
All rights reserved