User Manual

Table Of Contents
A More Complex DCT LUT Example
The following code shows an example of creating a mirror effect, illustrating how you can
access pixels spatially.
// Example of spatial access for mirror effect
__DEVICE__ float3 transform(int p_Width, int p_Height, int p_X, int p_Y, __
TEXTURE__ p_TexR, __TEXTURE__ p_TexG, __TEXTURE__ p_TexB)
{
const bool isMirror = (p_X < (p_Width / 2));
const float r = (isMirror) ? _tex2D(p_TexR, p_X, p_Y) : _tex2D(p_TexR, p_
Width - 1 - p_X, p_Y);
const float g = (isMirror) ? _tex2D(p_TexG, p_X, p_Y) : _tex2D(p_TexG, p_
Width - 1 - p_X, p_Y);
const float b = (isMirror) ? _tex2D(p_TexB, p_X, p_Y) : _tex2D(p_TexB, p_
Width - 1 - p_X, p_Y);
return make_float3(r, g, b);
}
Chapter – 174 Creating DCTL LUTs 3538