Skip to content

CPU Processor

cpu_processor

The main CPU processing implementation.

Classes:

CpuProcessor

CpuProcessor(cameras, lenses)

The main CPU processing implementation.

Methods:

load_density_curve

load_density_curve(
    negative_film: FilmSpectral,
    push_pull: float | int,
    color_masking: float | None = None,
)

Create the 1D LUT for the HD-curve.

load_input_lut

load_input_lut(
    negative_film: FilmSpectral,
    exp_kelvin: float | int,
    tint: float | int,
    exp_comp: float | int,
)

Create the 2D input LUT.

load_output_lut

load_output_lut(
    negative_film: FilmSpectral,
    print_film: FilmSpectral | None = None,
    red_light: float = 0.0,
    green_light: float = 0.0,
    blue_light: float = 0.0,
    projector_kelvin: int = 6500,
    shadow_comp: float = 0.0,
    sat_adjust: float = 1.0,
    gamma_func: GAMMA_KEYS = "sRGB",
    inversion_gamma: float = 4.0,
    idealized_curve: bool = False,
    inversion: bool = False,
    white_balance: bool = False,
    white_clip: bool = False,
    icc_transform=None,
    color_masking: float | None = None,
)

Create the output 3D LUT.

load_raw_image

load_raw_image(src, cam=None, lens=None, half_size: bool = True)

Load an image and apply lens correction.

load_raw_image_cached cached

load_raw_image_cached(src, cam=None, lens=None, half_size: bool = True)

Load images and cache previous requests.

process

process(
    src: str,
    negative_film: FilmSpectral,
    grain_size: float,
    grain_sigma: float,
    lens_correction: bool = True,
    print_film: FilmSpectral | None = None,
    exp_comp: float = 0.0,
    red_light: float = 0.0,
    green_light: float = 0.0,
    blue_light: float = 0.0,
    projector_kelvin: int = 6500,
    shadow_comp: float = 0.0,
    sat_adjust: float = 1.0,
    gamma_func: GAMMA_KEYS = "sRGB",
    exp_kelvin: int = 6500,
    tint: float = 0.0,
    inversion_gamma: float = 4.0,
    idealized_curve: bool = False,
    inversion: bool = False,
    push_pull: float = 0.0,
    white_balance: bool = False,
    white_clip: bool = False,
    icc_transform=None,
    resolution: None | tuple[int, int] = None,
    frame_width: int | float = 36,
    frame_height: int | float = 24,
    rotation: float = 0.0,
    zoom: float = 1.0,
    rotate_times: int = 0,
    flip: bool = False,
    cam: str | None = None,
    lens: str | None = None,
    canvas_mode: CANVAS_MODES = "No",
    canvas_scale: float = 1.0,
    canvas_ratio: float = 1.0,
    halation_intensity: float = 1.0,
    halation: bool = True,
    halation_size: float = 1.0,
    halation_green_factor: float = 0.4,
    sharpness: bool = True,
    sharpening_strength: float = 0.0,
    sharpening_sigma: float = 1.0,
    chroma_nr: int = 0,
    grain: int = 2,
    highlight_burn: float = 0.0,
    burn_scale: float = 50.0,
    half_size: bool = True,
    cache: bool = True,
    color_masking: float | None = None,
    max_scale: float | None = 400.0,
    **_,
)

Main function to load and process an image.