-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGaussianBlur.h
35 lines (26 loc) · 1.41 KB
/
GaussianBlur.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#ifndef GAUSSIANBLUR_H_INCLUDED
#define GAUSSIANBLUR_H_INCLUDED
#include <math.h>
#include <stdio.h>
#include <vector>
#include <string>
struct SDL_Texture;
struct SDL_Surface;
void BlurTexture(SDL_Texture* pTexture, unsigned int r);
void BlurSurface(SDL_Surface* pSurface, unsigned int r);
void FlipSurface(SDL_Surface* pSurface, bool aFlipHorizontal);
void BlurRGBA(int aWidth, int aHeight, int aPitch, unsigned char * pPixels, unsigned int aPixelFormat, int r, bool sw=true);
/// Funktion für den Gaussian-Blur-Effekt auf einem Graukanal
/// Ein Graukanal wird als zusammenhängendes Array ohne Padding definiert
/// \param scl Source-Array mit Grauwerten
/// \param tcl Destination-Array (gleiche Größe wie scl) mit geblurten Graudaten
/// \param scl_length Länge von scl und tcl
/// \param w Bildbreite
/// \param h Bildhöhe
/// \param r Blur-Radius
void gaussBlur (unsigned char *scl, unsigned char* tcl, unsigned int scl_length, unsigned int w, unsigned int h, unsigned int r);
std::vector<unsigned int> boxesForGauss(unsigned int sigma, unsigned int n);
void boxBlur (unsigned char *scl, unsigned char *tcl, unsigned int scl_length, unsigned int w, unsigned int h, unsigned int r);
void boxBlurH (unsigned char *scl, unsigned char *tcl, unsigned int w, unsigned int h, unsigned int r);
void boxBlurT (unsigned char *scl, unsigned char *tcl, unsigned int w, unsigned int h, unsigned int r);
#endif // GAUSSIANBLUR_H_INCLUDED