Vuo  2.3.2
Classes | Functions
VuoImageBlur.c File Reference

Description

VuoImageBlur implementation.

Definition in file VuoImageBlur.c.

Go to the source code of this file.

Classes

struct  VuoImageBlur_internal
 State data for the image blurrer. More...
 

Functions

void VuoImageBlur_free (void *blur)
 Frees image blender state data. More...
 
static double VuoImageBlur_gauss (double x, double width)
 Returns the value of the discretized, normalized gaussian function of width at x. More...
 
static VuoImage VuoImageBlur_calculateWeights (VuoBlurShape shape, double radius)
 Returns an image containing a set of (unnormalized) weights for the specified radius, depending on shape: More...
 
VuoImageBlur VuoImageBlur_make (void)
 Creates state data for the image blurrer. More...
 
VuoImage VuoImageBlur_blur (VuoImageBlur blur, VuoImage image, VuoImage mask, VuoBlurShape shape, VuoReal radius, VuoReal quality, VuoBoolean expandBounds)
 Returns a blurred copy of image. More...
 
VuoImage VuoImageBlur_blurDirectionally (VuoImageBlur blur, VuoImage image, VuoImage mask, VuoBlurShape shape, VuoReal radius, VuoReal quality, VuoReal angle, VuoBoolean symmetric, VuoBoolean expandBounds)
 Returns a linearly-blurred copy of image. More...
 
VuoImage VuoImageBlur_blurRadially (VuoImageBlur blur, VuoImage image, VuoImage mask, VuoBlurShape shape, VuoPoint2d center, VuoReal radius, VuoReal quality, VuoDispersion dispersion, VuoCurveEasing symmetry, VuoBoolean expandBounds)
 Returns a radially-blurred copy of image. More...
 

Class Documentation

◆ VuoImageBlur_internal

struct VuoImageBlur_internal
Class Members
VuoShader discShader
VuoShader shader

Function Documentation

◆ VuoImageBlur_blur()

VuoImage VuoImageBlur_blur ( VuoImageBlur  blur,
VuoImage  image,
VuoImage  mask,
VuoBlurShape  shape,
VuoReal  radius,
VuoReal  quality,
VuoBoolean  expandBounds 
)

Returns a blurred copy of image.

(Or, if radius is zero, returns image.)

radius is in points, and respects the image's scaleFactor (this function multiplies the two values).

If expandBounds is true, the output image will be expanded to encompass the full bleed of the blur. Otherwise, the output image will have the same dimensions as the soure image.

Definition at line 388 of file VuoImageBlur.c.

◆ VuoImageBlur_blurDirectionally()

VuoImage VuoImageBlur_blurDirectionally ( VuoImageBlur  blur,
VuoImage  image,
VuoImage  mask,
VuoBlurShape  shape,
VuoReal  radius,
VuoReal  quality,
VuoReal  angle,
VuoBoolean  symmetric,
VuoBoolean  expandBounds 
)

Returns a linearly-blurred copy of image.

(Or, if radius is zero, returns image.)

radius is in points, and respects the image's scaleFactor (this function multiplies the two values).

Definition at line 481 of file VuoImageBlur.c.

◆ VuoImageBlur_blurRadially()

VuoImage VuoImageBlur_blurRadially ( VuoImageBlur  blur,
VuoImage  image,
VuoImage  mask,
VuoBlurShape  shape,
VuoPoint2d  center,
VuoReal  radius,
VuoReal  quality,
VuoDispersion  dispersion,
VuoCurveEasing  symmetry,
VuoBoolean  expandBounds 
)

Returns a radially-blurred copy of image.

(Or, if radius is zero, returns image.)

radius is in points, and respects the image's scaleFactor (this function multiplies the two values).

Definition at line 534 of file VuoImageBlur.c.

◆ VuoImageBlur_calculateWeights()

static VuoImage VuoImageBlur_calculateWeights ( VuoBlurShape  shape,
double  radius 
)
static

Returns an image containing a set of (unnormalized) weights for the specified radius, depending on shape:

  • discretized Gaussian weights
  • triangle weights (linear ramp from highest at center to lowest on edges)
  • box weights (all values equal except the last (left/right edge) which is fractional)

Since the weights are symmetric, only the right half (including zero) is provided.

Definition at line 68 of file VuoImageBlur.c.

◆ VuoImageBlur_free()

void VuoImageBlur_free ( void *  blur)

Frees image blender state data.

Definition at line 40 of file VuoImageBlur.c.

◆ VuoImageBlur_gauss()

static double VuoImageBlur_gauss ( double  x,
double  width 
)
static

Returns the value of the discretized, normalized gaussian function of width at x.

erf(x) is the integral of the gaussian function from -inf to x. So, find the integral of the gaussian function from x-delta to x+delta by taking the difference between erf() at those positions.

Definition at line 54 of file VuoImageBlur.c.

◆ VuoImageBlur_make()

VuoImageBlur VuoImageBlur_make ( void  )

Creates state data for the image blurrer.

Definition at line 142 of file VuoImageBlur.c.