DD::Image::Blur Class Reference

Inherits DD::Image::Iop.

List of all members.

Public Types

enum  { BOX, TRIANGLE, QUADRATIC, GAUSSIAN }

Public Member Functions

 Blur (Node *node)
void _validate (bool)
void _request (int x, int y, int r, int t, ChannelMask, int count)
void engine (int y, int x, int r, ChannelMask, Row &)
void _close ()
double size () const
void size (double v)
void size (double v, double w)
double size_x () const
void size_x (double v)
double size_y () const
void size_y (double v)
int type () const
void type (int t)
virtual void knobs (Knob_Callback)
const char * Class () const
const char * node_help () const

Static Public Member Functions

static void make_filter (int type, float *array, int size, double diameter, double gamma=1.0)
static int filter_size (int type, double diameter)

Static Public Attributes

static const char *const filter_names []
static const Description d

Protected Attributes

double size_x_
double size_y_
int quality_
int type_
double falloff

Detailed Description

The "fast blur". Does a 2-pass convolution with a gaussian filter. If the amount of blur is large enough it uses DownRezIop and UpRezIop to scale it down so a smaller filter can be used.

Odd integer sizes when the filter is set to BOX make a box filter of exactly that size. Non-integer values cause the outer edge of the next larger box to gradually fade in. The filters used when the type is not BOX are larger and chosen to result in approximately the same amount of blurring as when box is used.


Member Function Documentation

void Blur::make_filter ( int  type,
float *  array,
int  size,
double  diameter,
double  gamma = 1.0 
) [static]

Fill in an array with the coefficients of a filter of the given type (one of BOX, TRIANGLE, QUADRATIC, or GAUSSIAN, possibly others will be added in the future). The size is how big the array is, if this is smaller than what filter_size() returned the filter has the ends truncated and is renormalized so the portion adds to one. If it is bigger the rest if filled with zero. size must be an odd number. diameter controls the filter width, for box filters integers indicate a box of exactly that size, all other numbers and filter types set the coefficients to resemble and smoothly interpolate those box filters.

int Blur::filter_size ( int  type,
double  diameter 
) [static]

Return the recommended size of an array to pass to make_filter(). The returned value is always odd, so that the filter has a center value.

References DD::Image::IopInfoOwner::r().


Member Data Documentation

const char *const Blur::filter_names [static]

This array may be passed to Enumeration_knob if you want to make a control where the user selects one of the filter types that the Blur can generate with filter_size() and make_filter().