Vuo  1.2.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Functions
VuoImageBlur.c File Reference

Description

VuoImageBlur implementation.

Classes

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

Functions

void VuoImageBlur_free (void *blur)
 Frees image blender state data.
 
static double VuoImageBlur_gauss (double x, double width)
 Returns the value of the discretized, normalized gaussian function of width at x.
 
static VuoImage VuoImageBlur_calculateWeights (VuoBlurShape shape, double radius)
 Returns an image containing a set of (unnormalized) weights for the specified radius, depending on shape:
 
VuoImageBlur VuoImageBlur_make (void)
 Creates state data for the image blurrer.
 
VuoImage VuoImageBlur_blur (VuoImageBlur blur, VuoImage image, VuoImage mask, VuoBlurShape shape, VuoReal radius, VuoReal quality, VuoBoolean expandBounds)
 Returns a blurred copy of image.
 
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.
 
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.
 

Class Documentation

struct VuoImageBlur_internal
Class Members
VuoGlContext context
VuoShader discShader
VuoImageRenderer imageRenderer
VuoShader shader

Function Documentation

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.)

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.

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.)

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.)

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.

void VuoImageBlur_free ( void *  blur)

Frees image blender state data.

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.

VuoImageBlur VuoImageBlur_make ( void  )

Creates state data for the image blurrer.