_________ __                 __
        /   _____//  |_____________ _/  |______     ____  __ __  ______
        \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
        /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ \
       /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
               \/                  \/          \//_____/            \/
    ______________________                           ______________________
                          T H E   W A R   B E G I N S
                   Stratagus - A free fantasy real time strategy game engine

List of all members
CBlurer Class Reference

Class for box blur algorithm. Used to blur 4x4 upscaled FOW texture. More...

#include <fow_utils.h>

fow_utils.cpp - The utilities for fog of war .

void Init (const uint16_t textureWidth, const uint16_t textureHeight, const float radius, const int numOfIterations)
 
void PrecalcParameters (const float radius, const int numOfIterations)
 
void Clean ()
 
void Blur (uint8_t *const texture)
 

Detailed Description

Class for box blur algorithm. Used to blur 4x4 upscaled FOW texture.

Member Function Documentation

◆ Blur()

void CBlurer::Blur ( uint8_t *const  texture)

Blur a texture (optimized for 1 chanel (alpha) textures)

Parameters
texturetexture to blur (uint8_t)

◆ Clean()

void CBlurer::Clean ( )

Clean blurer

◆ Init()

void CBlurer::Init ( const uint16_t  textureWidth,
const uint16_t  textureHeight,
const float  radius,
const int  numOfIterations 
)

Init box blurer

Parameters
textureWidthwidth of the working texture (input/output texture also)
textureHeightheight of the working texture (input/output texture also)
radiusRadius or standard deviation
numOfIterationsc

◆ PrecalcParameters()

void CBlurer::PrecalcParameters ( const float  radius,
const int  numOfIterations 
)

Init box blurer parameters (determine radiuses (box sizes) for box blur iterations) This used to set new parameters for blur algorithm

Parameters
radiusRadius or standard deviation
numOfIterationsNumber of boxes

The documentation for this class was generated from the following files:
(C) Copyright 1998-2012 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.