-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtests_image_processing.cpp
90 lines (63 loc) · 2.61 KB
/
tests_image_processing.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#include "tests.h"
#include <math.h>
#include <iomanip>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <wchar.h>
#include <math.h>
#include <sstream>
#include <fstream>
#include "HR_HDRImage.h"
#include "HR_HDRImageTool.h"
///////////////////////////////////////////////////////////////////////////////////
namespace HydraRender
{
void MyCustomFilter(pugi::xml_node a_settings, const HDRImage4f& a_inImage,
HDRImage4f* a_outImage)
{
}
void MyToneMapping(pugi::xml_node a_settings, const HDRImage4f& a_inImage,
std::vector<int>* a_outImage)
{
}
void BloomExtractBrightPixels(pugi::xml_node a_settings, const HDRImage4f& a_inImage,
HDRImage4f* a_outImage)
{
}
void BloomFinalPass(pugi::xml_node a_settings, const HDRImage4f& a_inImage, const HDRImage4f& a_inBrightPixels,
HDRImage4f* a_outImage)
{
}
};
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
using HydraRender::HDRImage4f;
void image_p_sandbox()
{
std::cout << "image_p main" << std::endl;
pugi::xml_document settingsDoc;
auto settings1 = settingsDoc.append_child(L"settings");
settings1.force_attribute(L"radius").set_value(1);
settings1.force_attribute(L"color_shift").set_value(L"0.1 0.0 0.05");
// example of filter chain with pin-pong
//
HDRImage4f img1, img2;
MyCustomFilter(settings1, img1, &img2); // 1 ==> 2
MyCustomFilter(settings1, img2, &img1); // 1 <== 2
MyCustomFilter(settings1, img1, &img2); // 1 ==> 2
std::vector<int> resulLDR;
MyToneMapping(settings1, img2,
&resulLDR); // got final result to ldr buffer
// more complex example, bloom
//
HDRImage4f brightPixels;
BloomExtractBrightPixels(settings1, img1,
&brightPixels);
BloomFinalPass(settings1, img1, brightPixels,
&img2);
MyToneMapping(settings1, img2,
&resulLDR); // got final result to ldr buffer
}