├── .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