Rocket::Core::ConvolutionFilter Class Reference

#include <ConvolutionFilter.h>


Public Types

enum  FilterOperation { MEDIAN, DILATION, EROSION }

Public Member Functions

bool Initialise (int kernel_size, FilterOperation operation=MEDIAN)
float * operator[] (int index)
void Run (byte *destination, const Vector2i &destination_dimensions, int destination_stride, const byte *source, const Vector2i &source_dimensions, const Vector2i &source_offset) const

Detailed Description

A programmable convolution filter, designed to aid in the generation of texture data by custom FontEffect types.

Author:
Peter Curry

Member Function Documentation

bool Rocket::Core::ConvolutionFilter::Initialise ( int  kernel_size,
FilterOperation  operation = MEDIAN 
)

Initialises the filter. A filter must be initialised and populated with values before use.

Parameters:
[in] kernel_size The size of the filter's kernel each side of the origin. So, for example, a filter initialised with a size of 1 will store 9 values.
[in] operation The operation the filter conducts to determine the result.

float * Rocket::Core::ConvolutionFilter::operator[] ( int  index  ) 

Returns a reference to one of the rows of the filter kernel.

Parameters:
[in] index The index of the desired row.
Returns:
The row of kernel values.

void Rocket::Core::ConvolutionFilter::Run ( byte *  destination,
const Vector2i destination_dimensions,
int  destination_stride,
const byte *  source,
const Vector2i source_dimensions,
const Vector2i source_offset 
) const

Runs the convolution filter. The filter will operate on each pixel in the destination surface, setting its opacity to the result the filter on the source opacity values. The colour values will remain unchanged.

Parameters:
[in] destination The RGBA-encoded destination buffer.
[in] destination_dimensions The size of the destination region (in pixels).
[in] destination_stride The stride (in bytes) of the destination region.
[in] source The opacity information for the source buffer.
[in] source_dimensions The size of the source region (in pixels). The stride is assumed to be equivalent to the horizontal width.
[in] source_offset The offset of the source region from the destination region. This is usually the same as the kernel size.


The documentation for this class was generated from the following files: