Commercial License Notice

The code generation modules, runtime target bindings, and underlying high-performance InfiniWorkflow Engine Library are proprietary software covered strictly under the Photron USA Inc. Commercial License Agreement. Redistribution, production deployment, or embedding these binaries into commercial applications requires a valid enterprise subscription tier.

1. What is CodeGen?

CodeGen turns your workflow into application or integration code. Depending on what you need, you can generate a complete sample application, a plugin, an extension, a notebook, or only the underlying processing code.

Sample App

Creates a complete application with a configurable user interface. This is the option to use when you want to design the application's controls, views, features, appearance, and build behavior.

OFX Plugin

Creates an OpenFX plugin suitable for hosts such as Resolve and Nuke.

PFV4 Plugin

Creates a Photron PFV4 plugin for camera frame buffers.

MATLAB Ext

Creates a MEX extension that can be called from MATLAB.

Jupyter Notebook

Creates an interactive Python notebook configured around the workflow.

Only Code

Generates the core processing code without the sample application's GUI.

Which option should I choose?
Choose Sample App when you want to customize the application's interface. Choose Only Code when you only need the processing implementation. Use the plugin or notebook options when the generated code is intended for those environments.

2. Starting CodeGen

  1. Open CodeGen from the application.
  2. Choose the type of output you want to create.
  3. Enter an Application Name for generated applications.
  4. Click Proceed.
  5. If you selected Sample App, the GUI Designer opens so you can configure the application before generation.

Application Name

The Application Name identifies the generated application. Use a simple name such as my_app. The application name is also used when creating the generated application workspace.

Cancel

Cancel closes the CodeGen setup without starting generation.

Proceed

Proceed continues with the selected generation type. You must enter an application name before continuing from the application setup screen.

3. CodeGen Options

Sample App — C++

Creates a C++ sample application with a configurable GUI. Selecting this option takes you to the GUI Designer.

Sample App — Python

Creates a Python sample application with a configurable GUI. Selecting this option takes you to the GUI Designer.

OFX Plugin

Creates a C++ OpenFX plugin. This is intended for OpenFX-compatible hosts such as Resolve and Nuke.

PFV4 Plugin

Creates a C++ Photron PFV4 plugin for camera frame buffers.

MATLAB Ext

Creates a MATLAB MEX extension that can be called directly from MATLAB scripts.

Jupyter Notebook

Creates a Python Jupyter Notebook configured for interactive use.

Only Code — C++

Generates C++ processing code without the sample application's GUI.

Only Code — Python

Generates Python processing code without the sample application's GUI.

The available generation choices and their C++/Python modes are defined by the CodeGen configuration. fileciteturn7file0L13-L23

4. GUI Designer Overview

The GUI Designer is where you configure the interface of a Sample App.

The designer is organized into five main areas:

  1. Parameters — the available workflow controls and outputs.
  2. Canvas — where you arrange application controls.
  3. Views — where you configure visual and telemetry outputs.
  4. Features — where you choose application capabilities.
  5. Style — where you configure the appearance and layout behavior.
  6. Build — where C++ applications can be configured for automatic compilation, execution, and packaging.
GUI Designer layout

Parameters   |   Canvas / Views / Features / Style / Build
The exact appearance follows the application's current theme.

Back

Back returns to the CodeGen selection screen without proceeding with the current designer configuration.

Proceed

Proceed accepts the current GUI configuration and starts generation.

5. Canvas Tab

The Canvas is where you design the application's control interface. You can drag workflow parameters onto the canvas, move them, resize them, select multiple controls, and organize controls into separate application tabs.

Parameters panel

The left side of the designer contains the parameters available from your workflow.

UI Widgets

Workflow nodes

Each workflow node appears as a group containing its available inputs and outputs.

Search

Use the search field at the top of the Parameters area to quickly find a node, input, or output.

Adding a control

  1. Find the parameter in the Parameters area.
  2. Drag it onto the Canvas.
  3. Drop it where you want the control to appear.
  4. Select the control to edit its properties.
You can also drag an entire workflow node onto the Canvas. This creates a group of controls for that node rather than requiring each parameter to be added individually.

