1
0

ape.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /*
  2. LICENSE
  3. -------
  4. Copyright 2005 Nullsoft, Inc.
  5. All rights reserved.
  6. Redistribution and use in source and binary forms, with or without modification,
  7. are permitted provided that the following conditions are met:
  8. * Redistributions of source code must retain the above copyright notice,
  9. this list of conditions and the following disclaimer.
  10. * Redistributions in binary form must reproduce the above copyright notice,
  11. this list of conditions and the following disclaimer in the documentation
  12. and/or other materials provided with the distribution.
  13. * Neither the name of Nullsoft nor the names of its contributors may be used to
  14. endorse or promote products derived from this software without specific prior written permission.
  15. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
  16. IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  17. FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  18. CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  19. DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  20. DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
  21. IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  22. OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  23. */
  24. #ifndef _APE_H_
  25. #define _APE_H_
  26. //extended APE stuff
  27. // to use this, you should have:
  28. // APEinfo *g_extinfo;
  29. // void __declspec(dllexport) AVS_APE_SetExtInfo(HINSTANCE hDllInstance, APEinfo *ptr)
  30. // {
  31. // g_extinfo = ptr;
  32. // }
  33. typedef void *VM_CONTEXT;
  34. typedef void *VM_CODEHANDLE;
  35. typedef struct
  36. {
  37. int ver; // ver=1 to start
  38. double *global_registers; // 100 of these
  39. // lineblendmode: 0xbbccdd
  40. // bb is line width (minimum 1)
  41. // dd is blend mode:
  42. // 0=replace
  43. // 1=add
  44. // 2=max
  45. // 3=avg
  46. // 4=subtractive (1-2)
  47. // 5=subtractive (2-1)
  48. // 6=multiplicative
  49. // 7=adjustable (cc=blend ratio)
  50. // 8=xor
  51. // 9=minimum
  52. int *lineblendmode;
  53. //evallib interface
  54. VM_CONTEXT (*allocVM)(); // return a handle
  55. void (*freeVM)(VM_CONTEXT); // free when done with a VM and ALL of its code have been freed, as well
  56. // you should only use these when no code handles are around (i.e. it's okay to use these before
  57. // compiling code, or right before you are going to recompile your code.
  58. void (*resetVM)(VM_CONTEXT);
  59. double * (*regVMvariable)(VM_CONTEXT, const char *name);
  60. // compile code to a handle
  61. VM_CODEHANDLE (*compileVMcode)(VM_CONTEXT, char *code);
  62. // execute code from a handle
  63. void (*executeCode)(VM_CODEHANDLE, char visdata[2][2][576]);
  64. // free a code block
  65. void (*freeCode)(VM_CODEHANDLE);
  66. // requires ver >= 2
  67. void (*doscripthelp)(HWND hwndDlg,char *mytext); // mytext can be NULL for no custom page
  68. /// requires ver >= 3
  69. void *(*getNbuffer)(int w, int h, int n, int do_alloc); // do_alloc should be 0 if you dont want it to allocate if empty
  70. // w and h should be the current width and height
  71. // n should be 0-7
  72. } APEinfo;
  73. #endif//_APE_H_