PfmVizzer
from panda3d.core import PfmVizzer
- class PfmVizzer
Bases:
DTOOL_SUPER_BASE
This class aids in the visualization and manipulation of PfmFile objects.
Inheritance diagram
- CTAuxVertex1 = 7
- CTAuxVertex2 = 8
- CTAuxVertex3 = 9
- CTBlend1 = 6
- CTNormal3 = 5
- CTTexcoord2 = 0
- CTTexcoord3 = 1
- CTVertex1 = 2
- CTVertex2 = 3
- CTVertex3 = 4
- CT_aux_vertex1 = 7
- CT_aux_vertex2 = 8
- CT_aux_vertex3 = 9
- CT_blend1 = 6
- CT_normal3 = 5
- CT_texcoord2 = 0
- CT_texcoord3 = 1
- CT_vertex1 = 2
- CT_vertex2 = 3
- CT_vertex3 = 4
- MFBack = 2
- MFBoth = 3
- MFFront = 1
- MF_back = 2
- MF_both = 3
- MF_front = 1
- __init__(*args, **kwargs)
- addVisColumn()
C++ Interface: add_vis_column(const PfmVizzer self, int source, int target, InternalName name, const TransformState transform, const Lens lens, const PfmFile undist_lut)
- /**
Adds a new vis column specification to the list of vertex data columns that
will be generated at the next call to generate_vis_points() or
generate_vis_mesh(). This advanced interface supercedes the higher-level
set_vis_inverse(), set_flat_texcoord_name(), and set_vis_2d().
If you use this advanced interface, you must specify explicitly the
complete list of data columns to be created in the resulting
GeomVertexData, by calling add_vis_column() each time. For each column,
you specify the source of the column in the PFMFile, the target column and
name in the GeomVertexData, and an optional transform matrix and/or lens to
transform and project the point before generating it.
*/
- /**
The private implementation of the public add_vis_column(), this adds the
column to the indicated specific vector.
*/
- add_vis_column()
C++ Interface: add_vis_column(const PfmVizzer self, int source, int target, InternalName name, const TransformState transform, const Lens lens, const PfmFile undist_lut)
- /**
Adds a new vis column specification to the list of vertex data columns that
will be generated at the next call to generate_vis_points() or
generate_vis_mesh(). This advanced interface supercedes the higher-level
set_vis_inverse(), set_flat_texcoord_name(), and set_vis_2d().
If you use this advanced interface, you must specify explicitly the
complete list of data columns to be created in the resulting
GeomVertexData, by calling add_vis_column() each time. For each column,
you specify the source of the column in the PFMFile, the target column and
name in the GeomVertexData, and an optional transform matrix and/or lens to
transform and project the point before generating it.
*/
- /**
The private implementation of the public add_vis_column(), this adds the
column to the indicated specific vector.
*/
- calcMaxUDisplacement()
C++ Interface: calc_max_u_displacement(PfmVizzer self)
- /**
Computes the maximum amount of shift, in pixels either left or right, of
any pixel in the distortion map. This can be passed to
make_displacement(); see that function for more information.
*/
- calcMaxVDisplacement()
C++ Interface: calc_max_v_displacement(PfmVizzer self)
- /**
Computes the maximum amount of shift, in pixels either up or down, of any
pixel in the distortion map. This can be passed to make_displacement();
see that function for more information.
*/
- calc_max_u_displacement()
C++ Interface: calc_max_u_displacement(PfmVizzer self)
- /**
Computes the maximum amount of shift, in pixels either left or right, of
any pixel in the distortion map. This can be passed to
make_displacement(); see that function for more information.
*/
- calc_max_v_displacement()
C++ Interface: calc_max_v_displacement(PfmVizzer self)
- /**
Computes the maximum amount of shift, in pixels either up or down, of any
pixel in the distortion map. This can be passed to make_displacement();
see that function for more information.
*/
- clearAuxPfm()
C++ Interface: clear_aux_pfm(const PfmVizzer self)
- /**
Removes the auxiliary PfmFile from this PfmVizzer.
*/
- clearFlatTexcoordName()
C++ Interface: clear_flat_texcoord_name(const PfmVizzer self)
- /**
Resets the flat_texcoord_name to empty, so that additional texture
coordinates are not created.
This may be used in lieu of the lower-level add_vis_column().
*/
- clearVisBlend()
C++ Interface: clear_vis_blend(const PfmVizzer self)
- /**
Removes the blending map set by a prior call to set_vis_blend().
*/
- clearVisColumns()
C++ Interface: clear_vis_columns(const PfmVizzer self)
- /**
Removes all of the previously-added vis columns in preparation for building
a new list. See add_vis_column().
*/
- clear_aux_pfm()
C++ Interface: clear_aux_pfm(const PfmVizzer self)
- /**
Removes the auxiliary PfmFile from this PfmVizzer.
*/
- clear_flat_texcoord_name()
C++ Interface: clear_flat_texcoord_name(const PfmVizzer self)
- /**
Resets the flat_texcoord_name to empty, so that additional texture
coordinates are not created.
This may be used in lieu of the lower-level add_vis_column().
*/
- clear_vis_blend()
C++ Interface: clear_vis_blend(const PfmVizzer self)
- /**
Removes the blending map set by a prior call to set_vis_blend().
*/
- clear_vis_columns()
C++ Interface: clear_vis_columns(const PfmVizzer self)
- /**
Removes all of the previously-added vis columns in preparation for building
a new list. See add_vis_column().
*/
- extrude()
C++ Interface: extrude(const PfmVizzer self, const Lens lens)
- /**
Converts each (u, v, depth) point of the Pfm file to an (x, y, z) point, by
reversing project(). If the original file is only a 1-d file, assumes that
it is a depth map with implicit (u, v) coordinates.
This method is only valid for a linear lens (e.g. a PerspectiveLens or
OrthographicLens). Non-linear lenses don’t necessarily compute a sensible
depth coordinate.
*/
- generateVisMesh()
C++ Interface: generate_vis_mesh(PfmVizzer self, int face)
- /**
Creates a triangle mesh with the points of the pfm as 3-d coordinates in
space, and texture coordinates ranging from 0 .. 1 based on the position
within the pfm grid.
*/
- generateVisPoints()
C++ Interface: generate_vis_points(PfmVizzer self)
- /**
Creates a point cloud with the points of the pfm as 3-d coordinates in
space, and texture coordinates ranging from 0 .. 1 based on the position
within the pfm grid.
*/
- generate_vis_mesh()
C++ Interface: generate_vis_mesh(PfmVizzer self, int face)
- /**
Creates a triangle mesh with the points of the pfm as 3-d coordinates in
space, and texture coordinates ranging from 0 .. 1 based on the position
within the pfm grid.
*/
- generate_vis_points()
C++ Interface: generate_vis_points(PfmVizzer self)
- /**
Creates a point cloud with the points of the pfm as 3-d coordinates in
space, and texture coordinates ranging from 0 .. 1 based on the position
within the pfm grid.
*/
- getAuxPfm()
C++ Interface: get_aux_pfm(PfmVizzer self)
- /**
Returns the reference to the auxiliary PfmFile queried by this PfmVizzer.
This contains the values that will be reflected in CT_aux_vertex3 etc. See
set_aux_pfm().
*/
- getFlatTexcoordName()
C++ Interface: get_flat_texcoord_name(PfmVizzer self)
- /**
Returns the flat_texcoord_name. See set_flat_texcoord_name().
*/
- getKeepBeyondLens()
C++ Interface: get_keep_beyond_lens(PfmVizzer self)
- /**
Returns the keep_beyond_lens flag. See set_keep_beyond_lens().
*/
- getPfm()
C++ Interface: get_pfm(const PfmVizzer self) get_pfm(PfmVizzer self)
- getVis2d()
C++ Interface: get_vis_2d(PfmVizzer self)
- /**
Returns the vis_2d flag. See set_vis_2d().
*/
- getVisBlend()
C++ Interface: get_vis_blend(PfmVizzer self)
- /**
Returns the blending map set by the most recent call to set_vis_blend(), or
NULL if there is no blending map in effect.
*/
- getVisInverse()
C++ Interface: get_vis_inverse(PfmVizzer self)
- /**
Returns the vis_inverse flag. See set_vis_inverse().
*/
- get_aux_pfm()
C++ Interface: get_aux_pfm(PfmVizzer self)
- /**
Returns the reference to the auxiliary PfmFile queried by this PfmVizzer.
This contains the values that will be reflected in CT_aux_vertex3 etc. See
set_aux_pfm().
*/
- get_flat_texcoord_name()
C++ Interface: get_flat_texcoord_name(PfmVizzer self)
- /**
Returns the flat_texcoord_name. See set_flat_texcoord_name().
*/
- get_keep_beyond_lens()
C++ Interface: get_keep_beyond_lens(PfmVizzer self)
- /**
Returns the keep_beyond_lens flag. See set_keep_beyond_lens().
*/
- get_pfm()
C++ Interface: get_pfm(const PfmVizzer self) get_pfm(PfmVizzer self)
- get_vis_2d()
C++ Interface: get_vis_2d(PfmVizzer self)
- /**
Returns the vis_2d flag. See set_vis_2d().
*/
- get_vis_blend()
C++ Interface: get_vis_blend(PfmVizzer self)
- /**
Returns the blending map set by the most recent call to set_vis_blend(), or
NULL if there is no blending map in effect.
*/
- get_vis_inverse()
C++ Interface: get_vis_inverse(PfmVizzer self)
- /**
Returns the vis_inverse flag. See set_vis_inverse().
*/
- makeDisplacement()
C++ Interface: make_displacement(PfmVizzer self, PNMImage result, double max_u, double max_v, bool for_32bit) make_displacement(PfmVizzer self, PfmFile result, double max_u, double max_v, bool for_32bit)
- /**
Assuming the underlying PfmFile is a 2-d distortion mesh, with the U and V
in the first two components and the third component unused, this computes
an AfterEffects-style displacement map that represents the same distortion.
The indicated PNMImage will be filled in with a displacement map image,
with horizontal shift in the red channel and vertical shift in the green
channel, where a fully bright (or fully black) pixel indicates a shift of
max_u or max_v pixels.
Use calc_max_u_displacement() and calc_max_v_displacement() to compute
suitable values for max_u and max_v.
This generates an integer 16-bit displacement image. It is a good idea,
though not necessarily essential, to check “Preserve RGB” in the interpret
footage section for each displacement image. Set for_32bit true if this is
meant to be used in a 32-bit project file, and false if it is meant to be
used in a 16-bit project file.
*/
- /**
Assuming the underlying PfmFile is a 2-d distortion mesh, with the U and V
in the first two components and the third component unused, this computes
an AfterEffects-style displacement map that represents the same distortion.
The indicated PNMImage will be filled in with a displacement map image,
with horizontal shift in the red channel and vertical shift in the green
channel, where a fully bright (or fully black) pixel indicates a shift of
max_u or max_v pixels.
Use calc_max_u_displacement() and calc_max_v_displacement() to compute
suitable values for max_u and max_v.
This generates a 32-bit floating-point displacement image. It is essential
to check “Preserve RGB” in the interpret footage section for each
displacement image. Set for_32bit true if this is meant to be used in a
32-bit project file, and false if it is meant to be used in a 16-bit
project file.
*/
- make_displacement()
C++ Interface: make_displacement(PfmVizzer self, PNMImage result, double max_u, double max_v, bool for_32bit) make_displacement(PfmVizzer self, PfmFile result, double max_u, double max_v, bool for_32bit)
- /**
Assuming the underlying PfmFile is a 2-d distortion mesh, with the U and V
in the first two components and the third component unused, this computes
an AfterEffects-style displacement map that represents the same distortion.
The indicated PNMImage will be filled in with a displacement map image,
with horizontal shift in the red channel and vertical shift in the green
channel, where a fully bright (or fully black) pixel indicates a shift of
max_u or max_v pixels.
Use calc_max_u_displacement() and calc_max_v_displacement() to compute
suitable values for max_u and max_v.
This generates an integer 16-bit displacement image. It is a good idea,
though not necessarily essential, to check “Preserve RGB” in the interpret
footage section for each displacement image. Set for_32bit true if this is
meant to be used in a 32-bit project file, and false if it is meant to be
used in a 16-bit project file.
*/
- /**
Assuming the underlying PfmFile is a 2-d distortion mesh, with the U and V
in the first two components and the third component unused, this computes
an AfterEffects-style displacement map that represents the same distortion.
The indicated PNMImage will be filled in with a displacement map image,
with horizontal shift in the red channel and vertical shift in the green
channel, where a fully bright (or fully black) pixel indicates a shift of
max_u or max_v pixels.
Use calc_max_u_displacement() and calc_max_v_displacement() to compute
suitable values for max_u and max_v.
This generates a 32-bit floating-point displacement image. It is essential
to check “Preserve RGB” in the interpret footage section for each
displacement image. Set for_32bit true if this is meant to be used in a
32-bit project file, and false if it is meant to be used in a 16-bit
project file.
*/
- project()
C++ Interface: project(const PfmVizzer self, const Lens lens, const PfmFile undist_lut)
- /**
Adjusts each (x, y, z) point of the Pfm file by projecting it through the
indicated lens, converting each point to a (u, v, w) texture coordinate.
The resulting file can be generated to a mesh (with set_vis_inverse(true)
and generate_vis_mesh()) that will apply the lens distortion to an
arbitrary texture image.
*/
- setAuxPfm()
C++ Interface: set_aux_pfm(const PfmVizzer self, const PfmFile pfm)
- /**
Assigns an auxiliary PfmFile to this PfmVizzer. This file will be queried
by column types CT_aux_vertex1/2/3, but has no other meaning to the vizzer.
This size of this PfmFile should exactly match the base PfmFile. No
reference count is held and no copy is made; the caller is responsible for
ensuring that the auxiliary PfmFile will persist throughout the lifetime of
the PfmVizzer it is assigned to.
*/
- setFlatTexcoordName()
C++ Interface: set_flat_texcoord_name(const PfmVizzer self, InternalName flat_texcoord_name)
- /**
If the flat_texcoord_name is specified, it is the name of an additional
vertex column that will be created for the “flat” texture coordinates, i.e.
the original 0..1 values that correspond to the 2-D index position of each
point in the original pfm file.
These are the same values that will be assigned to the default texture
coordinates if the vis_inverse flag is not true.
This may be used in lieu of the lower-level add_vis_column().
*/
- setKeepBeyondLens()
C++ Interface: set_keep_beyond_lens(const PfmVizzer self, bool keep_beyond_lens)
- /**
Sets the keep_beyond_lens flag. When this flag is true, points that fall
outside of the normal lens range in project() or in add_vis_column() will
be retained anyway; when it is false, these points will be discarded.
*/
- setVis2d()
C++ Interface: set_vis_2d(const PfmVizzer self, bool vis_2d)
- /**
Sets the vis_2d flag. When this flag is true, only the first two (x, y)
value of each depth point is considered meaningful; the z component is
ignored. This is only relevant for generating visualizations.
This may be used in lieu of the lower-level add_vis_column().
*/
- setVisBlend()
C++ Interface: set_vis_blend(const PfmVizzer self, const PNMImage vis_blend)
- /**
Specifies a blending map–a grayscale image–that will be applied to the
vertex color during generate_vis_mesh() and generate_vis_points(). The
image size must exactly match the mesh size of the PfmVizzer.
Ownership of the pointer is not kept by the PfmVizzer; it is your
responsibility to ensure it does not destruct during the lifetime of the
PfmVizzer (or at least not before your subsequent call to
generate_vis_mesh()).
*/
- setVisInverse()
C++ Interface: set_vis_inverse(const PfmVizzer self, bool vis_inverse)
- /**
Sets the vis_inverse flag. When this flag is true, vis meshes and point
clouds are generated with the 3-d depth value in the texture coordinates,
and the 2-d index value in the vertex position. When it is false, meshes
are generated normally, with the 3-d depth value in the vertex position and
the 2-d index value in the texture coordinates.
This may be used in lieu of the lower-level add_vis_column().
*/
- set_aux_pfm()
C++ Interface: set_aux_pfm(const PfmVizzer self, const PfmFile pfm)
- /**
Assigns an auxiliary PfmFile to this PfmVizzer. This file will be queried
by column types CT_aux_vertex1/2/3, but has no other meaning to the vizzer.
This size of this PfmFile should exactly match the base PfmFile. No
reference count is held and no copy is made; the caller is responsible for
ensuring that the auxiliary PfmFile will persist throughout the lifetime of
the PfmVizzer it is assigned to.
*/
- set_flat_texcoord_name()
C++ Interface: set_flat_texcoord_name(const PfmVizzer self, InternalName flat_texcoord_name)
- /**
If the flat_texcoord_name is specified, it is the name of an additional
vertex column that will be created for the “flat” texture coordinates, i.e.
the original 0..1 values that correspond to the 2-D index position of each
point in the original pfm file.
These are the same values that will be assigned to the default texture
coordinates if the vis_inverse flag is not true.
This may be used in lieu of the lower-level add_vis_column().
*/
- set_keep_beyond_lens()
C++ Interface: set_keep_beyond_lens(const PfmVizzer self, bool keep_beyond_lens)
- /**
Sets the keep_beyond_lens flag. When this flag is true, points that fall
outside of the normal lens range in project() or in add_vis_column() will
be retained anyway; when it is false, these points will be discarded.
*/
- set_vis_2d()
C++ Interface: set_vis_2d(const PfmVizzer self, bool vis_2d)
- /**
Sets the vis_2d flag. When this flag is true, only the first two (x, y)
value of each depth point is considered meaningful; the z component is
ignored. This is only relevant for generating visualizations.
This may be used in lieu of the lower-level add_vis_column().
*/
- set_vis_blend()
C++ Interface: set_vis_blend(const PfmVizzer self, const PNMImage vis_blend)
- /**
Specifies a blending map–a grayscale image–that will be applied to the
vertex color during generate_vis_mesh() and generate_vis_points(). The
image size must exactly match the mesh size of the PfmVizzer.
Ownership of the pointer is not kept by the PfmVizzer; it is your
responsibility to ensure it does not destruct during the lifetime of the
PfmVizzer (or at least not before your subsequent call to
generate_vis_mesh()).
*/
- set_vis_inverse()
C++ Interface: set_vis_inverse(const PfmVizzer self, bool vis_inverse)
- /**
Sets the vis_inverse flag. When this flag is true, vis meshes and point
clouds are generated with the 3-d depth value in the texture coordinates,
and the 2-d index value in the vertex position. When it is false, meshes
are generated normally, with the 3-d depth value in the vertex position and
the 2-d index value in the texture coordinates.
This may be used in lieu of the lower-level add_vis_column().
*/