ifsc

ifsc — Manipulate IFS Compose style IFS representations.

Synopsis




typedef     IFSCTrans;
PointXY     ifs_find_center                 (const IFS *ifs);
IFS*        ifs_from_ifscompose             (const IFSCTrans *ifsc,
                                             size_t ntrans,
                                             PointXY center);
IFSTrans*   ifs_trans_from_ifscompose       (const IFSCTrans *ifsct,
                                             PointXY center,
                                             IFSTrans *t);
IFSCTrans*  ifs_trans_to_ifscompose         (const IFSTrans *t,
                                             PointXY center,
                                             IFSCTrans *ifsct);

Description

IFS Compose is a GIMP plug-in using quite an unorthodox representation of affine transformations in plane. Exact formulas are described in a TeX file in IFSgr source distribution (too ugly to show here), ifs-trans-decomposition.tex.

Details

IFSCTrans

typedef struct {
    double  x, y;
    double  theta;
    double  scale;
    double  asym;
    double  shear;
    int     flip;
    double  prob;
} IFSCTrans;

Structure describing an iterated function system in GIMP IFS Compose style.

See the TeX files in source distribution for exact meaning and discussion of the parameters.


ifs_find_center ()

PointXY     ifs_find_center                 (const IFS *ifs);

Find fractal `center'.

This is just some point in the convex hull, nothing special. Namely it is the center of fixed points of all transformations, because these are points belonging to the fractal by definition (unless the transformations are dilations).

This is the same definition of center as IFS Compose uses, however this function should return something not-so-eccentric even for IFSes containing transformations without fixed points (they are excluded from the computation).

ifs: An Iterated Function System.
Returns : The fractal center.

ifs_from_ifscompose ()

IFS*        ifs_from_ifscompose             (const IFSCTrans *ifsc,
                                             size_t ntrans,
                                             PointXY center);

Convert complete fractal from IFS Compose style ot IFS.

ifsc: An array of IFS Compose style transformations.
ntrans: The number of items in ifsc.
center: IFS center, as used in IFS Compose.
Returns : A newly allocated IFS containing the converted fractal.

ifs_trans_from_ifscompose ()

IFSTrans*   ifs_trans_from_ifscompose       (const IFSCTrans *ifsct,
                                             PointXY center,
                                             IFSTrans *t);

Convert an IFS Compose transformation to IFSTrans.

ifsct: A IFS Compose affine transformation.
center: IFS center, as used in IFS Compose.
t: An affine transformation to recompute from ifsct (or NULL to allocate a new one).
Returns : t itself, or (if it was NULL) a newly allocated transformation that should be freed when no longer needed.

ifs_trans_to_ifscompose ()

IFSCTrans*  ifs_trans_to_ifscompose         (const IFSTrans *t,
                                             PointXY center,
                                             IFSCTrans *ifsct);

Convert an affine transformation t to IFC Compose affine transformation.

t: An affine transformation.
center: IFS Compose fractal center.
ifsct: IFS Compose affine transformation to modify, or NULL to allocate a new one.
Returns : ifsct itself (if it wasn't NULL), or a newly allocated transformation that should be freed when no longer needed.