8 #include "Convolution.h"
9 #include "ConvolutionDevice.h"
12 const float Convolution::kernel[9][9] =
13 {{0.0828, 0.1987, 0.3705, 0.5366, 0.6063, 0.5366, 0.3705, 0.1987, 0.0828},
14 {0.1987, 0.4746, 0.8646, 1.1794, 1.2765, 1.1794, 0.8646, 0.4746, 0.1987},
15 {0.3705, 0.8646, 1.3475, 1.0033, 0.4061, 1.0033, 1.3475, 0.8646, 0.3705},
16 {0.5366, 1.1794, 1.0033, -2.8306, -6.4829, -2.8306, 1.0033, 1.1794, 0.5366},
17 {0.6063, 1.2765, 0.4061, -6.4829, -12.7462, -6.4829, 0.4061, 1.2765, 0.6063},
18 {0.5366, 1.1794, 1.0033, -2.8306, -6.4829, -2.8306, 1.0033, 1.1794, 0.5366},
19 {0.3705, 0.8646, 1.3475, 1.0033, 0.4061, 1.0033, 1.3475, 0.8646, 0.3705},
20 {0.1987, 0.4746, 0.8646, 1.1794, 1.2765, 1.1794, 0.8646, 0.4746, 0.1987},
21 {0.0828, 0.1987, 0.3705, 0.5366, 0.6063, 0.5366, 0.3705, 0.1987, 0.0828}};
23 Convolution::Convolution(int w, int h) :
29 Device::assertDim(dg, db);
32 Convolution::~Convolution()
36 void Convolution::runGPU(uchar4* ptrDevPixels)
38 convolution<<<dg,db>>>(ptrDevPixels, this->w, this->h, this->t);
40 // HANDLE_ERROR(cudaDeviceSynchronize()); // Pour flusher les 'printf' (pour le DEBUG).
43 void Convolution::animationStep()
45 this->t += 0.1; // TODO.
48 int Convolution::getW()
53 int Convolution::getH()
58 float Convolution::getT()
63 string Convolution::getTitle()