Skip to content

Commit 5545e1c

Browse files
authored
Merge pull request #1 from cadik/master
Sync upstream
2 parents 6d9445a + 74d3f26 commit 5545e1c

33 files changed

+657
-51
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ add_subdirectory(TMOSon14/) #Sedlar Pavel, Tomas Hudziec
3939
add_subdirectory(TMOCLAHE/) #Sedlar Pavel
4040
#add_subdirectory(TMOKuhn08/) #Pavel Melcer
4141
add_subdirectory(TMOEisemann04/) #Roman Jaska
42+
add_subdirectory(TMOTai08/) #Michal Vlnas
4243

4344
INSTALL(FILES tmolib/libtmo.so DESTINATION lib)
4445
INSTALL(FILES TMOgui/tmogui PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE DESTINATION . )

TMOTai08/CMakeLists.txt

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
CMAKE_MINIMUM_REQUIRED(VERSION 2.4.8)
2+
SET(CMAKE_COLOR_MAKEFILE ON)
3+
SET(CMAKE_VERBOSE_MAKEFILE ON)
4+
SET(CMAKE_INCLUDE_CURRENT_DIR TRUE)
5+
6+
IF(UNIX AND NOT LINUX_SET)
7+
ADD_DEFINITIONS(-D LINUX)
8+
ENDIF(UNIX AND NOT LINUX_SET)
9+
10+
INCLUDE_DIRECTORIES(
11+
../tmolib/
12+
.
13+
)
14+
15+
LINK_LIBRARIES (
16+
tmo
17+
)
18+
19+
SET(TMO_SOURCES
20+
TMOTai08.cpp
21+
TMOPlugin.cpp
22+
)
23+
24+
25+
SET(TMOWARD_HEADERS
26+
TMOTai08.h
27+
TMOPlugin.h
28+
)
29+
30+
31+
add_library( tai08 SHARED ${TMO_SOURCES} )
32+
add_custom_command( TARGET tai08 POST_BUILD
33+
COMMAND cp -f libtai08.so ../TMOCmd/tai08.tml
34+
COMMAND cp -f libtai08.so ../TMOgui/tai08.tml
35+
COMMAND cp -f libtai08.so ../tai08.tml
36+
# COMMAND rm -f libtai08.so
37+
)
38+
39+

TMOTai08/TMOPlugin.cpp

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
/* -------------------------------------------------------------------- *
2+
* TMOPlugin.cpp : Template for tone mapping operator plugin *
3+
* in Tone Mapping Studio 2004 *
4+
* -------------------------------------------------------------------- *
5+
* *
6+
* Put this file into a DLL project with your plugin functions and *
7+
* replace commented sections below. *
8+
* *
9+
* Add this preprocesor definition to the project setings : *
10+
* *
11+
* TMOPLUGIN_EXPORTS *
12+
* *
13+
* -------------------------------------------------------------------- */
14+
#include "./TMOPlugin.h"
15+
16+
/* -------------------------------------------------------------------- *
17+
* Insert your operator header below *
18+
* -------------------------------------------------------------------- */
19+
#include "./TMOTai08.h"
20+
21+
22+
/* -------------------------------------------------------------------- *
23+
* Insert a number of implemented operators *
24+
* -------------------------------------------------------------------- */
25+
int iOperatorCount = 1;
26+
27+
/* -------------------------------------------------------------------- *
28+
* DLL Entry point; no changes necessary *
29+
* -------------------------------------------------------------------- */
30+
/*
31+
BOOL APIENTRY DllMain( HANDLE hModule,
32+
DWORD ul_reason_for_call,
33+
LPVOID lpReserved
34+
)
35+
{
36+
switch (ul_reason_for_call)
37+
{
38+
case DLL_PROCESS_ATTACH:
39+
case DLL_THREAD_ATTACH:
40+
case DLL_THREAD_DETACH:
41+
case DLL_PROCESS_DETACH:
42+
break;
43+
}
44+
return TRUE;
45+
}
46+
*/
47+
/* -------------------------------------------------------------------- *
48+
* Returns a number of implemented operators; no changes necessary *
49+
* -------------------------------------------------------------------- */
50+
int TMOPLUGIN_API OperatorCount()
51+
{
52+
return iOperatorCount;
53+
}
54+
55+
/* -------------------------------------------------------------------- *
56+
* For each implemented operator create a new object in field operators,*
57+
* then return number of created operators *
58+
* For exemple : *
59+
* *
60+
* operators[0] = new TMOOperator1; *
61+
* operators[1] = new TMOOperator2; *
62+
* . *
63+
* . *
64+
* . *
65+
* -------------------------------------------------------------------- */
66+
int TMOPLUGIN_API EnumOperators(TMO** operators)
67+
{
68+
operators[0] = new TMOTai08;
69+
return iOperatorCount;
70+
}
71+
72+
/* -------------------------------------------------------------------- *
73+
* Deletes operators; no changes necessary *
74+
* -------------------------------------------------------------------- */
75+
int TMOPLUGIN_API DeleteOperators(TMO** operators)
76+
{
77+
int i;
78+
for (i = 0; i < iOperatorCount; i++)
79+
delete operators[i];
80+
return iOperatorCount;
81+
}

TMOTai08/TMOPlugin.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#include "TMO.h"
2+
/*
3+
#ifdef TMOPLUGIN_EXPORTS
4+
#define TMOPLUGIN_API __declspec(dllexport)
5+
#else
6+
#define TMOPLUGIN_API __declspec(dllimport)
7+
#endif
8+
#pragma warning (disable: 4251)
9+
*/
10+
11+
#define TMOPLUGIN_API
12+
13+
extern "C" TMOPLUGIN_API int EnumOperators(TMO** operators);
14+
extern "C" TMOPLUGIN_API int DeleteOperators(TMO** operators);
15+
extern "C" TMOPLUGIN_API int OperatorCount();
16+

0 commit comments

Comments
 (0)