-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathmain.cpp
48 lines (40 loc) · 1.06 KB
/
main.cpp
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
36
37
38
39
40
41
42
43
44
45
46
47
48
// Copyright (C) 2014 University of Kaiserslautern
// Microelectronic System Design Research Group
//
// This file is part of the FPGAHS Course
// de.uni-kl.eit.course.fpgahs
//
// Matthias Jung <[email protected]>
// Christian De Schryver <[email protected]>
#include <iostream>
#include "profiler.h"
#include "median.h"
#include "EasyBMP/EasyBMP.h"
// define IMAGE, WIDTH, HEIGHT
#include "image.h"
using namespace std;
int main(void)
{
unsigned char OUT[WIDTH][HEIGHT];
// Do a profiling of this block:
{
Profiler p;
medianFilter(IMAGE, OUT, WIDTH, HEIGHT);
}
// Save Image:
BMP image;
image.SetSize(WIDTH,HEIGHT);
int x;
for(x = 0; x < WIDTH; x++)
{
int y;
for(y = 0; y < HEIGHT; y++)
{
image(x,y)->Red = OUT[x][y];
image(x,y)->Green = OUT[x][y];
image(x,y)->Blue = OUT[x][y];
image(x,y)->Alpha = 0;
}
}
image.WriteToFile("Output.bmp");
}