Moving and resizing controls

Click and drag a control to move it. Select a control to expose its resize handle, then drag the handle to change its size.

Selecting multiple controls

Multiple controls can be selected together. Multi-selection is useful for moving groups of controls or aligning them.

Alignment

ButtonWhat it does
Align LeftLines up selected controls using their left edges.
Align CenterCenters selected controls horizontally.
Align RightLines up selected controls using their right edges.

Clear

Clear removes the controls from the current canvas so you can rebuild the layout.

Undo and Redo

Undo reverses recent layout changes. Redo restores a change that was undone.

6. Organizing the Interface with Canvas Tabs

Canvas tabs let you divide a complex application interface into separate pages of controls.

Adding a tab

Click + Tab to create a new page. The new page starts with the name New Tab.

Renaming a tab

Double-click a tab name to rename it. Use meaningful names such as Camera, Processing, Output, or Advanced.

Switching tabs

Click a tab to make it the active control page.

Deleting a tab

Use the tab's close button to delete it. You will be asked to confirm because all controls on that page are deleted with the tab. The final remaining tab cannot be deleted.

Important: deleting a tab also deletes the parameters placed on that tab. Make sure you have moved anything you want to keep before confirming.

7. Control Properties

Select a control on the Canvas to edit its properties.

Assigned Tab

Choose which application page should contain the selected control.

Display Label / Text

Change the text displayed next to or inside the control.

Text Color

For text labels, choose the color used by the label.

Text Alignment

Text labels can be aligned Left, Center, or Right.

Camera Options

Camera-related controls can have camera-source constraints where applicable.

Position and Size

You can directly edit the control's X, Y, Width, and Height values for precise placement.

Remove Selected

Use Remove Selected to delete the selected control from the interface.

Different controls have different properties

The properties shown depend on the selected item. For example, text labels expose text and alignment settings, while camera controls can expose camera-specific settings.

8. Views Tab

The Views tab controls what the application displays as visual outputs and telemetry.

Media

The Media area contains image/video-style outputs from the workflow.

Output title

Give each output a meaningful title. The title is what users see when interacting with the generated application.

Default View

Use Set as Default to make a media output the application's default view.

Remove

Remove an output from the application's configured views when it is not needed.

Telemetry

Telemetry outputs are numeric or other non-video values that can be displayed by the application.

Tip: use clear titles for outputs. For example, instead of leaving a technical port name visible, use a user-facing description such as Frame Rate, Temperature, or Edge Strength.

9. Features Tab

The Features tab determines which capabilities are available to users of the generated application.

Playback Controls

The playback section controls navigation through media or frames.

FeaturePurpose
Seek FirstMove to the first available frame or position.
Seek PriorMove to the previous frame or position.
Seek NextMove to the next frame or position.
Seek LastMove to the final available frame or position.

Application Features

FeaturePurpose
ZoomProvides zoom functionality for the displayed content.
ImageProvides image-related viewing functionality.
MeasurementProvides measurement functionality.
StabilizeProvides stabilization functionality.
Key StoneProvides keystone correction functionality.
Pixel ProbeProvides pixel inspection functionality.
ViewProvides view-related functionality.
TelemetryProvides telemetry display functionality.

Available and Enabled

Features are managed using two lists:

Moving features

ButtonAction
Move AllEnables all available features.
MoveMoves selected features into the Enabled list.
Move in the opposite directionReturns selected enabled features to Available.
Move All in the opposite directionRemoves all optional features from Enabled.
Recommended approach: only enable features your application's users actually need. This keeps the generated interface simpler and easier to use.

10. Style Tab

The Style tab controls the visual appearance and layout behavior of the generated application.

App Features & Layout

Controls Position

OptionResult
LeftApplication controls appear on the left side of the interface.
RightApplication controls appear on the right side.
FloatingControls use a floating panel arrangement.

Timeline Position

OptionResult
EmbeddedThe timeline is integrated with the viewing area.
TopThe timeline appears above the viewer.
BottomThe timeline appears below the viewer.

Fonts & Global

Padding & Spacing

These controls determine how much space is used around windows, frames, items, and nested controls. Adjust them to make the interface more compact or more spacious.

