| www.delorie.com/gnu/docs/xaos/xaos_22.html | search |
![]() Buy GNU books! | |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This is a brief description of filter system used internally by XaoS. Filters in XaoS provides an object oriented interface to every part of XaoS engine. Main filters are: User interface implemented in ui_helper.c and zooming engine implemented in zoom.c. Filters are connected into an queue - at the beggining there is just two filters here(zoom and ui) but later additional filters should be inserted into the middle of queue like an stereogram generation etc. The queue supports operations like remove filter, add filter and initialize.
In the caluclation every filter should use data caluclated by filter lower in the queue. Data are stored into image. So for example stereogram filter should use fractal generated by zooming engine and create an stereogram.
This makes XaoS's code more flexible and makes easy future enhancements like different zooming engine, image rotation, other special effects, plug-ins and some other funny stuff since interface of each such part is well defined and each filter has quite good control over his childs. So stereogram filter should change palette, force zooming engine to change depth, width and height of calchlated image to fit his needs and so on.
This document describes mainly creating of filter like stereogram generator i.e. filter placed into middle of queue since I don't expect there will be many people creating "terminal" filters (zooming engines/user interface layer) note that different user interface is possible since user interface layer is not the real user interface just set of high level functions that should be called by main application like set_view. So in case you want to use XaoS as an calculation engine in your program this document is probably not for you.
Each filter is defined by filter_action structures as follows:
struct filteraction {
char *name;
char *shortname;
int flags;
struct filter *(*getinstance)(struct filteraction *a);
void (*destroyinstance)(struct filter *f);
int (*doit)(struct filter *f,int flags,int time);
int (*requirement)(struct filter *f,struct requirements *r);
int (*initialize)(struct filter *f,struct initdata *i);
void (*convertup)(struct filter *f,int *x,int *y);
void (*convertdown)(struct filter *f,int *x,int *y);
void (*removefilter)(struct filter *f);
};
|
Flags field is kept for future enhancements and is expected to be 0 for now.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
| webmaster donations bookstore | delorie software privacy |
| Copyright © 2003 by The Free Software Foundation | Updated Jun 2003 |