Layer Class Reference

Provides input to the Context. More...

#include <layer.h>

Inherits Entry, and JSyncThread.

Inherited by AudioLayer, FlashLayer, GeneratorLayer, GenLayer, GeoLayer, ImageLayer, UnicapLayer, V4lGrabber, and VideoLayer.

List of all members.

Public Member Functions

 Layer ()
 Layer constructor.
virtual ~Layer ()
 Layer destructor.
virtual int start ()
virtual bool open (const char *file)=0
 open the file (first called)
virtual bool init (int w=0, int h=0, int bpp=0)
 initializes the layer (this will call also the layer implementation's init)
virtual void close ()=0
 close the layer (ready to open a new one)
virtual bool set_parameter (int idx)
 activate the setting on parameter pointed by idx index number
virtual void set_position (int x, int y)
 Get Layer's filename.
virtual void set_zoom (double x, double y)
 Zoom (resize) a Layer.
virtual void set_rotate (double angle)
 Rotate a Layer.
virtual void * do_filters (void *tmp_buf)
 process all filters on a buffer
int do_iterators ()
 process all registered iterators
virtual char * get_blit ()
 return the name of the currently seleted Blit
virtual bool set_blit (const char *bname)
 select a Blit by name
void * js_constructor (Context *env, JSContext *cx, JSObject *obj, int argc, void *aargv, char *err_msg)
 javascript layer constructor

Public Attributes

Type type
 type of the layer
Linklist< Parameter > * parameters
 Parameter list for the layer.
Linklist< FilterInstance > filters
 Filter list of effects applied on the Layer.
Geometry geo
 Geometrical information about the Layer.
Geometry geo_rotozoom
 Geometrical information about the Rotozoom.
Linklist< Iterator > iterators
 Iterator list of value modifiers.
Blitter * blitter
 Blitter interface for this Layer.
Blit * current_blit
 currently set Blit on this Layer
ViewPortscreen
 ViewPort on which the Layer is blitted.
void * buffer
 RGBA pixel buffer returned by the layer.
unsigned int textureID
 opengl texture id
int frame_rate
 value set by implemented layer type

Protected Member Functions

virtual bool _init ()=0
 implementation specific _init() to be present in all layers

Detailed Description

Provides input to the Context.

This class describes methods and properties common to all Layers in FreeJ: it is the main interface for functionalities like blit changes, filter management and position changes.

The public methods hereby described are matching the javascript API which is made available by the internal parser.

Methods implemented to create and destroy a Layer:

Miscellaneus operations made available for the Layer:

Blitter interface of the Layer

LinkList of Filter instances added to the Layer:

LinkList of Parameters available for the Layer:

Geometrical informations about the layer:

Definition at line 81 of file layer.h.


Member Function Documentation

virtual bool Layer::_init (  )  [protected, pure virtual]

implementation specific _init() to be present in all layers

Initialize the layer implementation

Parameters:
freej freej context where the layer will be used

Referenced by init().

void * Layer::do_filters ( void *  tmp_buf  )  [virtual]

process all filters on a buffer

QUAAA fps should be passed XXX TODO

Definition at line 247 of file layer.cpp.

References filters.

virtual bool Layer::open ( const char *  file  )  [pure virtual]

open the file (first called)

Open a file or resource for the layer

Parameters:
file string describing the path to the file, can be also an url
void Layer::set_position ( int  x,
int  y 
) [virtual]

Get Layer's filename.

Move the layer to absolute position, coordinates refer to the upper left corner

Parameters:
x horizontal coordinate
y vertical coordinate Set Layer's position on screen

Definition at line 326 of file layer.cpp.

void Layer::set_rotate ( double  angle  )  [virtual]

Rotate a Layer.

Degrees of rotation

Parameters:
angle from 0 to 360 degrees rotation

Definition at line 366 of file layer.cpp.

void Layer::set_zoom ( double  x,
double  y 
) [virtual]

Zoom (resize) a Layer.

Set the zoom rate (magnification) for a layer the coordinates are floats, original size is 1.0

Parameters:
x horizontal zoom float coefficient (default 1.0)
y vertical zoom float coefficient (default 1.0)

Definition at line 347 of file layer.cpp.

virtual int Layer::start (  )  [inline, virtual]

Start the layer thread

Definition at line 106 of file layer.h.


Member Data Documentation

RGBA pixel buffer returned by the layer.

physical buffers

Definition at line 206 of file layer.h.

Referenced by Layer().


The documentation for this class was generated from the following files:

Generated on Mon May 10 15:34:13 2010 for FreeJ C++ API by  doxygen 1.6.1