Rounding & Borders

These controls determine the amount of corner rounding and border thickness used throughout the interface, including windows, frames, popups, tabs, scrollbars, and controls.

Colors

Colors are grouped into logical sections:

Theme Presets

The available presets include:

Theme Search

Use the search field to quickly locate a style setting.

Live Preview

The live preview shows how the application's controls, viewer, and timeline will be arranged. Use it while experimenting with layout settings so you can see the effect before generating the application.

Customizing a preset: once you change individual style values, the designer treats the theme as a custom configuration so your changes can be retained.

11. Build Tab

The Build tab provides build and packaging options for C++ Sample Apps.

Automatic Compilation

Enable Automatic Compilation (Build) controls whether the generated C++ application is automatically compiled.

Automatic Execution

Enable Automatic Execution (Run) controls whether the application is launched automatically after a successful build.

Run depends on Build. Automatic execution is only useful when automatic compilation is enabled.

Packaging & Installer

Enable the installer/package option when you want the generated application prepared for distribution.

Installer information includes:

SettingWhat to enter
Author / CompanyThe company or person responsible for the application.
VersionThe application's release version.
App Identifier / Bundle IDThe unique application identifier.
DescriptionA description of the application.
License File PathAn optional license file to include with the package.

The interface describes packaging targets as NSIS Windows / DMG Mac.

12. Generating the Application

After configuring the designer, click Proceed.

  1. The designer saves the current configuration.
  2. CodeGen starts generating the selected application.
  3. A progress display shows the generation status.
  4. When generation finishes, the generated files are displayed.

The generation process uses the selected language, application name, workflow, and interface configuration. The source confirms that the generation request includes the selected generation mode, layout configuration, application name, and plugin/notebook options where applicable. fileciteturn7file2L190-L205

13. Generated Source

After generation, the application displays the generated files so you can inspect the result.

Build & Run

When the generated result contains a buildable application, Build & Run is available. The generated result is considered buildable when the expected CMake or Python application files are present. fileciteturn7file2L225-L242

Copying build output

The build workspace provides a console showing compiler/build messages. Use this output when diagnosing a failed build.

Build progress

During compilation, the status can progress through workspace creation, CMake configuration, C++ compilation, deployment, and finally a successful running state. fileciteturn7file6L474-L516

14. Recommended User Workflow

  1. Choose Sample App if you need a custom application interface.
  2. Enter the application name.
  3. Open the Canvas.
  4. Add the important workflow inputs. Drag them from Parameters onto the Canvas.
  5. Organize controls into tabs. Use separate tabs for logical groups of controls.
  6. Configure control properties. Set labels, placement, size, and other available options.
  7. Configure Views. Add the visual outputs users should see and choose a default view.
  8. Configure Telemetry. Add useful numeric outputs and give them readable names and colors.
  9. Configure Features. Enable only the capabilities users need.
  10. Configure Style. Choose the control position, timeline location, theme, colors, spacing, and other appearance settings.
  11. Configure Build. For C++, decide whether the application should build and run automatically and whether it should be packaged.
  12. Proceed. Generate the application.
  13. Build & Run. If available, compile and launch the generated application.

15. Practical Design Tips

Keep the Canvas simple

Do not place every parameter on one page. Use Canvas tabs to separate groups of related controls.

Use user-facing labels

Technical workflow parameter names may be useful to developers but confusing to end users. Rename displayed labels to describe what the setting actually does.

Choose a useful default view

If your workflow produces several visual outputs, choose the output users are most likely to need first as the default.

Do not enable unnecessary features

Every enabled feature adds another capability to the generated application. Keep the interface focused on the application's purpose.

Use Style after the interface is functional

First build the controls and views, then use Style to refine the appearance and layout. This makes it easier to distinguish functional changes from visual changes.

Test Build and Run before packaging

For C++ applications, verify that the generated application builds and runs correctly before preparing the installer/package.

16. Quick Reference

