├── .gitmodules ├── COPYING ├── LICENSE ├── README.md ├── ext ├── .gitignore └── README.md ├── src ├── aftereffects │ ├── NaNny.cpp │ ├── NaNny.h │ ├── NaNny_PiPL.r │ ├── OpenEXR_ChannelMap.cpp │ ├── OpenEXR_ChannelMap.h │ ├── OpenEXR_PlatformIO.cpp │ ├── OpenEXR_PlatformIO.h │ ├── ProEXR_AE.cpp │ ├── ProEXR_AE.h │ ├── ProEXR_AEIO.cpp │ ├── ProEXR_AEIO.h │ ├── ProEXR_AE_Dialogs.h │ ├── ProEXR_AE_FrameSeq.cpp │ ├── ProEXR_AE_FrameSeq.h │ ├── ProEXR_AE_FrameSeq_Color.cpp │ ├── ProEXR_AE_GUI.cpp │ ├── ProEXR_AE_GUI.h │ ├── ProEXR_AE_PiPL.r │ ├── ProEXR_Comp_Creator.cpp │ ├── ProEXR_Comp_Creator.h │ ├── ProEXRdoc_AE.cpp │ ├── ProEXRdoc_AE.h │ ├── VRimg.cpp │ ├── VRimg.h │ ├── VRimg_AEIO.cpp │ ├── VRimg_AEIO.h │ ├── VRimg_ChannelCache.cpp │ ├── VRimg_ChannelCache.h │ ├── VRimg_FrameSeq.cpp │ ├── VRimg_FrameSeq.h │ ├── exrdisplay.cpp │ ├── exrdisplay.h │ ├── exrdisplay_PiPL.r │ ├── fnord_MissingSuiteError.cpp │ ├── fnord_SuiteHandler.cpp │ ├── fnord_SuiteHandler.h │ ├── mac │ │ ├── ProEXR_AE_Dialogs_Cocoa.mm │ │ ├── ProEXR_AE_GUI.xib │ │ ├── ProEXR_AE_GUI_Controller.h │ │ ├── ProEXR_AE_GUI_Controller.m │ │ ├── ProEXR_AE_Out.xib │ │ ├── ProEXR_AE_Out_Controller.h │ │ ├── ProEXR_AE_Out_Controller.m │ │ ├── ProEXR_AE_Progress.xib │ │ ├── ProEXR_AE_Progress_Controller.h │ │ ├── ProEXR_AE_Progress_Controller.m │ │ └── ProEXR_banner.png │ └── win │ │ ├── ProEXR_AE_Dialogs.rc │ │ ├── ProEXR_AE_Dialogs_Win.cpp │ │ ├── ProEXR_banner.bmp │ │ └── resource.h ├── common │ ├── ImfHybridInputFile.cpp │ ├── ImfHybridInputFile.h │ ├── ProEXR_UTF.cpp │ ├── ProEXR_UTF.h │ ├── ProEXRdoc.cpp │ ├── ProEXRdoc.h │ ├── ProEXRdoc_PS.cpp │ ├── ProEXRdoc_PS.h │ ├── VRimg │ │ ├── VRimgHeader.cpp │ │ ├── VRimgHeader.h │ │ ├── VRimgInputFile.cpp │ │ ├── VRimgInputFile.h │ │ ├── VRimgVersion.cpp │ │ ├── VRimgVersion.h │ │ └── VRimgXdr.h │ ├── iccProfileAttribute.cpp │ └── iccProfileAttribute.h ├── nuke │ └── ProEXR_Nuke_Comp_Builder.py └── photoshop │ ├── ProEXR.cpp │ ├── ProEXR.h │ ├── ProEXR.r │ ├── ProEXR_About.h │ ├── ProEXR_Attributes.cpp │ ├── ProEXR_Attributes.h │ ├── ProEXR_Color.cpp │ ├── ProEXR_Color.h │ ├── ProEXR_Deep.cpp │ ├── ProEXR_Deep.h │ ├── ProEXR_Deep.r │ ├── ProEXR_EZ.cpp │ ├── ProEXR_EZ.h │ ├── ProEXR_EZ.r │ ├── ProEXR_EZ_Scripting.cpp │ ├── ProEXR_Export.cpp │ ├── ProEXR_Export_Scripting.cpp │ ├── ProEXR_PSIO.cpp │ ├── ProEXR_PSIO.h │ ├── ProEXR_Scripting.cpp │ ├── ProEXR_Terminology.h │ ├── ProEXR_Version.h │ ├── ProEXR_displayWindow.jsx │ ├── VRimg.cpp │ ├── VRimg.h │ ├── mac │ ├── ProEXR_About.xib │ ├── ProEXR_About_Cocoa.mm │ ├── ProEXR_About_Controller.h │ ├── ProEXR_About_Controller.m │ ├── ProEXR_Dialogs_Cocoa.mm │ ├── ProEXR_EZ_About.xib │ ├── ProEXR_EZ_About_Cocoa.mm │ ├── ProEXR_EZ_About_Controller.h │ ├── ProEXR_EZ_About_Controller.m │ ├── ProEXR_EZ_Dialogs_Cocoa.mm │ ├── ProEXR_EZ_In.xib │ ├── ProEXR_EZ_In_Controller.h │ ├── ProEXR_EZ_In_Controller.m │ ├── ProEXR_EZ_In_Prefs.h │ ├── ProEXR_EZ_In_Prefs.m │ ├── ProEXR_EZ_Out.xib │ ├── ProEXR_EZ_Out_Controller.h │ ├── ProEXR_EZ_Out_Controller.m │ ├── ProEXR_In.xib │ ├── ProEXR_In_Controller.h │ ├── ProEXR_In_Controller.m │ ├── ProEXR_In_Prefs.h │ ├── ProEXR_In_Prefs.m │ ├── ProEXR_Out.xib │ ├── ProEXR_Out_Controller.h │ ├── ProEXR_Out_Controller.m │ ├── ProEXR_banner.png │ └── carbon │ │ ├── Out_Dialog.nib │ │ ├── classes.nib │ │ ├── info.nib │ │ └── objects.xib │ │ ├── ProEXR_About.r │ │ ├── ProEXR_About_Carbon.cpp │ │ ├── ProEXR_Dialogs.r │ │ ├── ProEXR_Dialogs_Carbon.cpp │ │ ├── ProEXR_EZ_Dialogs.r │ │ ├── ProEXR_EZ_Dialogs_Carbon.cpp │ │ └── ProEXR_banner.rsrc.zip │ └── win │ ├── ProEXR_About.rc │ ├── ProEXR_About_Win.cpp │ ├── ProEXR_Dialogs.rc │ ├── ProEXR_Dialogs_Win.cpp │ ├── ProEXR_EZ_Dialogs.rc │ ├── ProEXR_EZ_Dialogs_Win.cpp │ ├── ProEXR_banner.bmp │ ├── myDLLInstance.cpp │ ├── myDLLInstance.h │ ├── myDialogUtilities.cpp │ ├── myDialogUtilities.h │ └── resource.h ├── vc └── vc9 │ ├── ProEXR.vcproj │ ├── ProEXR_AE.sln │ ├── ProEXR_AE.vcproj │ ├── ProEXR_Deep.vcproj │ ├── ProEXR_EZ.vcproj │ ├── ProEXR_Photoshop.sln │ └── ext │ ├── lcms.vcproj │ ├── stdint.h │ └── zlib.vcproj └── xcode └── xcode3 ├── ProEXR_AE.plugin-Info.plist ├── ProEXR_AE.xcodeproj └── project.pbxproj ├── ProEXR_Deep_Info.plist ├── ProEXR_EZ_Info.plist ├── ProEXR_Info.plist ├── ProEXR_Photoshop.xcodeproj └── project.pbxproj └── ext ├── lcms.xcodeproj └── project.pbxproj └── zlib.xcodeproj └── project.pbxproj /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "ext/openexr"] 2 | path = ext/openexr 3 | url = https://github.com/fnordware/openexr.git 4 | branch = projects 5 | [submodule "ext/lcms"] 6 | path = ext/lcms 7 | url = https://github.com/mm2/Little-CMS.git 8 | [submodule "ext/zlib"] 9 | path = ext/zlib 10 | url = https://github.com/madler/zlib.git 11 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Code by Brendan Bolles (http://www.fnordware.com/) except: 2 | 3 | OpenEXR 4 | http://www.openexr.com/ 5 | 6 | Little CMS 7 | http://www.littlecms.com/ 8 | 9 | zlib 10 | http://www.zlib.net/ 11 | 12 | ----------------------------------------------- 13 | 14 | ProEXR - OpenEXR plug-ins for Photoshop and After Effects 15 | Copyright (c) 2007-2017 Brendan Bolles 16 | 17 | This program is free software: you can redistribute it and/or modify 18 | it under the terms of the GNU General Public License as published by 19 | the Free Software Foundation, either version 2 of the License, or 20 | (at your option) any later version. 21 | 22 | This program is distributed in the hope that it will be useful, 23 | but WITHOUT ANY WARRANTY; without even the implied warranty of 24 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 25 | GNU General Public License for more details. 26 | 27 | You should have received a copy of the GNU General Public License 28 | along with this program. If not, see . 29 | 30 | ----------------------------------------------- 31 | 32 | OpenEXR 33 | 34 | Copyright (c) 2006, Industrial Light & Magic, a division of Lucasfilm 35 | Entertainment Company Ltd. Portions contributed and copyright held by 36 | others as indicated. All rights reserved. 37 | 38 | Redistribution and use in source and binary forms, with or without 39 | modification, are permitted provided that the following conditions are 40 | met: 41 | 42 | * Redistributions of source code must retain the above 43 | copyright notice, this list of conditions and the following 44 | disclaimer. 45 | 46 | * Redistributions in binary form must reproduce the above 47 | copyright notice, this list of conditions and the following 48 | disclaimer in the documentation and/or other materials provided with 49 | the distribution. 50 | 51 | * Neither the name of Industrial Light & Magic nor the names of 52 | any other contributors to this software may be used to endorse or 53 | promote products derived from this software without specific prior 54 | written permission. 55 | 56 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 57 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 58 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 59 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 60 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 61 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 62 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 63 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 64 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 65 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 66 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 67 | 68 | ----------------------------------------------- 69 | 70 | Little CMS 71 | Copyright (c) 1998-2011 Marti Maria Saguer 72 | 73 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 74 | 75 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 76 | 77 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 78 | 79 | ----------------------------------------------- 80 | 81 | zlib 82 | 83 | Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler 84 | 85 | This software is provided 'as-is', without any express or implied 86 | warranty. In no event will the authors be held liable for any damages 87 | arising from the use of this software. 88 | 89 | Permission is granted to anyone to use this software for any purpose, 90 | including commercial applications, and to alter it and redistribute it 91 | freely, subject to the following restrictions: 92 | 93 | 1. The origin of this software must not be misrepresented; you must not 94 | claim that you wrote the original software. If you use this software 95 | in a product, an acknowledgment in the product documentation would be 96 | appreciated but is not required. 97 | 2. Altered source versions must be plainly marked as such, and must not be 98 | misrepresented as being the original software. 99 | 3. This notice may not be removed or altered from any source distribution. 100 | 101 | Jean-loup Gailly Mark Adler 102 | jloup@gzip.org madler@alumni.caltech.edu 103 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Moved 2 | ===== 3 | 4 | This repo has been [moved](http://fnordware.blogspot.com/2018/09/screw-you-microsoft.html) to [GitLab](https://gitlab.com/fnordware/ProEXR). 5 | 6 | 7 | ProEXR 8 | ====== 9 | 10 | ProEXR plug-ins for Photoshop and After Effects 11 | 12 | http://www.fnordware.com/ProEXR/ 13 | -------------------------------------------------------------------------------- /ext/.gitignore: -------------------------------------------------------------------------------- 1 | Adobe* 2 | adobe* 3 | -------------------------------------------------------------------------------- /ext/README.md: -------------------------------------------------------------------------------- 1 | ext 2 | ========= 3 | 4 | This directory holds git submodules that point to libraries needed by the ProEXR plug-ins. 5 | 6 | You will need to manually add the [After Effects CS6 SDK](http://www.adobe.com/devnet/aftereffects.html) and the [Photoshop CS6 SDK](http://www.adobe.com/devnet/photoshop/sdk.html). 7 | 8 | If the submodule contents are missing, you should be able to get them by typing: 9 | 10 | `git submodule init` 11 | `git submodule update` 12 | -------------------------------------------------------------------------------- /src/aftereffects/NaNny.h: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | // 3 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 4 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 5 | // 6 | // This file is part of ProEXR. 7 | // 8 | // ProEXR is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | // -------------------------------------------------------------------*/ 22 | 23 | // NaNny 24 | // 25 | // AE plug-in to kill NaN and inf floating point values 26 | // 27 | 28 | #ifndef NANNY_H 29 | #define NANNY_H 30 | 31 | #pragma once 32 | 33 | #include "AEConfig.h" 34 | #include "Entry.h" 35 | #include "AE_EffectUI.h" 36 | #include "AE_EffectCBSuites.h" 37 | #include "AE_AdvEffectSuites.h" 38 | #include "String_Utils.h" 39 | #include "Param_Utils.h" 40 | #include "AE_Macros.h" 41 | #include "fnord_SuiteHandler.h" 42 | 43 | 44 | #ifdef macintosh 45 | #define Macintosh 46 | #endif 47 | 48 | 49 | #ifdef MSWindows 50 | #include 51 | #endif 52 | 53 | 54 | #define NAME "NaNny" 55 | #define DESCRIPTION "Deal with evil floating point values NaN and inf." 56 | #define RELEASE_DATE __DATE__ 57 | #define COPYRIGHT "\xA9 2011-2012 fnord" 58 | #define WEBSITE "www.fnordware.com" 59 | #define MAJOR_VERSION 0 60 | #define MINOR_VERSION 6 61 | #define BUG_VERSION 0 62 | #define STAGE_VERSION PF_Stage_RELEASE 63 | #define BUILD_VERSION 0 64 | 65 | 66 | #if PF_AE_PLUG_IN_VERSION < PF_AE100_PLUG_IN_VERSION 67 | typedef A_long IteratorRefcon; 68 | #else 69 | typedef void * IteratorRefcon; 70 | #endif 71 | 72 | 73 | 74 | enum { 75 | NANNY_INPUT = 0, 76 | NANNY_MODE, 77 | NANNY_NAN_VALUE, 78 | NANNY_INF_VALUE, 79 | NANNY_NIN_VALUE, 80 | NANNY_NUM_PARAMS 81 | }; 82 | 83 | enum { 84 | MODE_ID = 1, 85 | NAN_ID, 86 | INF_ID, 87 | NIN_ID 88 | }; 89 | 90 | enum { 91 | MODE_ALL = 1, 92 | MODE_NAN, 93 | MODE_INF, 94 | MODE_NIN, 95 | MODE_DIVIDER, 96 | MODE_DIAGNOSTIC, 97 | //MODE_MAKE_NAN, 98 | MODE_NUM_OPTIONS = MODE_DIAGNOSTIC 99 | }; 100 | #define MODE_MENU_STRING "All|NaN|inf|-inf|(-|Diagnostic" 101 | 102 | 103 | #ifndef MAX 104 | #define MAX(A,B) ((A) > (B) ? (A) : (B)) 105 | #endif 106 | 107 | 108 | #ifdef __cplusplus 109 | extern "C" { 110 | #endif 111 | 112 | 113 | 114 | DllExport PF_Err PluginMain ( PF_Cmd cmd, 115 | PF_InData *in_data, 116 | PF_OutData *out_data, 117 | PF_ParamDef *params[], 118 | PF_LayerDef *output, 119 | void *extra ); 120 | 121 | 122 | #ifdef __cplusplus 123 | } 124 | #endif 125 | 126 | 127 | #endif // NANNY_H 128 | -------------------------------------------------------------------------------- /src/aftereffects/NaNny_PiPL.r: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | // 3 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 4 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 5 | // 6 | // This file is part of ProEXR. 7 | // 8 | // ProEXR is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | // -------------------------------------------------------------------*/ 22 | 23 | // NaNny 24 | // 25 | // AE plug-in to kill NaN and inf floating point values 26 | // 27 | 28 | #include "AEConfig.h" 29 | 30 | #ifdef USE_AE_EFFECT_VERS 31 | #include "AE_EffectVers.h" 32 | #else 33 | #define PF_PLUG_IN_VERSION 12 34 | #define PF_PLUG_IN_SUBVERS 12 35 | #endif 36 | 37 | #ifndef AE_OS_WIN 38 | #include "AE_General.r" 39 | #endif 40 | 41 | resource 'PiPL' (16000) { 42 | { /* array properties: 12 elements */ 43 | /* [1] */ 44 | Kind { 45 | AEEffect 46 | }, 47 | /* [2] */ 48 | Name { 49 | "NaNny" 50 | }, 51 | /* [3] */ 52 | Category { 53 | "Utility" 54 | }, 55 | 56 | #ifdef AE_OS_WIN 57 | #ifdef AE_PROC_INTELx64 58 | CodeWin64X86 {"PluginMain"}, 59 | #else 60 | CodeWin32X86 {"PluginMain"}, 61 | #endif 62 | #else 63 | #ifdef AE_PROC_INTELx64 64 | CodeMacIntel64 {"PluginMain"}, 65 | #else 66 | CodeMachOPowerPC {"PluginMain"}, 67 | CodeMacIntel32 {"PluginMain"}, 68 | #endif 69 | #endif /* [6] */ 70 | AE_PiPL_Version { 71 | 2, 72 | 0 73 | }, 74 | /* [7] */ 75 | AE_Effect_Spec_Version { 76 | PF_PLUG_IN_VERSION, 77 | PF_PLUG_IN_SUBVERS 78 | }, 79 | /* [8] */ 80 | AE_Effect_Version { 81 | 198144 /* 2.0 */ 82 | }, 83 | /* [9] */ 84 | AE_Effect_Info_Flags { 85 | 0 86 | }, 87 | /* [10] */ 88 | AE_Effect_Global_OutFlags { 89 | 33555520 90 | }, 91 | AE_Effect_Global_OutFlags_2 { 92 | 5120 93 | }, 94 | /* [11] */ 95 | AE_Effect_Match_Name { 96 | "NaNny" 97 | }, 98 | /* [12] */ 99 | AE_Reserved_Info { 100 | 0 101 | } 102 | } 103 | }; 104 | 105 | 106 | 107 | #ifdef AE_OS_MAC 108 | 109 | #include "MacTypes.r" 110 | 111 | #define NAME "NaNny" 112 | #define VERSION_STRING "0.5" 113 | resource 'vers' (1, NAME " Version", purgeable) 114 | { 115 | 5, 0x50, final, 0, verUs, 116 | VERSION_STRING, 117 | VERSION_STRING 118 | "\n\xA9 2011 fnord" 119 | }; 120 | 121 | resource 'vers' (2, NAME " Version", purgeable) 122 | { 123 | 5, 0x50, final, 0, verUs, 124 | VERSION_STRING, 125 | "by Brendan Bolles" 126 | }; 127 | 128 | #endif 129 | 130 | -------------------------------------------------------------------------------- /src/aftereffects/OpenEXR_ChannelMap.h: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | // 3 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 4 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 5 | // 6 | // This file is part of ProEXR. 7 | // 8 | // ProEXR is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | // -------------------------------------------------------------------*/ 22 | 23 | #ifndef OPENEXR_CHANNEL_MAP_H 24 | #define OPENEXR_CHANNEL_MAP_H 25 | 26 | 27 | #include 28 | #include 29 | 30 | 31 | class ChannelEntry { 32 | public: 33 | ChannelEntry() {} 34 | ChannelEntry(const char *channel_name, long type_code, long data_code); 35 | ChannelEntry(const char *channel_name, const char *type_code, const char *data_code); 36 | 37 | std::string name(void) { return chan_name; } 38 | long type(void) { return chan_type_code; } 39 | long data(void) { return chan_data_code; } 40 | 41 | int dimensions(void); 42 | std::string chan_part(int index); 43 | std::string key_name(void) { return chan_part(0); } 44 | 45 | private: 46 | std::vector bar_positions(void); 47 | 48 | std::string chan_name; 49 | long chan_type_code; 50 | long chan_data_code; 51 | }; 52 | 53 | class ChannelMap { 54 | public: 55 | ChannelMap(const char *file_path); 56 | 57 | bool exists(void) { return map.size() > 0; } 58 | 59 | bool findEntry(const char *channel_name, ChannelEntry &entry, bool search_all=false); 60 | bool findEntry(const char *channel_name, bool search_all=false); 61 | void addEntry(ChannelEntry entry) { map.push_back(entry); } 62 | 63 | private: 64 | std::vector map; 65 | }; 66 | 67 | 68 | #endif // OPENEXR_CHANNEL_MAP_H -------------------------------------------------------------------------------- /src/aftereffects/OpenEXR_PlatformIO.h: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | // 3 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 4 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 5 | // 6 | // This file is part of ProEXR. 7 | // 8 | // ProEXR is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | // -------------------------------------------------------------------*/ 22 | 23 | #ifndef OPENEXR_PLATFORM_IO_H 24 | #define OPENEXR_PLATFORM_IO_H 25 | 26 | #include 27 | 28 | #include "fnord_SuiteHandler.h" 29 | 30 | 31 | #ifdef WIN32 32 | #include 33 | typedef unsigned short uint16_t; 34 | typedef FILETIME DateTime; 35 | #endif 36 | 37 | #ifdef __APPLE__ 38 | #ifndef MAC_OS_X_VERSION_10_5 39 | #define MAC_OS_X_VERSION_10_5 1050 40 | #endif 41 | 42 | typedef UTCDateTime DateTime; 43 | 44 | #if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5 45 | typedef SInt16 FSIORefNum; 46 | #endif 47 | #endif // __APPLE__ 48 | 49 | 50 | class PathString 51 | { 52 | public: 53 | PathString(); 54 | PathString(const PathString &other); 55 | PathString(const A_char *str); 56 | PathString(const A_u_short *str); 57 | ~PathString(); 58 | 59 | PathString & operator = (const PathString &other); 60 | 61 | bool operator == (const PathString &other) const; 62 | bool operator != (const PathString &other) const { return !(*this == other); } 63 | 64 | const A_PathType *string() const { return _path; } 65 | 66 | template 67 | static int StrLen(const T *str); 68 | 69 | template 70 | static void StrCpy(T *ostr, const T *istr); 71 | 72 | private: 73 | A_PathType *_path; 74 | }; 75 | 76 | 77 | void DeleteFileCache(const SPBasicSuite *pica_basicP, int timeout=0); 78 | 79 | 80 | class IStreamPlatform : public Imf::IStream 81 | { 82 | public: 83 | 84 | IStreamPlatform(const char fileName[], const SPBasicSuite *pica_basicP=NULL); 85 | IStreamPlatform(const uint16_t fileName[], const SPBasicSuite *pica_basicP=NULL); 86 | ~IStreamPlatform(); 87 | 88 | 89 | virtual bool isMemoryMapped() const; 90 | virtual bool read(char c[/*n*/], int n); 91 | virtual char *readMemoryMapped(int n); 92 | virtual Imf::Int64 tellg(); 93 | virtual void seekg(Imf::Int64 pos); 94 | 95 | // function to load the file into a buffer and start memory mapping 96 | void memoryMap(); 97 | void unMemoryMap(); 98 | 99 | // access information relevant to caching 100 | const PathString & getPath() const { return _path; } 101 | DateTime getModTime() const { return _modtime; } 102 | 103 | private: 104 | void adopt_cache(); 105 | void release_cache(); 106 | 107 | private: 108 | void open_file(const char fileName[]); 109 | void open_file(const uint16_t fileName[]); 110 | void close_file(); 111 | bool read_file(char c[/*n*/], int n); 112 | Imf::Int64 tellg_file(); 113 | void seekg_file(Imf::Int64 pos); 114 | Imf::Int64 file_size(); 115 | DateTime file_modtime(); 116 | 117 | 118 | private: 119 | const SPBasicSuite *_pica_basicP; 120 | void *_vfile; 121 | Imf::Int64 _voffset; 122 | Imf::Int64 _vsize; 123 | 124 | PathString _path; 125 | DateTime _modtime; 126 | 127 | #ifdef __APPLE__ 128 | FSRef _fsRef; 129 | FSIORefNum _refNum; 130 | #endif 131 | 132 | #ifdef WIN32 133 | HANDLE _hFile; 134 | #endif 135 | }; 136 | 137 | 138 | class OStreamPlatform : public Imf::OStream 139 | { 140 | public: 141 | 142 | OStreamPlatform(const char fileName[]); 143 | OStreamPlatform(const uint16_t fileName[]); 144 | ~OStreamPlatform(); 145 | 146 | void write (const char c[/*n*/], int n); 147 | Imf::Int64 tellp (); 148 | void seekp (Imf::Int64 pos); 149 | 150 | private: 151 | 152 | #ifdef __APPLE__ 153 | FSRef _fsRef; 154 | FSIORefNum _refNum; 155 | #endif 156 | 157 | #ifdef WIN32 158 | HANDLE _hFile; 159 | #endif 160 | 161 | }; 162 | 163 | #endif // OPENEXR_PLATFORM_IO_H -------------------------------------------------------------------------------- /src/aftereffects/ProEXR_AE.h: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | // 3 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 4 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 5 | // 6 | // This file is part of ProEXR. 7 | // 8 | // ProEXR is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | // -------------------------------------------------------------------*/ 22 | 23 | #ifndef ProEXR_AE_H 24 | #define ProEXR_AE_H 25 | 26 | #include "ProEXR_AE_FrameSeq.h" 27 | 28 | 29 | #define PLUGIN_NAME "ProEXR Layers" 30 | 31 | 32 | 33 | #define MAX_CHANNELS 128 34 | 35 | 36 | 37 | 38 | typedef struct ProEXR_outData 39 | { 40 | A_u_char compression_type; 41 | A_Boolean float_not_half; 42 | A_Boolean layer_composite; 43 | A_Boolean hidden_layers; 44 | char reserved[60]; // total of 64 bytes 45 | } ProEXR_outData; 46 | 47 | 48 | A_Err 49 | ProEXR_Init(struct SPBasicSuite *pica_basicP); 50 | 51 | 52 | A_Err 53 | ProEXR_ConstructModuleInfo( 54 | AEIO_ModuleInfo *info); 55 | 56 | 57 | A_Err 58 | ProEXR_GetDepths( 59 | AEIO_SupportedDepthFlags *which); 60 | 61 | 62 | A_Err 63 | ProEXR_InitOutOptions( 64 | ProEXR_outData *options); 65 | 66 | A_Err 67 | ProEXR_OutputFile( 68 | AEIO_BasicData *basic_dataP, 69 | AEIO_OutSpecH outH, 70 | const A_PathType *file_pathZ, 71 | FrameSeq_Info *info, 72 | ProEXR_outData *options, 73 | PF_EffectWorld *wP); 74 | 75 | A_Err 76 | ProEXR_WriteOptionsDialog( 77 | AEIO_BasicData *basic_dataP, 78 | ProEXR_outData *options, 79 | A_Boolean *user_interactedPB0); 80 | 81 | A_Err 82 | ProEXR_GetOutSpecInfo( 83 | const A_PathType *file_pathZ, 84 | ProEXR_outData *options, 85 | AEIO_Verbiage *verbiageP); 86 | 87 | A_Err 88 | ProEXR_FlattenOutputOptions( 89 | ProEXR_outData *options); 90 | 91 | A_Err 92 | ProEXR_InflateOutputOptions( 93 | ProEXR_outData *options); 94 | 95 | 96 | A_Err 97 | ProEXR_DeathHook(const SPBasicSuite *pica_basicP); 98 | 99 | #endif // ProEXR_AE_H 100 | -------------------------------------------------------------------------------- /src/aftereffects/ProEXR_AEIO.h: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | // 3 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 4 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 5 | // 6 | // This file is part of ProEXR. 7 | // 8 | // ProEXR is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | // -------------------------------------------------------------------*/ 22 | 23 | #pragma once 24 | 25 | 26 | #ifdef MSWindows 27 | #include 28 | #endif 29 | 30 | #include "AEConfig.h" 31 | #include "entry.h" 32 | #include "AE_IO.h" 33 | #include "AE_Macros.h" 34 | #include "AE_EffectCBSuites.h" 35 | #include "fnord_SuiteHandler.h" 36 | 37 | #ifdef __cplusplus 38 | extern "C" { 39 | #endif 40 | 41 | 42 | DllExport A_Err 43 | GPMain_IO( 44 | struct SPBasicSuite *pica_basicP, /* >> */ 45 | A_long major_versionL, /* >> */ 46 | A_long minor_versionL, /* >> */ 47 | #if PF_AE_PLUG_IN_VERSION < PF_AE100_PLUG_IN_VERSION 48 | const A_char *file_pathZ, /* >> platform-specific delimiters */ 49 | const A_char *res_pathZ, /* >> platform-specific delimiters */ 50 | #endif 51 | AEGP_PluginID aegp_plugin_id, /* >> */ 52 | void *global_refconPV); /* << */ 53 | 54 | 55 | #ifdef __cplusplus 56 | } 57 | #endif 58 | 59 | -------------------------------------------------------------------------------- /src/aftereffects/ProEXR_AE_Dialogs.h: -------------------------------------------------------------------------------- 1 | 2 | /* --------------------------------------------------------------------- 3 | // 4 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 5 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 6 | // 7 | // This file is part of ProEXR. 8 | // 9 | // ProEXR is free software: you can redistribute it and/or modify 10 | // it under the terms of the GNU General Public License as published by 11 | // the Free Software Foundation, either version 2 of the License, or 12 | // (at your option) any later version. 13 | // 14 | // This program is distributed in the hope that it will be useful, 15 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | // GNU General Public License for more details. 18 | // 19 | // You should have received a copy of the GNU General Public License 20 | // along with this program. If not, see . 21 | // 22 | // -------------------------------------------------------------------*/ 23 | 24 | #ifndef PROEXR_AE_DIALOGS_H 25 | #define PROEXR_AE_DIALOGS_H 26 | 27 | #include 28 | 29 | typedef struct { 30 | int compression; 31 | bool float_not_half; 32 | bool layer_composite; 33 | bool hidden_layers; 34 | } ProEXR_AE_Out_Data; 35 | 36 | bool 37 | ProEXR_AE_Out( 38 | ProEXR_AE_Out_Data *params, 39 | const void *plugHndl, 40 | const void *mwnd); 41 | 42 | 43 | enum TimeSpan { 44 | TIMESPAN_CURRENT_FRAME = 0, 45 | TIMESPAN_WORK_AREA, 46 | TIMESPAN_FULL_COMP, 47 | TIMESPAN_CUSTOM 48 | }; 49 | 50 | typedef struct { 51 | int compression; 52 | bool float_not_half; 53 | bool layer_composite; 54 | bool hidden_layers; 55 | TimeSpan timeSpan; 56 | int start_frame; 57 | int end_frame; 58 | } ProEXR_AE_GUI_Data; 59 | 60 | bool 61 | ProEXR_AE_GUI( 62 | ProEXR_AE_GUI_Data *params, 63 | std::string &path, 64 | int current_frame, 65 | int work_start, 66 | int work_end, 67 | int comp_start, 68 | int comp_end, 69 | const void *plugHndl, 70 | const void *mwnd); 71 | 72 | bool 73 | ProEXR_AE_Update_Progress( 74 | int current_frame, 75 | int total_frames, 76 | const void *plugHndl, 77 | const void *mwnd); 78 | 79 | void 80 | ProEXR_AE_End_Progress(); 81 | 82 | void ProEXR_CopyPluginPath(char *pathZ, int max_len); 83 | 84 | #endif // PROEXR_AE_DIALOGS_H -------------------------------------------------------------------------------- /src/aftereffects/ProEXR_AE_FrameSeq.h: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | // 3 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 4 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 5 | // 6 | // This file is part of ProEXR. 7 | // 8 | // ProEXR is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | // -------------------------------------------------------------------*/ 22 | 23 | #ifndef PROEXR_FRAMESEQ_H 24 | #define PROEXR_FRAMESEQ_H 25 | 26 | #include "AEConfig.h" 27 | #include "AE_IO.h" 28 | #include "AE_Macros.h" 29 | #include "fnord_SuiteHandler.h" 30 | 31 | #ifndef MAX 32 | #define MAX(A,B) ( (A) > (B) ? (A) : (B)) 33 | #endif 34 | #define AE_RANGE(NUM) (A_u_short)MIN( MAX( (NUM), 0 ), PF_MAX_CHAN16 ) 35 | #define AE8_RANGE(NUM) (A_u_char)MIN( MAX( (NUM), 0 ), PF_MAX_CHAN8 ) 36 | #define SIXTEEN_RANGE(NUM) (A_u_short)MIN( MAX( (NUM), 0 ), 0xFFFF ) 37 | 38 | #define AE_TO_FLOAT(NUM) ( (float)(NUM) / (float)PF_MAX_CHAN16 ) 39 | #define FLOAT_TO_AE(NUM) AE_RANGE( ( (NUM) * (float)PF_MAX_CHAN16 ) + 0.5) 40 | 41 | #define AE8_TO_FLOAT(NUM) ( (float)(NUM) / (float)PF_MAX_CHAN8 ) 42 | #define FLOAT_TO_AE8(NUM) AE8_RANGE( ( (NUM) * (float)PF_MAX_CHAN8 ) + 0.5) 43 | 44 | #define SIXTEEN_TO_FLOAT(NUM) ( (float)(NUM) / (float)0xFFFF ) 45 | #define FLOAT_TO_SIXTEEN(NUM) SIXTEEN_RANGE( ( (NUM) * (float)0xFFFF ) + 0.5) 46 | 47 | #ifndef CONVERT16TO8 48 | #define CONVERT16TO8(A) ( (((long)(A) * PF_MAX_CHAN8) + PF_HALF_CHAN16) / PF_MAX_CHAN16) 49 | #endif 50 | 51 | // addition to AEIO_AlphaType 52 | #define AEIO_Alpha_UNKNOWN 99 53 | 54 | // addition to FIEL_Type 55 | #define FIEL_Type_UNKNOWN 88 56 | 57 | 58 | 59 | #define CHROMATICITIES_MAX_NAME_LEN 255 60 | typedef struct { 61 | A_char color_space_name[CHROMATICITIES_MAX_NAME_LEN + 1]; 62 | A_FloatPoint red; 63 | A_FloatPoint green; 64 | A_FloatPoint blue; 65 | A_FloatPoint white; 66 | } A_Chromaticities; 67 | 68 | 69 | #define COMPUTER_NAME_SIZE 128 70 | #define COMP_NAME_SIZE 128 71 | typedef struct { 72 | A_char proj_name[AEGP_MAX_PROJ_NAME_SIZE]; 73 | A_char comp_name[COMP_NAME_SIZE]; 74 | A_char comment_str[AEGP_MAX_RQITEM_COMMENT_SIZE]; 75 | A_char computer_name[COMPUTER_NAME_SIZE]; 76 | A_char user_name[COMPUTER_NAME_SIZE]; 77 | A_Time framerate; 78 | } Render_Info; 79 | 80 | 81 | typedef struct 82 | { 83 | A_long width; 84 | A_long height; 85 | A_long planes; 86 | A_long depth; // 8 or 16 or 32! 87 | AEIO_AlphaType alpha_type; 88 | A_Ratio pixel_aspect_ratio; 89 | PF_Pixel *premult_color; 90 | FIEL_Label *field_label; // if so inclined 91 | void *icc_profile; 92 | size_t icc_profile_len; 93 | A_Chromaticities *chromaticities; 94 | Render_Info *render_info; 95 | } FrameSeq_Info; 96 | 97 | 98 | 99 | void 100 | Init_Chromaticities(A_Chromaticities *chrm); 101 | 102 | A_Boolean 103 | Chromaticities_Set(A_Chromaticities *chrm); 104 | 105 | A_Boolean 106 | Profile_To_Chromaticities( 107 | void *icc_profile, 108 | size_t icc_profile_len, 109 | A_Chromaticities *chrm); 110 | 111 | A_Boolean 112 | Chromaticities_To_Profile( 113 | void **icc_profile, 114 | size_t *icc_profile_len, 115 | A_Chromaticities *chrm); 116 | 117 | 118 | 119 | A_Err 120 | FrameSeq_Init(struct SPBasicSuite *pica_basicP); 121 | 122 | 123 | A_Err 124 | FrameSeq_ConstructModuleInfo( 125 | AEIO_ModuleInfo *info); 126 | 127 | 128 | A_Err 129 | FrameSeq_GetDepths( 130 | AEIO_BasicData *basic_dataP, 131 | AEIO_OutSpecH outH, 132 | AEIO_SupportedDepthFlags *which); 133 | 134 | A_Err 135 | FrameSeq_InitOutputSpec( 136 | AEIO_BasicData *basic_dataP, 137 | AEIO_OutSpecH outH, 138 | A_Boolean *user_interacted); 139 | 140 | A_Err 141 | FrameSeq_OutputFrame( 142 | AEIO_BasicData *basic_dataP, 143 | AEIO_OutSpecH outH, 144 | const PF_EffectWorld *wP); 145 | 146 | A_Err 147 | FrameSeq_UserOptionsDialog( 148 | AEIO_BasicData *basic_dataP, 149 | AEIO_OutSpecH outH, 150 | const PF_EffectWorld *sample0, 151 | A_Boolean *user_interacted0); 152 | 153 | A_Err 154 | FrameSeq_GetOutputInfo( 155 | AEIO_BasicData *basic_dataP, 156 | AEIO_OutSpecH outH, 157 | AEIO_Verbiage *verbiageP); 158 | 159 | A_Err 160 | FrameSeq_DisposeOutputOptions( 161 | AEIO_BasicData *basic_dataP, 162 | void *optionsPV); 163 | 164 | A_Err 165 | FrameSeq_GetFlatOutputOptions( 166 | AEIO_BasicData *basic_dataP, 167 | AEIO_OutSpecH outH, 168 | AEIO_Handle *flat_optionsPH); 169 | 170 | A_Err 171 | FrameSeq_DeathHook(const SPBasicSuite *pica_basicP); 172 | 173 | #endif // PROEXR_FRAMESEQ_H 174 | -------------------------------------------------------------------------------- /src/aftereffects/ProEXR_AE_GUI.h: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | // 3 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 4 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 5 | // 6 | // This file is part of ProEXR. 7 | // 8 | // ProEXR is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | // -------------------------------------------------------------------*/ 22 | 23 | #ifndef PROEXR_AE_GUI_H 24 | #define PROEXR_AE_GUI_H 25 | 26 | 27 | #pragma once 28 | 29 | #ifdef MSWindows 30 | #include 31 | #include 32 | #endif 33 | 34 | #include 35 | #include 36 | #include 37 | #include "stdlib.h" 38 | 39 | #include "AEConfig.h" 40 | #include "entry.h" 41 | #include "AE_GeneralPlug.h" 42 | #include "A.h" 43 | #include "AE_EffectUI.h" 44 | 45 | #include "SPSuites.h" 46 | #include "AE_AdvEffectSuites.h" 47 | #include "AE_EffectCBSuites.h" 48 | #include "AE_Macros.h" 49 | #include "fnord_SuiteHandler.h" 50 | 51 | 52 | #define PROEXR_AE_GUI_MENU_STR "ProEXR..." 53 | 54 | A_Err 55 | ProEXR_GPCommandHook( 56 | AEGP_GlobalRefcon plugin_refconPV, 57 | AEGP_CommandRefcon refconPV, 58 | AEGP_Command command, 59 | AEGP_HookPriority hook_priority, 60 | A_Boolean already_handledB, 61 | A_Boolean *handledPB); 62 | 63 | A_Err 64 | ProEXR_UpdateMenuHook( 65 | AEGP_GlobalRefcon plugin_refconPV, 66 | AEGP_UpdateMenuRefcon refconPV, 67 | AEGP_WindowType active_window); 68 | 69 | 70 | #endif // PROEXR_AE_GUI_H -------------------------------------------------------------------------------- /src/aftereffects/ProEXR_AE_PiPL.r: -------------------------------------------------------------------------------- 1 | 2 | /* --------------------------------------------------------------------- 3 | // 4 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 5 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 6 | // 7 | // This file is part of ProEXR. 8 | // 9 | // ProEXR is free software: you can redistribute it and/or modify 10 | // it under the terms of the GNU General Public License as published by 11 | // the Free Software Foundation, either version 2 of the License, or 12 | // (at your option) any later version. 13 | // 14 | // This program is distributed in the hope that it will be useful, 15 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | // GNU General Public License for more details. 18 | // 19 | // You should have received a copy of the GNU General Public License 20 | // along with this program. If not, see . 21 | // 22 | // -------------------------------------------------------------------*/ 23 | 24 | #include "AEConfig.h" 25 | 26 | #ifndef AE_OS_WIN 27 | #include "AE_General.r" 28 | #endif 29 | resource 'PiPL' (16000) { 30 | { /* array properties: 7 elements */ 31 | /* [1] */ 32 | Kind { 33 | AEGP 34 | }, 35 | /* [2] */ 36 | Name { 37 | "ProEXR AE" 38 | }, 39 | /* [3] */ 40 | Category { 41 | "General Plugin" 42 | }, 43 | /* [4] */ 44 | Version { 45 | 65536 46 | }, 47 | #ifdef AE_OS_WIN 48 | #ifdef AE_PROC_INTELx64 49 | CodeWin64X86 {"GPMain_IO"}, 50 | #else 51 | CodeWin32X86 { "GPMain_IO" }, 52 | #endif 53 | #else 54 | #ifdef AE_PROC_INTELx64 55 | CodeMacIntel64 { "GPMain_IO" }, 56 | #else 57 | CodeMachOPowerPC { "GPMain_IO" }, 58 | CodeMacIntel32 { "GPMain_IO" }, 59 | #endif 60 | #endif 61 | } 62 | }; 63 | 64 | -------------------------------------------------------------------------------- /src/aftereffects/ProEXR_Comp_Creator.h: -------------------------------------------------------------------------------- 1 | 2 | /* --------------------------------------------------------------------- 3 | // 4 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 5 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 6 | // 7 | // This file is part of ProEXR. 8 | // 9 | // ProEXR is free software: you can redistribute it and/or modify 10 | // it under the terms of the GNU General Public License as published by 11 | // the Free Software Foundation, either version 2 of the License, or 12 | // (at your option) any later version. 13 | // 14 | // This program is distributed in the hope that it will be useful, 15 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | // GNU General Public License for more details. 18 | // 19 | // You should have received a copy of the GNU General Public License 20 | // along with this program. If not, see . 21 | // 22 | // -------------------------------------------------------------------*/ 23 | 24 | #ifndef PROEXR_COMP_CREATOR_H 25 | #define PROEXR_COMP_CREATOR_H 26 | 27 | 28 | #pragma once 29 | 30 | #ifdef MSWindows 31 | #include 32 | #include 33 | #endif 34 | 35 | #include 36 | #include 37 | #include 38 | #include "stdlib.h" 39 | 40 | #include "AEConfig.h" 41 | #include "entry.h" 42 | #include "AE_GeneralPlug.h" 43 | #include "A.h" 44 | #include "AE_EffectUI.h" 45 | 46 | #include "SPSuites.h" 47 | #include "AE_AdvEffectSuites.h" 48 | #include "AE_EffectCBSuites.h" 49 | #include "AE_Macros.h" 50 | #include "fnord_SuiteHandler.h" 51 | 52 | 53 | #define COMP_CREATOR_MENU_STR "Create ProEXR Layer Comps" 54 | #define COMP_CREATOR_ALT_MENU_STR "ProEXR DisplayWindow Comp" 55 | 56 | A_Err 57 | GPCommandHook( 58 | AEGP_GlobalRefcon plugin_refconPV, 59 | AEGP_CommandRefcon refconPV, 60 | AEGP_Command command, 61 | AEGP_HookPriority hook_priority, 62 | A_Boolean already_handledB, 63 | A_Boolean *handledPB); 64 | 65 | A_Err 66 | UpdateMenuHook( 67 | AEGP_GlobalRefcon plugin_refconPV, 68 | AEGP_UpdateMenuRefcon refconPV, 69 | AEGP_WindowType active_window); 70 | 71 | void GetControlKeys(SPBasicSuite *pica_basicP); 72 | 73 | 74 | #endif // PROEXR_COMP_CREATOR_H 75 | -------------------------------------------------------------------------------- /src/aftereffects/ProEXRdoc_AE.h: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | // 3 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 4 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 5 | // 6 | // This file is part of ProEXR. 7 | // 8 | // ProEXR is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | // -------------------------------------------------------------------*/ 22 | 23 | #ifndef __ProEXRdoc_AE_H__ 24 | #define __ProEXRdoc_AE_H__ 25 | 26 | #include "ProEXRdoc.h" 27 | 28 | #include "ProEXRdoc_PS.h" 29 | 30 | #include "AEConfig.h" 31 | #include "entry.h" 32 | #include "AE_IO.h" 33 | #include "AE_Macros.h" 34 | #include "AE_EffectCBSuites.h" 35 | #include "fnord_SuiteHandler.h" 36 | 37 | 38 | // exception meaning AE gave us an error 39 | DEFINE_EXC(AfterEffectsExc, Iex::BaseExc) 40 | 41 | extern AEGP_PluginID S_mem_id; 42 | 43 | 44 | class AE_Layer 45 | { 46 | public: 47 | AE_Layer(const SPBasicSuite *pica_basicP, AEGP_LayerH layerH); 48 | ~AE_Layer() {} 49 | 50 | void restore() const; 51 | 52 | AEGP_LayerH getLayer() const { return _layerH; } 53 | 54 | private: 55 | AEGP_SuiteHandler suites; 56 | AEGP_LayerH _layerH; 57 | 58 | bool _visibility; 59 | bool _solo; 60 | bool _adjustment_layer; 61 | 62 | AEGP_LayerTransferMode _layer_mode; 63 | }; 64 | 65 | class AE_Layers_State 66 | { 67 | public: 68 | AE_Layers_State(AEIO_BasicData *basic_dataP, AEIO_OutSpecH outH); 69 | AE_Layers_State(const SPBasicSuite *pica_basicP, AEGP_CompH compH); 70 | ~AE_Layers_State() {} 71 | 72 | void isolate(AEGP_LayerH layerH) const; 73 | void restore() const; 74 | 75 | private: 76 | AEGP_SuiteHandler suites; 77 | 78 | void setup(const SPBasicSuite *pica_basicP, AEGP_CompH compH); 79 | 80 | std::vector _layers; 81 | }; 82 | 83 | 84 | typedef struct { 85 | A_Time time; 86 | A_Time time_step; 87 | A_short xDownsample; 88 | A_short yDownsample; 89 | A_LRect roi; 90 | } RenderParams; 91 | 92 | 93 | class ProEXRchannel_writeAE : public ProEXRchannel 94 | { 95 | public: 96 | ProEXRchannel_writeAE(std::string name, Imf::PixelType pixelType=Imf::HALF); 97 | virtual ~ProEXRchannel_writeAE(); 98 | 99 | void loadFromAE(float *world, size_t rowbytes); 100 | }; 101 | 102 | 103 | class ProEXRlayer_writeAE : public ProEXRlayer 104 | { 105 | public: 106 | ProEXRlayer_writeAE(AEGP_SuiteHandler &sh, AEGP_LayerH layerH, std::string name, Imf::PixelType pixelType=Imf::HALF); 107 | ProEXRlayer_writeAE(AEGP_SuiteHandler &sh, PF_PixelFloat *buf, size_t rowbytes, std::string name, Imf::PixelType pixelType=Imf::HALF); 108 | 109 | virtual ~ProEXRlayer_writeAE(); 110 | 111 | std::string layerString() const; 112 | 113 | void loadFromAE(RenderParams *params); 114 | 115 | AEGP_LayerH getLayer() const { return _layerH; } 116 | 117 | private: 118 | AEGP_SuiteHandler &suites; 119 | 120 | AEGP_LayerH _layerH; 121 | 122 | // these will be non-null only if this is a composite layer 123 | PF_PixelFloat *_composite_buf; 124 | size_t _composite_rowbytes; 125 | 126 | void setupLayer(Imf::PixelType pixelType); 127 | bool isCompositeLayer() { return (_composite_buf != NULL && _composite_rowbytes > 0); } 128 | 129 | bool _visibility; 130 | bool _adjustment_layer; 131 | TransferMode _transfer_mode; 132 | bool _preserve_transparency; 133 | AEGP_TrackMatte _track_matte; 134 | }; 135 | 136 | 137 | class ProEXRdoc_writeAE : public ProEXRdoc_write 138 | { 139 | public: 140 | ProEXRdoc_writeAE(Imf::OStream &os, Imf::Header &header, AEIO_BasicData *basic_dataP, AEIO_OutSpecH outH, 141 | Imf::PixelType pixelType, bool hidden_layers); 142 | 143 | ProEXRdoc_writeAE(Imf::OStream &os, Imf::Header &header, const SPBasicSuite *pica_basicP, AEGP_CompH compH, 144 | Imf::PixelType pixelType, bool hidden_layers); 145 | 146 | virtual ~ProEXRdoc_writeAE(); 147 | 148 | void addMainLayer(Imf::PixelType pixelType); 149 | void addMainLayer(PF_PixelFloat *base_addr, size_t rowbytes, Imf::PixelType pixelType); 150 | 151 | void loadFromAE(RenderParams *params) const; 152 | 153 | AEGP_ItemH getItem() const { return _itemH; } 154 | 155 | void isolateLayer(AEGP_LayerH layerH) const { _layers_state.isolate(layerH); }; 156 | void restoreLayers() const { _layers_state.restore(); } 157 | 158 | private: 159 | AEGP_SuiteHandler suites; 160 | 161 | AEGP_ItemH _itemH; 162 | 163 | AE_Layers_State _layers_state; 164 | 165 | std::string layersString() const; 166 | void setupComp(AEGP_CompH compH, Imf::PixelType pixelType, bool hidden_layers); 167 | }; 168 | 169 | 170 | 171 | 172 | 173 | #endif // __ProEXRdoc_AE_H__ 174 | -------------------------------------------------------------------------------- /src/aftereffects/VRimg.h: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | // 3 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 4 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 5 | // 6 | // This file is part of ProEXR. 7 | // 8 | // ProEXR is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | // -------------------------------------------------------------------*/ 22 | 23 | 24 | #ifndef VRIMG_H 25 | #define VRIMG_H 26 | 27 | #include "VRimg_FrameSeq.h" 28 | 29 | 30 | #define PLUGIN_NAME "VRimg" 31 | 32 | 33 | 34 | 35 | typedef struct VRimg_inData 36 | { 37 | A_u_long real_channels; // not compound 38 | A_u_char reserved[28]; // saving 32 bytes 39 | A_u_long channels; 40 | PF_ChannelDesc channel[1]; 41 | } VRimg_inData; 42 | 43 | 44 | 45 | A_Err 46 | VRimg_Init(struct SPBasicSuite *pica_basicP); 47 | 48 | A_Err 49 | VRimg_DeathHook(const SPBasicSuite *pica_basicP); 50 | 51 | A_Err 52 | VRimg_IdleHook(const SPBasicSuite *pica_basicP); 53 | 54 | A_Err 55 | VRimg_PurgeHook(const SPBasicSuite *pica_basicP); 56 | 57 | 58 | A_Err 59 | VRimg_ConstructModuleInfo( 60 | AEIO_ModuleInfo *info); 61 | 62 | A_Err 63 | VRimg_GetInSpecInfo( 64 | const A_PathType *file_pathZ, 65 | VRimg_inData *options, 66 | AEIO_Verbiage *verbiageP); 67 | 68 | A_Err 69 | VRimg_VerifyFile( 70 | const A_PathType *file_pathZ, 71 | A_Boolean *importablePB); 72 | 73 | A_Err 74 | VRimg_FileInfo( 75 | AEIO_BasicData *basic_dataP, 76 | const A_PathType *file_pathZ, 77 | FrameSeq_Info *info, 78 | AEIO_Handle optionsH); 79 | 80 | A_Err 81 | VRimg_DrawSparseFrame( 82 | AEIO_BasicData *basic_dataP, 83 | const AEIO_DrawSparseFramePB *sparse_framePPB, 84 | PF_EffectWorld *wP, 85 | AEIO_DrawingFlags *draw_flagsP, 86 | const A_PathType *file_pathZ, 87 | FrameSeq_Info *info, 88 | VRimg_inData *options); 89 | 90 | 91 | A_Err 92 | VRimg_InitInOptions( 93 | VRimg_inData *options); 94 | 95 | A_Err 96 | VRimg_ReadOptionsDialog( 97 | AEIO_BasicData *basic_dataP, 98 | VRimg_inData *options, 99 | A_Boolean *user_interactedPB0); 100 | 101 | A_Err 102 | VRimg_FlattenInputOptions( 103 | AEIO_BasicData *basic_dataP, 104 | AEIO_Handle optionsH); 105 | 106 | A_Err 107 | VRimg_InflateInputOptions( 108 | AEIO_BasicData *basic_dataP, 109 | AEIO_Handle optionsH); 110 | 111 | 112 | 113 | 114 | A_Err 115 | VRimg_GetNumAuxChannels( 116 | AEIO_BasicData *basic_dataP, 117 | AEIO_Handle optionsH, 118 | const A_PathType *file_pathZ, 119 | A_long *num_channelsPL); 120 | 121 | A_Err 122 | VRimg_GetAuxChannelDesc( 123 | AEIO_BasicData *basic_dataP, 124 | AEIO_Handle optionsH, 125 | const A_PathType *file_pathZ, 126 | A_long chan_indexL, 127 | PF_ChannelDesc *descP); 128 | 129 | A_Err 130 | VRimg_DrawAuxChannel( 131 | AEIO_BasicData *basic_dataP, 132 | VRimg_inData *options, 133 | const A_PathType *file_pathZ, 134 | A_long chan_indexL, 135 | const AEIO_DrawFramePB *pbP, 136 | PF_Point scale, 137 | PF_ChannelChunk *chunkP); 138 | 139 | 140 | 141 | #endif // VRIMG_H 142 | -------------------------------------------------------------------------------- /src/aftereffects/VRimg_AEIO.h: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | // 3 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 4 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 5 | // 6 | // This file is part of ProEXR. 7 | // 8 | // ProEXR is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | // -------------------------------------------------------------------*/ 22 | 23 | #pragma once 24 | 25 | 26 | #ifdef MSWindows 27 | #include 28 | #endif 29 | 30 | #include "AEConfig.h" 31 | #include "entry.h" 32 | #include "AE_IO.h" 33 | #include "AE_Macros.h" 34 | #include "AE_EffectCBSuites.h" 35 | #include "fnord_SuiteHandler.h" 36 | 37 | #ifdef __cplusplus 38 | extern "C" { 39 | #endif 40 | 41 | 42 | DllExport A_Err 43 | VRimg_IO( 44 | struct SPBasicSuite *pica_basicP, /* >> */ 45 | A_long major_versionL, /* >> */ 46 | A_long minor_versionL, /* >> */ 47 | #if PF_AE_PLUG_IN_VERSION < PF_AE100_PLUG_IN_VERSION 48 | const A_char *file_pathZ, /* >> platform-specific delimiters */ 49 | const A_char *res_pathZ, /* >> platform-specific delimiters */ 50 | #endif 51 | AEGP_PluginID aegp_plugin_id, /* >> */ 52 | void *global_refconPV); /* << */ 53 | 54 | 55 | #ifdef __cplusplus 56 | } 57 | #endif 58 | 59 | -------------------------------------------------------------------------------- /src/aftereffects/VRimg_ChannelCache.h: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | // 3 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 4 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 5 | // 6 | // This file is part of ProEXR. 7 | // 8 | // ProEXR is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | // -------------------------------------------------------------------*/ 22 | 23 | #ifndef VRIMG_CHANNEL_CACHE_H 24 | #define VRIMG_CHANNEL_CACHE_H 25 | 26 | #include "VRimgInputFile.h" 27 | 28 | #include "OpenEXR_PlatformIO.h" 29 | 30 | #include "fnord_SuiteHandler.h" 31 | 32 | #include 33 | #include 34 | 35 | 36 | class CancelExc : public std::exception 37 | { 38 | public: 39 | CancelExc(A_Err err) throw() : _err(err) {} 40 | virtual ~CancelExc() throw() {} 41 | 42 | A_Err err() const throw() { return _err; } 43 | virtual const char* what() const throw() { return "User cancelled"; } 44 | 45 | private: 46 | A_Err _err; 47 | }; 48 | 49 | 50 | class VRimg_ChannelCache 51 | { 52 | public: 53 | VRimg_ChannelCache(const SPBasicSuite *pica_basicP, const AEIO_InterruptFuncs *inter, 54 | VRimg::InputFile &in, const IStreamPlatform &stream); 55 | ~VRimg_ChannelCache(); 56 | 57 | void copyLayerToBuffer(const std::string &name, void *buf, size_t rowbytes); 58 | 59 | const PathString & getPath() const { return _path; } 60 | DateTime getModTime() const { return _modtime; } 61 | 62 | double cacheAge() const; 63 | bool cacheIsStale(int timeout) const; 64 | 65 | private: 66 | AEGP_SuiteHandler suites; 67 | 68 | int _width; 69 | int _height; 70 | 71 | typedef struct ChannelCache { 72 | VRimg::PixelType pix_type; 73 | int dimensions; 74 | AEIO_Handle bufH; 75 | 76 | ChannelCache(VRimg::PixelType t=VRimg::FLOAT, int d=1, AEIO_Handle b=NULL) : pix_type(t), dimensions(d), bufH(b) {} 77 | } ChannelCache; 78 | 79 | typedef std::map ChannelMap; 80 | ChannelMap _cache; 81 | 82 | PathString _path; 83 | DateTime _modtime; 84 | 85 | time_t _last_access; 86 | void updateCacheTime(); 87 | }; 88 | 89 | 90 | class VRimg_CachePool 91 | { 92 | public: 93 | VRimg_CachePool(); 94 | ~VRimg_CachePool(); 95 | 96 | void configurePool(int max_caches, const SPBasicSuite *pica_basicP=NULL); 97 | 98 | VRimg_ChannelCache *findCache(const IStreamPlatform &stream) const; 99 | 100 | VRimg_ChannelCache *addCache(VRimg::InputFile &in, const IStreamPlatform &stream, const AEIO_InterruptFuncs *inter); 101 | 102 | void deleteStaleCaches(int timeout); 103 | 104 | private: 105 | int _max_caches; 106 | const SPBasicSuite *_pica_basicP; 107 | std::list _pool; 108 | }; 109 | 110 | 111 | #endif // VRIMG_CHANNEL_CACHE_H 112 | -------------------------------------------------------------------------------- /src/aftereffects/VRimg_FrameSeq.h: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | // 3 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 4 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 5 | // 6 | // This file is part of ProEXR. 7 | // 8 | // ProEXR is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | // -------------------------------------------------------------------*/ 22 | 23 | #ifndef VRIMG_FRAMESEQ_H 24 | #define VRIMG_FRAMESEQ_H 25 | 26 | #include "AEConfig.h" 27 | #include "AE_IO.h" 28 | #include "AE_Macros.h" 29 | #include "fnord_SuiteHandler.h" 30 | 31 | #ifndef MAX 32 | #define MAX(A,B) ( (A) > (B) ? (A) : (B)) 33 | #endif 34 | #define AE_RANGE(NUM) (A_u_short)MIN( MAX( (NUM), 0 ), PF_MAX_CHAN16 ) 35 | #define AE8_RANGE(NUM) (A_u_char)MIN( MAX( (NUM), 0 ), PF_MAX_CHAN8 ) 36 | #define SIXTEEN_RANGE(NUM) (A_u_short)MIN( MAX( (NUM), 0 ), 0xFFFF ) 37 | 38 | #define AE_TO_FLOAT(NUM) ( (float)(NUM) / (float)PF_MAX_CHAN16 ) 39 | #define FLOAT_TO_AE(NUM) AE_RANGE( ( (NUM) * (float)PF_MAX_CHAN16 ) + 0.5) 40 | 41 | #define AE8_TO_FLOAT(NUM) ( (float)(NUM) / (float)PF_MAX_CHAN8 ) 42 | #define FLOAT_TO_AE8(NUM) AE8_RANGE( ( (NUM) * (float)PF_MAX_CHAN8 ) + 0.5) 43 | 44 | #define SIXTEEN_TO_FLOAT(NUM) ( (float)(NUM) / (float)0xFFFF ) 45 | #define FLOAT_TO_SIXTEEN(NUM) SIXTEEN_RANGE( ( (NUM) * (float)0xFFFF ) + 0.5) 46 | 47 | #ifndef CONVERT16TO8 48 | #define CONVERT16TO8(A) ( (((long)(A) * PF_MAX_CHAN8) + PF_HALF_CHAN16) / PF_MAX_CHAN16) 49 | #endif 50 | 51 | // addition to AEIO_AlphaType 52 | #define AEIO_Alpha_UNKNOWN 99 53 | 54 | // addition to FIEL_Type 55 | #define FIEL_Type_UNKNOWN 88 56 | 57 | 58 | /* 59 | #define CHROMATICITIES_MAX_NAME_LEN 255 60 | typedef struct { 61 | A_char color_space_name[CHROMATICITIES_MAX_NAME_LEN + 1]; 62 | A_FloatPoint red; 63 | A_FloatPoint green; 64 | A_FloatPoint blue; 65 | A_FloatPoint white; 66 | } A_Chromaticities; 67 | */ 68 | 69 | 70 | typedef struct 71 | { 72 | A_long width; 73 | A_long height; 74 | A_long planes; 75 | A_long depth; // 8 or 16 or 32! 76 | AEIO_AlphaType alpha_type; 77 | A_Ratio pixel_aspect_ratio; 78 | PF_Pixel *premult_color; 79 | FIEL_Label *field_label; // if so inclined 80 | void *icc_profile; 81 | size_t icc_profile_len; 82 | //A_Chromaticities *chromaticities; 83 | //Render_Info *render_info; 84 | } FrameSeq_Info; 85 | 86 | 87 | 88 | 89 | A_Err 90 | VRimg_FrameSeq_Init(struct SPBasicSuite *pica_basicP); 91 | 92 | A_Err 93 | VRimg_FrameSeq_DeathHook(const SPBasicSuite *pica_basicP); 94 | 95 | A_Err 96 | VRimg_FrameSeq_IdleHook(const SPBasicSuite *pica_basicP, A_long *max_sleepPL); 97 | 98 | A_Err 99 | VRimg_FrameSeq_PurgeHook(const SPBasicSuite *pica_basicP); 100 | 101 | A_Err 102 | VRimg_FrameSeq_ConstructModuleInfo( 103 | AEIO_ModuleInfo *info); 104 | 105 | A_Err 106 | VRimg_FrameSeq_GetInSpecInfo( 107 | AEIO_BasicData *basic_dataP, 108 | AEIO_InSpecH specH, 109 | AEIO_Verbiage *verbiageP); 110 | 111 | A_Err 112 | VRimg_FrameSeq_VerifyFileImportable( 113 | AEIO_BasicData *basic_dataP, 114 | AEIO_ModuleSignature sig, 115 | const A_PathType *file_pathZ, 116 | A_Boolean *importablePB); 117 | 118 | A_Err 119 | VRimg_FrameSeq_InitInSpecFromFile( 120 | AEIO_BasicData *basic_dataP, 121 | const A_PathType *file_pathZ, 122 | AEIO_InSpecH specH); 123 | 124 | A_Err 125 | VRimg_FrameSeq_DrawSparseFrame( 126 | AEIO_BasicData *basic_dataP, 127 | AEIO_InSpecH specH, 128 | const AEIO_DrawSparseFramePB *sparse_framePPB, 129 | PF_EffectWorld *wP, 130 | AEIO_DrawingFlags *draw_flagsP); 131 | 132 | A_Err 133 | VRimg_FrameSeq_SeqOptionsDlg( 134 | AEIO_BasicData *basic_dataP, 135 | AEIO_InSpecH specH, 136 | A_Boolean *user_interactedPB0); 137 | 138 | A_Err 139 | VRimg_FrameSeq_DisposeInSpec( 140 | AEIO_BasicData *basic_dataP, 141 | AEIO_InSpecH specH); 142 | 143 | A_Err 144 | VRimg_FrameSeq_FlattenOptions( 145 | AEIO_BasicData *basic_dataP, 146 | AEIO_InSpecH specH, 147 | AEIO_Handle *flat_optionsPH); 148 | 149 | A_Err 150 | VRimg_FrameSeq_InflateOptions( 151 | AEIO_BasicData *basic_dataP, 152 | AEIO_InSpecH specH, 153 | AEIO_Handle flat_optionsH); 154 | 155 | 156 | A_Err 157 | VRimg_FrameSeq_GetNumAuxChannels( 158 | AEIO_BasicData *basic_dataP, 159 | AEIO_InSpecH specH, 160 | A_long *num_channelsPL); 161 | 162 | A_Err 163 | VRimg_FrameSeq_GetAuxChannelDesc( 164 | AEIO_BasicData *basic_dataP, 165 | AEIO_InSpecH specH, 166 | A_long chan_indexL, 167 | PF_ChannelDesc *descP); 168 | 169 | A_Err 170 | VRimg_FrameSeq_DrawAuxChannel( 171 | AEIO_BasicData *basic_dataP, 172 | AEIO_InSpecH specH, 173 | A_long chan_indexL, 174 | const AEIO_DrawFramePB *pbP, 175 | PF_ChannelChunk *chunkP); 176 | 177 | A_Err 178 | VRimg_FrameSeq_FreeAuxChannel( 179 | AEIO_BasicData *basic_dataP, 180 | AEIO_InSpecH specH, 181 | PF_ChannelChunk *chunkP); 182 | 183 | #endif // VRIMG_FRAMESEQ_H 184 | -------------------------------------------------------------------------------- /src/aftereffects/exrdisplay.h: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | // 3 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 4 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 5 | // 6 | // This file is part of ProEXR. 7 | // 8 | // ProEXR is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | // -------------------------------------------------------------------*/ 22 | 23 | // exrdisplay 24 | // 25 | // AE plug-in to replicate the exrdisplay controls 26 | // 27 | 28 | #ifndef EXRDISPLAY_H 29 | #define EXRDISPLAY_H 30 | 31 | #pragma once 32 | 33 | #include "AEConfig.h" 34 | #include "Entry.h" 35 | #include "AE_EffectUI.h" 36 | #include "AE_EffectCBSuites.h" 37 | #include "AE_AdvEffectSuites.h" 38 | #include "String_Utils.h" 39 | #include "Param_Utils.h" 40 | #include "AE_Macros.h" 41 | #include "fnord_SuiteHandler.h" 42 | 43 | 44 | #ifdef macintosh 45 | #define Macintosh 46 | #endif 47 | 48 | 49 | #ifdef MSWindows 50 | #include 51 | #endif 52 | 53 | 54 | #define NAME "exrdisplay" 55 | #define DESCRIPTION "exrdisplay emulation." 56 | #define RELEASE_DATE __DATE__ 57 | #define COPYRIGHT "\xA9 2008 fnord" 58 | #define WEBSITE "www.fnordware.com" 59 | #define MAJOR_VERSION 1 60 | #define MINOR_VERSION 0 61 | #define BUG_VERSION 0 62 | #define STAGE_VERSION PF_Stage_RELEASE 63 | #define BUILD_VERSION 0 64 | 65 | 66 | #if PF_AE_PLUG_IN_VERSION < PF_AE100_PLUG_IN_VERSION 67 | typedef A_long IteratorRefcon; 68 | #else 69 | typedef void * IteratorRefcon; 70 | #endif 71 | 72 | /* 73 | #ifndef Macintosh 74 | typedef unsigned char UInt8; 75 | typedef signed char SInt8; 76 | typedef unsigned short UInt16; 77 | typedef signed short SInt16; 78 | typedef unsigned long UInt32; 79 | typedef signed long SInt32; 80 | typedef char * Ptr; 81 | #endif 82 | */ 83 | 84 | 85 | 86 | enum { 87 | EXRDISPLAY_INPUT = 0, 88 | EXRDISPLAY_GAMMA, 89 | EXRDISPLAY_EXPOSURE, 90 | EXRDISPLAY_DEFOG, 91 | EXRDISPLAY_KNEELOW, 92 | EXRDISPLAY_KNEEHIGH, 93 | EXRDISPLAY_INVERSE, 94 | EXRDISPLAY_DITHER, 95 | EXRDISPLAY_NUM_PARAMS 96 | }; 97 | 98 | enum { 99 | GAMMA_ID = 1, 100 | EXPOSURE_ID, 101 | DEFOG_ID, 102 | KNEELOW_ID, 103 | KNEEHIGH_ID, 104 | DITHER_ID, 105 | INVERSE_ID 106 | }; 107 | 108 | 109 | #ifndef MAX 110 | #define MAX(A,B) ((A) > (B) ? (A) : (B)) 111 | #endif 112 | 113 | 114 | #ifdef __cplusplus 115 | extern "C" { 116 | #endif 117 | 118 | 119 | 120 | DllExport PF_Err PluginMain ( PF_Cmd cmd, 121 | PF_InData *in_data, 122 | PF_OutData *out_data, 123 | PF_ParamDef *params[], 124 | PF_LayerDef *output, 125 | void *extra ); 126 | 127 | 128 | #ifdef __cplusplus 129 | } 130 | #endif 131 | 132 | 133 | #endif // EXRDISPLAY_H 134 | -------------------------------------------------------------------------------- /src/aftereffects/exrdisplay_PiPL.r: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | // 3 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 4 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 5 | // 6 | // This file is part of ProEXR. 7 | // 8 | // ProEXR is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | // -------------------------------------------------------------------*/ 22 | 23 | 24 | #include "AEConfig.h" 25 | 26 | #ifdef USE_AE_EFFECT_VERS 27 | #include "AE_EffectVers.h" 28 | #else 29 | #define PF_PLUG_IN_VERSION 12 30 | #define PF_PLUG_IN_SUBVERS 12 31 | #endif 32 | 33 | #ifndef AE_OS_WIN 34 | #include "AE_General.r" 35 | #endif 36 | 37 | resource 'PiPL' (16000) { 38 | { /* array properties: 12 elements */ 39 | /* [1] */ 40 | Kind { 41 | AEEffect 42 | }, 43 | /* [2] */ 44 | Name { 45 | "exrdisplay" 46 | }, 47 | /* [3] */ 48 | Category { 49 | "Utility" 50 | }, 51 | 52 | #ifdef AE_OS_WIN 53 | #ifdef AE_PROC_INTELx64 54 | CodeWin64X86 {"PluginMain"}, 55 | #else 56 | CodeWin32X86 {"PluginMain"}, 57 | #endif 58 | #else 59 | #ifdef AE_PROC_INTELx64 60 | CodeMacIntel64 {"PluginMain"}, 61 | #else 62 | CodeMachOPowerPC {"PluginMain"}, 63 | CodeMacIntel32 {"PluginMain"}, 64 | #endif 65 | #endif /* [6] */ 66 | AE_PiPL_Version { 67 | 2, 68 | 0 69 | }, 70 | /* [7] */ 71 | AE_Effect_Spec_Version { 72 | PF_PLUG_IN_VERSION, 73 | PF_PLUG_IN_SUBVERS 74 | }, 75 | /* [8] */ 76 | AE_Effect_Version { 77 | 525824 /* 2.0 */ 78 | }, 79 | /* [9] */ 80 | AE_Effect_Info_Flags { 81 | 0 82 | }, 83 | /* [10] */ 84 | AE_Effect_Global_OutFlags { 85 | 33555520 86 | }, 87 | AE_Effect_Global_OutFlags_2 { 88 | 5120 89 | }, 90 | /* [11] */ 91 | AE_Effect_Match_Name { 92 | "exrdisplay" 93 | }, 94 | /* [12] */ 95 | AE_Reserved_Info { 96 | 0 97 | } 98 | } 99 | }; 100 | 101 | 102 | 103 | #ifdef AE_OS_MAC 104 | 105 | #include "MacTypes.r" 106 | 107 | #define NAME "exrdisplay" 108 | #define VERSION_STRING "1.0" 109 | resource 'vers' (1, NAME " Version", purgeable) 110 | { 111 | 5, 0x50, final, 0, verUs, 112 | VERSION_STRING, 113 | VERSION_STRING 114 | "\n\xA9 2008 fnord" 115 | }; 116 | 117 | resource 'vers' (2, NAME " Version", purgeable) 118 | { 119 | 5, 0x50, final, 0, verUs, 120 | VERSION_STRING, 121 | "by Brendan Bolles" 122 | }; 123 | 124 | #endif 125 | 126 | -------------------------------------------------------------------------------- /src/aftereffects/fnord_MissingSuiteError.cpp: -------------------------------------------------------------------------------- 1 | 2 | /* --------------------------------------------------------------------- 3 | // 4 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 5 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 6 | // 7 | // This file is part of ProEXR. 8 | // 9 | // ProEXR is free software: you can redistribute it and/or modify 10 | // it under the terms of the GNU General Public License as published by 11 | // the Free Software Foundation, either version 2 of the License, or 12 | // (at your option) any later version. 13 | // 14 | // This program is distributed in the hope that it will be useful, 15 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | // GNU General Public License for more details. 18 | // 19 | // You should have received a copy of the GNU General Public License 20 | // along with this program. If not, see . 21 | // 22 | // -------------------------------------------------------------------*/ 23 | 24 | // 25 | // fnord_SuiteHandler 26 | // by Brendan Bolles 27 | // 28 | // A multi-version SuiteHandler. Inspired by the Adobe SDK verison. 29 | // 30 | // Part of the fnord OpenEXR tools 31 | // http://www.fnordware.com/OpenEXR/ 32 | // 33 | // 34 | 35 | #include "fnord_SuiteHandler.h" 36 | 37 | void AEGP_SuiteHandler::MissingSuiteError() const 38 | { 39 | // Yes, we've read Scott Meyers, and know throwing 40 | // a stack-based object can cause problems. Since 41 | // the err is just a long, and since we aren't de- 42 | // referencing it in any way, risk is mimimal. 43 | 44 | // As always, we expect those of you who use 45 | // exception-based code to do a little less rudi- 46 | // mentary job of it than we are here. 47 | 48 | // Also, excuse the Madagascar-inspired monkey 49 | // joke; couldn't resist. 50 | // -bbb 10/10/05 51 | 52 | PF_Err poop = PF_Err_BAD_CALLBACK_PARAM; 53 | 54 | throw poop; 55 | } 56 | 57 | -------------------------------------------------------------------------------- /src/aftereffects/fnord_SuiteHandler.cpp: -------------------------------------------------------------------------------- 1 | 2 | /* --------------------------------------------------------------------- 3 | // 4 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 5 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 6 | // 7 | // This file is part of ProEXR. 8 | // 9 | // ProEXR is free software: you can redistribute it and/or modify 10 | // it under the terms of the GNU General Public License as published by 11 | // the Free Software Foundation, either version 2 of the License, or 12 | // (at your option) any later version. 13 | // 14 | // This program is distributed in the hope that it will be useful, 15 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | // GNU General Public License for more details. 18 | // 19 | // You should have received a copy of the GNU General Public License 20 | // along with this program. If not, see . 21 | // 22 | // -------------------------------------------------------------------*/ 23 | // 24 | // fnord_SuiteHandler 25 | // by Brendan Bolles 26 | // 27 | // A multi-version SuiteHandler. Inspired by the Adobe SDK verison. 28 | // 29 | // Part of the fnord OpenEXR tools 30 | // http://www.fnordware.com/OpenEXR/ 31 | // 32 | // 33 | 34 | #include 35 | #include 36 | 37 | AEGP_SuiteHandler::AEGP_SuiteHandler(const SPBasicSuite *pica_basicP) : 38 | i_pica_basicP(pica_basicP) 39 | { 40 | AEFX_CLR_STRUCT(i_suites); 41 | 42 | if (!i_pica_basicP) { //can't construct w/out basic suite, everything else is demand loaded 43 | MissingSuiteError(); 44 | } 45 | } 46 | 47 | AEGP_SuiteHandler::~AEGP_SuiteHandler() 48 | { 49 | ReleaseAllSuites(); 50 | } 51 | 52 | // Had to go to the header file to be inlined to please CW mach-o target 53 | /*void *AEGP_SuiteHandler::pLoadSuite(A_char *nameZ, A_long versionL) const 54 | { 55 | const void *suiteP; 56 | A_long err = i_pica_basicP->AcquireSuite(nameZ, versionL, &suiteP); 57 | 58 | if (err || !suiteP) { 59 | MissingSuiteError(); 60 | } 61 | 62 | return (void*)suiteP; 63 | }*/ 64 | 65 | // Free a particular suite. Ignore errors, because, what is there to be done if release fails? 66 | void AEGP_SuiteHandler::ReleaseSuite(A_char *nameZ, A_long versionL) 67 | { 68 | i_pica_basicP->ReleaseSuite(nameZ, versionL); 69 | } 70 | 71 | -------------------------------------------------------------------------------- /src/aftereffects/mac/ProEXR_AE_GUI_Controller.h: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | // 3 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 4 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 5 | // 6 | // This file is part of ProEXR. 7 | // 8 | // ProEXR is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | // -------------------------------------------------------------------*/ 22 | 23 | #import 24 | 25 | #if !NSINTEGER_DEFINED 26 | typedef int NSInteger; 27 | #define NSINTEGER_DEFINED 1 28 | #endif 29 | 30 | typedef enum { 31 | DIALOG_TIMESPAN_CURRENT_FRAME = 0, 32 | DIALOG_TIMESPAN_WORK_AREA, 33 | DIALOG_TIMESPAN_FULL_COMP, 34 | DIALOG_TIMESPAN_CUSTOM 35 | } DialogTimeSpan; 36 | 37 | @interface ProEXR_AE_GUI_Controller : NSWindowController 38 | { 39 | IBOutlet NSTextField *pathField; 40 | IBOutlet NSPopUpButton *timeSpanMenu; 41 | IBOutlet NSTextField *startField; 42 | IBOutlet NSTextField *startLabel; 43 | IBOutlet NSTextField *endField; 44 | IBOutlet NSTextField *endLabel; 45 | IBOutlet NSPopUpButton *compressionMenu; 46 | IBOutlet NSButton *floatButton; 47 | IBOutlet NSButton *compositeButton; 48 | IBOutlet NSButton *hiddenButton; 49 | 50 | NSInteger current_frame; 51 | NSInteger work_start; 52 | NSInteger work_end; 53 | NSInteger comp_start; 54 | NSInteger comp_end; 55 | } 56 | 57 | - (id)init:(NSString *)path 58 | compression:(NSInteger)compression 59 | useFloat:(BOOL)floatVal 60 | composite:(BOOL)compositeVal 61 | hidden:(BOOL)hiddenVal 62 | timeSpan:(DialogTimeSpan)timeSpan 63 | startFrame:(NSInteger)startFrame 64 | endFrame:(NSInteger)endFrame 65 | currentFrame:(NSInteger)currentFrame 66 | workStart:(NSInteger)workStart 67 | workEnd:(NSInteger)workEnd 68 | compStart:(NSInteger)compStart 69 | compEnd:(NSInteger)compEnd; 70 | 71 | 72 | - (IBAction)clickedRender:(id)sender; 73 | - (IBAction)clickedCancel:(id)sender; 74 | 75 | - (IBAction)browsePath:(id)sender; 76 | 77 | - (IBAction)trackTimeFrame:(id)sender; 78 | 79 | - (NSInteger)getCompression; 80 | - (BOOL)getFloat; 81 | - (BOOL)getComposite; 82 | - (BOOL)getHidden; 83 | - (NSString *)getPath; 84 | - (DialogTimeSpan)getTimeSpan; 85 | - (NSInteger)getStart; 86 | - (NSInteger)getEnd; 87 | 88 | @end 89 | -------------------------------------------------------------------------------- /src/aftereffects/mac/ProEXR_AE_Out_Controller.h: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | // 3 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 4 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 5 | // 6 | // This file is part of ProEXR. 7 | // 8 | // ProEXR is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | // -------------------------------------------------------------------*/ 22 | 23 | #import 24 | 25 | #if !NSINTEGER_DEFINED 26 | typedef int NSInteger; 27 | #define NSINTEGER_DEFINED 1 28 | #endif 29 | 30 | typedef enum { 31 | DIALOG_RESULT_CONTINUE = 0, 32 | DIALOG_RESULT_OK, 33 | DIALOG_RESULT_CANCEL 34 | } DialogResult; 35 | 36 | @interface ProEXR_AE_Out_Controller : NSObject { 37 | IBOutlet NSPopUpButton *compressionMenu; 38 | IBOutlet NSButton *floatCheck; 39 | IBOutlet NSButton *compositeCheck; 40 | IBOutlet NSButton *hiddenCheck; 41 | IBOutlet NSWindow *theWindow; 42 | 43 | DialogResult theResult; 44 | } 45 | 46 | - (id)init:(NSInteger)compression 47 | useFloat:(BOOL)floatVal 48 | composite:(BOOL)compositeVal 49 | hidden:(BOOL)hiddenVal; 50 | 51 | - (IBAction)clickedCancel:(id)sender; 52 | - (IBAction)clickedOK:(id)sender; 53 | - (DialogResult)getResult; 54 | 55 | - (NSInteger)getCompression; 56 | - (BOOL)getFloat; 57 | - (BOOL)getComposite; 58 | - (BOOL)getHidden; 59 | 60 | - (NSWindow *)getWindow; 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /src/aftereffects/mac/ProEXR_AE_Out_Controller.m: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | // 3 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 4 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 5 | // 6 | // This file is part of ProEXR. 7 | // 8 | // ProEXR is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | // -------------------------------------------------------------------*/ 22 | 23 | #import "ProEXR_AE_Out_Controller.h" 24 | 25 | @implementation ProEXR_AE_Out_Controller 26 | 27 | - (id)init:(NSInteger)compression 28 | useFloat:(BOOL)floatVal 29 | composite:(BOOL)compositeVal 30 | hidden:(BOOL)hiddenVal 31 | { 32 | self = [super init]; 33 | 34 | if(!([NSBundle loadNibNamed:@"ProEXR_AE_Out" owner:self])) 35 | return nil; 36 | 37 | [theWindow center]; 38 | 39 | [compressionMenu removeAllItems]; 40 | [compressionMenu addItemsWithTitles: 41 | [NSArray arrayWithObjects:@"None", @"RLE", @"Zip", @"Zip16", @"Piz", @"PXR24", @"B44", @"B44A", @"DWAA", @"DWAB", nil]]; 42 | [compressionMenu selectItem:[compressionMenu itemAtIndex:compression]]; 43 | 44 | [floatCheck setState:(floatVal ? NSOnState : NSOffState)]; 45 | [compositeCheck setState:(compositeVal ? NSOnState : NSOffState)]; 46 | [hiddenCheck setState:(hiddenVal ? NSOnState : NSOffState)]; 47 | 48 | theResult = DIALOG_RESULT_CONTINUE; 49 | 50 | return self; 51 | } 52 | 53 | - (IBAction)clickedCancel:(id)sender { 54 | theResult = DIALOG_RESULT_CANCEL; 55 | } 56 | 57 | - (IBAction)clickedOK:(id)sender { 58 | theResult = DIALOG_RESULT_OK; 59 | } 60 | 61 | - (DialogResult)getResult { 62 | return theResult; 63 | } 64 | 65 | - (NSInteger)getCompression { 66 | return [compressionMenu indexOfSelectedItem]; 67 | } 68 | 69 | - (BOOL)getFloat { 70 | return ([floatCheck state] == NSOnState); 71 | } 72 | 73 | - (BOOL)getComposite { 74 | return ([compositeCheck state] == NSOnState); 75 | } 76 | 77 | - (BOOL)getHidden { 78 | return ([hiddenCheck state] == NSOnState); 79 | } 80 | 81 | - (NSWindow *)getWindow { 82 | return theWindow; 83 | } 84 | 85 | @end 86 | -------------------------------------------------------------------------------- /src/aftereffects/mac/ProEXR_AE_Progress_Controller.h: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | // 3 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 4 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 5 | // 6 | // This file is part of ProEXR. 7 | // 8 | // ProEXR is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | // -------------------------------------------------------------------*/ 22 | 23 | #import 24 | 25 | #if !NSINTEGER_DEFINED 26 | typedef int NSInteger; 27 | #define NSINTEGER_DEFINED 1 28 | #endif 29 | 30 | @interface ProEXR_AE_Progress_Controller : NSWindowController 31 | { 32 | IBOutlet NSProgressIndicator *progressBar; 33 | IBOutlet NSTextField *textProgress; 34 | 35 | NSInteger total_frames; 36 | BOOL userCancelled; 37 | } 38 | 39 | - (id)init:(NSInteger)startFrame totalFrames:(NSInteger)totalFrames; 40 | 41 | - (IBAction)clickedCancel:(id)sender; 42 | 43 | - (BOOL)updateProgress:(NSInteger)currentFrame; // returns NO if user cancelled 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /src/aftereffects/mac/ProEXR_AE_Progress_Controller.m: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | // 3 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 4 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 5 | // 6 | // This file is part of ProEXR. 7 | // 8 | // ProEXR is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | // -------------------------------------------------------------------*/ 22 | 23 | #import "ProEXR_AE_Progress_Controller.h" 24 | 25 | 26 | @implementation ProEXR_AE_Progress_Controller 27 | 28 | - (id)init:(NSInteger)startFrame totalFrames:(NSInteger)totalFrames; 29 | { 30 | self = [super init]; 31 | 32 | if(!([NSBundle loadNibNamed:@"ProEXR_AE_Progress" owner:self])) 33 | return nil; 34 | 35 | if(self) 36 | { 37 | total_frames = totalFrames; 38 | 39 | userCancelled = NO; 40 | 41 | [self updateProgress:startFrame]; 42 | 43 | [[self window] center]; 44 | } 45 | 46 | return self; 47 | } 48 | 49 | - (IBAction)clickedCancel:(id)sender 50 | { 51 | userCancelled = YES; 52 | } 53 | 54 | - (BOOL)updateProgress:(NSInteger)currentFrame 55 | { 56 | NSAssert([progressBar minValue] == 0.0, @"Min value should be 0.0"); 57 | 58 | [progressBar setDoubleValue:([progressBar maxValue] * ((double)(currentFrame - 1) / (double)total_frames))]; 59 | 60 | [textProgress setStringValue:[NSString stringWithFormat:@"Rendering frame %ld of %ld", currentFrame, total_frames]]; 61 | 62 | return !userCancelled; 63 | } 64 | 65 | @end 66 | -------------------------------------------------------------------------------- /src/aftereffects/mac/ProEXR_banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fnordware/ProEXR/b256276a03f75b69904962cf4620ae94590528a1/src/aftereffects/mac/ProEXR_banner.png -------------------------------------------------------------------------------- /src/aftereffects/win/ProEXR_banner.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fnordware/ProEXR/b256276a03f75b69904962cf4620ae94590528a1/src/aftereffects/win/ProEXR_banner.bmp -------------------------------------------------------------------------------- /src/aftereffects/win/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by ProEXR_EZ_Dialogs.rc 4 | // 5 | #define IDD_DIALOG1 101 6 | #define IDD_DIALOG2 103 7 | #define IDC_CHECK3 1007 8 | 9 | // Next default values for new objects 10 | // 11 | #ifdef APSTUDIO_INVOKED 12 | #ifndef APSTUDIO_READONLY_SYMBOLS 13 | #define _APS_NEXT_RESOURCE_VALUE 105 14 | #define _APS_NEXT_COMMAND_VALUE 40001 15 | #define _APS_NEXT_CONTROL_VALUE 1007 16 | #define _APS_NEXT_SYMED_VALUE 101 17 | #endif 18 | #endif 19 | -------------------------------------------------------------------------------- /src/common/ImfHybridInputFile.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2017 Brendan Bolles (http://www.fnordware.com) 2 | // 3 | // Redistribution and use in source and binary forms, with or without modification, 4 | // are permitted provided that the following conditions are met: 5 | // 6 | // 1. Redistributions of source code must retain the above copyright notice, this list of 7 | // conditions and the following disclaimer. 8 | // 9 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 10 | // of conditions and the following disclaimer in the documentation and/or other 11 | // materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 14 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 15 | // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 16 | // SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 17 | // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 18 | // TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 19 | // BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 20 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 21 | // WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 22 | // 23 | 24 | #include "ImfHybridInputFile.h" 25 | 26 | #include "ImfInputPart.h" 27 | #include "ImfPartType.h" 28 | 29 | #include "Iex.h" 30 | 31 | 32 | OPENEXR_IMF_INTERNAL_NAMESPACE_SOURCE_ENTER 33 | 34 | 35 | using namespace std; 36 | using IMATH_NAMESPACE::Box2i; 37 | 38 | 39 | HybridInputFile::HybridInputFile(const char fileName[], bool renameFirstPart, int numThreads, bool reconstructChunkOffsetTable) : 40 | _multiPart(fileName, numThreads, reconstructChunkOffsetTable), 41 | _renameFirstPart(renameFirstPart) 42 | { 43 | setup(); 44 | } 45 | 46 | 47 | HybridInputFile::HybridInputFile(IStream& is, bool renameFirstPart, int numThreads, bool reconstructChunkOffsetTable) : 48 | _multiPart(is, numThreads, reconstructChunkOffsetTable), 49 | _renameFirstPart(renameFirstPart) 50 | { 51 | setup(); 52 | } 53 | 54 | 55 | bool 56 | HybridInputFile::isComplete() const 57 | { 58 | for(int i=0; i < _multiPart.parts(); i++) 59 | { 60 | if( !_multiPart.partComplete(i) ) 61 | return false; 62 | } 63 | 64 | return true; 65 | } 66 | 67 | 68 | void 69 | HybridInputFile::readPixels(int scanLine1, int scanLine2) 70 | { 71 | for(int n=0; n < _multiPart.parts(); n++) 72 | { 73 | FrameBuffer part_fb; 74 | 75 | for(FrameBuffer::ConstIterator i = _frameBuffer.begin(); i != _frameBuffer.end(); i++) 76 | { 77 | if( _map.find( i.name() ) != _map.end() ) 78 | { 79 | const HybridChannel &hyChan = _map[ i.name() ]; 80 | 81 | if(hyChan.part == n) 82 | { 83 | part_fb.insert( hyChan.name, i.slice() ); 84 | } 85 | } 86 | else if(n == 0) 87 | { 88 | // for channels that will be simply be filled 89 | const bool rename = (_multiPart.parts() > 1); 90 | 91 | const string name_never_loaded = (rename ? string("zzNOLOADzz") + i.name() : i.name()); 92 | 93 | part_fb.insert( name_never_loaded, i.slice() ); 94 | } 95 | } 96 | 97 | if(part_fb.begin() != part_fb.end()) // i.e. it's not empty 98 | { 99 | const Box2i &dataW = _multiPart.header(n).dataWindow(); 100 | 101 | const int startScanline = max(scanLine1, dataW.min.y); 102 | const int endScanline = min(scanLine2, dataW.max.y); 103 | 104 | if(endScanline >= startScanline) 105 | { 106 | InputPart inPart(_multiPart, n); 107 | 108 | inPart.setFrameBuffer(part_fb); 109 | 110 | inPart.readPixels(startScanline, endScanline); 111 | } 112 | } 113 | } 114 | } 115 | 116 | 117 | void 118 | HybridInputFile::setup() 119 | { 120 | for(int n=0; n < _multiPart.parts(); n++) 121 | { 122 | const Header &head = _multiPart.header(n); 123 | 124 | if(head.type() != OPENEXR_IMF_INTERNAL_NAMESPACE::DEEPTILE) 125 | { 126 | // this will make a dataWindow that can hold the dataWindows of every part 127 | _dataWindow.extendBy( head.dataWindow() ); 128 | 129 | // all displayWindows should be the same, actually 130 | _displayWindow.extendBy( head.displayWindow() ); 131 | 132 | 133 | const ChannelList &chans = head.channels(); 134 | 135 | for(ChannelList::ConstIterator i = chans.begin(); i != chans.end(); ++i) 136 | { 137 | const bool rename = (_multiPart.parts() > 1) && (n > 0 || _renameFirstPart) && head.hasName(); 138 | 139 | const string hybrid_name = (rename ? head.name() + "." + i.name() : i.name()); 140 | 141 | _map[ hybrid_name ] = HybridChannel(n, i.name()); 142 | 143 | _chanList.insert(hybrid_name, i.channel()); 144 | } 145 | } 146 | } 147 | 148 | if(_chanList.begin() == _chanList.end()) // empty 149 | throw IEX_NAMESPACE::BaseExc("DeepTile images not supported"); // only reason this should happen 150 | } 151 | 152 | 153 | OPENEXR_IMF_INTERNAL_NAMESPACE_SOURCE_EXIT -------------------------------------------------------------------------------- /src/common/ImfHybridInputFile.h: -------------------------------------------------------------------------------- 1 | 2 | // Copyright 2007-2017 Brendan Bolles (http://www.fnordware.com) 3 | // 4 | // Redistribution and use in source and binary forms, with or without modification, 5 | // are permitted provided that the following conditions are met: 6 | // 7 | // 1. Redistributions of source code must retain the above copyright notice, this list of 8 | // conditions and the following disclaimer. 9 | // 10 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 11 | // of conditions and the following disclaimer in the documentation and/or other 12 | // materials provided with the distribution. 13 | // 14 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 15 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 16 | // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 17 | // SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 18 | // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 19 | // TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 20 | // BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 22 | // WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 | // 24 | 25 | #ifndef INCLUDED_IMF_HYBRID_INPUT_FILE_H 26 | #define INCLUDED_IMF_HYBRID_INPUT_FILE_H 27 | 28 | #include "ImfHeader.h" 29 | #include "ImfMultiPartInputFile.h" 30 | #include "ImfFrameBuffer.h" 31 | #include "ImfChannelList.h" 32 | #include "ImathBox.h" 33 | 34 | 35 | OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER 36 | 37 | 38 | class IMF_EXPORT HybridInputFile : public GenericInputFile 39 | { 40 | public: 41 | HybridInputFile(const char fileName[], bool renameFirstPart = false, 42 | int numThreads = globalThreadCount(), 43 | bool reconstructChunkOffsetTable = true); 44 | 45 | HybridInputFile(IStream& is, bool renameFirstPart = false, 46 | int numThreads = globalThreadCount(), 47 | bool reconstructChunkOffsetTable = true); 48 | 49 | virtual ~HybridInputFile() {} 50 | 51 | 52 | int parts() const { return _multiPart.parts(); } 53 | 54 | const Header & header(int n) const { return _multiPart.header(n); } 55 | 56 | int version () const { return _multiPart.version(); } 57 | 58 | bool isComplete () const; 59 | 60 | const ChannelList & channels () const { return _chanList; } 61 | 62 | const IMATH_NAMESPACE::Box2i & dataWindow() const { return _dataWindow; } 63 | const IMATH_NAMESPACE::Box2i & displayWindow() const { return _displayWindow; } 64 | 65 | 66 | void setFrameBuffer (const FrameBuffer &frameBuffer) { _frameBuffer = frameBuffer; } 67 | 68 | const FrameBuffer & frameBuffer () const { return _frameBuffer; } 69 | 70 | void readPixels (int scanLine1, int scanLine2); 71 | void readPixels (int scanLine) { readPixels(scanLine, scanLine); } 72 | 73 | private: 74 | void setup(); 75 | 76 | private: 77 | MultiPartInputFile _multiPart; 78 | 79 | const bool _renameFirstPart; 80 | 81 | IMATH_NAMESPACE::Box2i _dataWindow; 82 | IMATH_NAMESPACE::Box2i _displayWindow; 83 | 84 | FrameBuffer _frameBuffer; 85 | 86 | typedef struct HybridChannel { 87 | int part; 88 | std::string name; 89 | 90 | HybridChannel(int p=0, const std::string &n="") : part(p), name(n) {} 91 | }HybridChannel; 92 | 93 | typedef std::map HybridChannelMap; 94 | 95 | HybridChannelMap _map; 96 | 97 | ChannelList _chanList; 98 | }; 99 | 100 | 101 | OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT 102 | 103 | #endif // INCLUDED_IMF_HYBRID_INPUT_FILE_H -------------------------------------------------------------------------------- /src/common/ProEXR_UTF.cpp: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | // 3 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 4 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 5 | // 6 | // This file is part of ProEXR. 7 | // 8 | // ProEXR is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | // -------------------------------------------------------------------*/ 22 | 23 | #include "ProEXR_UTF.h" 24 | 25 | 26 | #ifdef __APPLE__ 27 | 28 | #include 29 | 30 | 31 | bool UTF8toUTF16(const std::string &str, utf16_char *buf, unsigned int max_len) 32 | { 33 | bool result = false; 34 | 35 | CFStringRef input = CFStringCreateWithCString(kCFAllocatorDefault, 36 | str.c_str(), 37 | kCFStringEncodingUTF8); 38 | 39 | if(input) 40 | { 41 | CFIndex len = CFStringGetLength(input); 42 | 43 | if(len < max_len) 44 | { 45 | CFRange range = {0, len}; 46 | 47 | CFIndex chars = CFStringGetBytes(input, range, 48 | kCFStringEncodingUTF16, '?', FALSE, 49 | (UInt8 *)buf, max_len * sizeof(utf16_char), NULL); 50 | 51 | result = (chars == len); 52 | 53 | buf[len] = '\0'; 54 | } 55 | 56 | 57 | CFRelease(input); 58 | } 59 | 60 | 61 | return result; 62 | } 63 | 64 | 65 | std::string UTF16toUTF8(const utf16_char *str) 66 | { 67 | std::string output; 68 | 69 | unsigned int len = 0; 70 | 71 | while(str[len] != '\0') 72 | len++; 73 | 74 | CFStringRef input = CFStringCreateWithBytes(kCFAllocatorDefault, 75 | (const UInt8 *)str, len * sizeof(utf16_char), 76 | kCFStringEncodingUTF16, FALSE); 77 | 78 | if(input) 79 | { 80 | CFIndex len = CFStringGetLength(input); 81 | 82 | CFRange range = {0, len}; 83 | 84 | CFIndex size = CFStringGetMaximumSizeForEncoding(len + 1, kCFStringEncodingUTF8); 85 | 86 | char buf[size]; 87 | 88 | CFIndex usedBufLen = 0; 89 | 90 | CFIndex chars = CFStringGetBytes(input, range, 91 | kCFStringEncodingUTF8, '?', FALSE, 92 | (UInt8 *)buf, size, &usedBufLen); 93 | 94 | buf[usedBufLen] = '\0'; 95 | 96 | output = buf; 97 | 98 | CFRelease(input); 99 | } 100 | 101 | return output; 102 | } 103 | 104 | #endif // __APPLE__ 105 | 106 | 107 | #ifdef WIN32 108 | 109 | #include 110 | 111 | bool UTF8toUTF16(const std::string &str, utf16_char *buf, unsigned int max_len) 112 | { 113 | int len = MultiByteToWideChar(CP_UTF8, 0, str.c_str(), -1, (LPWSTR)buf, max_len); 114 | 115 | return (len != 0); 116 | } 117 | 118 | 119 | std::string UTF16toUTF8(const utf16_char *str) 120 | { 121 | std::string output; 122 | 123 | // first one just returns the required length 124 | int len = WideCharToMultiByte(CP_UTF8, 0, (LPCWSTR)str, -1, NULL, 0, NULL, NULL); 125 | 126 | char *buf = new char[len]; 127 | 128 | int len2 = WideCharToMultiByte(CP_UTF8, 0, (LPCWSTR)str, -1, buf, len, NULL, NULL); 129 | 130 | output = buf; 131 | 132 | delete [] buf; 133 | 134 | return output; 135 | } 136 | 137 | 138 | #endif // WIN32 -------------------------------------------------------------------------------- /src/common/ProEXR_UTF.h: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | // 3 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 4 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 5 | // 6 | // This file is part of ProEXR. 7 | // 8 | // ProEXR is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | // -------------------------------------------------------------------*/ 22 | 23 | 24 | #ifndef UTF_H 25 | #define UTF_H 26 | 27 | #include 28 | 29 | typedef unsigned short utf16_char; 30 | 31 | bool UTF8toUTF16(const std::string &str, utf16_char *buf, unsigned int max_len); 32 | std::string UTF16toUTF8(const utf16_char *str); 33 | 34 | 35 | #endif // UTF_H -------------------------------------------------------------------------------- /src/common/VRimg/VRimgHeader.h: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | // 3 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 4 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 5 | // 6 | // This file is part of ProEXR. 7 | // 8 | // ProEXR is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | // -------------------------------------------------------------------*/ 22 | 23 | 24 | #ifndef VRIMG_HEADER_H 25 | #define VRIMG_HEADER_H 26 | 27 | #include 28 | #include 29 | 30 | #include 31 | 32 | 33 | namespace VRimg { 34 | 35 | typedef enum 36 | { 37 | FLOAT = 2, // float (32 bit floating point) 38 | INT = 4, // int (32 bit) 39 | 40 | NUM_PIXELTYPES = 2 // number of different pixel types 41 | } PixelType; 42 | 43 | #define RIF_FLAG_COMPRESSION 0x00000001 44 | 45 | typedef enum { 46 | RIT_RESOLUTION=0x100, ///< A tag with this ID contains information about the image resolution. 47 | RIT_REGIONSINFO, ///< A tag with this ID contains information about the regions (buckets) of the image. 48 | RIT_CHAN3F, ///< A tag with this ID contains pixel color information in floating-point RGB format, or 3D vector information in XYZ format. 49 | RIT_CHAN2F, ///< A tag with this ID contains pixel 2D vector information in floating-point XY format. 50 | RIT_CHANF, ///< A tag with this ID contains pixel floating point information. 51 | RIT_CHANI, ///< A tag with this ID contains pixel 32-bit integer information. 52 | RIT_CHAN_INFO, ///< A tag with ID contains information about the channels in the image. 53 | RIT_INDEX, ///< A tag with this ID contains the offset of the tag table in the file. 54 | RIT_CAMERA_INFO, ///< A tag with this ID contains information about the camera. 55 | RIT_RENDER_REGION, ///< A tag with information about the render region (data window). 56 | RIT_PREVIEW, ///< A tag for storing image preview directly in the file. 57 | RIT_SCENE_INFO,///< A tag with this ID contains information about the scene. 58 | RIT_STAMP, ///< A tag with this ID contains the stamp for the image. 59 | RIT_NOTE, ///< A tag with this ID contains user note about the image, 60 | } RIF_TAG_ID; 61 | 62 | /// A single tag in the file. The tag is immediately followed by any data associated with it. 63 | struct RIF_TAG { 64 | unsigned int tag; ///< The tag identifier. See RIF_TAG_ID for more information. 65 | unsigned int tagsize; ///< The size of the tag in bytes. This includes the size of this structure plus the size in bytes of any additional data for the tag. 66 | unsigned int p0; 67 | unsigned int p1; 68 | unsigned int p2; 69 | unsigned int p3; 70 | unsigned int p4; 71 | unsigned int p5; 72 | unsigned int p6; 73 | unsigned int p7; 74 | RIF_TAG() { tag=0; tagsize=0; p0=p1=p2=p3=p4=p5=p6=p7=0; } 75 | }; 76 | 77 | typedef struct Layer 78 | { 79 | int index; 80 | PixelType type; 81 | int alias; 82 | unsigned int flags; 83 | 84 | int dimensions; 85 | 86 | Layer(int i = 0, PixelType t = FLOAT, int a = 0, unsigned int f = 0, int d = 0) { index = i; type = t; alias = a; flags = f; dimensions = d; } 87 | } Layer; 88 | 89 | 90 | class Header 91 | { 92 | public: 93 | 94 | Header(int width = 64, int height = 64); 95 | ~Header(); 96 | 97 | unsigned int width() const { return _width; } 98 | unsigned int height() const { return _height; } 99 | float pixelAspectRatio() const { return _pixelAspectRatio; } 100 | 101 | bool isCompressed() const { return (_flags & RIF_FLAG_COMPRESSION); } 102 | 103 | void readFrom(Imf::IStream &is); 104 | 105 | 106 | typedef std::map LayerMap; 107 | 108 | const Layer *findLayer(std::string name) const; 109 | 110 | const LayerMap & layers() const { return _map; } 111 | 112 | 113 | private: 114 | 115 | bool moveToTag(Imf::IStream &is, RIF_TAG_ID tag, bool brute_force); 116 | bool parseTag(Imf::IStream &is, RIF_TAG_ID tag, bool brute_force = false); 117 | 118 | void parseTag(Imf::IStream &is, bool skip_ahead = true); 119 | 120 | Imf::Int64 _indexPos; 121 | unsigned int _flags; 122 | 123 | unsigned int _width; 124 | unsigned int _height; 125 | float _pixelAspectRatio; 126 | 127 | LayerMap _map; 128 | }; 129 | 130 | 131 | } // namespace VRimg 132 | 133 | 134 | #endif // VRIMG_HEADER_H -------------------------------------------------------------------------------- /src/common/VRimg/VRimgInputFile.h: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | // 3 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 4 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 5 | // 6 | // This file is part of ProEXR. 7 | // 8 | // ProEXR is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | // -------------------------------------------------------------------*/ 22 | 23 | 24 | #ifndef VRIMG_INPUT_FILE_H 25 | #define VRIMG_INPUT_FILE_H 26 | 27 | #include "VRimgHeader.h" 28 | 29 | #ifdef __APPLE__ 30 | #include 31 | typedef __gnu_cxx::crope Rope; 32 | #else 33 | typedef std::string Rope; 34 | #endif 35 | 36 | 37 | namespace VRimg { 38 | 39 | class InputFile 40 | { 41 | public: 42 | InputFile(Imf::IStream &is); 43 | ~InputFile(); 44 | 45 | const Header & header() const { return _header; } 46 | 47 | // used for pre-loading the whole image 48 | typedef std::map BufferMap; 49 | 50 | void loadFromFile(BufferMap *buf_map=NULL); 51 | 52 | void copyLayerToBuffer(const std::string &name, void *buf, size_t rowbytes); 53 | 54 | Rope getXMPdescription() const; 55 | 56 | private: 57 | void AddDescription(Rope &xmp) const; 58 | void DescribeTag(Rope &xmp) const; 59 | 60 | Header _header; 61 | 62 | Imf::IStream &_is; 63 | 64 | BufferMap _map; 65 | Rope _desc; 66 | 67 | void freeBuffers(); 68 | }; 69 | 70 | } // namespace VRimg 71 | 72 | #endif // VRIMG_INPUT_FILE_H -------------------------------------------------------------------------------- /src/common/VRimg/VRimgVersion.cpp: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | // 3 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 4 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 5 | // 6 | // This file is part of ProEXR. 7 | // 8 | // ProEXR is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | // -------------------------------------------------------------------*/ 22 | 23 | 24 | #include "VRimgVersion.h" 25 | 26 | namespace VRimg { 27 | 28 | bool isVRimgMagic(const char bytes[4]) 29 | { 30 | return bytes[0] == ((MAGIC >> 0) & 0x00ff) && 31 | bytes[1] == ((MAGIC >> 8) & 0x00ff) && 32 | bytes[2] == ((MAGIC >> 16) & 0x00ff) && 33 | bytes[3] == ((MAGIC >> 24) & 0x00ff); 34 | } 35 | 36 | } // namespace VRimg 37 | -------------------------------------------------------------------------------- /src/common/VRimg/VRimgVersion.h: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | // 3 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 4 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 5 | // 6 | // This file is part of ProEXR. 7 | // 8 | // ProEXR is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | // -------------------------------------------------------------------*/ 22 | 23 | 24 | #ifndef VRIMG_VERSION_H 25 | #define VRIMG_VERSION_H 26 | 27 | namespace VRimg { 28 | 29 | const unsigned int MAGIC = 0x52564d50; 30 | 31 | bool isVRimgMagic(const char bytes[4]); 32 | 33 | } // namespace VRimg 34 | 35 | 36 | #endif // VRIMG_VERSION_H -------------------------------------------------------------------------------- /src/common/iccProfileAttribute.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2017 Brendan Bolles (http://www.fnordware.com) 2 | // 3 | // Redistribution and use in source and binary forms, with or without modification, 4 | // are permitted provided that the following conditions are met: 5 | // 6 | // 1. Redistributions of source code must retain the above copyright notice, this list of 7 | // conditions and the following disclaimer. 8 | // 9 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 10 | // of conditions and the following disclaimer in the documentation and/or other 11 | // materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 14 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 15 | // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 16 | // SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 17 | // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 18 | // TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 19 | // BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 20 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 21 | // WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 22 | // 23 | 24 | 25 | 26 | #include "iccProfileAttribute.h" 27 | 28 | using namespace Imf; 29 | 30 | 31 | iccProfileAttribute::iccProfileAttribute() 32 | { 33 | _profile = NULL; 34 | _size = 0; 35 | } 36 | 37 | iccProfileAttribute::iccProfileAttribute(void *profile, size_t size) 38 | { 39 | _profile = malloc(_size = size); 40 | memcpy(_profile, profile, size); 41 | } 42 | 43 | iccProfileAttribute::~iccProfileAttribute() 44 | { 45 | if(_profile) 46 | { 47 | free(_profile); 48 | _profile = NULL; 49 | _size = 0; 50 | } 51 | } 52 | 53 | const void * 54 | iccProfileAttribute::value(size_t &size) const 55 | { 56 | size = _size; 57 | return _profile; 58 | } 59 | 60 | const char * 61 | iccProfileAttribute::typeName() const 62 | { 63 | return staticTypeName(); 64 | } 65 | 66 | const char * 67 | iccProfileAttribute::staticTypeName() 68 | { 69 | return "iccProfile"; 70 | } 71 | 72 | Attribute * 73 | iccProfileAttribute::copy() const 74 | { 75 | return new iccProfileAttribute(_profile, _size); 76 | } 77 | 78 | void 79 | iccProfileAttribute::writeValueTo(OStream &os, int version) const 80 | { 81 | if(_profile) 82 | Xdr::write(os, (char *)_profile, _size); 83 | else 84 | throw Iex::NullExc("Profile not initialized."); 85 | } 86 | 87 | void 88 | iccProfileAttribute::readValueFrom(IStream &is, int size, int version) 89 | { 90 | if(_profile) 91 | free(_profile); 92 | 93 | _profile = malloc(_size = size); 94 | 95 | Xdr::read(is, (char *)_profile, size); 96 | } 97 | 98 | void 99 | iccProfileAttribute::copyValueFrom(const Attribute &other) 100 | { 101 | const iccProfileAttribute &o = dynamic_cast( other ); 102 | 103 | if(_profile) 104 | free(_profile); 105 | 106 | if(o._profile && o._size) 107 | { 108 | _profile = malloc(_size = o._size); 109 | memcpy(_profile, o._profile, o._size); 110 | } 111 | else 112 | { 113 | _profile = NULL; 114 | _size = 0; 115 | } 116 | } 117 | 118 | Attribute * 119 | iccProfileAttribute::makeNewAttribute() 120 | { 121 | return new iccProfileAttribute(); 122 | } 123 | 124 | void 125 | iccProfileAttribute::registerAttributeType() 126 | { 127 | Attribute::registerAttributeType(staticTypeName(), makeNewAttribute); 128 | } 129 | 130 | 131 | #define STD_ICC_PROFILE_NAME "iccProfile" 132 | 133 | void 134 | addICCprofile(Header &header, const iccProfileAttribute &value) 135 | { 136 | header.insert(STD_ICC_PROFILE_NAME, value); 137 | } 138 | 139 | void 140 | addICCprofile(Header &header, void *profile, size_t size) 141 | { 142 | addICCprofile(header, iccProfileAttribute(profile, size)); 143 | } 144 | 145 | bool 146 | hasICCprofile(const Header &header) 147 | { 148 | return header.findTypedAttribute(STD_ICC_PROFILE_NAME) != 0; 149 | } 150 | 151 | const iccProfileAttribute & 152 | ICCprofileAttribute(const Header &header) 153 | { 154 | return header.typedAttribute(STD_ICC_PROFILE_NAME); 155 | } 156 | 157 | iccProfileAttribute & 158 | ICCprofileAttribute(Header &header) 159 | { 160 | return header.typedAttribute (STD_ICC_PROFILE_NAME); 161 | } 162 | 163 | -------------------------------------------------------------------------------- /src/common/iccProfileAttribute.h: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2017 Brendan Bolles (http://www.fnordware.com) 2 | // 3 | // Redistribution and use in source and binary forms, with or without modification, 4 | // are permitted provided that the following conditions are met: 5 | // 6 | // 1. Redistributions of source code must retain the above copyright notice, this list of 7 | // conditions and the following disclaimer. 8 | // 9 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 10 | // of conditions and the following disclaimer in the documentation and/or other 11 | // materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 14 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 15 | // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 16 | // SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 17 | // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 18 | // TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 19 | // BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 20 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 21 | // WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 22 | // 23 | 24 | 25 | #include 26 | #include 27 | 28 | class iccProfileAttribute : public Imf::Attribute 29 | { 30 | public: 31 | iccProfileAttribute(); 32 | iccProfileAttribute(void *profile, size_t size); 33 | virtual ~iccProfileAttribute(); 34 | 35 | const void *value(size_t &size) const; 36 | 37 | virtual const char *typeName() const; 38 | static const char *staticTypeName(); 39 | 40 | virtual Imf::Attribute *copy() const; 41 | 42 | virtual void writeValueTo(Imf::OStream &os, int version) const; 43 | virtual void readValueFrom (Imf::IStream &is, int size, int version); 44 | 45 | virtual void copyValueFrom(const Imf::Attribute &other); 46 | 47 | static Imf::Attribute *makeNewAttribute(); 48 | static void registerAttributeType(); 49 | 50 | protected: 51 | 52 | private: 53 | void *_profile; 54 | size_t _size; 55 | }; 56 | 57 | 58 | void addICCprofile(Imf::Header &header, const iccProfileAttribute &value); 59 | void addICCprofile(Imf::Header &header, void *profile, size_t size); 60 | bool hasICCprofile(const Imf::Header &header); 61 | const iccProfileAttribute & ICCprofileAttribute(const Imf::Header &header); 62 | iccProfileAttribute & ICCprofileAttribute(Imf::Header &header); -------------------------------------------------------------------------------- /src/photoshop/ProEXR.r: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fnordware/ProEXR/b256276a03f75b69904962cf4620ae94590528a1/src/photoshop/ProEXR.r -------------------------------------------------------------------------------- /src/photoshop/ProEXR_About.h: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | // 3 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 4 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 5 | // 6 | // This file is part of ProEXR. 7 | // 8 | // ProEXR is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | // -------------------------------------------------------------------*/ 22 | 23 | 24 | #ifndef __ProEXR_About_H__ 25 | #define __ProEXR_About_H__ 26 | 27 | #ifdef __APPLE__ 28 | void ProEXR_About(void); 29 | #else 30 | #include 31 | void ProEXR_About(HWND hwndOwner); 32 | #endif 33 | 34 | #endif // __ProEXR_About_H__ -------------------------------------------------------------------------------- /src/photoshop/ProEXR_Attributes.h: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | // 3 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 4 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 5 | // 6 | // This file is part of ProEXR. 7 | // 8 | // ProEXR is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | // -------------------------------------------------------------------*/ 22 | 23 | #ifndef __ProEXR_Attributes__ 24 | #define __ProEXR_Attributes__ 25 | 26 | 27 | #include 28 | 29 | void AddExtraAttributes(Imf::Header &header); 30 | std::string CreateXMPdescription(const ProEXRdoc_read &file); 31 | void ParseXMPdescription(Imf::Header &header, int width, int height, const char *xmp_text, size_t xmp_size); 32 | 33 | #endif // __ProEXR_Attributes__ -------------------------------------------------------------------------------- /src/photoshop/ProEXR_Color.h: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | // 3 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 4 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 5 | // 6 | // This file is part of ProEXR. 7 | // 8 | // ProEXR is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | // -------------------------------------------------------------------*/ 22 | 23 | #ifndef __Pro_EXR_Color_H__ 24 | #define __Pro_EXR_Color_H__ 25 | 26 | //#include 27 | //#include 28 | 29 | #include 30 | 31 | void initializeEXRcolor(); 32 | void GetEXRcolor(const Imf::Header &header, void **icc, size_t *prof_len); 33 | void SetEXRcolor(void *icc, size_t prof_len, Imf::Header &header); 34 | 35 | 36 | #endif // __Pro_EXR_Color_H__ -------------------------------------------------------------------------------- /src/photoshop/ProEXR_Deep.h: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | // 3 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 4 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 5 | // 6 | // This file is part of ProEXR. 7 | // 8 | // ProEXR is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | // -------------------------------------------------------------------*/ 22 | 23 | #ifndef __ProEXR_Deep_H__ 24 | #define __ProEXR_Deep_H__ 25 | 26 | 27 | // weird problem I'm having with A.h in Xcode 28 | #ifdef __GNUC__ 29 | typedef unsigned long long uint64_t; 30 | #endif 31 | 32 | 33 | #include "A.h" 34 | #include "PIDefines.h" // New in 7.0 SDK 35 | #include "PIFormat.h" // Format Photoshop header file. 36 | #include "PIExport.h" // Export Photoshop header file. 37 | #include "PIUtilities.h" // SDK Utility library. 38 | 39 | #include "ProEXR_PSIO.h" 40 | #include "ProEXRdoc_PS.h" 41 | 42 | /* 43 | enum { 44 | ALPHA_TRANSPARENCY = 1, 45 | ALPHA_SEPERATE 46 | }; 47 | typedef A_u_char AlphaMode ; 48 | 49 | typedef struct ProEXR_inData 50 | { 51 | AlphaMode alpha_mode; 52 | A_Boolean unmult; 53 | A_Boolean memory_map; 54 | char reserved[29]; // total of 32 bytes 55 | } ProEXR_inData; 56 | 57 | enum { 58 | WRITE_ALPHA_NONE = 1, 59 | WRITE_ALPHA_TRANSPARENCY, 60 | WRITE_ALPHA_CHANNEL 61 | }; 62 | typedef A_u_char WriteAlphaMode; 63 | 64 | typedef struct ProEXR_outData 65 | { 66 | A_u_char compression_type; 67 | A_Boolean float_not_half; 68 | A_Boolean luminance_chroma; 69 | WriteAlphaMode alpha_mode; 70 | char reserved[60]; // total of 64 bytes 71 | } ProEXR_outData; 72 | */ 73 | 74 | typedef struct Globals 75 | { // This is our structure that we use to pass globals between routines: 76 | 77 | short *result; // Must always be first in Globals. 78 | FormatRecord *formatParamBlock; // Must always be second in Globals. 79 | 80 | //ProEXR_outData options; 81 | //ProEXR_inData in_options; 82 | 83 | //IStreamPS *ps_in; 84 | //ProEXRdoc_readPS *doc_in; 85 | 86 | bool done_reg; 87 | 88 | } Globals, *GPtr, **GHdl; // *GPtr = global pointer; **GHdl = global handle 89 | 90 | 91 | //------------------------------------------------------------------------------- 92 | // Globals -- definitions and macros 93 | //------------------------------------------------------------------------------- 94 | 95 | #define gResult (*(globals->result)) 96 | #define gStuff (globals->formatParamBlock) 97 | 98 | #define gPixelBuffer (globals->pixelBuffer) 99 | #define gPixelData (globals->pixelData) 100 | #define gRowBytes (globals->rowBytes) 101 | 102 | #define gAliasHandle (globals->aliasHandle) 103 | 104 | #define gOptions (globals->options) 105 | #define gInOptions (globals->in_options) 106 | 107 | #define gDone_Reg globals->done_reg 108 | 109 | #ifndef MIN 110 | #define MIN(A,B) ( (A) < (B) ? (A) : (B) ) 111 | #define MAX(A,B) ( (A) > (B) ? (A) : (B) ) 112 | #endif 113 | 114 | //------------------------------------------------------------------------------- 115 | // Prototypes 116 | //------------------------------------------------------------------------------- 117 | 118 | #ifdef PS_CS4_SDK 119 | typedef intptr_t entryData; 120 | typedef void * allocateGlobalsPointer; 121 | #else 122 | typedef long entryData; 123 | typedef uint32 allocateGlobalsPointer; 124 | #endif 125 | 126 | // Everything comes in and out of PluginMain. It must be first routine in source (really?): 127 | DLLExport MACPASCAL void PluginMain (const short selector, 128 | FormatRecord *formatParamBlock, 129 | entryData *data, 130 | short *result); 131 | 132 | // dialogs 133 | 134 | #ifdef __PIWin__ 135 | //bool ProEXR_Write_Dialog(HWND hwndOwner, ProEXR_outData *options, const char *alpha_name, bool have_transparency, bool greyscale); 136 | //bool ProEXR_Read_Dialog(HWND hwndOwner, ProEXR_inData *in_options); 137 | #else 138 | //bool ProEXR_Write_Dialog(ProEXR_outData *options, const char *alpha_name, bool have_transparency, bool greyscale); 139 | //bool ProEXR_Read_Dialog(ProEXR_inData *in_options); 140 | #endif 141 | 142 | // scripting calls 143 | // During read phase: 144 | //Boolean ReadScriptParamsOnRead (GPtr globals); 145 | //OSErr WriteScriptParamsOnRead (GPtr globals); 146 | 147 | // During write phase: 148 | //Boolean ReadScriptParamsOnWrite (GPtr globals); 149 | //OSErr WriteScriptParamsOnWrite (GPtr globals); 150 | 151 | 152 | //------------------------------------------------------------------------------- 153 | 154 | #endif // __ProEXR_Deep_H__ 155 | -------------------------------------------------------------------------------- /src/photoshop/ProEXR_Deep.r: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fnordware/ProEXR/b256276a03f75b69904962cf4620ae94590528a1/src/photoshop/ProEXR_Deep.r -------------------------------------------------------------------------------- /src/photoshop/ProEXR_EZ.h: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | // 3 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 4 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 5 | // 6 | // This file is part of ProEXR. 7 | // 8 | // ProEXR is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | // -------------------------------------------------------------------*/ 22 | 23 | #ifndef __ProEXR_EZ_H__ 24 | #define __ProEXR_EZ_H__ 25 | 26 | 27 | // weird problem I'm having with A.h in Xcode 28 | #ifdef __GNUC__ 29 | typedef unsigned long long uint64_t; 30 | #endif 31 | 32 | 33 | #include "A.h" 34 | #include "PIDefines.h" // New in 7.0 SDK 35 | #include "PIFormat.h" // Format Photoshop header file. 36 | #include "PIExport.h" // Export Photoshop header file. 37 | #include "PIUtilities.h" // SDK Utility library. 38 | 39 | #include "ProEXR_PSIO.h" 40 | #include "ProEXRdoc_PS.h" 41 | 42 | 43 | enum { 44 | ALPHA_TRANSPARENCY = 1, 45 | ALPHA_SEPERATE 46 | }; 47 | typedef A_u_char AlphaMode ; 48 | 49 | typedef struct ProEXR_inData 50 | { 51 | AlphaMode alpha_mode; 52 | A_Boolean unmult; 53 | A_Boolean memory_map; 54 | char reserved[29]; // total of 32 bytes 55 | } ProEXR_inData; 56 | 57 | enum { 58 | WRITE_ALPHA_NONE = 1, 59 | WRITE_ALPHA_TRANSPARENCY, 60 | WRITE_ALPHA_CHANNEL 61 | }; 62 | typedef A_u_char WriteAlphaMode; 63 | 64 | typedef struct ProEXR_outData 65 | { 66 | A_u_char compression_type; 67 | A_Boolean float_not_half; 68 | A_Boolean luminance_chroma; 69 | WriteAlphaMode alpha_mode; 70 | char reserved[60]; // total of 64 bytes 71 | } ProEXR_outData; 72 | 73 | 74 | typedef struct Globals 75 | { // This is our structure that we use to pass globals between routines: 76 | 77 | short *result; // Must always be first in Globals. 78 | FormatRecord *formatParamBlock; // Must always be second in Globals. 79 | 80 | ProEXR_outData options; 81 | ProEXR_inData in_options; 82 | 83 | IStreamPS *ps_in; 84 | ProEXRdoc_readPS *doc_in; 85 | 86 | } Globals, *GPtr, **GHdl; // *GPtr = global pointer; **GHdl = global handle 87 | 88 | 89 | //------------------------------------------------------------------------------- 90 | // Globals -- definitions and macros 91 | //------------------------------------------------------------------------------- 92 | 93 | #define gResult (*(globals->result)) 94 | #define gStuff (globals->formatParamBlock) 95 | 96 | #define gPixelBuffer (globals->pixelBuffer) 97 | #define gPixelData (globals->pixelData) 98 | #define gRowBytes (globals->rowBytes) 99 | 100 | #define gAliasHandle (globals->aliasHandle) 101 | 102 | #define gOptions (globals->options) 103 | #define gInOptions (globals->in_options) 104 | 105 | 106 | #ifndef MIN 107 | #define MIN(A,B) ( (A) < (B) ? (A) : (B) ) 108 | #define MAX(A,B) ( (A) > (B) ? (A) : (B) ) 109 | #endif 110 | 111 | //------------------------------------------------------------------------------- 112 | // Prototypes 113 | //------------------------------------------------------------------------------- 114 | 115 | #ifdef PS_CS4_SDK 116 | typedef intptr_t entryData; 117 | typedef void * allocateGlobalsPointer; 118 | #else 119 | typedef long entryData; 120 | typedef uint32 allocateGlobalsPointer; 121 | #endif 122 | 123 | // Everything comes in and out of PluginMain. It must be first routine in source (really?): 124 | DLLExport MACPASCAL void PluginMain (const short selector, 125 | FormatRecord *formatParamBlock, 126 | entryData *data, 127 | short *result); 128 | 129 | // dialogs 130 | 131 | #ifdef __PIWin__ 132 | bool ProEXR_Write_Dialog(HWND hwndOwner, ProEXR_outData *options, const char *alpha_name, bool have_transparency, bool greyscale); 133 | bool ProEXR_Read_Dialog(HWND hwndOwner, ProEXR_inData *in_options); 134 | #else 135 | bool ProEXR_Write_Dialog(ProEXR_outData *options, const char *alpha_name, bool have_transparency, bool greyscale); 136 | bool ProEXR_Read_Dialog(ProEXR_inData *in_options); 137 | #endif 138 | 139 | // scripting calls 140 | // During read phase: 141 | //Boolean ReadScriptParamsOnRead (GPtr globals); 142 | //OSErr WriteScriptParamsOnRead (GPtr globals); 143 | 144 | // During write phase: 145 | Boolean ReadScriptParamsOnWrite (GPtr globals); 146 | OSErr WriteScriptParamsOnWrite (GPtr globals); 147 | 148 | 149 | //------------------------------------------------------------------------------- 150 | 151 | #endif // __ProEXR_EZ_H__ 152 | -------------------------------------------------------------------------------- /src/photoshop/ProEXR_EZ.r: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fnordware/ProEXR/b256276a03f75b69904962cf4620ae94590528a1/src/photoshop/ProEXR_EZ.r -------------------------------------------------------------------------------- /src/photoshop/ProEXR_PSIO.h: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | // 3 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 4 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 5 | // 6 | // This file is part of ProEXR. 7 | // 8 | // ProEXR is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | // -------------------------------------------------------------------*/ 22 | 23 | #ifndef __ProEXR_PSIO_H__ 24 | #define __ProEXR_PSIO_H__ 25 | 26 | #include 27 | 28 | 29 | #ifdef WIN32 30 | #include 31 | #endif 32 | 33 | 34 | #ifdef __APPLE__ 35 | #include 36 | 37 | #ifndef MAC_OS_X_VERSION_10_5 38 | #define MAC_OS_X_VERSION_10_5 1050 39 | #endif 40 | 41 | #if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5 42 | typedef unsigned short FSIORefNum; 43 | #endif 44 | #endif // __APPLE__ 45 | 46 | 47 | class IStreamPS : public Imf::IStream 48 | { 49 | public: 50 | 51 | IStreamPS(int refNum, const char fileName[]); 52 | virtual ~IStreamPS(); 53 | 54 | virtual bool isMemoryMapped() const; 55 | virtual bool read(char c[/*n*/], int n); 56 | virtual char *readMemoryMapped(int n); 57 | virtual Imf::Int64 tellg(); 58 | virtual void seekg(Imf::Int64 pos); 59 | 60 | // function to load the file into a buffer and start memory mapping 61 | void memoryMap(); 62 | void unMemoryMap(); 63 | 64 | private: 65 | Imf::Int64 file_size(); 66 | bool read_file(char c[/*n*/], int n); 67 | Imf::Int64 tellg_file(); 68 | void seekg_file(Imf::Int64 pos); 69 | 70 | 71 | private: 72 | void *_vfile; 73 | Imf::Int64 _voffset; 74 | Imf::Int64 _vsize; 75 | 76 | #ifdef __APPLE__ 77 | FSIORefNum _refNum; 78 | #endif 79 | 80 | #ifdef WIN32 81 | HANDLE _hFile; 82 | #endif 83 | }; 84 | 85 | 86 | class OStreamPS : public Imf::OStream 87 | { 88 | public: 89 | 90 | OStreamPS(int refNum, const char fileName[]); 91 | virtual ~OStreamPS() {} 92 | 93 | virtual void write(const char c[/*n*/], int n); 94 | virtual Imf::Int64 tellp(); 95 | virtual void seekp(Imf::Int64 pos); 96 | 97 | private: 98 | #ifdef __APPLE__ 99 | FSIORefNum _refNum; 100 | #endif 101 | 102 | #ifdef WIN32 103 | HANDLE _hFile; 104 | #endif 105 | }; 106 | 107 | #endif // __ProEXR_PSIO_H__ 108 | 109 | -------------------------------------------------------------------------------- /src/photoshop/ProEXR_Terminology.h: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | // 3 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 4 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 5 | // 6 | // This file is part of ProEXR. 7 | // 8 | // ProEXR is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | // -------------------------------------------------------------------*/ 22 | 23 | #ifndef __ProEXRTerminology_H__ 24 | #define __ProEXRTerminology_H__ 25 | 26 | 27 | //------------------------------------------------------------------------------- 28 | // Definitions -- Scripting keys 29 | //------------------------------------------------------------------------------- 30 | 31 | // output 32 | #define keyEXRcompression 'exrC' 33 | #define keyEXRfloat 'exrF' 34 | #define keyEXRlumichrom 'exrY' 35 | #define keyEXRcomposite 'exrT' 36 | #define keyEXRhidden 'exrH' 37 | #define keyEXRalpha 'exrL' 38 | 39 | // compression enum 40 | #define typeCompression 'enuC' 41 | 42 | #define compressionNone 'cNon' 43 | #define compressionRLE 'cRLE' 44 | #define compressionZip 'cZip' 45 | #define compressionZip16 'cZ16' 46 | #define compressionPiz 'cPiz' 47 | #define compressionPXR24 'cP24' 48 | #define compressionB44 'cB44' 49 | #define compressionB44A 'cB4A' 50 | #define compressionDWAA 'cDWA' 51 | #define compressionDWAB 'cDWB' 52 | 53 | // alpha enum (ProEXR EZ) 54 | #define typeAlphaChannel 'enuT' 55 | 56 | #define alphaChannelNone 'alfN' 57 | #define alphaChannelTransparency 'alfT' 58 | #define alphaChannelChannel 'alfC' 59 | 60 | 61 | // input 62 | #define keyEXRalphamode 'exrM' 63 | #define keyEXRunmult 'exrU' 64 | #define keyEXRignore 'exrI' 65 | 66 | // alpha mode enum 67 | #define typeAlphaMode 'enuA' 68 | 69 | #define alphamodeTransparency 'aTrn' 70 | #define alphamodeSeperate 'aSep' 71 | 72 | // export 73 | #define keyIn 'In ' 74 | 75 | 76 | #endif // __ProEXRTerminology_H__ 77 | -------------------------------------------------------------------------------- /src/photoshop/ProEXR_Version.h: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | // 3 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 4 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 5 | // 6 | // This file is part of ProEXR. 7 | // 8 | // ProEXR is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | // -------------------------------------------------------------------*/ 22 | 23 | #ifndef __ProEXR_Version_H__ 24 | #define __ProEXR_Version_H__ 25 | 26 | #define ProEXR_Major_Version 1 27 | #define ProEXR_Minor_Version 9 28 | #define ProEXR_Version_String "1.9.3" 29 | #define ProEXR_Build_Date __DATE__ 30 | #define ProEXR_Build_Date_Manual "4 January 2017" 31 | #define ProEXR_Build_Complete_Manual "v1.9.3 - 4 January 2017" 32 | #define ProEXR_Copyright_Year "2007-2017" 33 | #define ProEXR_Build_Year "2017" 34 | 35 | #define ProEXR_Category "OpenEXR" 36 | #define ProEXR_Priority 2 37 | #define ProEXR_EZ_Priority 1 38 | 39 | #define ProEXR_Description "A file format module for using OpenEXR files in Adobe Photoshop®." 40 | 41 | #endif // __ProEXR_Version_H__ 42 | -------------------------------------------------------------------------------- /src/photoshop/VRimg.h: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | // 3 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 4 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 5 | // 6 | // This file is part of ProEXR. 7 | // 8 | // ProEXR is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | // -------------------------------------------------------------------*/ 22 | 23 | #ifndef __VRIMG_H__ 24 | #define __VRIMG_H__ 25 | 26 | 27 | // weird problem I'm having with A.h in Xcode 28 | #ifdef __GNUC__ 29 | typedef unsigned long long uint64_t; 30 | #endif 31 | 32 | 33 | #include "A.h" 34 | #include "PIDefines.h" // New in 7.0 SDK 35 | #include "PIFormat.h" // Format Photoshop header file. 36 | #include "PIExport.h" // Export Photoshop header file. 37 | #include "PIUtilities.h" // SDK Utility library. 38 | 39 | #include "ProEXR_PSIO.h" 40 | #include "VRimgInputFile.h" 41 | #include 42 | #include 43 | 44 | 45 | 46 | 47 | typedef struct Globals 48 | { // This is our structure that we use to pass globals between routines: 49 | 50 | short *result; // Must always be first in Globals. 51 | FormatRecord *formatParamBlock; // Must always be second in Globals. 52 | 53 | IStreamPS *ps_in; 54 | VRimg::InputFile *doc_in; 55 | std::vector *layer_list; 56 | 57 | bool done_reg; 58 | 59 | BufferID blackID; 60 | Ptr blackBuf; 61 | int blackHeight; 62 | size_t blackRowbytes; 63 | 64 | BufferID whiteID; 65 | Ptr whiteBuf; 66 | int whiteHeight; 67 | size_t whiteRowbytes; 68 | 69 | } Globals, *GPtr, **GHdl; // *GPtr = global pointer; **GHdl = global handle 70 | 71 | 72 | //------------------------------------------------------------------------------- 73 | // Globals -- definitions and macros 74 | //------------------------------------------------------------------------------- 75 | 76 | #define gResult (*(globals->result)) 77 | //#define gStuff (globals->formatParamBlock) 78 | 79 | #define gDone_Reg globals->done_reg 80 | 81 | 82 | #ifndef MIN 83 | #define MIN(A,B) ( (A) < (B) ? (A) : (B) ) 84 | #define MAX(A,B) ( (A) > (B) ? (A) : (B) ) 85 | #endif 86 | 87 | //------------------------------------------------------------------------------- 88 | // Prototypes 89 | //------------------------------------------------------------------------------- 90 | 91 | #ifdef PS_CS4_SDK 92 | typedef intptr_t entryData; 93 | typedef void * allocateGlobalsPointer; 94 | #else 95 | typedef long entryData; 96 | typedef uint32 allocateGlobalsPointer; 97 | #endif 98 | 99 | // Everything comes in and out of PluginMain. It must be first routine in source (really?): 100 | DLLExport MACPASCAL void VRimgMain (const short selector, 101 | FormatRecord *formatParamBlock, 102 | entryData *data, 103 | short *result); 104 | 105 | 106 | #endif // __VRIMG_H__ 107 | -------------------------------------------------------------------------------- /src/photoshop/mac/ProEXR_About_Cocoa.mm: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | // 3 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 4 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 5 | // 6 | // This file is part of ProEXR. 7 | // 8 | // ProEXR is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | // -------------------------------------------------------------------*/ 22 | 23 | 24 | #include "ProEXR_About.h" 25 | 26 | #include "ProEXR_About_Controller.h" 27 | 28 | #include "ProEXR_Version.h" 29 | 30 | 31 | #ifdef PRO_EXR_EZ 32 | #define BUNDLE_ID "com.fnordware.Photoshop.ProEXR_EZ" 33 | #else 34 | #define BUNDLE_ID "com.fnordware.Photoshop.ProEXR" 35 | #endif 36 | 37 | // ============== 38 | // Only compiled on 64-bit 39 | // ============== 40 | #if __LP64__ 41 | 42 | void ProEXR_About(void) 43 | { 44 | Class about_controller_class = [[NSBundle bundleWithIdentifier:@BUNDLE_ID] 45 | classNamed:@"ProEXR_About_Controller"]; 46 | 47 | if(about_controller_class) 48 | { 49 | ProEXR_About_Controller *about_controller = [[about_controller_class alloc] 50 | init:@ProEXR_Version_String " - " ProEXR_Build_Date]; 51 | 52 | if(about_controller) 53 | { 54 | NSWindow *the_window = [about_controller getWindow]; 55 | 56 | if(the_window) 57 | { 58 | [NSApp runModalForWindow:the_window]; 59 | 60 | [the_window close]; 61 | } 62 | 63 | [about_controller release]; 64 | } 65 | } 66 | } 67 | 68 | 69 | #endif //__LP64__ 70 | -------------------------------------------------------------------------------- /src/photoshop/mac/ProEXR_About_Controller.h: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | // 3 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 4 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 5 | // 6 | // This file is part of ProEXR. 7 | // 8 | // ProEXR is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | // -------------------------------------------------------------------*/ 22 | 23 | #import 24 | 25 | @interface ProEXR_About_Controller : NSObject { 26 | IBOutlet NSWindow *theWindow; 27 | IBOutlet NSControl *versionText; 28 | } 29 | - (id)init:(NSString *)versionString; 30 | - (IBAction)clickOK:(id)sender; 31 | - (NSWindow *)getWindow; 32 | @end 33 | -------------------------------------------------------------------------------- /src/photoshop/mac/ProEXR_About_Controller.m: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | // 3 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 4 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 5 | // 6 | // This file is part of ProEXR. 7 | // 8 | // ProEXR is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | // -------------------------------------------------------------------*/ 22 | 23 | #import "ProEXR_About_Controller.h" 24 | 25 | @implementation ProEXR_About_Controller 26 | - (id)init:(NSString *)versionString { 27 | self = [super init]; 28 | 29 | if(!([NSBundle loadNibNamed:@"ProEXR_About" owner:self])) 30 | return nil; 31 | 32 | [theWindow center]; 33 | 34 | [versionText setStringValue:versionString]; 35 | 36 | return self; 37 | } 38 | 39 | - (IBAction)clickOK:(id)sender { 40 | [NSApp stopModal]; 41 | } 42 | 43 | - (NSWindow *)getWindow { 44 | return theWindow; 45 | } 46 | @end 47 | -------------------------------------------------------------------------------- /src/photoshop/mac/ProEXR_EZ_About_Cocoa.mm: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | // 3 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 4 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 5 | // 6 | // This file is part of ProEXR. 7 | // 8 | // ProEXR is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | // -------------------------------------------------------------------*/ 22 | 23 | 24 | #include "ProEXR_About.h" 25 | 26 | #include "ProEXR_EZ_About_Controller.h" 27 | 28 | #include "ProEXR_Version.h" 29 | 30 | 31 | // ============== 32 | // Only compiled on 64-bit 33 | // ============== 34 | #if __LP64__ 35 | 36 | void ProEXR_About(void) 37 | { 38 | Class about_controller_class = [[NSBundle bundleWithIdentifier:@"com.fnordware.Photoshop.ProEXR_EZ"] 39 | classNamed:@"ProEXR_EZ_About_Controller"]; 40 | 41 | if(about_controller_class) 42 | { 43 | ProEXR_EZ_About_Controller *about_controller = [[about_controller_class alloc] 44 | init:@ProEXR_Version_String " - " ProEXR_Build_Date]; 45 | 46 | if(about_controller) 47 | { 48 | NSWindow *the_window = [about_controller getWindow]; 49 | 50 | if(the_window) 51 | { 52 | [NSApp runModalForWindow:the_window]; 53 | 54 | [the_window close]; 55 | } 56 | 57 | [about_controller release]; 58 | } 59 | } 60 | } 61 | 62 | 63 | #endif //__LP64__ 64 | -------------------------------------------------------------------------------- /src/photoshop/mac/ProEXR_EZ_About_Controller.h: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | // 3 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 4 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 5 | // 6 | // This file is part of ProEXR. 7 | // 8 | // ProEXR is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | // -------------------------------------------------------------------*/ 22 | 23 | #import 24 | 25 | @interface ProEXR_EZ_About_Controller : NSObject { 26 | IBOutlet NSWindow *theWindow; 27 | IBOutlet NSControl *versionText; 28 | } 29 | - (id)init:(NSString *)versionString; 30 | - (IBAction)clickOK:(id)sender; 31 | - (NSWindow *)getWindow; 32 | @end 33 | -------------------------------------------------------------------------------- /src/photoshop/mac/ProEXR_EZ_About_Controller.m: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | // 3 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 4 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 5 | // 6 | // This file is part of ProEXR. 7 | // 8 | // ProEXR is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | // -------------------------------------------------------------------*/ 22 | 23 | #import "ProEXR_EZ_About_Controller.h" 24 | 25 | @implementation ProEXR_EZ_About_Controller 26 | - (id)init:(NSString *)versionString { 27 | self = [super init]; 28 | 29 | if(!([NSBundle loadNibNamed:@"ProEXR_EZ_About" owner:self])) 30 | return nil; 31 | 32 | [theWindow center]; 33 | 34 | [versionText setStringValue:versionString]; 35 | 36 | return self; 37 | } 38 | 39 | - (IBAction)clickOK:(id)sender { 40 | [NSApp stopModal]; 41 | } 42 | 43 | - (NSWindow *)getWindow { 44 | return theWindow; 45 | } 46 | @end 47 | -------------------------------------------------------------------------------- /src/photoshop/mac/ProEXR_EZ_Dialogs_Cocoa.mm: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | // 3 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 4 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 5 | // 6 | // This file is part of ProEXR. 7 | // 8 | // ProEXR is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | // -------------------------------------------------------------------*/ 22 | 23 | 24 | #include "ProEXR_EZ.h" 25 | 26 | #import "ProEXR_EZ_In_Prefs.h" 27 | #import "ProEXR_EZ_In_Controller.h" 28 | 29 | #import "ProEXR_EZ_Out_Controller.h" 30 | 31 | 32 | // ============== 33 | // Only compiled on 64-bit 34 | // ============== 35 | #if __LP64__ 36 | 37 | 38 | bool ProEXR_Write_Dialog(ProEXR_outData *options, const char *alpha_name, bool have_transparency, bool greyscale) 39 | { 40 | bool hit_ok = true; 41 | 42 | Class out_controller_class = [[NSBundle bundleWithIdentifier:@"com.fnordware.Photoshop.ProEXR_EZ"] 43 | classNamed:@"ProEXR_EZ_Out_Controller"]; 44 | 45 | if(out_controller_class) 46 | { 47 | ProEXR_EZ_Out_Controller *out_controller = [[out_controller_class alloc] 48 | init:options->compression_type 49 | lumiChrom:options->luminance_chroma 50 | useFloat:options->float_not_half 51 | alphaMode:(DialogAlphaMode)options->alpha_mode 52 | alphaName:alpha_name 53 | haveTransparency:have_transparency 54 | greyscale:greyscale 55 | ]; 56 | 57 | if(out_controller) 58 | { 59 | NSWindow *the_window = [out_controller getWindow]; 60 | 61 | if(the_window) 62 | { 63 | NSInteger modal_result = [NSApp runModalForWindow:the_window]; 64 | 65 | if(modal_result == NSRunStoppedResponse) 66 | { 67 | hit_ok = true; 68 | 69 | options->compression_type = [out_controller getCompression]; 70 | options->luminance_chroma = [out_controller getLumiChrom]; 71 | options->float_not_half = [out_controller getFloat]; 72 | options->alpha_mode = [out_controller getAlphaMode]; 73 | } 74 | else 75 | hit_ok = false; 76 | 77 | [the_window close]; 78 | } 79 | 80 | [out_controller release]; 81 | } 82 | } 83 | 84 | return hit_ok; 85 | } 86 | 87 | 88 | bool ProEXR_Read_Dialog(ProEXR_inData *in_options) 89 | { 90 | bool hit_ok = true; 91 | 92 | UInt32 keys = GetCurrentEventKeyModifiers(); 93 | bool option_key = ( (keys & shiftKey) || (keys & rightShiftKey) || (keys & optionKey) || (keys & rightOptionKey) ); 94 | 95 | ProEXR_EZ_In_Prefs *prefs_obj = [[ProEXR_EZ_In_Prefs alloc] init]; 96 | 97 | if(prefs_obj && (option_key || [prefs_obj getAlwaysDialog])) 98 | { 99 | Class in_controller_class = [[NSBundle bundleWithIdentifier:@"com.fnordware.Photoshop.ProEXR_EZ"] 100 | classNamed:@"ProEXR_EZ_In_Controller"]; 101 | 102 | if(in_controller_class) 103 | { 104 | ProEXR_EZ_Out_Controller *in_controller = [[in_controller_class alloc] init:prefs_obj]; 105 | 106 | if(in_controller) 107 | { 108 | NSWindow *the_window = [in_controller getWindow]; 109 | 110 | if(the_window) 111 | { 112 | NSInteger modal_result = [NSApp runModalForWindow:the_window]; 113 | 114 | if(modal_result == NSRunStoppedResponse) 115 | { 116 | hit_ok = true; 117 | 118 | [prefs_obj writeAlways]; 119 | } 120 | else 121 | hit_ok = false; 122 | 123 | [the_window close]; 124 | } 125 | 126 | [in_controller release]; 127 | } 128 | } 129 | } 130 | 131 | if(prefs_obj) 132 | { 133 | in_options->alpha_mode = [prefs_obj getAlphaMode]; 134 | in_options->unmult = [prefs_obj getUnMult]; 135 | in_options->memory_map = [prefs_obj getMemoryMap]; 136 | 137 | [prefs_obj release]; 138 | } 139 | 140 | 141 | return hit_ok; 142 | } 143 | 144 | 145 | 146 | #endif //__LP64__ 147 | -------------------------------------------------------------------------------- /src/photoshop/mac/ProEXR_EZ_In_Controller.h: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | // 3 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 4 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 5 | // 6 | // This file is part of ProEXR. 7 | // 8 | // ProEXR is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | // -------------------------------------------------------------------*/ 22 | 23 | #import 24 | 25 | #import "ProEXR_EZ_In_Prefs.h" 26 | 27 | @interface ProEXR_EZ_In_Controller : NSObject { 28 | IBOutlet NSMatrix *alphaModeRadioGroup; 29 | IBOutlet NSButton *unMultCheck; 30 | IBOutlet NSButton *memoryMapCheck; 31 | IBOutlet NSButton *alwaysDialogCheck; 32 | IBOutlet NSWindow *theWindow; 33 | 34 | ProEXR_EZ_In_Prefs *prefs_obj; 35 | } 36 | - (id)init:(ProEXR_EZ_In_Prefs *)prefs; 37 | 38 | - (IBAction)clickedCancel:(id)sender; 39 | - (IBAction)clickedOK:(id)sender; 40 | - (IBAction)setDefaults:(id)sender; 41 | - (IBAction)trackAlphaMode:(id)sender; 42 | 43 | - (NSWindow *)getWindow; 44 | @end 45 | -------------------------------------------------------------------------------- /src/photoshop/mac/ProEXR_EZ_In_Controller.m: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | // 3 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 4 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 5 | // 6 | // This file is part of ProEXR. 7 | // 8 | // ProEXR is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | // -------------------------------------------------------------------*/ 22 | 23 | #import "ProEXR_EZ_In_Controller.h" 24 | 25 | @implementation ProEXR_EZ_In_Controller 26 | 27 | - (id)init:(ProEXR_EZ_In_Prefs *)prefs { 28 | 29 | if(prefs == NULL) 30 | return nil; 31 | 32 | self = [super init]; 33 | 34 | if(!([NSBundle loadNibNamed:@"ProEXR_EZ_In" owner:self])) 35 | return nil; 36 | 37 | [theWindow center]; 38 | 39 | [alphaModeRadioGroup selectCellAtRow:([prefs getAlphaMode] - 1) column:0]; 40 | [unMultCheck setState:([prefs getUnMult] ? NSOnState : NSOffState)]; 41 | [memoryMapCheck setState:([prefs getMemoryMap] ? NSOnState : NSOffState)]; 42 | [alwaysDialogCheck setState:([prefs getAlwaysDialog] ? NSOnState : NSOffState)]; 43 | 44 | [self trackAlphaMode:nil]; 45 | 46 | prefs_obj = prefs; 47 | 48 | return self; 49 | } 50 | 51 | - (IBAction)clickedCancel:(id)sender { 52 | [NSApp abortModal]; 53 | } 54 | 55 | - (IBAction)clickedOK:(id)sender { 56 | [prefs_obj setAlphaMode:([alphaModeRadioGroup selectedRow] == 1 ? PREFS_ALPHA_SEPARATE : PREFS_ALPHA_TRANSPARENCY)]; 57 | [prefs_obj setUnMult:([unMultCheck state] == NSOnState)]; 58 | [prefs_obj setMemoryMap:([memoryMapCheck state] == NSOnState)]; 59 | [prefs_obj setAlwaysDialog:([alwaysDialogCheck state] == NSOnState)]; 60 | 61 | [NSApp stopModal]; 62 | } 63 | 64 | - (IBAction)setDefaults:(id)sender { 65 | [prefs_obj setAlphaMode:([alphaModeRadioGroup selectedRow] == 1 ? PREFS_ALPHA_SEPARATE : PREFS_ALPHA_TRANSPARENCY)]; 66 | [prefs_obj setUnMult:([unMultCheck state] == NSOnState)]; 67 | [prefs_obj setMemoryMap:([memoryMapCheck state] == NSOnState)]; 68 | [prefs_obj setAlwaysDialog:([alwaysDialogCheck state] == NSOnState)]; 69 | 70 | [prefs_obj writePrefs]; 71 | } 72 | 73 | - (IBAction)trackAlphaMode:(id)sender { 74 | [unMultCheck setEnabled:([alphaModeRadioGroup selectedRow] == 1)]; 75 | } 76 | 77 | - (NSWindow *)getWindow { 78 | return theWindow; 79 | } 80 | 81 | @end 82 | -------------------------------------------------------------------------------- /src/photoshop/mac/ProEXR_EZ_In_Prefs.h: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | // 3 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 4 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 5 | // 6 | // This file is part of ProEXR. 7 | // 8 | // ProEXR is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | // -------------------------------------------------------------------*/ 22 | 23 | 24 | #import 25 | 26 | typedef enum { 27 | PREFS_ALPHA_TRANSPARENCY = 1, 28 | PREFS_ALPHA_SEPARATE 29 | } PrefsAlphaMode; 30 | 31 | 32 | @interface ProEXR_EZ_In_Prefs : NSObject { 33 | PrefsAlphaMode alpha_mode; 34 | BOOL unmult; 35 | BOOL memory_map; 36 | BOOL always_dialog; 37 | } 38 | 39 | - (id)init; 40 | 41 | - (PrefsAlphaMode)getAlphaMode; 42 | - (BOOL)getUnMult; 43 | - (BOOL)getMemoryMap; 44 | - (BOOL)getAlwaysDialog; 45 | 46 | - (void)setAlphaMode:(PrefsAlphaMode)alphaMode; 47 | - (void)setUnMult:(BOOL)un_mult; 48 | - (void)setMemoryMap:(BOOL)mem_map; 49 | - (void)setAlwaysDialog:(BOOL)alwaysDialog; 50 | 51 | - (void)readPrefs; 52 | - (void)writePrefs; 53 | - (void)writeAlways; 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /src/photoshop/mac/ProEXR_EZ_Out_Controller.h: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | // 3 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 4 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 5 | // 6 | // This file is part of ProEXR. 7 | // 8 | // ProEXR is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | // -------------------------------------------------------------------*/ 22 | 23 | #import 24 | 25 | typedef enum { 26 | DIALOG_WRITE_ALPHA_NONE = 1, 27 | DIALOG_WRITE_ALPHA_TRANSPARENCY, 28 | DIALOG_WRITE_ALPHA_CHANNEL 29 | } DialogAlphaMode; 30 | 31 | 32 | @interface ProEXR_EZ_Out_Controller : NSObject { 33 | IBOutlet NSMatrix *alphaRadioGroup; 34 | IBOutlet NSPopUpButton *compressionPulldown; 35 | IBOutlet NSButton *floatCheck; 36 | IBOutlet NSTextField *floatLabel; 37 | IBOutlet NSButton *lumiChromCheck; 38 | IBOutlet NSWindow *theWindow; 39 | } 40 | - (id)init:(int)compression lumiChrom:(BOOL)lumiChromVal useFloat:(BOOL)floatVal alphaMode:(DialogAlphaMode)alphaModeVal 41 | alphaName:(const char *)alphaNameVal haveTransparency:(BOOL)haveTrans greyscale:(BOOL)isGrey; 42 | 43 | - (int)getCompression; 44 | - (BOOL)getLumiChrom; 45 | - (BOOL)getFloat; 46 | - (DialogAlphaMode)getAlphaMode; 47 | 48 | - (IBAction)clickedCancel:(id)sender; 49 | - (IBAction)clickedOK:(id)sender; 50 | - (IBAction)trackLumiChrom:(id)sender; 51 | 52 | - (NSWindow *)getWindow; 53 | @end 54 | -------------------------------------------------------------------------------- /src/photoshop/mac/ProEXR_EZ_Out_Controller.m: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | // 3 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 4 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 5 | // 6 | // This file is part of ProEXR. 7 | // 8 | // ProEXR is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | // -------------------------------------------------------------------*/ 22 | 23 | #import "ProEXR_EZ_Out_Controller.h" 24 | 25 | @implementation ProEXR_EZ_Out_Controller 26 | 27 | - (id)init:(int)compression lumiChrom:(BOOL)lumiChromVal useFloat:(BOOL)floatVal alphaMode:(DialogAlphaMode)alphaModeVal 28 | alphaName:(const char *)alphaNameVal haveTransparency:(BOOL)haveTrans greyscale:(BOOL)isGrey 29 | { 30 | self = [super init]; 31 | 32 | if(!([NSBundle loadNibNamed:@"ProEXR_EZ_Out" owner:self])) 33 | return nil; 34 | 35 | [theWindow center]; 36 | 37 | [compressionPulldown removeAllItems]; 38 | [compressionPulldown addItemsWithTitles: 39 | [NSArray arrayWithObjects:@"None", @"RLE", @"Zip", @"Zip16", @"Piz", @"PXR24", @"B44", @"B44A", @"DWAA", @"DWAB", nil]]; 40 | [compressionPulldown selectItem:[compressionPulldown itemAtIndex:compression]]; 41 | 42 | [lumiChromCheck setState:(lumiChromVal ? NSOnState : NSOffState)]; 43 | 44 | if(isGrey) 45 | [lumiChromCheck setEnabled:FALSE]; 46 | else 47 | [self trackLumiChrom:nil]; 48 | 49 | [floatCheck setState:(floatVal ? NSOnState : NSOffState)]; 50 | 51 | if(!haveTrans) 52 | { 53 | if(alphaModeVal == DIALOG_WRITE_ALPHA_TRANSPARENCY) 54 | alphaModeVal = (alphaNameVal != NULL ? DIALOG_WRITE_ALPHA_CHANNEL : DIALOG_WRITE_ALPHA_NONE); 55 | 56 | [[alphaRadioGroup cellAtRow:1 column:0] setEnabled:FALSE]; 57 | } 58 | 59 | if(alphaNameVal == NULL) 60 | { 61 | if(alphaModeVal == DIALOG_WRITE_ALPHA_CHANNEL) 62 | alphaModeVal = (haveTrans ? DIALOG_WRITE_ALPHA_TRANSPARENCY : DIALOG_WRITE_ALPHA_NONE); 63 | 64 | [[alphaRadioGroup cellAtRow:2 column:0] setEnabled:FALSE]; 65 | } 66 | else 67 | { 68 | [[alphaRadioGroup cellAtRow:2 column:0] setTitle:[NSString stringWithFormat:@"Channel \"%s\"", alphaNameVal]]; 69 | } 70 | 71 | [alphaRadioGroup selectCellAtRow:(alphaModeVal - 1) column:0]; 72 | 73 | return self; 74 | } 75 | 76 | - (int)getCompression { 77 | return [compressionPulldown indexOfSelectedItem]; 78 | } 79 | 80 | - (BOOL)getLumiChrom { 81 | return ([lumiChromCheck state] == NSOnState); 82 | } 83 | 84 | - (BOOL)getFloat { 85 | return ([floatCheck state] == NSOnState); 86 | } 87 | 88 | - (DialogAlphaMode)getAlphaMode { 89 | return ([alphaRadioGroup selectedRow] + 1); 90 | } 91 | 92 | - (IBAction)clickedCancel:(id)sender { 93 | [NSApp abortModal]; 94 | } 95 | 96 | - (IBAction)clickedOK:(id)sender { 97 | [NSApp stopModal]; 98 | } 99 | 100 | - (IBAction)trackLumiChrom:(id)sender { 101 | BOOL enabled = ([lumiChromCheck state] == NSOffState); 102 | NSColor *label_color = (enabled ? [NSColor textColor] : [NSColor disabledControlTextColor]); 103 | 104 | [floatCheck setEnabled:enabled]; 105 | [floatLabel setTextColor:label_color]; 106 | 107 | [label_color release]; 108 | } 109 | 110 | - (NSWindow *)getWindow { 111 | return theWindow; 112 | } 113 | 114 | @end 115 | -------------------------------------------------------------------------------- /src/photoshop/mac/ProEXR_In_Controller.h: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | // 3 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 4 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 5 | // 6 | // This file is part of ProEXR. 7 | // 8 | // ProEXR is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | // -------------------------------------------------------------------*/ 22 | 23 | #import 24 | 25 | #import "ProEXR_In_Prefs.h" 26 | 27 | @interface ProEXR_In_Controller : NSObject { 28 | IBOutlet NSMatrix *alphaModeRadioGroup; 29 | IBOutlet NSButton *unMultCheck; 30 | IBOutlet NSButton *ignoreLayeringCheck; 31 | IBOutlet NSButton *memoryMapCheck; 32 | IBOutlet NSButton *alwaysDialogCheck; 33 | IBOutlet NSWindow *theWindow; 34 | 35 | ProEXR_In_Prefs *prefs_obj; 36 | } 37 | - (id)init:(ProEXR_In_Prefs *)prefs; 38 | 39 | - (IBAction)clickedCancel:(id)sender; 40 | - (IBAction)clickedOK:(id)sender; 41 | - (IBAction)setDefaults:(id)sender; 42 | - (IBAction)trackAlphaMode:(id)sender; 43 | 44 | - (NSWindow *)getWindow; 45 | @end 46 | -------------------------------------------------------------------------------- /src/photoshop/mac/ProEXR_In_Controller.m: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | // 3 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 4 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 5 | // 6 | // This file is part of ProEXR. 7 | // 8 | // ProEXR is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | // -------------------------------------------------------------------*/ 22 | 23 | #import "ProEXR_In_Controller.h" 24 | 25 | @implementation ProEXR_In_Controller 26 | 27 | - (id)init:(ProEXR_In_Prefs *)prefs { 28 | 29 | if(prefs == NULL) 30 | return nil; 31 | 32 | self = [super init]; 33 | 34 | if(!([NSBundle loadNibNamed:@"ProEXR_In" owner:self])) 35 | return nil; 36 | 37 | [theWindow center]; 38 | 39 | [alphaModeRadioGroup selectCellAtRow:([prefs getAlphaMode] - 1) column:0]; 40 | [unMultCheck setState:([prefs getUnMult] ? NSOnState : NSOffState)]; 41 | [ignoreLayeringCheck setState:([prefs getIgnoreLayerText] ? NSOnState : NSOffState)]; 42 | [memoryMapCheck setState:([prefs getMemoryMap] ? NSOnState : NSOffState)]; 43 | [alwaysDialogCheck setState:([prefs getAlwaysDialog] ? NSOnState : NSOffState)]; 44 | 45 | [self trackAlphaMode:nil]; 46 | 47 | prefs_obj = prefs; 48 | 49 | return self; 50 | } 51 | 52 | - (IBAction)clickedCancel:(id)sender { 53 | [NSApp abortModal]; 54 | } 55 | 56 | - (IBAction)clickedOK:(id)sender { 57 | [prefs_obj setAlphaMode:([alphaModeRadioGroup selectedRow] == 1 ? PREFS_ALPHA_SEPARATE : PREFS_ALPHA_TRANSPARENCY)]; 58 | [prefs_obj setUnMult:([unMultCheck state] == NSOnState)]; 59 | [prefs_obj setIgnoreLayerText:([ignoreLayeringCheck state] == NSOnState)]; 60 | [prefs_obj setMemoryMap:([memoryMapCheck state] == NSOnState)]; 61 | [prefs_obj setAlwaysDialog:([alwaysDialogCheck state] == NSOnState)]; 62 | 63 | [NSApp stopModal]; 64 | } 65 | 66 | - (IBAction)setDefaults:(id)sender { 67 | [prefs_obj setAlphaMode:([alphaModeRadioGroup selectedRow] == 1 ? PREFS_ALPHA_SEPARATE : PREFS_ALPHA_TRANSPARENCY)]; 68 | [prefs_obj setUnMult:([unMultCheck state] == NSOnState)]; 69 | [prefs_obj setIgnoreLayerText:([ignoreLayeringCheck state] == NSOnState)]; 70 | [prefs_obj setMemoryMap:([memoryMapCheck state] == NSOnState)]; 71 | [prefs_obj setAlwaysDialog:([alwaysDialogCheck state] == NSOnState)]; 72 | 73 | [prefs_obj writePrefs]; 74 | } 75 | 76 | - (IBAction)trackAlphaMode:(id)sender { 77 | [unMultCheck setEnabled:([alphaModeRadioGroup selectedRow] == 1)]; 78 | } 79 | 80 | - (NSWindow *)getWindow { 81 | return theWindow; 82 | } 83 | 84 | @end 85 | -------------------------------------------------------------------------------- /src/photoshop/mac/ProEXR_In_Prefs.h: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | // 3 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 4 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 5 | // 6 | // This file is part of ProEXR. 7 | // 8 | // ProEXR is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | // -------------------------------------------------------------------*/ 22 | 23 | #import 24 | 25 | typedef enum { 26 | PREFS_ALPHA_TRANSPARENCY = 1, 27 | PREFS_ALPHA_SEPARATE 28 | } PrefsAlphaMode; 29 | 30 | 31 | @interface ProEXR_In_Prefs : NSObject { 32 | PrefsAlphaMode alpha_mode; 33 | BOOL unmult; 34 | BOOL ignore_layertext; 35 | BOOL memory_map; 36 | BOOL always_dialog; 37 | } 38 | 39 | - (id)init; 40 | 41 | - (PrefsAlphaMode)getAlphaMode; 42 | - (BOOL)getUnMult; 43 | - (BOOL)getIgnoreLayerText; 44 | - (BOOL)getMemoryMap; 45 | - (BOOL)getAlwaysDialog; 46 | 47 | - (void)setAlphaMode:(PrefsAlphaMode)alphaMode; 48 | - (void)setUnMult:(BOOL)un_mult; 49 | - (void)setIgnoreLayerText:(BOOL)ignoreLayerText; 50 | - (void)setMemoryMap:(BOOL)mem_map; 51 | - (void)setAlwaysDialog:(BOOL)alwaysDialog; 52 | 53 | - (void)readPrefs; 54 | - (void)writePrefs; 55 | - (void)writeAlways; 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /src/photoshop/mac/ProEXR_Out_Controller.h: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | // 3 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 4 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 5 | // 6 | // This file is part of ProEXR. 7 | // 8 | // ProEXR is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | // -------------------------------------------------------------------*/ 22 | 23 | #import 24 | 25 | @interface ProEXR_Out_Controller : NSObject { 26 | IBOutlet NSButton *compositeCheck; 27 | IBOutlet NSPopUpButton *compressionMenu; 28 | IBOutlet NSButton *floatCheck; 29 | IBOutlet NSButton *hiddenCheck; 30 | IBOutlet NSButton *lumiChromCheck; 31 | IBOutlet NSWindow *theWindow; 32 | } 33 | - (id)init:(int)compression lumiChrom:(BOOL)lumiChromVal useFloat:(BOOL)floatVal composite:(BOOL)compositeVal hidden:(BOOL)hiddenVal 34 | layers:(int)numLayers hiddenLayers:(BOOL)haveHiddenLayers; 35 | 36 | - (IBAction)clickedCancel:(id)sender; 37 | - (IBAction)clickedOK:(id)sender; 38 | - (IBAction)trackLumiChrom:(id)sender; 39 | 40 | - (NSInteger)getCompression; 41 | - (BOOL)getLumiChrom; 42 | - (BOOL)getFloat; 43 | - (BOOL)getComposite; 44 | - (BOOL)getHidden; 45 | 46 | - (NSWindow *)getWindow; 47 | @end 48 | -------------------------------------------------------------------------------- /src/photoshop/mac/ProEXR_Out_Controller.m: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | // 3 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 4 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 5 | // 6 | // This file is part of ProEXR. 7 | // 8 | // ProEXR is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | // -------------------------------------------------------------------*/ 22 | 23 | #import "ProEXR_Out_Controller.h" 24 | 25 | @implementation ProEXR_Out_Controller 26 | 27 | - (id)init:(int)compression lumiChrom:(BOOL)lumiChromVal useFloat:(BOOL)floatVal composite:(BOOL)compositeVal hidden:(BOOL)hiddenVal 28 | layers:(int)numLayers hiddenLayers:(BOOL)haveHiddenLayers 29 | { 30 | self = [super init]; 31 | 32 | if(!([NSBundle loadNibNamed:@"ProEXR_Out" owner:self])) 33 | return nil; 34 | 35 | [theWindow center]; 36 | 37 | [compressionMenu removeAllItems]; 38 | [compressionMenu addItemsWithTitles: 39 | [NSArray arrayWithObjects:@"None", @"RLE", @"Zip", @"Zip16", @"Piz", @"PXR24", @"B44", @"B44A", @"DWAA", @"DWAB", nil]]; 40 | [compressionMenu selectItem:[compressionMenu itemAtIndex:compression]]; 41 | 42 | [lumiChromCheck setState:(lumiChromVal ? NSOnState : NSOffState)]; 43 | [floatCheck setState:(floatVal ? NSOnState : NSOffState)]; 44 | [compositeCheck setState:(compositeVal ? NSOnState : NSOffState)]; 45 | [hiddenCheck setState:(hiddenVal ? NSOnState : NSOffState)]; 46 | 47 | if(numLayers > 1) 48 | { 49 | [lumiChromCheck setEnabled:FALSE]; 50 | } 51 | else 52 | { 53 | [self trackLumiChrom:nil]; 54 | [compositeCheck setEnabled:FALSE]; 55 | } 56 | 57 | if(!haveHiddenLayers) 58 | [hiddenCheck setEnabled:FALSE]; 59 | 60 | return self; 61 | } 62 | 63 | - (IBAction)clickedCancel:(id)sender { 64 | [NSApp abortModal]; 65 | } 66 | 67 | - (IBAction)clickedOK:(id)sender { 68 | [NSApp stopModal]; 69 | } 70 | 71 | - (IBAction)trackLumiChrom:(id)sender { 72 | [floatCheck setEnabled:([lumiChromCheck state] == NSOffState)]; 73 | } 74 | 75 | - (NSInteger)getCompression { 76 | return [compressionMenu indexOfSelectedItem]; 77 | } 78 | 79 | - (BOOL)getLumiChrom { 80 | return ([lumiChromCheck state] == NSOnState); 81 | } 82 | 83 | - (BOOL)getFloat { 84 | return ([floatCheck state] == NSOnState); 85 | } 86 | 87 | - (BOOL)getComposite { 88 | return ([compositeCheck state] == NSOnState); 89 | } 90 | 91 | - (BOOL)getHidden { 92 | return ([hiddenCheck state] == NSOnState); 93 | } 94 | 95 | - (NSWindow *)getWindow { 96 | return theWindow; 97 | } 98 | 99 | @end 100 | -------------------------------------------------------------------------------- /src/photoshop/mac/ProEXR_banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fnordware/ProEXR/b256276a03f75b69904962cf4620ae94590528a1/src/photoshop/mac/ProEXR_banner.png -------------------------------------------------------------------------------- /src/photoshop/mac/carbon/Out_Dialog.nib/classes.nib: -------------------------------------------------------------------------------- 1 | { 2 | IBClasses = (); 3 | IBVersion = 1; 4 | } 5 | -------------------------------------------------------------------------------- /src/photoshop/mac/carbon/Out_Dialog.nib/info.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBDocumentLocation 6 | 69 143 356 240 0 0 1920 1178 7 | IBFramework Version 8 | 446.1 9 | IBOpenObjects 10 | 11 | 195 12 | 166 13 | 14 | IBSystem Version 15 | 8P2137 16 | targetFramework 17 | IBCarbonFramework 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/photoshop/mac/carbon/ProEXR_About.r: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | // 3 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 4 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 5 | // 6 | // This file is part of ProEXR. 7 | // 8 | // ProEXR is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | // -------------------------------------------------------------------*/ 22 | 23 | #include "Types.r" 24 | #include "SysTypes.r" 25 | 26 | #include "ProEXR_Version.h" 27 | 28 | #define OutID 16100 29 | #define AboutID 16101 30 | #define RegID 16102 31 | #define InID 16103 32 | 33 | 34 | 35 | resource 'DLOG' (AboutID, "About", purgeable) 36 | { 37 | {797, 504, 1016, 794}, 38 | movableDBoxProc, 39 | visible, 40 | noGoAway, 41 | 0x0, 42 | AboutID, 43 | "About ProEXR", 44 | alertPositionMainScreen // Universal 3.0 headers. 45 | }; 46 | 47 | resource 'dlgx' (AboutID) { 48 | versionZero { 49 | kDialogFlagsHandleMovableModal + kDialogFlagsUseThemeControls + kDialogFlagsUseThemeBackground + kDialogFlagsUseControlHierarchy 50 | } 51 | }; 52 | 53 | resource 'DITL' (AboutID, "About Items", purgeable) 54 | { 55 | { 56 | {179, 110, 199, 179}, Button { enabled, "OK" }, 57 | {63, 20, 79, 270}, StaticText { disabled, "ProEXR" }, 58 | {79, 20, 95, 270}, StaticText { disabled, "by Brendan Bolles" }, 59 | {95, 20, 111, 270}, StaticText { disabled, "www.fnordware.com" }, 60 | {130, 20, 146, 270}, StaticText { disabled, "v" ProEXR_Version_String " - " ProEXR_Build_Date_Manual }, 61 | {146, 20, 175, 270}, StaticText { disabled, "Portions copyright Industrial Light + Magic.\rSee documentation for details." }, 62 | {5, 20, 55, 270}, Picture { disabled, 1901 }, 63 | } 64 | }; 65 | 66 | 67 | -------------------------------------------------------------------------------- /src/photoshop/mac/carbon/ProEXR_About_Carbon.cpp: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | // 3 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 4 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 5 | // 6 | // This file is part of ProEXR. 7 | // 8 | // ProEXR is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | // -------------------------------------------------------------------*/ 22 | 23 | 24 | #include "ProEXR_About.h" 25 | 26 | #include 27 | 28 | enum { 29 | DIALOG_ID = 16100, 30 | ABOUT_ID, 31 | REG_ID, 32 | IMPORT_ID 33 | }; 34 | 35 | 36 | enum { 37 | ABOUT_OK = 1, 38 | ABOUT_NAME, 39 | ABOUT_BY, 40 | ABOUT_WEBSITE, 41 | ABOUT_VERSION, 42 | ABOUT_COPYRIGHT1 43 | }; 44 | 45 | // ============== 46 | // Only compiled on 32-bit 47 | // ============== 48 | #if !__LP64__ 49 | 50 | 51 | void ProEXR_About(void) 52 | { 53 | DialogRef dp = GetNewDialog (ABOUT_ID, nil, (WindowPtr) -1); // instantiate the dialog 54 | 55 | if(dp) 56 | { 57 | ControlRef name_ctl = NULL, 58 | by_ctl = NULL, 59 | website_ctl = NULL, 60 | version_ctl = NULL, 61 | copyright1_ctl = NULL; 62 | 63 | GetDialogItemAsControl(dp, ABOUT_NAME, &name_ctl); 64 | GetDialogItemAsControl(dp, ABOUT_BY, &by_ctl); 65 | GetDialogItemAsControl(dp, ABOUT_WEBSITE, &website_ctl); 66 | GetDialogItemAsControl(dp, ABOUT_VERSION, &version_ctl); 67 | GetDialogItemAsControl(dp, ABOUT_COPYRIGHT1, ©right1_ctl); 68 | 69 | // justify copyright 70 | ControlFontStyleRec normal_style = {kControlUseJustMask, 0, 0, 0, 0, teCenter, {0,0,0}, {0,0,0} }; 71 | ControlFontStyleRec title_style = {kControlUseJustMask | kControlUseFaceMask, 0, 0, 1, 0, teCenter, {0,0,0}, {0,0,0} }; 72 | ControlFontStyleRec version_style = {kControlUseJustMask | kControlUseSizeMask, 0, 11, 0, 0, teCenter, {0,0,0}, {0,0,0} }; 73 | ControlFontStyleRec copyright_style = {kControlUseJustMask | kControlUseSizeMask, 0, 9, 0, 0, teCenter, {0,0,0}, {0,0,0} }; 74 | 75 | SetControlFontStyle(name_ctl, &title_style); 76 | SetControlFontStyle(by_ctl, &version_style); 77 | SetControlFontStyle(website_ctl, &version_style); 78 | SetControlFontStyle(version_ctl, &version_style); 79 | SetControlFontStyle(copyright1_ctl, ©right_style); 80 | 81 | 82 | ShowWindow((WindowRef)dp); 83 | DrawDialog(dp); 84 | 85 | short item; 86 | do{ 87 | ModalDialog(NULL, &item); 88 | }while(item > ABOUT_OK); 89 | 90 | DisposeDialog(dp); 91 | } 92 | } 93 | 94 | 95 | #endif //!__LP64__ 96 | -------------------------------------------------------------------------------- /src/photoshop/mac/carbon/ProEXR_Dialogs.r: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | // 3 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 4 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 5 | // 6 | // This file is part of ProEXR. 7 | // 8 | // ProEXR is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | // -------------------------------------------------------------------*/ 22 | 23 | 24 | #include "Types.r" 25 | #include "SysTypes.r" 26 | 27 | 28 | #define OutID 16100 29 | #define AboutID 16101 30 | #define RegID 16102 31 | #define InID 16103 32 | 33 | resource 'DLOG' (OutID, "Save Options", purgeable) 34 | { 35 | {449, 541, 754, 831}, 36 | movableDBoxProc, 37 | visible, 38 | noGoAway, 39 | 0x0, 40 | OutID, 41 | "ProEXR Options", 42 | alertPositionMainScreen // Universal 3.0 headers. 43 | }; 44 | 45 | resource 'dlgx' (OutID) { 46 | versionZero { 47 | kDialogFlagsHandleMovableModal + kDialogFlagsUseThemeControls + kDialogFlagsUseThemeBackground + kDialogFlagsUseControlHierarchy 48 | } 49 | }; 50 | 51 | #define MenuID 2001 52 | 53 | 54 | resource 'DITL' (OutID, "Dialog Items", purgeable) 55 | { 56 | { 57 | {265, 201, 285, 270}, Button { enabled, "OK" }, 58 | {265, 120, 285, 189}, Button { enabled, "Cancel" }, 59 | {82, 21, 98, 123}, StaticText { disabled, "Compression:" }, 60 | {81, 131, 101, 251}, Control {enabled, MenuID}, 61 | {121, 43, 139, 188}, CheckBox { enabled, "Luminance/Chroma"}, 62 | {145, 43, 163, 141}, CheckBox { enabled, "32-bit float"}, 63 | {195, 43, 213, 219}, CheckBox { enabled, "Include layer composite"}, 64 | {219, 43, 237, 219}, CheckBox { enabled, "Include hidden layers"}, 65 | {5, 20, 55, 270}, Picture { disabled, 1901 }, 66 | } 67 | }; 68 | 69 | resource 'CNTL' (MenuID, purgeable) { 70 | {81, 131, 101, 251}, 71 | 0, 72 | visible, 73 | 0, 74 | MenuID, 75 | 1008, 76 | 0, 77 | "" 78 | }; 79 | 80 | resource 'MENU' (MenuID) { 81 | MenuID, 82 | textMenuProc, 83 | allEnabled, 84 | enabled, 85 | "Compression", 86 | { /* array: 4 elements */ 87 | /* [1] */ 88 | "None", noIcon, noKey, noMark, plain, 89 | } 90 | }; 91 | 92 | 93 | resource 'DLOG' (InID, "Import Options", purgeable) 94 | { 95 | {493, 665, 826, 1020}, 96 | movableDBoxProc, 97 | visible, 98 | noGoAway, 99 | 0x0, 100 | InID, 101 | "ProEXR Import Options", 102 | alertPositionMainScreen // Universal 3.0 headers. 103 | }; 104 | 105 | resource 'dlgx' (InID) { 106 | versionZero { 107 | kDialogFlagsHandleMovableModal + kDialogFlagsUseThemeControls + kDialogFlagsUseThemeBackground + kDialogFlagsUseControlHierarchy 108 | } 109 | }; 110 | 111 | resource 'DITL' (InID, "Import Items", purgeable) 112 | { 113 | { 114 | {293, 249, 313, 335}, Button { enabled, "OK" }, 115 | {293, 151, 313, 237}, Button { enabled, "Cancel" }, 116 | {293, 20, 313, 124}, Button { enabled, "Set Defaults" }, 117 | {79, 62, 98, 302}, RadioButton { enabled, "Alpha makes layers transparent" }, 118 | {104, 62, 123, 302}, RadioButton { enabled, "Alpha appears on separate layers" }, 119 | {131, 86, 149, 286}, CheckBox { enabled, "UnMultiply RGB using Alpha"}, 120 | {177, 62, 195, 286}, CheckBox { enabled, "Ignore custom layering attribute"}, 121 | {202, 62, 220, 286}, CheckBox { enabled, "Memory mapping"}, 122 | {249, 62, 267, 286}, CheckBox { enabled, "Always bring up this dialog"}, 123 | {7, 52, 57, 302}, Picture { disabled, 1901 }, 124 | } 125 | }; 126 | -------------------------------------------------------------------------------- /src/photoshop/mac/carbon/ProEXR_EZ_Dialogs.r: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | // 3 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 4 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 5 | // 6 | // This file is part of ProEXR. 7 | // 8 | // ProEXR is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | // -------------------------------------------------------------------*/ 22 | 23 | #include "Types.r" 24 | #include "SysTypes.r" 25 | 26 | 27 | #define OutID 16100 28 | #define AboutID 16101 29 | #define RegID 16102 30 | #define InID 16103 31 | 32 | resource 'DLOG' (OutID, "Save Options", purgeable) 33 | { 34 | {357, 769, 714, 1059}, 35 | movableDBoxProc, 36 | visible, 37 | noGoAway, 38 | 0x0, 39 | OutID, 40 | "ProEXR EZ Options", 41 | alertPositionMainScreen // Universal 3.0 headers. 42 | }; 43 | 44 | resource 'dlgx' (OutID) { 45 | versionZero { 46 | kDialogFlagsHandleMovableModal + kDialogFlagsUseThemeControls + kDialogFlagsUseThemeBackground + kDialogFlagsUseControlHierarchy 47 | } 48 | }; 49 | 50 | #define MenuID 2001 51 | 52 | #define GroupID 2222 53 | 54 | resource 'DITL' (OutID, "Dialog Items", purgeable) 55 | { 56 | { 57 | {317, 201, 337, 270}, Button { enabled, "OK" }, 58 | {317, 120, 337, 189}, Button { enabled, "Cancel" }, 59 | {82, 21, 98, 123}, StaticText { disabled, "Compression:" }, 60 | {81, 131, 101, 251}, Control { enabled, MenuID }, 61 | {121, 43, 139, 188}, CheckBox { enabled, "Luminance/Chroma"}, 62 | {145, 43, 163, 141}, CheckBox { enabled, "32-bit float"}, 63 | {161, 63, 172, 177}, StaticText { disabled, "(not recommended)" }, 64 | {189, 31, 287, 251}, Control { enabled, GroupID }, 65 | {210, 46, 230, 103}, RadioButton { enabled, "None" }, 66 | {233, 46, 253, 152}, RadioButton { enabled, "Transparency" }, 67 | {256, 46, 276, 247}, RadioButton { enabled, "Channel Blah" }, 68 | {5, 20, 55, 270}, Picture { disabled, 1901 }, 69 | } 70 | }; 71 | 72 | resource 'CNTL' (MenuID, purgeable) { 73 | {81, 131, 101, 251}, 74 | 0, 75 | visible, 76 | 0, 77 | MenuID, 78 | 1008, 79 | 0, 80 | "" 81 | }; 82 | 83 | resource 'MENU' (MenuID) { 84 | MenuID, 85 | textMenuProc, 86 | allEnabled, 87 | enabled, 88 | "", 89 | { /* array: 4 elements */ 90 | /* [1] */ 91 | "None", noIcon, noKey, noMark, plain, 92 | } 93 | }; 94 | 95 | resource 'CNTL' (GroupID) { 96 | {189, 31, 287, 251}, 97 | 0, 98 | visible, 99 | 0, 100 | 0, 101 | kControlGroupBoxTextTitleProc, 102 | 0, 103 | "Alpha Channel" 104 | }; 105 | 106 | // http://developer.apple.com/DOCUMENTATION/macos8/HumanInterfaceToolbox/ControlManager/ControlMgr8Ref/ControlMgrRef.10.html 107 | 108 | 109 | 110 | resource 'DLOG' (InID, "Import Options", purgeable) 111 | { 112 | {493, 665, 772, 1020}, 113 | movableDBoxProc, 114 | visible, 115 | noGoAway, 116 | 0x0, 117 | InID, 118 | "ProEXR EZ Import Options", 119 | alertPositionMainScreen // Universal 3.0 headers. 120 | }; 121 | 122 | resource 'dlgx' (InID) { 123 | versionZero { 124 | kDialogFlagsHandleMovableModal + kDialogFlagsUseThemeControls + kDialogFlagsUseThemeBackground + kDialogFlagsUseControlHierarchy 125 | } 126 | }; 127 | 128 | resource 'DITL' (InID, "Import Items", purgeable) 129 | { 130 | { 131 | {244, 249, 264, 335}, Button { enabled, "OK" }, 132 | {244, 151, 264, 237}, Button { enabled, "Cancel" }, 133 | {244, 20, 264, 124}, Button { enabled, "Set Defaults" }, 134 | {79, 55, 98, 308}, RadioButton { enabled, "Alpha makes layer transparent" }, 135 | {104, 55, 123, 308}, RadioButton { enabled, "Alpha appears as a separate channel" }, 136 | {131, 86, 149, 286}, CheckBox { enabled, "UnMultiply RGB using Alpha"}, 137 | {165, 55, 183, 286}, CheckBox { enabled, "Memory mapping"}, 138 | {204, 55, 222, 286}, CheckBox { enabled, "Always bring up this dialog"}, 139 | {7, 52, 57, 302}, Picture { disabled, 1901 }, 140 | } 141 | }; 142 | -------------------------------------------------------------------------------- /src/photoshop/mac/carbon/ProEXR_banner.rsrc.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fnordware/ProEXR/b256276a03f75b69904962cf4620ae94590528a1/src/photoshop/mac/carbon/ProEXR_banner.rsrc.zip -------------------------------------------------------------------------------- /src/photoshop/win/ProEXR_About.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #include "resource.h" 4 | 5 | #define APSTUDIO_READONLY_SYMBOLS 6 | ///////////////////////////////////////////////////////////////////////////// 7 | // 8 | // Generated from the TEXTINCLUDE 2 resource. 9 | // 10 | #include "afxres.h" 11 | #include "ProEXR_Version.h" 12 | 13 | ///////////////////////////////////////////////////////////////////////////// 14 | #undef APSTUDIO_READONLY_SYMBOLS 15 | 16 | ///////////////////////////////////////////////////////////////////////////// 17 | // English (U.S.) resources 18 | 19 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 20 | #ifdef _WIN32 21 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 22 | #pragma code_page(1252) 23 | #endif //_WIN32 24 | 25 | #ifdef APSTUDIO_INVOKED 26 | ///////////////////////////////////////////////////////////////////////////// 27 | // 28 | // TEXTINCLUDE 29 | // 30 | 31 | 1 TEXTINCLUDE 32 | BEGIN 33 | "resource.h\0" 34 | END 35 | 36 | 2 TEXTINCLUDE 37 | BEGIN 38 | "#include ""afxres.h""\r\n" 39 | "\0" 40 | END 41 | 42 | 3 TEXTINCLUDE 43 | BEGIN 44 | "\r\n" 45 | "\0" 46 | END 47 | 48 | 49 | #endif // APSTUDIO_INVOKED 50 | 51 | 52 | ///////////////////////////////////////////////////////////////////////////// 53 | // 54 | // Dialog 55 | // 56 | 57 | ABOUTDIALOG DIALOGEX 0, 0, 181, 119 58 | STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU 59 | CAPTION "About ProEXR" 60 | FONT 8, "Microsoft Sans Serif", 400, 0, 0x0 61 | BEGIN 62 | DEFPUSHBUTTON "OK",IDOK,61,97,50,14 63 | CONTROL "BANNER2",IDC_STATIC,"Static",SS_BITMAP,7,7,15,13 64 | CTEXT "ProEXR",IDC_STATIC,39,50,94,9 65 | CTEXT "by Brendan Bolles",IDC_STATIC,39,60,94,9 66 | CTEXT ProEXR_Build_Complete_Manual,IDC_STATIC,39,75,94,9 67 | CTEXT "Portions copyright Industrial Light + Magic.", 68 | IDC_STATIC,7,85,172,9 69 | END 70 | 71 | 72 | ///////////////////////////////////////////////////////////////////////////// 73 | // 74 | // DESIGNINFO 75 | // 76 | 77 | #ifdef APSTUDIO_INVOKED 78 | GUIDELINES DESIGNINFO 79 | BEGIN 80 | "ABOUTDIALOG", DIALOG 81 | BEGIN 82 | LEFTMARGIN, 7 83 | RIGHTMARGIN, 179 84 | TOPMARGIN, 7 85 | BOTTOMMARGIN, 61 86 | END 87 | END 88 | #endif // APSTUDIO_INVOKED 89 | 90 | 91 | ///////////////////////////////////////////////////////////////////////////// 92 | // 93 | // Bitmap 94 | // 95 | 96 | BANNER2 BITMAP "ProEXR_banner.bmp" 97 | #endif // English (U.S.) resources 98 | ///////////////////////////////////////////////////////////////////////////// 99 | 100 | 101 | 102 | #ifndef APSTUDIO_INVOKED 103 | ///////////////////////////////////////////////////////////////////////////// 104 | // 105 | // Generated from the TEXTINCLUDE 3 resource. 106 | // 107 | 108 | 109 | ///////////////////////////////////////////////////////////////////////////// 110 | #endif // not APSTUDIO_INVOKED 111 | 112 | -------------------------------------------------------------------------------- /src/photoshop/win/ProEXR_About_Win.cpp: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | // 3 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 4 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 5 | // 6 | // This file is part of ProEXR. 7 | // 8 | // ProEXR is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | // -------------------------------------------------------------------*/ 22 | 23 | 24 | #include "ProEXR_About.h" 25 | 26 | extern HANDLE hDllInstance; 27 | 28 | // thanks, Photoshop 6 SDK! 29 | static void PS6CenterDialog(HWND hDlg) 30 | { 31 | int nHeight; 32 | int nWidth; 33 | int nTitleBits; 34 | RECT rcDialog; 35 | RECT rcParent; 36 | int xOrigin; 37 | int yOrigin; 38 | int xScreen; 39 | int yScreen; 40 | 41 | HWND hParent = GetParent(hDlg); 42 | 43 | if (hParent == NULL) 44 | hParent = GetDesktopWindow(); 45 | 46 | GetClientRect(hParent, &rcParent); 47 | ClientToScreen(hParent, (LPPOINT)&rcParent.left); // point(left, top) 48 | ClientToScreen(hParent, (LPPOINT)&rcParent.right); // point(right, bottom) 49 | 50 | // Center on Title: title bar has system menu, minimize, maximize bitmaps 51 | // Width of title bar bitmaps - assumes 3 of them and dialog has a sysmenu 52 | nTitleBits = GetSystemMetrics(SM_CXSIZE); 53 | 54 | 55 | 56 | // If dialog has no sys menu compensate for odd# bitmaps by sub 1 bitwidth 57 | if ( ! (GetWindowLong(hDlg, GWL_STYLE) & WS_SYSMENU)) 58 | nTitleBits -= nTitleBits / 3; 59 | 60 | 61 | GetWindowRect(hDlg, &rcDialog); 62 | nWidth = rcDialog.right - rcDialog.left; 63 | nHeight = rcDialog.bottom - rcDialog.top; 64 | 65 | 66 | xOrigin = max(rcParent.right - rcParent.left - nWidth, 0) / 2 67 | + rcParent.left - nTitleBits; 68 | 69 | xScreen = GetSystemMetrics(SM_CXSCREEN); 70 | 71 | if (xOrigin + nWidth > xScreen) 72 | xOrigin = max (0, xScreen - nWidth); 73 | 74 | yOrigin = max(rcParent.bottom - rcParent.top - nHeight, 0) / 3 75 | + rcParent.top; 76 | 77 | yScreen = GetSystemMetrics(SM_CYSCREEN); 78 | 79 | if (yOrigin + nHeight > yScreen) 80 | yOrigin = max(0 , yScreen - nHeight); 81 | 82 | SetWindowPos(hDlg, NULL, xOrigin, yOrigin, nWidth, nHeight, SWP_NOZORDER); 83 | } 84 | 85 | BOOL CALLBACK AboutProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam) 86 | { 87 | BOOL fError; 88 | 89 | switch (message) 90 | { 91 | case WM_INITDIALOG: 92 | PS6CenterDialog(hwndDlg); 93 | break; 94 | 95 | case WM_COMMAND: 96 | 97 | switch (LOWORD(wParam)) 98 | { 99 | case IDOK: 100 | //PostMessage((HWND)hwndDlg, WM_QUIT, (WPARAM)WA_ACTIVE, lParam); 101 | EndDialog(hwndDlg, 0); 102 | //DestroyWindow(hwndDlg); 103 | 104 | return TRUE; 105 | } 106 | } 107 | 108 | return FALSE; 109 | } 110 | 111 | 112 | void ProEXR_About(HWND hwndOwner) 113 | { 114 | int status = DialogBox((HINSTANCE)hDllInstance, (LPSTR)"ABOUTDIALOG", hwndOwner, (DLGPROC)AboutProc); 115 | } 116 | -------------------------------------------------------------------------------- /src/photoshop/win/ProEXR_Dialogs.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #include "resource.h" 4 | 5 | #define APSTUDIO_READONLY_SYMBOLS 6 | ///////////////////////////////////////////////////////////////////////////// 7 | // 8 | // Generated from the TEXTINCLUDE 2 resource. 9 | // 10 | #include "afxres.h" 11 | 12 | ///////////////////////////////////////////////////////////////////////////// 13 | #undef APSTUDIO_READONLY_SYMBOLS 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | // English (U.S.) resources 17 | 18 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 19 | #ifdef _WIN32 20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 21 | #pragma code_page(1252) 22 | #endif //_WIN32 23 | 24 | #ifdef APSTUDIO_INVOKED 25 | ///////////////////////////////////////////////////////////////////////////// 26 | // 27 | // TEXTINCLUDE 28 | // 29 | 30 | 1 TEXTINCLUDE 31 | BEGIN 32 | "resource.h\0" 33 | END 34 | 35 | 2 TEXTINCLUDE 36 | BEGIN 37 | "#include ""afxres.h""\r\n" 38 | "\0" 39 | END 40 | 41 | 3 TEXTINCLUDE 42 | BEGIN 43 | "\r\n" 44 | "\0" 45 | END 46 | 47 | #endif // APSTUDIO_INVOKED 48 | 49 | 50 | ///////////////////////////////////////////////////////////////////////////// 51 | // 52 | // Dialog 53 | // 54 | 55 | OUTDIALOG DIALOGEX 0, 0, 181, 178 56 | STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU 57 | CAPTION "ProEXR Options" 58 | FONT 8, "MS Shell Dlg", 400, 0, 0x1 59 | BEGIN 60 | DEFPUSHBUTTON "OK",IDOK,124,157,50,14 61 | PUSHBUTTON "Cancel",IDCANCEL,66,157,50,14 62 | COMBOBOX 3,79,50,66,14,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP 63 | LTEXT "Compression",IDC_STATIC,25,50,48,12,SS_CENTERIMAGE,WS_EX_RIGHT 64 | CONTROL "BANNER1",IDC_STATIC,"Static",SS_BITMAP,7,7,15,13 65 | CONTROL "32-bit float",5,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,40,90,51,10 66 | CONTROL "Luminance/Chroma",4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,40,73,82,12 67 | CONTROL "Include layer composite",6,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,40,115,91,10 68 | CONTROL "Include hidden layers",7,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,40,131,84,10 69 | END 70 | 71 | INDIALOG DIALOGEX 0, 0, 209, 172 72 | STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU 73 | CAPTION "ProEXR Read Options" 74 | FONT 8, "MS Shell Dlg", 400, 0, 0x1 75 | BEGIN 76 | DEFPUSHBUTTON "OK",IDOK,152,151,50,14 77 | PUSHBUTTON "Cancel",IDCANCEL,95,151,50,14 78 | PUSHBUTTON "Set Defaults",3,7,151,57,14 79 | CONTROL "BANNER1",IDC_STATIC,"Static",SS_BITMAP,20,3,15,13 80 | CONTROL "Alpha makes layers transparent",4,"Button",BS_AUTORADIOBUTTON,42,38,131,10 81 | CONTROL "Alpha appears on seperate layers",5,"Button",BS_AUTORADIOBUTTON,42,51,131,10 82 | CONTROL "UnMultiply RGB using Alpha",6,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,55,65,103,10 83 | CONTROL "Ignore custom layering attribute",7,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,42,92,119,10 84 | CONTROL "Always bring up this dialog",9,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,42,128,101,10 85 | CONTROL "Memory mapping",8,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,42,105,70,10 86 | END 87 | 88 | 89 | ///////////////////////////////////////////////////////////////////////////// 90 | // 91 | // DESIGNINFO 92 | // 93 | 94 | #ifdef APSTUDIO_INVOKED 95 | GUIDELINES DESIGNINFO 96 | BEGIN 97 | "OUTDIALOG", DIALOG 98 | BEGIN 99 | LEFTMARGIN, 7 100 | RIGHTMARGIN, 174 101 | TOPMARGIN, 7 102 | BOTTOMMARGIN, 171 103 | END 104 | 105 | "INDIALOG", DIALOG 106 | BEGIN 107 | LEFTMARGIN, 7 108 | RIGHTMARGIN, 202 109 | TOPMARGIN, 7 110 | BOTTOMMARGIN, 165 111 | END 112 | END 113 | #endif // APSTUDIO_INVOKED 114 | 115 | 116 | ///////////////////////////////////////////////////////////////////////////// 117 | // 118 | // Bitmap 119 | // 120 | 121 | BANNER1 BITMAP "ProEXR_banner.bmp" 122 | 123 | ///////////////////////////////////////////////////////////////////////////// 124 | // 125 | // Version 126 | // 127 | 128 | VS_VERSION_INFO VERSIONINFO 129 | FILEVERSION 1,9,3,0 130 | PRODUCTVERSION 1,9,3,0 131 | FILEFLAGSMASK 0x18L 132 | #ifdef _DEBUG 133 | FILEFLAGS 0x1L 134 | #else 135 | FILEFLAGS 0x0L 136 | #endif 137 | FILEOS 0x4L 138 | FILETYPE 0x2L 139 | FILESUBTYPE 0x0L 140 | BEGIN 141 | BLOCK "StringFileInfo" 142 | BEGIN 143 | BLOCK "040904b0" 144 | BEGIN 145 | VALUE "FileDescription", "ProEXR" 146 | VALUE "FileVersion", "1.9.3" 147 | VALUE "InternalName", "ProEXR" 148 | VALUE "LegalCopyright", "Copyright (C) 2007-2017" 149 | VALUE "OriginalFilename", "ProEXR_Dialogs.rc" 150 | VALUE "ProductName", "ProEXR" 151 | VALUE "ProductVersion", "1, 9, 3, 0" 152 | END 153 | END 154 | BLOCK "VarFileInfo" 155 | BEGIN 156 | VALUE "Translation", 0x409, 1200 157 | END 158 | END 159 | 160 | #endif // English (U.S.) resources 161 | ///////////////////////////////////////////////////////////////////////////// 162 | 163 | 164 | 165 | #ifndef APSTUDIO_INVOKED 166 | ///////////////////////////////////////////////////////////////////////////// 167 | // 168 | // Generated from the TEXTINCLUDE 3 resource. 169 | // 170 | 171 | 172 | ///////////////////////////////////////////////////////////////////////////// 173 | #endif // not APSTUDIO_INVOKED 174 | 175 | -------------------------------------------------------------------------------- /src/photoshop/win/ProEXR_banner.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fnordware/ProEXR/b256276a03f75b69904962cf4620ae94590528a1/src/photoshop/win/ProEXR_banner.bmp -------------------------------------------------------------------------------- /src/photoshop/win/myDLLInstance.cpp: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | // 3 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 4 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 5 | // 6 | // This file is part of ProEXR. 7 | // 8 | // ProEXR is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | // -------------------------------------------------------------------*/ 22 | 23 | 24 | //------------------------------------------------------------------------------- 25 | // Includes 26 | //------------------------------------------------------------------------------- 27 | #include "myDLLInstance.h" 28 | 29 | namespace myDLLInstance 30 | { 31 | HINSTANCE dllInstance = NULL; 32 | } 33 | 34 | using namespace myDLLInstance; 35 | 36 | HINSTANCE GetDLLInstance(SPPluginRef plugin) 37 | { 38 | // Photoshop's PIDLLInstance.cpp was doing some fancy stuff that 39 | // involved the AutoSuite and seemed to cause problems. 40 | // We'll just keep it simple. 41 | 42 | return dllInstance; 43 | } 44 | 45 | //------------------------------------------------------------------------------- 46 | // 47 | // DllMain 48 | // 49 | // Initialization and termination code for Windows DLLs 50 | // 51 | //------------------------------------------------------------------------------- 52 | 53 | 54 | extern "C" BOOL APIENTRY DllMain(HANDLE hModule, 55 | DWORD ul_reason_for_call, 56 | LPVOID /*lpReserved*/); 57 | 58 | BOOL APIENTRY DllMain(HANDLE hModule, 59 | DWORD ul_reason_for_call, 60 | LPVOID /*lpReserved*/) 61 | { 62 | // very odd, when running SimpleFormat and selecting multiple images 63 | // in the open dialog I get dettach messages at about the 7th image ????? 64 | // the detach messages come with a valid hModule so no if ????? 65 | // if (ul_reason_for_call == DLL_PROCESS_ATTACH || 66 | // ul_reason_for_call == DLL_THREAD_ATTACH) 67 | dllInstance = static_cast(hModule); 68 | // else 69 | // dllInstance = NULL; 70 | return true; 71 | } 72 | // end PIDLLInstance.cpp -------------------------------------------------------------------------------- /src/photoshop/win/myDLLInstance.h: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | // 3 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 4 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 5 | // 6 | // This file is part of ProEXR. 7 | // 8 | // ProEXR is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | // -------------------------------------------------------------------*/ 22 | 23 | 24 | #ifndef _myDLLInstance_H 25 | #define _myDLLInstance_H 26 | 27 | //#include "PIDefines.h" 28 | 29 | #include "SPPlugs.h" 30 | //#include "SPAccess.h" 31 | 32 | //#include "PIUSuites.h" 33 | 34 | #include 35 | 36 | HINSTANCE GetDLLInstance(SPPluginRef plugin); 37 | 38 | #endif -------------------------------------------------------------------------------- /src/photoshop/win/myDialogUtilities.cpp: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | // 3 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 4 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 5 | // 6 | // This file is part of ProEXR. 7 | // 8 | // ProEXR is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | // -------------------------------------------------------------------*/ 22 | 23 | 24 | #include "DialogUtilities.h" 25 | 26 | short ShowVersionAlert (DialogPtr dp, 27 | const short alertID, 28 | const short stringID, 29 | Str255 versText1, 30 | Str255 versText2) 31 | { 32 | MessageBox(NULL, "There is a problem using ProEXR with this version of Photoshop.", "ProEXR error", MB_OK); 33 | 34 | return 0; 35 | } -------------------------------------------------------------------------------- /src/photoshop/win/myDialogUtilities.h: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | // 3 | // ProEXR - OpenEXR plug-ins for Photoshop and After Effects 4 | // Copyright (c) 2007-2017, Brendan Bolles, http://www.fnordware.com 5 | // 6 | // This file is part of ProEXR. 7 | // 8 | // ProEXR is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | // -------------------------------------------------------------------*/ 22 | 23 | 24 | #ifndef __MyDialogUtilities_H__ // Has this not been defined yet? 25 | #define __MyDialogUtilities_H__ // Only include this once by predefining it 26 | 27 | #include "PIDefines.h" 28 | 29 | #ifdef __PIWin__ // Windows only 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | 38 | typedef HWND DialogPtr; 39 | typedef HWND DialogTHndl; 40 | #else // Macintosh and others 41 | #include // Macintosh standard dialogs 42 | #include // Macintosh standard types 43 | #include // Macintosh gestalt routines 44 | #include // Macintosh text utilities (GetString()) 45 | #include // Macintosh OS Utilities (Delay()) 46 | #include // Macintosh Menu Manager routines (DelMenuItem()) 47 | #endif 48 | 49 | #include "PITypes.h" // Photoshop types 50 | #include "PIGeneral.h" // Photoshop general routines 51 | #include "PIAbout.h" 52 | #include "PIUtilities.h" // SDK Utility routines 53 | #include "PIUSuites.h" // AutoSuite definition 54 | #include "PIGetFileListSuite.h" // URL browser function 55 | #include "PIUIHooksSuite.h" // idle event processing function 56 | #include 57 | 58 | //------------------------------------------------------------------------------- 59 | // C++ wrapper 60 | //------------------------------------------------------------------------------- 61 | 62 | #ifdef __cplusplus 63 | extern "C" { 64 | #endif // __cplusplus 65 | 66 | //------------------------------------------------------------------------------- 67 | // Prototypes -- Alerts 68 | //------------------------------------------------------------------------------- 69 | 70 | // Display a cross-platform alert with a version number: 71 | short ShowVersionAlert (DialogPtr dp, 72 | const short alertID, 73 | const short stringID, 74 | Str255 versText1, 75 | Str255 versText2); 76 | #endif -------------------------------------------------------------------------------- /src/photoshop/win/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by ProEXR_EZ_Dialogs.rc 4 | // 5 | #define IDD_DIALOG1 101 6 | #define IDD_DIALOG2 103 7 | #define IDC_CHECK3 1007 8 | 9 | // Next default values for new objects 10 | // 11 | #ifdef APSTUDIO_INVOKED 12 | #ifndef APSTUDIO_READONLY_SYMBOLS 13 | #define _APS_NEXT_RESOURCE_VALUE 105 14 | #define _APS_NEXT_COMMAND_VALUE 40001 15 | #define _APS_NEXT_CONTROL_VALUE 1007 16 | #define _APS_NEXT_SYMED_VALUE 101 17 | #endif 18 | #endif 19 | -------------------------------------------------------------------------------- /xcode/xcode3/ProEXR_AE.plugin-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleIdentifier 6 | com.fnordware.AfterEffects.ProEXR_AE 7 | CFBundleInfoDictionaryVersion 8 | 6.0 9 | CFBundleName 10 | ProEXR AE 11 | CFBundleExecutable 12 | ProEXR AE 13 | CFBundlePackageType 14 | AEgx 15 | CFBundleSignature 16 | FXTC 17 | NSAppleScriptEnabled 18 | No 19 | NSHumanReadableCopyright 20 | © 2007-2014 fnord 21 | LSRequiresCarbon 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /xcode/xcode3/ProEXR_Deep_Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleExecutable 6 | $(PRODUCT_NAME) 7 | CFBundleName 8 | $(PRODUCT_NAME) 9 | CFBundleIdentifier 10 | com.fnordware.Photoshop.ProEXR_Deep 11 | CFBundleSignature 12 | 8BIM 13 | CFBundlePackageType 14 | $(PLUGIN_TYPE) 15 | CFBundleGetInfoString 16 | ©2007-2017 fnord 17 | CFBundleDevelopmentRegion 18 | English 19 | 20 | 21 | -------------------------------------------------------------------------------- /xcode/xcode3/ProEXR_EZ_Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | $(PRODUCT_NAME) 9 | CFBundleGetInfoString 10 | ©2007-2017 fnord 11 | CFBundleIdentifier 12 | com.fnordware.Photoshop.ProEXR_EZ 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PLUGIN_TYPE) 17 | CFBundleSignature 18 | 8BIM 19 | 20 | 21 | -------------------------------------------------------------------------------- /xcode/xcode3/ProEXR_Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleExecutable 6 | $(PRODUCT_NAME) 7 | CFBundleName 8 | $(PRODUCT_NAME) 9 | CFBundleIdentifier 10 | com.fnordware.Photoshop.ProEXR 11 | CFBundleSignature 12 | 8BIM 13 | CFBundlePackageType 14 | $(PLUGIN_TYPE) 15 | CFBundleGetInfoString 16 | ©2007-2017 fnord 17 | CFBundleDevelopmentRegion 18 | English 19 | 20 | 21 | --------------------------------------------------------------------------------