Subversion Repositories filter_foundry

Rev

Rev 385 | Rev 394 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. /*
  2.     This file is part of "Filter Foundry", a filter plugin for Adobe Photoshop
  3.     Copyright (C) 2003-2009 Toby Thain, toby@telegraphics.com.au
  4.     Copyright (C) 2018-2021 Daniel Marschall, ViaThinkSoft
  5.  
  6.     This program is free software; you can redistribute it and/or modify
  7.     it under the terms of the GNU General Public License as published by
  8.     the Free Software Foundation; either version 2 of the License, or
  9.     (at your option) any later version.
  10.  
  11.     This program is distributed in the hope that it will be useful,
  12.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.     GNU General Public License for more details.
  15.  
  16.     You should have received a copy of the GNU General Public License
  17.     along with this program; if not, write to the Free Software
  18.     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  19. */
  20.  
  21. // Reverse-Engineering of Filter Factory for Photoshop by Alex Hunter (7/1999)
  22. // Reverse-Engineering of Filter/Transition Factory for Premiere by Daniel Marschall (1/2019)
  23.  
  24. #define PARM_SIZE/*_PHOTOSHOP*/  0x2068 // Photoshop FF and Filter Foundry since 1.7
  25. #define PARM_SIZE_PREMIERE       0x206C // Premiere FF/TF
  26. #define PARM_SIG_MAC             0x1C68 // Mac OS Filter Factory and Filter Foundy <1.7 use 0x1C68 instead of 0x2068 as first member
  27.  
  28. #ifdef MAC_ENV
  29.         #define PARM_TYPE 'PARM'
  30.         #define PARM_ID_OLD 16000
  31.         #define PARM_ID_NEW 16 // Filter Factory compatibility
  32. #else
  33.         #define PARM_TYPE "PARM"
  34.         #define PARM_ID_OLD MAKEINTRESOURCE(16000)
  35.         #define PARM_ID_NEW MAKEINTRESOURCE(16) // Filter Factory compatibility
  36. #endif
  37.  
  38. #ifdef MAC_ENV
  39.         #define OBFUSCDATA_TYPE_OLD 'DATA'
  40.         #define OBFUSCDATA_TYPE_NEW 'obFS'
  41.         #define OBFUSCDATA_ID_OLD 16001
  42.         #define OBFUSCDATA_ID_NEW 16
  43. #else
  44.         #define OBFUSCDATA_TYPE_OLD RT_RCDATA
  45.         #define OBFUSCDATA_TYPE_NEW "OBFS"
  46.         #define OBFUSCDATA_ID_OLD MAKEINTRESOURCE(16001)
  47.         #define OBFUSCDATA_ID_NEW MAKEINTRESOURCE(16)
  48. #endif
  49.  
  50. #ifdef Rez
  51.  
  52. type PARM_TYPE {
  53.         longint = PARM_SIZE; // cbSize;    //size of this structure
  54.         longint FilterFactory,standaloneFilter; // standalone;  //0=original FF, 1=standalone filter
  55.         array[8] { longint; }; // val[8];    //initial values of controls
  56.         longint noParameters,parametersDialog; // popDialog; //true if need to pop a parameter dialog
  57.         longint; // unknown1;
  58.         longint; // unknown2;
  59.         longint; // unknown3;
  60.         array[4] { longint; }; // map_used[4];   //true if map(n) is used
  61.         array[8] { longint; }; // ctl_used[8];   //true if ctl(n) is used
  62.         pstring[251];    //Category name
  63.         // Michael Johannhanwahr's protect flag...
  64.         longint notProtected,isProtected; // iProtected;            // == 1 means protected
  65.         pstring[255];   //Filter title
  66.         pstring[255];   //Copyright info
  67.         pstring[255];   //Filter author(s)
  68.         array[4] { pstring[255]; };  //4 map labels
  69.         array[8] { pstring[255]; };  //8 control labels
  70.         array[4] { cstring[1024]; }; //4 channel formulas
  71. };
  72.  
  73. #else
  74.  
  75. // Note: In Windows DLL/8BF files, the strings are C-strings, while in MAC-plugins they are Pascal-strings!
  76. // Formulas are never Pascal strings.
  77. // Since 1.7.0.13, we internally, we work with C-strings.
  78.  
  79. typedef uint32_t bool32_t;
  80.  
  81. // Photoshop's Filter Factory has PARM:16
  82. // Filter Foundry has PARM:16000 (old) or PARM:16 (new)
  83. typedef struct {   //structure of FF PARM resource
  84.         uint32_t cbSize;     //size of this structure = 0x2068 (or 0x1C68 for Filter Foundry <1.7)
  85.         bool32_t standalone; //0=original FF, 1=standalone filter
  86.         uint32_t val[8];     //initial values of controls
  87.         bool32_t popDialog;  //1 if need to pop a parameter dialog
  88.         uint32_t unknown1; // This field is used for the obfuscation (checksum for obfusc v6+)
  89.         uint32_t unknown2; // This field is used for the obfuscation (obfusc version info for obfusc v2+)
  90.         uint32_t unknown3; // This field is reserved for future use
  91.         bool32_t map_used[4];   //true if map(n) is used
  92.         bool32_t ctl_used[8];   //true if ctl(n) is used
  93.         char szCategory[252];    //Category name
  94.         // Michael Johannhanwahr's protect flag...
  95.         bool32_t iProtected;            // == 1 means protected
  96.         char szTitle[256];       //Filter title
  97.         char szCopyright[256];   //Copyright info
  98.         char szAuthor[256];      //Filter author(s)
  99.         char szMap[4][256];      //4 map labels
  100.         char szCtl[8][256];      //8 control labels
  101.         char szFormula[4][1024]; //4 channel formulas; in Photoshop: (r,g,b,a)
  102. } PARM_T/*_PHOTOSHOP*/;
  103.  
  104. // Premiere's Transition/Filter Factory has PARM:16000
  105. typedef struct {   //structure of Premiere FF/TF PARM resource
  106.         uint32_t cbSize;    //size of this structure = 0x206C
  107.         bool32_t standalone;  //0=original FF, 1=standalone filter
  108.         bool32_t singleExpression; //1 if "single expression" is checked (member only available in Premiere)
  109.         uint32_t val[8];    //initial values of controls
  110.         bool32_t popDialog; //1 if need to pop a parameter dialog
  111.         uint32_t unknown1;
  112.         uint32_t unknown2;
  113.         uint32_t unknown3;
  114.         bool32_t map_used[4];   //true if map(n) is used
  115.         bool32_t ctl_used[8];   //true if ctl(n) is used
  116.         char szTitle[256]; // in Photoshop Filter Factory: Category
  117.         char szAuthor[256]; // in Photoshop Filter Factory: Title
  118.         char szModulename[256]; // in Photoshop Filter Factory: Copyright
  119.         char szCopyright[256]; // in Photoshop Filter Factory: Author
  120.         char szMap[4][256];      //4 map labels
  121.         char szCtl[8][256];      //8 control labels
  122.         char szFormula[4][1024]; //4 channel formulas; in Premiere: (b,g,r,a) or (-,-,-,r=g=b=a) in single-expression-mode
  123. } PARM_T_PREMIERE;
  124.  
  125. #endif
  126.