Screen / TabMain purpose
CodeGenChoose what kind of code or application to generate.
CanvasDesign the application's controls and control pages.
ViewsConfigure visual outputs and telemetry.
FeaturesChoose playback and application capabilities.
StyleConfigure layout, fonts, spacing, colors, borders, rounding, and theme.
BuildConfigure automatic C++ build/run and packaging.
ProceedAccept the configuration and generate the application.
BackReturn to the previous configuration screen.

Build, Run & Installer Generation

Upon generating your application, you are provided with a Source code explorer interface. This interface allows you to:

Installer Generation (NSIS Requirement)

The system also provides a Standalone ZIP Packager that compresses your application into a final distributable artifact. To successfully build full executable installers via this backend service, you must install NSIS (Nullsoft Scriptable Install System) on your build machine. Ensure that the makensis executable is explicitly added to your system's PATH environment variable so the automated packaging scripts can invoke it correctly.

Localization

To translate or customize text within your generated application, the engine supports a drop-in localization dictionary. Follow these steps to implement custom strings:

  1. Navigate to the assets directory within your project workspace.
  2. Create a text file explicitly named localize.txt.
  3. Add your translations using a standard key-value format. You can use either an equals sign (=) or a colon (:) as a delimiter.

Example localize.txt formatting:

# This is a comment line
my_app = My Custom App Name
Zoom In : Magnify View
Tracking Progress = Processando o Rastreamento

Note: The engine will automatically load these pairs at runtime and replace corresponding tr("...") text wrapping instances in the UI.

Bundling the Visual C++ Redistributable

If your application depends on the Visual C++ runtime, you can have the installer check for it and install it automatically — no code changes required.

Place your copy of vc_redist.x64.exe in your project's assets folder. During generation, the installer:

This means bundling the redistributable is entirely optional and additive — including or omitting vc_redist.x64.exe from assets is the only thing you need to do.


Customizing Your App and Installer Branding

When you generate your C++ or Python applications, the system automatically includes default branding assets and licensing files so your app is ready to compile immediately. However, you can easily override these defaults to fully customize and white-label your application and its installer.

How It Works

The code generator uses a simple drop-in replacement system. During generation, it checks your project's assets folder for specific file names. If it finds your custom files, it will use them. If a file is missing, it will seamlessly fall back to the default system assets.

Supported Custom Files

To override the default branding, simply place any of the following files directly into your project's assets directory:

The Result

There is no need to modify any code, scripts, or configuration files. Just drop your preferred assets into the assets folder, and the next time you trigger the code generation, your branding will automatically replace the defaults!

Code Signing Your Executable and Installer

If you have a code-signing process, you can have it applied automatically during generation.

Place a signing script in your project's assets folder:

The script should accept a single argument — the full path to the file to sign — and sign that file in place (for example, by calling out to signtool on Windows or codesign/your own signing tooling on macOS/Linux).

When a signing script is found:

If no signing script is present in assets, signing is skipped entirely and generation proceeds exactly as it would otherwise — no extra steps, no changes to your build.

Note: The uninstaller that ships inside the installer is not currently signed as part of this process.

Application User Interface Features

The generated application's user interface can be xtended with application features by adding them in the Features tab of the GUI designer.

1. Zoom Controls

2. Image Adjustments & Comparison

3. Measurement & Calibration

4. Stabilization

5. Keystone Correction

6. View Selector & Exporting

7. Telemetry & Data Inspection

8. Playback & Timeline

Architecture & API Usage

Regardless of your chosen output language, your code follows a matching workflow lifecycle to manage memory boundaries and thread execution models cleanly:

C++ API


OVERALL C++ WORKFLOW LIFECYCLE USAGE HANDBOOK:

INITIALIZATION & SETUP:
AppLogic app;
if (!app.initEngine()) { // Initializes Photron Engine
    // Handle DLL loading failure safely
    return -1;
}
app.setupWorkflow(); // Hydrates pipeline handles, configurations, and topology

LIVE PARAMETER MODIFICATION:
Modifies parameter values type-safely via Port Enums mapped dynamically:
app.updateNodeVal(NodeID::AI_WELDING, AI_WeldingInputs::MODEL, std::string("..."));

