r3raysmp
real/frio/r3raysmp.h
r3frio
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.
r3Root
R3CLID_ROOT
r3Raysample
R3CLID_RAYSAMPLE - 325
INITIALIZE, ADDCHANNEL, REMOVEDYNAMICCHANN, NAMETOINDEX, NAMETOCLID, GETCHANNELVALUE, SETCHANNELVALUE, GETCHANNELVALUEBYN, SETCHANNELVALUEBYN, ASSIGN, BEGIN, END, INSTALLCHANNEL, ENUMSTATICCHANNEL, GETCHANNELINDEX, NAMETOSTATICCLID,
int R3RegisterRaySampleClass(R3APP *app);
R3RAYSMPM_INITIALIZE
INITIALIZE
R3RAYSMPM_INITIALIZE
obj.INITIALIZE();
resets the channel data to zero
R3RAYSMPM_ADDCHANNEL
ADDCHANNEL
R3RAYSMPM_ADDCHANNEL
R3INT, class id of channel
R3INT, unique name of the channel.
obj.ADDCHANNEL(p1, p3);
adds to a new channel to a raysample instance. If a channel with the given name already exists, no actions take place.
R3RAYSMPM_REMOVEDYNAMICCHANN
REMOVEDYNAMICCHANN
R3RAYSMPM_REMOVEDYNAMICCHANN
obj.REMOVEDYNAMICCHANN();
removes all added dynamic channels from a raysample.
R3RAYSMPM_NAMETOINDEX
NAMETOINDEX
R3RAYSMPM_NAMETOINDEX
char*, name of the channel
obj.NAMETOINDEX(p3);
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
NAMETOCLID
R3RAYSMPM_NAMETOCLID
R3INT, channel class identifier (NULL if not found)
char*, channel name
rc = obj.NAMETOCLID(p3);
returns the clid of a given channel name.
R3RAYSMPM_GETCHANNELVALUE
GETCHANNELVALUE
R3RAYSMPM_GETCHANNELVALUE
R3INT, clid of the channel
void*, the address to which the channel data is copied.
obj.GETCHANNELVALUE(p1, p3);
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
SETCHANNELVALUE
R3RAYSMPM_SETCHANNELVALUE
R3INT, clid of the channel
void*, the address from which the channel data is copied.
obj.SETCHANNELVALUE(p1, p3);
Sets the contents of the given (static) channel in a raysample.
R3RAYSMPM_GETCHANNELVALUEBYN
GETCHANNELVALUEBYN
R3RAYSMPM_GETCHANNELVALUEBYN
char*, name of the channel
void*, the address to which the channel data is copied.
obj.GETCHANNELVALUEBYN(p1, p3);
Read the contents of the given channel. The caller must allocate * wide enough buffer for storing tchannel data.
R3RAYSMPM_SETCHANNELVALUEBYN
SETCHANNELVALUEBYN
R3RAYSMPM_SETCHANNELVALUEBYN
char*, name of the channel
void*, the address from which the channel data is copied.
obj.SETCHANNELVALUEBYN(p1, p3);
Sets the contents of the given channel in a raysample.
R3RAYSMPM_ASSIGN
ASSIGN
R3RAYSMPM_ASSIGN
R3OBJ*, the sample from which data is copied
obj.ASSIGN(p3);
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
BEGIN
R3RAYSMPM_BEGIN
obj.BEGIN();
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
END
R3RAYSMPM_END
obj.END();
Frees channel data.
R3RAYSMPCM_INSTALLCHANNEL
INSTALLCHANNEL
R3RAYSMPCM_INSTALLCHANNEL
R3INT, clid of the channel (of base class R3CLID_CHANNEL) to be installed
obj.INSTALLCHANNEL(p3);
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
ENUMSTATICCHANNEL
R3RAYSMPCM_ENUMSTATICCHANNEL
R3OBJ*, object to be called
R3INT, callback method
obj.ENUMSTATICCHANNEL(p1, p3);
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
GETCHANNELINDEX
R3RAYSMPCM_GETCHANNELINDEX
R3INT, class id of the channel
obj.GETCHANNELINDEX(p3);
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
NAMETOSTATICCLID
R3RAYSMPCM_NAMETOSTATICCLID
R3INT, channel class identifier (NULL if not found)
char*, channel name
rc = obj.NAMETOSTATICCLID(p3);
returns the clid of a given static channel name.
Width
Width
R3RAYSMPA_Width
Integer
R3INT
width of channel data (pixels)
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
ChannelCount
R3RAYSMPA_ChannelCount
Integer
R3INT
number of added channels
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 *