VRay SDK for C++
|
#include <vraysdk.hpp>
Public Member Functions | |
UVTextureSampler (const UVTextureSampler &r)=delete | |
UVTextureSampler (UVTextureSampler &&r) noexcept | |
UVTextureSampler & | operator= (const UVTextureSampler &rhs)=delete |
UVTextureSampler & | operator= (UVTextureSampler &&rhs) noexcept |
bool | releaseRenderer (VRayRenderer &renderer) |
bool | sample (const PluginRef &pluginRef, float u, float v, AColor &result) |
bool | sample (const PluginRef &pluginRef, float u, float v, float &result) |
This method is an overload of sample(). It should be used with plugins whose output is a floating point number(float textures). | |
bool | sample (const PluginRef &pluginRef, float u, float v, int &result) |
This method is an overload of sample(). It should be used with plugins whose output is an integer(int textures). | |
VRayImage * | sampleArea (const PluginRef &pluginRef, float u_start, float u_end, float v_start, float v_end, int width, int height) |
FloatList | sampleAreaFloat (const PluginRef &pluginRef, float u_start, float u_end, float v_start, float v_end, int width, int height) |
IntList | sampleAreaInt (const PluginRef &pluginRef, float u_start, float u_end, float v_start, float v_end, int width, int height) |
bool | setupRenderer (VRayRenderer &renderer) |
A class which allows you to sample textures without starting a renderer. It is a simple and lightweight UV sampler which might not work with textures that require information which is obtained during the rendering process.
bool VRay::UVTextureSampler::releaseRenderer | ( | VRayRenderer & | renderer | ) |
This method releases the VRayRenderer(if there is any). Call this method with the VRayRenderer instance that you have used in setupRenderer(). After a successful execution of this method, the renderer instance will be restored to its normal state. This means that you will be able to modify plugins, load .vrscene files and etc.
renderer | The released renderer. |
bool VRay::UVTextureSampler::sample | ( | const PluginRef & | pluginRef, |
float | u, | ||
float | v, | ||
AColor & | result | ||
) |
This method samples the output of the given plugin at point (u, v). The plugin must be related to the VRayRenderer which has been used to set up the texture sampler.
pluginRef | The plugin whose output(main or alternative) will be sampled and which returns AColor as a result. |
u | The u-coordinate of the sample point. |
v | The v-coordinate of the sample point. |
result | The result of the sampling. |
VRayImage * VRay::UVTextureSampler::sampleArea | ( | const PluginRef & | pluginRef, |
float | u_start, | ||
float | u_end, | ||
float | v_start, | ||
float | v_end, | ||
int | width, | ||
int | height | ||
) |
This method samples an area of the output of the given plugin. The sampled region(it is a rectangle) has dimensions: [u_start; u_end] x [v_start; v_end].
pluginRef | The plugin whose output(main or alternative) will be sampled and which returns AColor as a result. |
u_start | The u-coordinate from which to sample. |
u_end | The u-coordinate to which to sample. |
v_start | The v-coordinate from which to sample. |
v_end | The v-coordinate to which to sample. |
width | The width of the resulting VRayImage. |
height | The height of the resulting VRayImage. |
FloatList VRay::UVTextureSampler::sampleAreaFloat | ( | const PluginRef & | pluginRef, |
float | u_start, | ||
float | u_end, | ||
float | v_start, | ||
float | v_end, | ||
int | width, | ||
int | height | ||
) |
This method samples an area of the output of the given plugin. The sampled region(it is a rectangle) has dimensions: [u_start; u_end] x [v_start; v_end].
pluginRef | The plugin whose output(main or alternative) will be sampled and which returns float as a result(float textures). |
u_start | The u-coordinate from which to sample. |
u_end | The u-coordinate to which to sample. |
v_start | The v-coordinate from which to sample. |
v_end | The v-coordinate to which to sample. |
width | The width of the sample area, which determines the sample step(resolution) of the u-coordinate. |
height | The height of the sample area, which determines the sample step(resolution) of the v-coordinate. |
IntList VRay::UVTextureSampler::sampleAreaInt | ( | const PluginRef & | pluginRef, |
float | u_start, | ||
float | u_end, | ||
float | v_start, | ||
float | v_end, | ||
int | width, | ||
int | height | ||
) |
This method is almost the same as sampleAreaFloat(). The only difference is that it should be used with plugins whose output(main or alternative) returns int as a result(int textures).
bool VRay::UVTextureSampler::setupRenderer | ( | VRayRenderer & | renderer | ) |
This method prepares the passed renderer for sampling. It does not modify the passed renderer on failure. However, it does make the renderer unusable(outside the UVTextureSampler) on success. This means that the methods of the VRayRenderer instance won't do anything after a successful execution of this method. To get the renderer back, you have to call releaseRenderer() with the same VRayRenderer instance.
renderer | The renderer which will be used for sampling. |