LIVE VIEWER API:
Registers a live callback to view output of a node's port
app.addImageLive(NodeID::AI_WELDING, 2, "live_ai_welding_2", on_ai_welding_2_callback);
app.addMatrixLive(NodeID::WELD_ANALYSIS, 0, "live_weld_analysis_0", on_weld_analysis_0_callback);
app.addNumericLive(NodeID::WELD_ANALYSIS, 2, "live_weld_analysis_2", on_weld_analysis_2_numeric_callback);

C++ Example

Below is a typical lifecycle implementation mapping the exported C++ target bindings based on the engine's initialization architecture:

#include "app_logic.h"
#include <iostream>
#include <mutex>
#include <opencv2/opencv.hpp>

// Define a global lock and frame buffer
std::mutex g_data_mutex;
cv::Mat g_ai_welding_2_frame;

// Define the live image callback
void on_ai_welding_2_callback(const cv::Mat& frame) {
    std::lock_guard<std::mutex> lock(g_data_mutex);
    if (!frame.empty()) {
        frame.copyTo(g_ai_welding_2_frame);
    }
}

int main() {
    AppLogic app;
    
    // 1. Initialize engine library bindings
    if (!app.initEngine()) {
        std::cerr << "Failed to load photron_engine runtime binary." << std::endl;
        return -1;
    }
    
    // 2. Hydrate configuration parameters and thread topology
    app.setupWorkflow(); 
    
    // 3. Connect Live View Listeners
    app.addImageLive(NodeID::AI_WELDING, 2, "live_ai_welding_2", on_ai_welding_2_callback);
    
    // 4. Update active node attributes type-safely via generated Port Enums
    app.updateNodeVal(NodeID::AI_WELDING, AI_WeldingInputs::MODEL, std::string("path/to/model.onnx"));
    
    // Main UI or execution loop would continue here...
    return 0;
}

Local C++ Compilation & Deployment

To compile your pipeline using native C++ bindings, ensure your built application can access all engine library links correctly by executing the following steps:

  1. Download the generated app_logic.h and app_logic.cpp files and add them to your C++ application project layout.
  2. Build the source files together with your main orchestration code into a compiled executable file.
  3. Move or copy your finalized executable binary artifact into the designated bin directory or run the included standalone zip packager.
  4. Execute your application binary directly from that folder.
Method Description & Examples
__init__ Initializes the Photron engine, configures the PythonNodeFactory, and sets up essential FFI callback types and memory management to prevent garbage collection crashes.
initialize_workflow Entry point for building the computational pipeline; instantiates C++ nodes and Python proxies, sets node parameters, and establishes edge connections.
add_live_viewer Creates a live viewer node, connects it to a source, and registers a callback for C++ nodes

Examples:
1. Numeric: app.add_live_viewer(NodeID.NUMERIC_A_B, 0, 'numeric', lambda val: print(f"Value: {val}"))
2. String: app.add_live_viewer(NodeID.STR, 0, 'string', lambda s: print(f"String: {s.decode('utf-8')}"))
3. Matrix: app.add_live_viewer(NodeID.DARKNET_YOLO7_CLASSIFICATION, 0, 'matrix', lambda mat: print(f"Mean: {mat.mean()}"))
4. Image: app.add_live_viewer(NodeID.MOVIE_READER, 0, 'image', lambda img: print(f"Shape: {img.shape}"))

Note: Automatically wraps raw C++ pointers into NumPy arrays and uses arr.copy() to ensure data persistence.
execution_loop A daemon thread that manages node updates, triggers re-execution for "dirty" Python nodes, and handles stream inspection logging.
update_node_val Updates node parameters; if the target is a Python node, it marks it as "dirty" for re-execution; otherwise, it calls the engine’s parameter setter.
view_node Designates a node/port for real-time inspection. For Python nodes, it enables internal monitoring; for C++ nodes, it triggers native engine rendering.
update_from_cpp Synchronizes Python state with C++ updates, parsing binary streams and mapping raw data buffers to NumPy arrays.
python_proxy_callback A static FFI handler invoked by the C++ engine to flag specific proxy nodes as "dirty" when their port data updates.
stop Signals the execution thread to stop and gracefully shuts down the workflow pipeline.