|
| 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 | +} |
0 commit comments