r3raysmp

r3raysmp

Class

real/frio/r3raysmp.h

Library

r3frio

Description:

RaySample Class. Raysample object stores values of all installed channels. The location of channel data items is configured at program startup and can vary depending on plugins etc. Therefore, the data can be accessed only using the methods and macros defined below. If the 'width' of the raysample is greater than one, the width units of each channel data are stored in consecutive memory locations. For example, if width is 3, data may be stored as Normal Normal Normal RGB RGB RGB ALPHA ALPHA ALPHA ... 1 wide raysamples are used most frequently and many of the methods below can be used only with such minimal raysamples. Raysample object supports two kind of channels: static and dynamic ones. Static channels are installed at program startup and their indices (offset variables through which the data can be accessed quickly) remain constant during the execution. Static channels are intended for kind of 'fixed purposes': they are so frequently needed that they are always inserted to ray sample instances by default. Dynamic channels can be inserted/removed from/to a raysample at any time. They are typically intended for custom (end user configured) purposes. A raysample object should be used for data IO purposes only between RAYSMPM_BEGIN-END method calls. These methods e.g. allocate/deallocate data. Raysample attributes such as width and channel configuration must not be changed between BEGIN-END methods.

See Also

oops/r3root.h

Super Class

r3Root

R3CLID_ROOT

JavaScript

r3Raysample

Class Identifier

R3CLID_RAYSAMPLE - 325

Methods

INITIALIZE, ADDCHANNEL, REMOVEDYNAMICCHANN, NAMETOINDEX, NAMETOCLID, GETCHANNELVALUE, SETCHANNELVALUE, GETCHANNELVALUEBYN, SETCHANNELVALUEBYN, ASSIGN, BEGIN, END, INSTALLCHANNEL, ENUMSTATICCHANNEL, GETCHANNELINDEX, NAMETOSTATICCLID,

Attributes

Width, ChannelCount,

Registration

int R3RegisterRaySampleClass(R3APP *app);

R3RAYSMPM_INITIALIZE

Method

INITIALIZE

Identifier

R3RAYSMPM_INITIALIZE

JavaScript

obj.INITIALIZE();

Description

resets the channel data to zero

R3RAYSMPM_ADDCHANNEL

Method

ADDCHANNEL

Identifier

R3RAYSMPM_ADDCHANNEL

Param 1:

R3INT, class id of channel

Param 3:

R3INT, unique name of the channel.

JavaScript

obj.ADDCHANNEL(p1, p3);

Description

adds to a new channel to a raysample instance. If a channel with the given name already exists, no actions take place.

R3RAYSMPM_REMOVEDYNAMICCHANN

Method

REMOVEDYNAMICCHANN

Identifier

R3RAYSMPM_REMOVEDYNAMICCHANN

JavaScript

obj.REMOVEDYNAMICCHANN();

Description

removes all added dynamic channels from a raysample.

R3RAYSMPM_NAMETOINDEX

Method

NAMETOINDEX

Identifier

R3RAYSMPM_NAMETOINDEX

Param 3:

char*, name of the channel

JavaScript

obj.NAMETOINDEX(p3);

Description

returns the storage offset of a given channel. This offset can be used * together with the macro R3CHADDR(raysmp, storage_offset) to find out the memory * address of the channel data.

R3RAYSMPM_NAMETOCLID

Method

NAMETOCLID

Identifier

R3RAYSMPM_NAMETOCLID

Return

R3INT, channel class identifier (NULL if not found)

Param 3:

char*, channel name

JavaScript

rc = obj.NAMETOCLID(p3);

Description

returns the clid of a given channel name.

R3RAYSMPM_GETCHANNELVALUE

Method

GETCHANNELVALUE

Identifier

R3RAYSMPM_GETCHANNELVALUE

Param 1:

R3INT, clid of the channel

Param 3:

void*, the address to which the channel data is copied.

JavaScript

obj.GETCHANNELVALUE(p1, p3);

Description

Read the contents of the given channel. The caller must allocate * wide enough buffer for storing tchannel data. The method is suitable for static channels * because the channel is identified by a clid. See also R3RAYSMPM_GETCHANNELVALUEBYNAME below.

R3RAYSMPM_SETCHANNELVALUE

Method

SETCHANNELVALUE

Identifier

R3RAYSMPM_SETCHANNELVALUE

Param 1:

R3INT, clid of the channel

Param 3:

void*, the address from which the channel data is copied.

JavaScript

obj.SETCHANNELVALUE(p1, p3);

Description

Sets the contents of the given (static) channel in a raysample.

R3RAYSMPM_GETCHANNELVALUEBYN

