cinema_python.images

cinema_python.images.camera_utils module

A collection of utilities for cinema camera handling.

cinema_python.images.camera_utils.convert_pose_to_camera(iPosition, iFocalPoint, iViewUp, pose, camType)[source]

Converts input eye, focal point and view up using the pose and camType and returns (neweye, newfp, newviewup)

cinema_python.images.camera_utils.nearest_camera(poses, mnext)[source]

find index of the pose that is closest match to mnext

cinema_python.images.compositor module

A module that composites one or more layers together to produce a recognizable image.

class cinema_python.images.compositor.Compositor[source]

Bases: object

enableGeometryColor(enable)[source]
enableLighting(enable)[source]
render(layers)[source]
setColorDefinitions(colorDefs)[source]
set_background_color(rgb)[source]
class cinema_python.images.compositor.Compositor_SpecA(parent=None)[source]

Bases: cinema_python.images.compositor.Compositor

Compositor SpecA. Loads LayerSpecs consisting of a single image. No compositing supported.

class cinema_python.images.compositor.Compositor_SpecB(parent=None)[source]

Bases: cinema_python.images.compositor.Compositor

Compositor SpecB. Composites several LayerSpec instances together. Each LayerSpec holds all of its buffer components (depth, color, luminance, etc.).

ambient(rgb)[source]

Returns the ambient contribution in an RGB luminance image.

diffuse(rgb)[source]

Returns the diffuse contribution in an RGB luminance image.

enableGeometryColor(enable)[source]
enableLighting(enable)[source]
setColorDefinitions(colorDefs)[source]
specular(rgb)[source]

Returns the specular contribution in an RGB luminance image.

cinema_python.images.querymaker module

API for creating images that correspond to a set of queries. Used by viewer primarily.

class cinema_python.images.querymaker.QueryMaker[source]

Bases: object

setStore(store)[source]
store()[source]
supportsLayering()[source]

Predicate to query if a translator supports compositing (e.g. Spec-B). Abstract, implement in a derived class.

translateQuery(query)[source]

Receives a set of parameters from the UI. The parameters (or UI queries) come in the following form:

total_query = { “parameter_1” : set([values_of_1]),
“parameter_2” : set([values_of_2]), ... }

Example:

total_query = { “phi” : set([-180]),
“theta” : set([0]), “Slice2” : set([-0.34, -0.1, 0.1]) }

The queries are passed to the LayerRasters instances which then use cinema_store to parse these queries into image file paths. This method is expected to return a set of LayerRasters consisting of all the layers to render (each LayerRasters instance holds all of its required images). Abstract, implement in a derived class.

class cinema_python.images.querymaker.QueryMaker_SpecA[source]

Bases: cinema_python.images.querymaker.QueryMaker

This class translates UI queries into a single Spec-A LayerRasters instance (single-image).

supportsLayering()[source]
translateQuery(query)[source]

cinema_python.images.querymaker_specb module

Creating images that correspond to a set of queries by compositing the results together. Used by viewer primarily.

class cinema_python.images.querymaker_specb.QueryMaker_SpecB[source]

Bases: cinema_python.images.querymaker.QueryMaker

This class translates UI queries into a set of Spec-B LayerRasters instances (multi-image). This set of LayerRasters can be composited through the Compositor class (compositor.py).

supportsLayering()[source]
translateQuery(query, colorDefinitions={})[source]

Receives a UI query and returns a set of LayerRasters consisting of all the different layers to composite. See the base class documentation for detail.

cinema_python.images.lookup_tables module

Module for handling color lookup tables.

class cinema_python.images.lookup_tables.LookupTable[source]

Color table container. - self.lut : Actual color LUT. - self.x : Vector containing the value bins. - self.adjustedBins : Vector containing the value bins Where adjustedBins is adjusted to hold a value > 1.0 in the end.

ingest(rgbPoints)[source]
class cinema_python.images.lookup_tables.LookupTableManager[source]

Loads a set of color lookup tables from a .json file.

getColorLutStructByName(name)[source]
names()[source]

Return an array of the names of all available lookup tables.

read(file_path)[source]
cinema_python.images.lookup_tables.add_grayscale(luts)[source]
cinema_python.images.lookup_tables.add_ocean(luts)[source]
cinema_python.images.lookup_tables.add_rainbow(luts)[source]
cinema_python.images.lookup_tables.add_spectral(luts)[source]

cinema_python.images.layer_rasters module

Manages the set of one or more fields that go into a layer.

class cinema_python.images.layer_rasters.LayerRasters[source]

Bases: object

addQuery(img_type, fieldname, fieldchoice)[source]

add a query for a particular field of the layer

addToBaseQuery(query)[source]

add queries that together define the layer

customizationName
getColorArray(index=0)[source]
getDepth()[source]
getLuminance()[source]
getValueArray(index=0)[source]
hasColorArray()[source]
hasValueArray()[source]
loadImages(store)[source]

Take the queries we’ve been given and get images for them. Later call get* to get the images out.

setCustomizationName(name)[source]
setValueRange(vRange)[source]
valueRange