formZ SDK | 4.0 Call Back Reference | Surface Style Representation

# fz_srep_cbak_get_generic_parm

Description

Surface Style Representation generic get parameter function (Optional). This function is called to return the srep parameters in a generic format. This functionality is invoked, for example, when rendering the srep in Shaded Full preview, or when exporting. All output parameters are optional. It is mandatory, that an output parameter is checked for NULL, before it is assigned a value. This function is frequently called with only those output parameters requested, which are relevant in a specific calling context. For example, this function may be called to only inquire the diffuse reflection factor. In this case. the diffuse output parameter would be non NULL and all other parameters NULL.
For color, transparency and bump patterns, this function returns either a solid value (a color rgb color for example), a texture map or indicates, that a procedural pattern is used. While the solid value and texture map are returned by this function, the procedural pattern is not returned. Three addition callback functions exist, that can be implemented to render procedural patterns into a texture map. See fz_srep_cbak_rndr_texture_func.

Plugin Prototype

fzrt_error_td fz_srep_cbak_get_generic_parm(

fzrt_int | windex,
fz_rmtl_ptr | rmtl,
void * | srep_data,
fz_srep_pattern_type_enum * | col_which,
float * | col,
fz_tmap_embd_ptr | col_tmap,
fzrt_int * | col_tmap_flags,
float * | col_txr_scale,
fz_srep_shading_type_enum * | refl_which,
float * | ambient,
float * | diffuse,
float * | specular,
float * | spec_expo,
float * | spec_col,
float * | mirr,
float * | trans_misson,
float * | refr,
float * | glow,
fz_srep_pattern_type_enum * | transp_which,
float * | transp,
fz_tmap_embd_ptr | transp_tmap,
fzrt_int * | transp_tmap_flags,
float * | trn_txr_scale,
fz_srep_pattern_type_enum * | bmp_which,
fz_tmap_embd_ptr | bmp_tmap,
float * | bmp_amp,
fzrt_int * | bmp_tmap_flags,
float * | bmp_txr_scale,
fzrt_int * | parm_mask )

Parameters

windex [Input]

project window index

rmtl [Input]

surface style to which the srep belongs

srep_data [Input]

The Surface Style Representation data.

col_which [Result, Optional]

the type of color pattern.

col [Result, Optional]

the rgb color. If the pattern type is not a plain color, it shoud be the average of the map or procedural pattern.

col_tmap [Result, Optional]

the image map, if col_which == FZ_SREP_PATTERN_TYPE_MAP. If passed as non NULL, the texture map has been allocated by the calling code. The plugin should set the fields of the map with the respective api functions, such as and .

col_tmap_flags [Result, Optional]

bit encoded color map option, if col_which == FZ_SREP_PATTERN_TYPE_MAP.

col_txr_scale [Result, Optional]

The scale of the color pattern, if col_which == FZ_SREP_PATTERN_TYPE_MAP or col_which == FZ_SREP_PATTERN_TYPE_PROCEDURAL

refl_which [Result, Optional]

The shading type.

ambient [Result, Optional]

The ambient reflection factor, if refl_which == FZ_SREP_REFLECTION_TYPE_SHADED.

diffuse [Result, Optional]

The diffuse reflection factor, if refl_which == FZ_SREP_REFLECTION_TYPE_SHADED.

specular [Result, Optional]

The specular reflection factor, if refl_which == FZ_SREP_REFLECTION_TYPE_SHADED.

spec_expo [Result, Optional]

The specular exponent, if refl_which == FZ_SREP_REFLECTION_TYPE_SHADED.

spec_col [Result, Optional]

The specular color, if refl_which == FZ_SREP_REFLECTION_TYPE_SHADED.

mirr [Result, Optional]

The mirror reflection factor, if refl_which == FZ_SREP_REFLECTION_TYPE_SHADED.

trans_misson [Result, Optional]

The glass like transmission factor, if refl_which == FZ_SREP_REFLECTION_TYPE_SHADED.

refr [Result, Optional]

The index of refraction (for glass like transmission), if refl_which == FZ_SREP_REFLECTION_TYPE_SHADED.

glow [Result, Optional]

The glow factor, if refl_which == FZ_SREP_REFLECTION_TYPE_SHADED.

transp_which [Result, Optional]

the type of transparency pattern.

transp [Result, Optional]

the transparency value. If the pattern type is not a simple transparency, it shoud be the average of the map or procedural pattern.

transp_tmap [Result, Optional]

the image map, if transp_which == FZ_SREP_PATTERN_TYPE_MAP. If passed as non NULL, the texture map has been allocated by the calling code. The plugin should set the fields of the map with the respective api functions, such as and .

transp_tmap_flags [Result, Optional]

bit encoded transparency map option, if transp_which == FZ_SREP_PATTERN_TYPE_MAP.

trn_txr_scale [Result, Optional]

The scale of the transparency pattern, if transp_which == FZ_SREP_PATTERN_TYPE_MAP or transp_which == FZ_SREP_PATTERN_TYPE_PROCEDURAL

bmp_which [Result, Optional]

the type of bump pattern.

bmp_tmap [Result, Optional]

the image map, if bmp_which == FZ_SREP_PATTERN_TYPE_MAP. If passed as non NULL, the texture map has been allocated by the calling code. The plugin should set the fields of the map with the respective api functions, such as and .

bmp_amp [Result, Optional]

The amplitude of the bump pattern, if bmp_which == FZ_SREP_PATTERN_TYPE_MAP or FZ_SREP_PATTERN_TYPE_PROCEDURAL

bmp_tmap_flags [Result, Optional]

bit encoded bump map option, if bmp_which == FZ_SREP_PATTERN_TYPE_MAP.

bmp_txr_scale [Result, Optional]

The scale of the bump pattern, if bmp_which == FZ_SREP_PATTERN_TYPE_MAP or bmp_which == FZ_SREP_PATTERN_TYPE_PROCEDURAL

parm_mask [Result]

Bit mask, that indicates which parameters were actually set. THis is important, so that the calling code knows which parameters were actually filled in, and which simply don't apply for the srep.

Returns

Error codes

Availability

7.0.0.0

See Also

,,fz_srep_cbak_rndr_texture_func,fz_srep_cbak_set_generic_parm_func

Function Set

fz_srep_cbak_fset

Defined in

fz_srep_api.h