| Title: | Introduction of 'HLSL' Syntax to 'Rcpp' |
|---|---|
| Description: | Brings 'HLSL'-like syntax to 'Rcpp' codes via the 'HLSL++' library <https://github.com/redorav/hlslpp>. |
| Authors: | Akiru Kato [aut, cre], Emilio López [cph] (Author of the 'HLSL++' library) |
| Maintainer: | Akiru Kato <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.1 |
| Built: | 2026-05-31 06:09:15 UTC |
| Source: | https://github.com/paithiov909/nativeshadr |
ASCII filter
ascii_filter(nr, sc_factor = 128, intensity = 0.8)ascii_filter(nr, sc_factor = 128, intensity = 0.8)
nr |
A |
sc_factor |
A numeric scalar; the scale factor. |
intensity |
A numeric scalar; the intensity of filter edge.
Set to |
A nativeRaster object.
Deforms the image by sampling it at
uv + float2(sin(uv.y * freq.x) * amp.x, cos(uv.x * freq.y) * amp.y).
deform(nr, freq = c(10, 10), amp = c(0.1, 0.1))deform(nr, freq = c(10, 10), amp = c(0.1, 0.1))
nr |
A |
freq |
A numeric vector of length 2; the frequency of the deformation. |
amp |
A numeric vector of length 2; the amplitude of the deformation. |
A nativeRaster object.
Godray effect
godray( nr, parallel = FALSE, angle = pi/6, center = c(0, 0), gain = 0.5, lacunarity = 2.5, alpha = 1, octaves = 5, time = 0 )godray( nr, parallel = FALSE, angle = pi/6, center = c(0, 0), gain = 0.5, lacunarity = 2.5, alpha = 1, octaves = 5, time = 0 )
nr |
A |
parallel |
A logical scalar; whether to use parallel lighting. |
angle |
A numeric scalar; the angle of the light.
If |
center |
A numeric vector of length 2;
the offset coordinates to roughly change the position of the light.
If |
gain |
A numeric scalar; the gain of the effect. |
lacunarity |
A numeric scalar; the lacunarity of the effect. |
alpha |
A numeric scalar; the alpha of the effect. |
octaves |
A numeric scalar; the octaves of turbulence. |
time |
A numeric scalar; ellapsed time. |
A nativeRaster object.
Multiply turbulence to the image
gritty_shade( nr, lacunarity = 2, gain = 1.2, intensity = 0.4, octaves = 5, time = 0 )gritty_shade( nr, lacunarity = 2, gain = 1.2, intensity = 0.4, octaves = 5, time = 0 )
nr |
A |
lacunarity |
A numeric scalar; the lacunarity of the effect. |
gain |
A numeric scalar; the gain of the effect. |
intensity |
A numeric scalar; the intensity of the effect. |
octaves |
A numeric scalar; the octaves of turbulence. |
time |
A numeric scalar; ellapsed time. |
A nativeRaster object.
Retro look effect
retro_filter(nr, asp = rev(dim(nr)/100), distort = TRUE, time = 0)retro_filter(nr, asp = rev(dim(nr)/100), distort = TRUE, time = 0)
nr |
A |
asp |
A numeric vector of length 2; factor to scale the offset of vignette effect. |
distort |
A logical scalar; whether to apply barrel distortion. |
time |
A numeric scalar; ellapsed time. |
A nativeRaster object.
Chromatic aberration effect
rgb_split(nr, r = c(0.01, 0), g = c(0, 0.01), b = c(0, 0))rgb_split(nr, r = c(0.01, 0), g = c(0, 0.01), b = c(0, 0))
nr |
A |
r, g, b
|
A numeric vector of length 6; X and Y offsets for the red, green and blue channels (in uv coordinates). |
A nativeRaster object.
Adds a ripple effect to the image by sampling it at
uv + sin(length(uv - center) * freq) * amp.
ripple(nr, center = rev(dim(nr))/2, freq = 50, amp = 0.01)ripple(nr, center = rev(dim(nr))/2, freq = 50, amp = 0.01)
nr |
A |
center |
A numeric vector of length 2. The distortion of the effect increases the farther they are from this point. |
freq |
A numeric scalar; the frequency of the effect. |
amp |
A numeric scalar; the amplitude of the effect. |
A nativeRaster object.
Shockwave effect
shockwave( nr, center = rev(dim(nr))/2, speed = log(min(dim(nr))), amp = 50, wave_length = 160, brigthness = 1, radius = -1, time = 1 )shockwave( nr, center = rev(dim(nr))/2, speed = log(min(dim(nr))), amp = 50, wave_length = 160, brigthness = 1, radius = -1, time = 1 )
nr |
A |
center |
A numeric vector of length 2; the center coordinates where the shockwave starts. |
speed |
A numeric scalar;
the speed about the shockwave ripples out (in pixels per |
amp |
A numeric scalar; the amplitude of the shockwave. |
wave_length |
A numeric scalar; the wave length of the shockwave. |
brigthness |
A numeric scalar; the brigthness of the shockwave. |
radius |
A numeric scalar;
The maximum radius of the shockwave. Set to |
time |
A numeric scalar; ellapsed time. |
A nativeRaster object.
Twist effect
twist(nr, offset = rev(dim(nr))/2, angle = pi, radius = 100, padding = 0)twist(nr, offset = rev(dim(nr))/2, angle = pi, radius = 100, padding = 0)
nr |
A |
offset |
A numeric vector of length 2; the offset coordinates to change the position of the center of the effect. |
angle |
A numeric scalar; the angle of the twist. |
radius |
A numeric scalar; the radius of the twist. |
padding |
A numeric scalar; padding for the filter area. |
A nativeRaster object.