kernel: tweak gaussian deviation
So that the shadow doesn't look cut off or fuzzy. Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
12
src/kernel.h
12
src/kernel.h
@ -18,8 +18,16 @@ typedef struct conv {
|
||||
double attr_pure sum_kernel(const conv *map, int x, int y, int width, int height);
|
||||
double attr_pure sum_kernel_normalized(const conv *map, int x, int y, int width, int height);
|
||||
|
||||
/// Create a kernel with gaussian distribution of radius r
|
||||
conv *gaussian_kernel(double r);
|
||||
/// Create a kernel with gaussian distribution with standard deviation `r`, and size
|
||||
/// `size`.
|
||||
conv *gaussian_kernel(double r, int size);
|
||||
|
||||
/// Create a gaussian kernel with auto detected standard deviation. The choosen standard
|
||||
/// deviation tries to make sure the outer most pixels of the shadow are completely
|
||||
/// transparent.
|
||||
///
|
||||
/// @param[in] shadow_radius the radius of the shadow
|
||||
conv *gaussian_kernel_autodetect_deviation(int shadow_radius);
|
||||
|
||||
/// preprocess kernels to make shadow generation faster
|
||||
/// shadow_sum[x*d+y] is the sum of the kernel from (0, 0) to (x, y), inclusive
|
||||
|
Reference in New Issue
Block a user