Method

GETCHANNELVALUEBYN

Identifier

R3RAYSMPM_GETCHANNELVALUEBYN

Param 1:

char*, name of the channel

Param 3:

void*, the address to which the channel data is copied.

JavaScript

obj.GETCHANNELVALUEBYN(p1, p3);

Description

Read the contents of the given channel. The caller must allocate * wide enough buffer for storing tchannel data.

R3RAYSMPM_SETCHANNELVALUEBYN

Method

SETCHANNELVALUEBYN

Identifier

R3RAYSMPM_SETCHANNELVALUEBYN

Param 1:

char*, name of the channel

Param 3:

void*, the address from which the channel data is copied.

JavaScript

obj.SETCHANNELVALUEBYN(p1, p3);

Description

Sets the contents of the given channel in a raysample.

R3RAYSMPM_ASSIGN

Method

ASSIGN

Identifier

R3RAYSMPM_ASSIGN

Param 3:

R3OBJ*, the sample from which data is copied

JavaScript

obj.ASSIGN(p3);

Description

Copies the channel data of a raysample to another raysample. * The caller is rensponsible for passing two identically configured raysamples. * Different width or channel set (not examined for speed reasons) may result to system failure.

R3RAYSMPM_BEGIN

Method

BEGIN

Identifier

R3RAYSMPM_BEGIN

JavaScript

obj.BEGIN();

Description

Allocates channel data. Raysample channels can be read and written after this. * Do not change width or channel configuration between BEGIN-END pair.

R3RAYSMPM_END

Method

END

Identifier

R3RAYSMPM_END

JavaScript

obj.END();

Description

Frees channel data.

R3RAYSMPCM_INSTALLCHANNEL

Method

INSTALLCHANNEL

Identifier

R3RAYSMPCM_INSTALLCHANNEL

Param 3:

R3INT, clid of the channel (of base class R3CLID_CHANNEL) to be installed

JavaScript

obj.INSTALLCHANNEL(p3);

Description

installs a new static channel to the raysample class. If it already was installled, * actions take place. This method should be called only during class installation (at program * configuration time) because some modules rely on fixed static channel indices.

R3RAYSMPCM_ENUMSTATICCHANNEL

Method

ENUMSTATICCHANNEL

Identifier

R3RAYSMPCM_ENUMSTATICCHANNEL

Param 1:

R3OBJ*, object to be called

Param 3:

R3INT, callback method

JavaScript

obj.ENUMSTATICCHANNEL(p1, p3);

Description

Does R3SendMsg3(p1, msg, channeldatatype, channelclid, * R3RCA_Name, channelname, * R3CHCA_SubCount, channelsubcount, * R3CHCA_SubIds, channelsubidarray, * R3CHCA_SubNames, channelsubnamearray, * R3TAG_END); * * for all installed static channels *

R3RAYSMPCM_GETCHANNELINDEX

Method

GETCHANNELINDEX

Identifier

R3RAYSMPCM_GETCHANNELINDEX

Param 3:

R3INT, class id of the channel

JavaScript

obj.GETCHANNELINDEX(p3);

Description

returns the storage offset of a given static channel. This offset can be used * together with the macro R3CHADDR(raysmp, channel_index) to find out the memory * address of the channel data.

R3RAYSMPCM_NAMETOSTATICCLID

Method

NAMETOSTATICCLID

Identifier

R3RAYSMPCM_NAMETOSTATICCLID

Return

R3INT, channel class identifier (NULL if not found)

Param 3:

char*, channel name

JavaScript

rc = obj.NAMETOSTATICCLID(p3);

Description

returns the clid of a given static channel name.

Width

Attribute

Width

Identifier

R3RAYSMPA_Width

JavaScript type

Integer

C type

R3INT

Description

width of channel data (pixels)

Syntax


jsobj.SetWidth(value);
value = jsobj.GetWidth();


R3INT value = ...;
R3SetAttrs(r3obj, R3RAYSMPA_Width, value, R3TAG_END);
R3INT value;
R3GetAttrs(r3obj, R3RAYSMPA_Width, &value, R3TAG_END);

ChannelCount

Attribute

ChannelCount

Identifier

R3RAYSMPA_ChannelCount

JavaScript type

Integer

C type

R3INT

Description

number of added channels

Syntax


value = jsobj.GetChannelCount();


R3INT value;
R3GetAttrs(r3obj, R3RAYSMPA_ChannelCount, &value, R3TAG_END);

Fetch channels from raysample objects using this macro. Channel_index is the return value from the installchannel method


r3appobj *

Tags

Tags

R3RAYSMPA_NoStaticChannels