├── Windows ├── CheckThreadSafeSymbols.exe ├── README.txt └── register_msdia.cmd ├── README.md ├── Mac ├── README.txt └── check_symbols_for_thread_safety.sh ├── CodeSamples ├── README.txt ├── Has_Issues.cpp └── Issues_Fixed.cpp ├── ISSUE_TEMPLATE.md ├── PULL_REQUEST_TEMPLATE.md ├── CONTRIBUTING.md ├── CODE_OF_CONDUCT.md └── LICENSE /Windows/CheckThreadSafeSymbols.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adobe/ae-plugin-thread-safety/master/Windows/CheckThreadSafeSymbols.exe -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ae-plugin-thread-safety 2 | Tooling for third-party plugin developers to ensure their code aligns with After Effects' threadsafe standards. 3 | -------------------------------------------------------------------------------- /Mac/README.txt: -------------------------------------------------------------------------------- 1 | This is After Effects' internal tool for finding possible thread safety issues in object files on macOS. It filters the output of the nm command line tool to show global and static variables. The input is an object file or linked binary. 2 | 3 | Syntax: 4 | check_symbols_for_thread_safety.sh [file] 5 | 6 | This will run nm on your binary and look for any static or global state in your project. See the the section on plug-in thread safety at http://ae-plugin-sdk.aenhancers.com/effect-details/multi-frame-rendering-in-ae.html for more detail on how to interpret output and fix issues. 7 | -------------------------------------------------------------------------------- /CodeSamples/README.txt: -------------------------------------------------------------------------------- 1 | These source files contain examples of issues you may run into while reviewing your plugins for thread safety issues. 2 | 3 | Has_Issues.cpp contains some examples of global state you might run into, while Issues_Fixed.cpp contains our recommended way of fixing them. 4 | 5 | For more information, see the Thread Safety portion of After Effects' SDK docs at http://ae-plugin-sdk.aenhancers.com/effect-details/multi-frame-rendering-in-ae.html 6 | 7 | Note: These two sample files contain just a few modifications on top of the SDK skeleton sample. If you're interested in seeing what symbols are identified by the ae-plugin-thread-safe tools in this repo, you can replace Skeleton.cpp with either of these files and build. 8 | -------------------------------------------------------------------------------- /ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ### Expected Behaviour 5 | 6 | ### Actual Behaviour 7 | 8 | ### Reproduce Scenario (including but not limited to) 9 | 10 | #### Steps to Reproduce 11 | 12 | #### Platform and Version 13 | 14 | #### Sample Code that illustrates the problem 15 | 16 | #### Logs taken while reproducing problem 17 | -------------------------------------------------------------------------------- /Windows/README.txt: -------------------------------------------------------------------------------- 1 | This tool finds problematic global symbols in your effect code by examining the programming database (.pdb) file output by debug builds of your plugin. It filters these symbols by either source file or compiland, which can be specified using the -source flag or the -objfile flag. All paths must be absolute and case-insensitive. 2 | 3 | Installation: 4 | In order to run this tool, you need a working installation of Visual Studio and you need to have the DIA SDK registered. Included is register_msdia.cmd, which will register the SDK for you. 5 | 6 | From the Start menu, search for "x64 Native Tools Command Prompt for VS 2017" and Right Click->Run as administrator. 7 | 8 | In the terminal, cd to this directory and run .\register_msdia.cmd 9 | 10 | After this, the script should just work, e.g.: 11 | .\CheckThreadSafeIssues.exe -sf [Path to your project pdb] 12 | 13 | Alternatively, if you know where msdia.dll is on your system you can register it manually with regsvr32 14 | 15 | For instructions on how to use the tool and understand the output, see the AfterEffects Plugin SDK docs at http://ae-plugin-sdk.aenhancers.com/effect-details/multi-frame-rendering-in-ae.html 16 | -------------------------------------------------------------------------------- /PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## Description 4 | 5 | 6 | 7 | ## Related Issue 8 | 9 | 10 | 11 | 12 | 13 | 14 | ## Motivation and Context 15 | 16 | 17 | 18 | ## How Has This Been Tested? 19 | 20 | 21 | 22 | 23 | 24 | ## Screenshots (if appropriate): 25 | 26 | ## Types of changes 27 | 28 | 29 | 30 | - [ ] Bug fix (non-breaking change which fixes an issue) 31 | - [ ] New feature (non-breaking change which adds functionality) 32 | - [ ] Breaking change (fix or feature that would cause existing functionality to change) 33 | 34 | ## Checklist: 35 | 36 | 37 | 38 | 39 | - [ ] I have signed the [Adobe Open Source CLA](https://opensource.adobe.com/cla.html). 40 | - [ ] My code follows the code style of this project. 41 | - [ ] My change requires a change to the documentation. 42 | - [ ] I have updated the documentation accordingly. 43 | - [ ] I have read the **CONTRIBUTING** document. 44 | - [ ] I have added tests to cover my changes. 45 | - [ ] All new and existing tests passed. 46 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Thanks for choosing to contribute! 4 | 5 | The following are a set of guidelines to follow when contributing to this project. 6 | 7 | ## Code Of Conduct 8 | 9 | This project adheres to the Adobe [code of conduct](../CODE_OF_CONDUCT.md). By participating, 10 | you are expected to uphold this code. Please report unacceptable behavior to 11 | [Grp-opensourceoffice@adobe.com](mailto:Grp-opensourceoffice@adobe.com). 12 | 13 | ## Have A Question? 14 | 15 | Start by filing an issue. The existing committers on this project work to reach 16 | consensus around project direction and issue solutions within issue threads 17 | (when appropriate). 18 | 19 | ## Contributor License Agreement 20 | 21 | All third-party contributions to this project must be accompanied by a signed contributor 22 | license agreement. This gives Adobe permission to redistribute your contributions 23 | as part of the project. [Sign our CLA](https://opensource.adobe.com/cla.html). You 24 | only need to submit an Adobe CLA one time, so if you have submitted one previously, 25 | you are good to go! 26 | 27 | ## Code Reviews 28 | 29 | All submissions should come in the form of pull requests and need to be reviewed 30 | by project committers. Read [GitHub's pull request documentation](https://help.github.com/articles/about-pull-requests/) 31 | for more information on sending pull requests. 32 | 33 | Lastly, please follow the [pull request template](PULL_REQUEST_TEMPLATE.md) when 34 | submitting a pull request! 35 | 36 | ## From Contributor To Committer 37 | 38 | We love contributions from our community! If you'd like to go a step beyond contributor 39 | and become a committer with full write access and a say in the project, you must 40 | be invited to the project. The existing committers employ an internal nomination 41 | process that must reach lazy consensus (silence is approval) before invitations 42 | are issued. If you feel you are qualified and want to get more deeply involved, 43 | feel free to reach out to existing committers to have a conversation about that. 44 | 45 | ## Security Issues 46 | 47 | Security issues shouldn't be reported on this issue tracker. Instead, [file an issue to our security experts](https://helpx.adobe.com/security/alertus.html). 48 | -------------------------------------------------------------------------------- /Mac/check_symbols_for_thread_safety.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2020 Adobe 3 | # All Rights Reserved. 4 | 5 | # NOTICE: Adobe permits you to use, modify, and distribute this file in 6 | # accordance with the terms of the Adobe license agreement accompanying 7 | # it. If you have received this file from a source other than Adobe, 8 | # then your use, modification, or distribution of it requires the prior 9 | # written permission of Adobe. 10 | 11 | nm -demangle -print-file-name "$1" |\ 12 | grep -o [[:space:]][B,D,b,d,S,s,u,V,v,W,w][[:space:]].* |\ 13 | sed -e 's/^[ \t]*//' |\ 14 | sed 's/ /; /' |\ 15 | uniq |\ 16 | grep -v "sDisabled" |\ 17 | grep -v "sEnabled" |\ 18 | grep -v "sTraceChangeCount" |\ 19 | grep -v "in_place_init" |\ 20 | grep -v "BIB_T_MT" |\ 21 | grep -v "_G_zhdr" |\ 22 | grep -v "_G_zref" |\ 23 | grep -v "_G_ztab" |\ 24 | grep -v "typeinfo name for" |\ 25 | grep -v "typeinfo for"|\ 26 | grep -v "GCC_except_table" |\ 27 | grep -v "dyld" |\ 28 | grep -v "g_strs" |\ 29 | grep -v "AEFX_DEBUG_draw_bounding_boxB" |\ 30 | grep -v "VideoFrameASLClassID" |\ 31 | grep -v "AdobeOR709_colorSpaceID" |\ 32 | grep -v "AdobeOR2020_colorSpaceID" |\ 33 | grep -v "AdobeOR2100PQ_colorSpaceID" |\ 34 | grep -v "AdobeOR2100HLG_colorSpaceID" |\ 35 | grep -v "AdobeOR2020Linear_colorSpaceID" |\ 36 | grep -v "boost::none" |\ 37 | grep -v "typeinfo for boost::property_tree::ptree_error" |\ 38 | grep -v "typeinfo for boost::property_tree::ptree_bad_data" |\ 39 | grep -v "typeinfo for boost::property_tree::ptree_bad_path" |\ 40 | grep -v "typeinfo for boost::system::system_error" |\ 41 | grep -v "typeinfo for boost::system::error_category::std_category" |\ 42 | grep -v "typeinfo name for boost::property_tree::ptree_error" |\ 43 | grep -v "typeinfo name for boost::property_tree::ptree_bad_data" |\ 44 | grep -v "typeinfo name for boost::property_tree::ptree_bad_path" |\ 45 | grep -v "typeinfo name for boost::system::system_error" |\ 46 | grep -v "typeinfo name for boost::system::error_category::std_category" |\ 47 | grep -v "vtable for boost::property_tree::ptree_error" |\ 48 | grep -v "vtable for boost::property_tree::ptree_bad_data" |\ 49 | grep -v "vtable for boost::property_tree::ptree_bad_path" |\ 50 | grep -v "vtable for boost::system::system_error" |\ 51 | grep -v "vtable for boost::system::error_category::std_category" |\ 52 | grep -v "boost::gil" |\ 53 | grep -v "boost::exception" |\ 54 | grep -v "[s|S]; vtable for " 55 | -------------------------------------------------------------------------------- /Windows/register_msdia.cmd: -------------------------------------------------------------------------------- 1 | ::Copyright 2020 Adobe. All rights reserved. 2 | ::This file is licensed to you under the Apache License, Version 2.0 (the "License"); 3 | ::you may not use this file except in compliance with the License. You may obtain a copy 4 | ::of the License at http://www.apache.org/licenses/LICENSE-2.0 5 | 6 | ::Unless required by applicable law or agreed to in writing, software distributed under 7 | ::the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 8 | ::OF ANY KIND, either express or implied. See the License for the specific language 9 | ::governing permissions and limitations under the License. 10 | 11 | @echo off 12 | setlocal 13 | 14 | set _clsid=e6756135-1e65-4d17-8576-610761398c3c 15 | set _reg_root=HKCR 16 | 17 | :: Check if msdia140.dll is already registered 18 | reg query %_reg_root%\{%_clsid%} 1>nul 2>nul 19 | if errorlevel 1 goto not_registered 20 | 21 | @echo msdia140.dll is already registered - no further action required 22 | goto :eof 23 | 24 | :not_registered 25 | 26 | :: Find devenv.exe in the path 27 | set _devenv= 28 | for %%i in ("devenv.exe") do ( 29 | if NOT "%%~$PATH:i"=="" ( 30 | set _devenv=%%~$PATH:i 31 | ) 32 | if defined _devenv goto found_devenv 33 | ) 34 | if not defined _devenv goto run_vcvars64 35 | :found_devenv 36 | 37 | :: Extract the base path 38 | for /f "tokens=1-4 delims=\" %%i in ("%_devenv%") do set _msdia_root=%%i\%%j\%%k\%%l 39 | 40 | :: Now find the DIA SDK 41 | set _vs_sku= 42 | if not exist "%_msdia_root%\DIA SDK" ( 43 | for %%e in (Community,Professional,Enterprise) do ( 44 | if exist "%_msdia_root%\%%e\DIA SDK" ( 45 | set _vs_sku=\%%e 46 | goto got_suffix 47 | ) 48 | ) 49 | goto dll_not_found 50 | ) 51 | :got_suffix 52 | 53 | set _msdia= 54 | for /f "delims=" %%i in ('dir /s /b "%_msdia_root%%_vs_sku%\DIA SDK\msdia140.dll" ^| findstr -i amd64') do ( 55 | set _msdia=%%i 56 | goto got_bin_path 57 | ) 58 | if "%_msdia" == "" goto dll_not_found 59 | :got_bin_path 60 | 61 | :: Now register msdia140.dll 62 | regsvr32 /s "%_msdia%" 63 | if errorlevel 1 goto error_registering 64 | 65 | @echo Registered %_msdia% 66 | 67 | goto :eof 68 | 69 | :run_vcvars64 70 | echo Unable to find devenv.exe in the path. Please run vcvars64.cmd and try again 71 | goto :eof 72 | 73 | :dll_not_found 74 | @echo Could not find msdia140.dll in the expected location. Please contact anlewis@adobe.com 75 | goto :eof 76 | 77 | :error_registering 78 | @echo An error occurred registering msdia140.dll. Please run this script in an elevated prompt. 79 | goto :eof -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Adobe Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to making participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, gender identity and expression, level of experience, 9 | nationality, personal appearance, race, religion, or sexual identity and 10 | orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | * Using welcoming and inclusive language. 18 | * Being respectful of differing viewpoints and experiences. 19 | * Gracefully accepting constructive criticism. 20 | * Focusing on what is best for the community. 21 | * Showing empathy towards other community members. 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | * The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances. 27 | * Trolling, insulting/derogatory comments, and personal or political attacks. 28 | * Public or private harassment. 29 | * Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission. 31 | * Other conduct which could reasonably be considered inappropriate in a 32 | professional setting. 33 | 34 | ## Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies both within project spaces and in public spaces 49 | when an individual is representing the project or its community. Examples of 50 | representing a project or community include using an official project e-mail 51 | address, posting via an official social media account, or acting as an appointed 52 | representative at an online or offline event. Representation of a project may be 53 | further defined and clarified by project maintainers. 54 | 55 | ## Enforcement 56 | 57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 58 | reported by contacting the project team at Grp-opensourceoffice@adobe.com. All 59 | complaints will be reviewed and investigated and will result in a response that 60 | is deemed necessary and appropriate to the circumstances. The project team is 61 | obligated to maintain confidentiality with regard to the reporter of an incident. 62 | Further details of specific enforcement policies may be posted separately. 63 | 64 | Project maintainers who do not follow or enforce the Code of Conduct in good 65 | faith may face temporary or permanent repercussions as determined by other 66 | members of the project's leadership. 67 | 68 | ## Attribution 69 | 70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 71 | available at [https://contributor-covenant.org/version/1/4][version]. 72 | 73 | [homepage]: https://contributor-covenant.org 74 | [version]: https://contributor-covenant.org/version/1/4/ 75 | -------------------------------------------------------------------------------- /CodeSamples/Has_Issues.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | /* Skeleton.cpp 14 | 15 | This is a compiling husk of a project. Fill it in with interesting 16 | pixel processing code. 17 | 18 | Revision History 19 | 20 | Version Change Engineer Date 21 | ======= ====== ======== ====== 22 | 1.0 (seemed like a good idea at the time) bbb 6/1/2002 23 | 24 | 1.0 Okay, I'm leaving the version at 1.0, bbb 2/15/2006 25 | for obvious reasons; you're going to 26 | copy these files directly! This is the 27 | first XCode version, though. 28 | 29 | 1.0 Let's simplify this barebones sample zal 11/11/2010 30 | 31 | 1.0 Added new entry point zal 9/18/2017 32 | 33 | */ 34 | #define WINDOWS_IGNORE_PACKING_MISMATCH 35 | #include "Skeleton.h" 36 | 37 | 38 | int SomeComputation(int x) { 39 | return x * 2; 40 | } 41 | 42 | // Case 1: you might as well pass it between functions 43 | static int should_just_be_local; 44 | 45 | // Case 2: Could just be initialized 46 | // 2a: a simple case 47 | int should_just_be_const = 2; 48 | 49 | // 2b: initialization can't easily be done in line 50 | static int state_with_initializer[64]; 51 | static bool state_was_initialized = false; 52 | void InitializeState() { 53 | for (int i = 0; i < 64; ++i) { 54 | state_with_initializer[i] = i * i; 55 | } 56 | state_was_initialized = true; 57 | } 58 | 59 | // Case 3: Initialized once based on runtime state and reused across renders. Should be a const static local 60 | static int depends_on_unchanging_prerender_state; 61 | 62 | // Case 4a: Should change across renders but each thread should have its own copy 63 | static int needs_to_stay_static; 64 | 65 | // Case 4b: Should change across renders but every thread needs an up-to-date-copy 66 | static int every_thread_needs_latest_state; 67 | 68 | 69 | static PF_Err 70 | About ( 71 | PF_InData *in_data, 72 | PF_OutData *out_data, 73 | PF_ParamDef *params[], 74 | PF_LayerDef *output ) 75 | { 76 | AEGP_SuiteHandler suites(in_data->pica_basicP); 77 | 78 | suites.ANSICallbacksSuite1()->sprintf( out_data->return_msg, 79 | "%s v%d.%d\r%s", 80 | STR(StrID_Name), 81 | MAJOR_VERSION, 82 | MINOR_VERSION, 83 | STR(StrID_Description)); 84 | return PF_Err_NONE; 85 | } 86 | 87 | static PF_Err 88 | GlobalSetup ( 89 | PF_InData *in_data, 90 | PF_OutData *out_data, 91 | PF_ParamDef *params[], 92 | PF_LayerDef *output ) 93 | { 94 | out_data->my_version = PF_VERSION( MAJOR_VERSION, 95 | MINOR_VERSION, 96 | BUG_VERSION, 97 | STAGE_VERSION, 98 | BUILD_VERSION); 99 | 100 | out_data->out_flags = PF_OutFlag_DEEP_COLOR_AWARE; // just 16bpc, not 32bpc 101 | 102 | return PF_Err_NONE; 103 | } 104 | 105 | static PF_Err 106 | ParamsSetup ( 107 | PF_InData *in_data, 108 | PF_OutData *out_data, 109 | PF_ParamDef *params[], 110 | PF_LayerDef *output ) 111 | { 112 | PF_Err err = PF_Err_NONE; 113 | PF_ParamDef def; 114 | 115 | AEFX_CLR_STRUCT(def); 116 | 117 | PF_ADD_FLOAT_SLIDERX( STR(StrID_Gain_Param_Name), 118 | SKELETON_GAIN_MIN, 119 | SKELETON_GAIN_MAX, 120 | SKELETON_GAIN_MIN, 121 | SKELETON_GAIN_MAX, 122 | SKELETON_GAIN_DFLT, 123 | PF_Precision_HUNDREDTHS, 124 | 0, 125 | 0, 126 | GAIN_DISK_ID); 127 | 128 | AEFX_CLR_STRUCT(def); 129 | 130 | PF_ADD_COLOR( STR(StrID_Color_Param_Name), 131 | PF_HALF_CHAN8, 132 | PF_MAX_CHAN8, 133 | PF_MAX_CHAN8, 134 | COLOR_DISK_ID); 135 | 136 | out_data->num_params = SKELETON_NUM_PARAMS; 137 | 138 | return err; 139 | } 140 | 141 | static PF_Err 142 | MySimpleGainFunc16 ( 143 | void *refcon, 144 | A_long xL, 145 | A_long yL, 146 | PF_Pixel16 *inP, 147 | PF_Pixel16 *outP) 148 | { 149 | PF_Err err = PF_Err_NONE; 150 | 151 | GainInfo *giP = reinterpret_cast(refcon); 152 | PF_FpLong tempF = 0; 153 | 154 | if (giP){ 155 | tempF = giP->gainF * PF_MAX_CHAN16 / 100.0; 156 | if (tempF > PF_MAX_CHAN16){ 157 | tempF = PF_MAX_CHAN16; 158 | }; 159 | 160 | outP->alpha = inP->alpha; 161 | outP->red = MIN((inP->red + (A_u_char) tempF), PF_MAX_CHAN16); 162 | outP->green = MIN((inP->green + (A_u_char) tempF), PF_MAX_CHAN16); 163 | outP->blue = MIN((inP->blue + (A_u_char) tempF), PF_MAX_CHAN16); 164 | } 165 | 166 | return err; 167 | } 168 | 169 | static PF_Err 170 | MySimpleGainFunc8 ( 171 | void *refcon, 172 | A_long xL, 173 | A_long yL, 174 | PF_Pixel8 *inP, 175 | PF_Pixel8 *outP) 176 | { 177 | PF_Err err = PF_Err_NONE; 178 | 179 | GainInfo *giP = reinterpret_cast(refcon); 180 | PF_FpLong tempF = 0; 181 | 182 | if (giP){ 183 | tempF = giP->gainF * PF_MAX_CHAN8 / 100.0; 184 | if (tempF > PF_MAX_CHAN8){ 185 | tempF = PF_MAX_CHAN8; 186 | }; 187 | 188 | outP->alpha = inP->alpha; 189 | outP->red = MIN((inP->red + (A_u_char) tempF), PF_MAX_CHAN8); 190 | outP->green = MIN((inP->green + (A_u_char) tempF), PF_MAX_CHAN8); 191 | outP->blue = MIN((inP->blue + (A_u_char) tempF), PF_MAX_CHAN8); 192 | } 193 | 194 | return err; 195 | } 196 | 197 | static PF_Err 198 | Render ( 199 | PF_InData *in_data, 200 | PF_OutData *out_data, 201 | PF_ParamDef *params[], 202 | PF_LayerDef *output ) 203 | { 204 | if (!state_was_initialized) { 205 | InitializeState(); 206 | } 207 | PF_Err err = PF_Err_NONE; 208 | AEGP_SuiteHandler suites(in_data->pica_basicP); 209 | 210 | /* Put interesting code here. */ 211 | GainInfo giP; 212 | AEFX_CLR_STRUCT(giP); 213 | A_long linesL = 0; 214 | 215 | int local_capture = every_thread_needs_latest_state; 216 | every_thread_needs_latest_state = SomeComputation(local_capture); 217 | 218 | int I_am_using_global_state_here = should_just_be_const 219 | * should_just_be_local 220 | * state_with_initializer[0] * 221 | depends_on_unchanging_prerender_state * 222 | local_capture * 223 | needs_to_stay_static; 224 | 225 | linesL = output->extent_hint.bottom - output->extent_hint.top; 226 | giP.gainF = params[SKELETON_GAIN]->u.fs_d.value; 227 | giP.gainF *= I_am_using_global_state_here; 228 | 229 | if (PF_WORLD_IS_DEEP(output)){ 230 | ERR(suites.Iterate16Suite1()->iterate( in_data, 231 | 0, // progress base 232 | linesL, // progress final 233 | ¶ms[SKELETON_INPUT]->u.ld, // src 234 | NULL, // area - null for all pixels 235 | (void*)&giP, // refcon - your custom data pointer 236 | MySimpleGainFunc16, // pixel function pointer 237 | output)); 238 | } else { 239 | ERR(suites.Iterate8Suite1()->iterate( in_data, 240 | 0, // progress base 241 | linesL, // progress final 242 | ¶ms[SKELETON_INPUT]->u.ld, // src 243 | NULL, // area - null for all pixels 244 | (void*)&giP, // refcon - your custom data pointer 245 | MySimpleGainFunc8, // pixel function pointer 246 | output)); 247 | } 248 | 249 | return err; 250 | } 251 | 252 | 253 | extern "C" DllExport 254 | PF_Err PluginDataEntryFunction( 255 | PF_PluginDataPtr inPtr, 256 | PF_PluginDataCB inPluginDataCallBackPtr, 257 | SPBasicSuite* inSPBasicSuitePtr, 258 | const char* inHostName, 259 | const char* inHostVersion) 260 | { 261 | PF_Err result = PF_Err_INVALID_CALLBACK; 262 | 263 | result = PF_REGISTER_EFFECT( 264 | inPtr, 265 | inPluginDataCallBackPtr, 266 | "Skeleton", // Name 267 | "ADBE Skeleton", // Match Name 268 | "Sample Plug-ins", // Category 269 | AE_RESERVED_INFO); // Reserved Info 270 | 271 | return result; 272 | } 273 | 274 | 275 | PF_Err 276 | EffectMain( 277 | PF_Cmd cmd, 278 | PF_InData *in_data, 279 | PF_OutData *out_data, 280 | PF_ParamDef *params[], 281 | PF_LayerDef *output, 282 | void *extra) 283 | { 284 | PF_Err err = PF_Err_NONE; 285 | should_just_be_local = 10; 286 | depends_on_unchanging_prerender_state = SomeComputation(in_data->width); 287 | every_thread_needs_latest_state = SomeComputation(in_data->width); 288 | needs_to_stay_static = SomeComputation(in_data->width); 289 | 290 | try { 291 | switch (cmd) { 292 | case PF_Cmd_ABOUT: 293 | 294 | err = About(in_data, 295 | out_data, 296 | params, 297 | output); 298 | break; 299 | 300 | case PF_Cmd_GLOBAL_SETUP: 301 | 302 | err = GlobalSetup( in_data, 303 | out_data, 304 | params, 305 | output); 306 | break; 307 | 308 | case PF_Cmd_PARAMS_SETUP: 309 | 310 | err = ParamsSetup( in_data, 311 | out_data, 312 | params, 313 | output); 314 | break; 315 | 316 | case PF_Cmd_RENDER: 317 | 318 | err = Render( in_data, 319 | out_data, 320 | params, 321 | output); 322 | break; 323 | } 324 | } 325 | catch(PF_Err &thrown_err){ 326 | err = thrown_err; 327 | } 328 | return err; 329 | } 330 | 331 | -------------------------------------------------------------------------------- /CodeSamples/Issues_Fixed.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | /* Skeleton.cpp 14 | 15 | This is a compiling husk of a project. Fill it in with interesting 16 | pixel processing code. 17 | 18 | Revision History 19 | 20 | Version Change Engineer Date 21 | ======= ====== ======== ====== 22 | 1.0 (seemed like a good idea at the time) bbb 6/1/2002 23 | 24 | 1.0 Okay, I'm leaving the version at 1.0, bbb 2/15/2006 25 | for obvious reasons; you're going to 26 | copy these files directly! This is the 27 | first XCode version, though. 28 | 29 | 1.0 Let's simplify this barebones sample zal 11/11/2010 30 | 31 | 1.0 Added new entry point zal 9/18/2017 32 | 33 | */ 34 | #define WINDOWS_IGNORE_PACKING_MISMATCH 35 | #include "Skeleton.h" 36 | #include 37 | #include 38 | 39 | int SomeComputation(int x) { 40 | return x * 2; 41 | } 42 | 43 | 44 | // Case 1: You might as well pass it between functions 45 | // Declared in EffectMain. 46 | 47 | // Case 2: Can just be statically initialized 48 | // 2a Just put const in front. 49 | const int should_just_be_const = 2; 50 | 51 | // 2b: You might have to change data types around a bit 52 | std::array InitializeState() { 53 | std::array temp; 54 | for (int i = 0; i < 64; ++i) { 55 | temp[i] = i * i; 56 | } 57 | return temp; 58 | } 59 | static const std::array state_with_initializer = InitializeState(); 60 | //static bool state_was_initialized = false; No need for flags 61 | 62 | // Case 3: make a const static local to initialize once and pass through 63 | // Declared in EffectMain. 64 | 65 | // Case 4a: Just make it thread_local 66 | thread_local static int needs_to_stay_static; 67 | 68 | // Case 4b: Protect all accesses with a mutex 69 | std::mutex case4b_mutex; 70 | static int every_thread_needs_latest_state; 71 | 72 | 73 | 74 | static PF_Err 75 | About ( 76 | PF_InData *in_data, 77 | PF_OutData *out_data, 78 | PF_ParamDef *params[], 79 | PF_LayerDef *output ) 80 | { 81 | AEGP_SuiteHandler suites(in_data->pica_basicP); 82 | 83 | suites.ANSICallbacksSuite1()->sprintf( out_data->return_msg, 84 | "%s v%d.%d\r%s", 85 | STR(StrID_Name), 86 | MAJOR_VERSION, 87 | MINOR_VERSION, 88 | STR(StrID_Description)); 89 | return PF_Err_NONE; 90 | } 91 | 92 | static PF_Err 93 | GlobalSetup ( 94 | PF_InData *in_data, 95 | PF_OutData *out_data, 96 | PF_ParamDef *params[], 97 | PF_LayerDef *output ) 98 | { 99 | out_data->my_version = PF_VERSION( MAJOR_VERSION, 100 | MINOR_VERSION, 101 | BUG_VERSION, 102 | STAGE_VERSION, 103 | BUILD_VERSION); 104 | 105 | out_data->out_flags = PF_OutFlag_DEEP_COLOR_AWARE; // just 16bpc, not 32bpc 106 | 107 | return PF_Err_NONE; 108 | } 109 | 110 | static PF_Err 111 | ParamsSetup ( 112 | PF_InData *in_data, 113 | PF_OutData *out_data, 114 | PF_ParamDef *params[], 115 | PF_LayerDef *output ) 116 | { 117 | PF_Err err = PF_Err_NONE; 118 | PF_ParamDef def; 119 | 120 | AEFX_CLR_STRUCT(def); 121 | 122 | PF_ADD_FLOAT_SLIDERX( STR(StrID_Gain_Param_Name), 123 | SKELETON_GAIN_MIN, 124 | SKELETON_GAIN_MAX, 125 | SKELETON_GAIN_MIN, 126 | SKELETON_GAIN_MAX, 127 | SKELETON_GAIN_DFLT, 128 | PF_Precision_HUNDREDTHS, 129 | 0, 130 | 0, 131 | GAIN_DISK_ID); 132 | 133 | AEFX_CLR_STRUCT(def); 134 | 135 | PF_ADD_COLOR( STR(StrID_Color_Param_Name), 136 | PF_HALF_CHAN8, 137 | PF_MAX_CHAN8, 138 | PF_MAX_CHAN8, 139 | COLOR_DISK_ID); 140 | 141 | out_data->num_params = SKELETON_NUM_PARAMS; 142 | 143 | return err; 144 | } 145 | 146 | static PF_Err 147 | MySimpleGainFunc16 ( 148 | void *refcon, 149 | A_long xL, 150 | A_long yL, 151 | PF_Pixel16 *inP, 152 | PF_Pixel16 *outP) 153 | { 154 | PF_Err err = PF_Err_NONE; 155 | 156 | GainInfo *giP = reinterpret_cast(refcon); 157 | PF_FpLong tempF = 0; 158 | 159 | if (giP){ 160 | tempF = giP->gainF * PF_MAX_CHAN16 / 100.0; 161 | if (tempF > PF_MAX_CHAN16){ 162 | tempF = PF_MAX_CHAN16; 163 | }; 164 | 165 | outP->alpha = inP->alpha; 166 | outP->red = MIN((inP->red + (A_u_char) tempF), PF_MAX_CHAN16); 167 | outP->green = MIN((inP->green + (A_u_char) tempF), PF_MAX_CHAN16); 168 | outP->blue = MIN((inP->blue + (A_u_char) tempF), PF_MAX_CHAN16); 169 | } 170 | 171 | return err; 172 | } 173 | 174 | static PF_Err 175 | MySimpleGainFunc8 ( 176 | void *refcon, 177 | A_long xL, 178 | A_long yL, 179 | PF_Pixel8 *inP, 180 | PF_Pixel8 *outP) 181 | { 182 | PF_Err err = PF_Err_NONE; 183 | 184 | GainInfo *giP = reinterpret_cast(refcon); 185 | PF_FpLong tempF = 0; 186 | 187 | if (giP){ 188 | tempF = giP->gainF * PF_MAX_CHAN8 / 100.0; 189 | if (tempF > PF_MAX_CHAN8){ 190 | tempF = PF_MAX_CHAN8; 191 | }; 192 | 193 | outP->alpha = inP->alpha; 194 | outP->red = MIN((inP->red + (A_u_char) tempF), PF_MAX_CHAN8); 195 | outP->green = MIN((inP->green + (A_u_char) tempF), PF_MAX_CHAN8); 196 | outP->blue = MIN((inP->blue + (A_u_char) tempF), PF_MAX_CHAN8); 197 | } 198 | 199 | return err; 200 | } 201 | 202 | 203 | static PF_Err 204 | Render ( 205 | PF_InData *in_data, 206 | PF_OutData *out_data, 207 | PF_ParamDef *params[], 208 | int should_just_be_local, 209 | int depends_on_unchanging_prerender_state, 210 | PF_LayerDef *output ) 211 | { 212 | // This is now done statically. 213 | //if (!state_was_initialized) { 214 | //InitializeState(); 215 | //} 216 | PF_Err err = PF_Err_NONE; 217 | AEGP_SuiteHandler suites(in_data->pica_basicP); 218 | 219 | /* Put interesting code here. */ 220 | GainInfo giP; 221 | AEFX_CLR_STRUCT(giP); 222 | A_long linesL = 0; 223 | int local_capture; 224 | { 225 | // scoped_lock would be preferable if your compiler supports it. 226 | std::lock_guard lock(case4b_mutex); 227 | local_capture = every_thread_needs_latest_state; 228 | every_thread_needs_latest_state = SomeComputation(local_capture); 229 | } 230 | int I_am_using_global_state_here = should_just_be_const 231 | * should_just_be_local 232 | * state_with_initializer[0] * 233 | depends_on_unchanging_prerender_state * 234 | local_capture * 235 | needs_to_stay_static; 236 | 237 | linesL = output->extent_hint.bottom - output->extent_hint.top; 238 | giP.gainF = params[SKELETON_GAIN]->u.fs_d.value; 239 | giP.gainF *= I_am_using_global_state_here; 240 | 241 | if (PF_WORLD_IS_DEEP(output)){ 242 | ERR(suites.Iterate16Suite1()->iterate( in_data, 243 | 0, // progress base 244 | linesL, // progress final 245 | ¶ms[SKELETON_INPUT]->u.ld, // src 246 | NULL, // area - null for all pixels 247 | (void*)&giP, // refcon - your custom data pointer 248 | MySimpleGainFunc16, // pixel function pointer 249 | output)); 250 | } else { 251 | ERR(suites.Iterate8Suite1()->iterate( in_data, 252 | 0, // progress base 253 | linesL, // progress final 254 | ¶ms[SKELETON_INPUT]->u.ld, // src 255 | NULL, // area - null for all pixels 256 | (void*)&giP, // refcon - your custom data pointer 257 | MySimpleGainFunc8, // pixel function pointer 258 | output)); 259 | } 260 | 261 | return err; 262 | } 263 | 264 | 265 | extern "C" DllExport 266 | PF_Err PluginDataEntryFunction( 267 | PF_PluginDataPtr inPtr, 268 | PF_PluginDataCB inPluginDataCallBackPtr, 269 | SPBasicSuite* inSPBasicSuitePtr, 270 | const char* inHostName, 271 | const char* inHostVersion) 272 | { 273 | PF_Err result = PF_Err_INVALID_CALLBACK; 274 | 275 | result = PF_REGISTER_EFFECT( 276 | inPtr, 277 | inPluginDataCallBackPtr, 278 | "Skeleton", // Name 279 | "ADBE Skeleton", // Match Name 280 | "Sample Plug-ins", // Category 281 | AE_RESERVED_INFO); // Reserved Info 282 | 283 | return result; 284 | } 285 | 286 | 287 | PF_Err 288 | EffectMain( 289 | PF_Cmd cmd, 290 | PF_InData *in_data, 291 | PF_OutData *out_data, 292 | PF_ParamDef *params[], 293 | PF_LayerDef *output, 294 | void *extra) 295 | { 296 | PF_Err err = PF_Err_NONE; 297 | int should_just_be_local = 10; 298 | static const int depends_on_unchanging_prerender_state = SomeComputation(in_data->width); 299 | { 300 | // scoped_lock would be preferable if your compiler supports it. 301 | std::lock_guard lock(case4b_mutex); 302 | every_thread_needs_latest_state = SomeComputation(in_data->width); 303 | } 304 | needs_to_stay_static = SomeComputation(in_data->width); 305 | 306 | try { 307 | switch (cmd) { 308 | case PF_Cmd_ABOUT: 309 | 310 | err = About(in_data, 311 | out_data, 312 | params, 313 | output); 314 | break; 315 | 316 | case PF_Cmd_GLOBAL_SETUP: 317 | 318 | err = GlobalSetup( in_data, 319 | out_data, 320 | params, 321 | output); 322 | break; 323 | 324 | case PF_Cmd_PARAMS_SETUP: 325 | 326 | err = ParamsSetup( in_data, 327 | out_data, 328 | params, 329 | output); 330 | break; 331 | 332 | case PF_Cmd_RENDER: 333 | 334 | err = Render( in_data, 335 | out_data, 336 | params, 337 | should_just_be_local, 338 | depends_on_unchanging_prerender_state, 339 | output); 340 | break; 341 | } 342 | } 343 | catch(PF_Err &thrown_err){ 344 | err = thrown_err; 345 | } 346 | return err; 347 | } 348 | 349 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright 2020 Adobe 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | --------------------------------------------------------------------------------