Object base class with builtin reference counting
This class (in conjunction with the ‘ref’ reference counter)
constitutes the foundation of an efficient reference-counted object
hierarchy. The implementation here is an alternative to standard
mechanisms for reference counting such as std::shared_ptr
from the
STL.
Why not simply use std::shared_ptr
? To be spec-compliant, such
shared pointers must associate a special record with every instance,
which stores at least two counters plus a deletion function.
Allocating this record naturally incurs further overheads to maintain
data structures within the memory allocator. In addition to this, the
size of an individual shared_ptr
references is at least two data
words. All of this quickly adds up and leads to significant overheads
for large collections of instances, hence the need for an alternative
in Mitsuba.
In contrast, the Object
class allows for a highly efficient
implementation that only adds 32 bits to the base object (for the
counter) and has no overhead for references.
Default constructor
Copy constructor
arg0
(mitsuba.core.Object
):no description available
Return a Class instance containing run-time type information about this Object
Class
mitsuba.core.Class
:no description available
Decrease the reference count of the object and possibly deallocate it.
The object will automatically be deallocated once the reference count reaches zero.
dealloc
(bool):no description available
no description available
Expand the object into a list of sub-objects and return them
In some cases, an Object instance is merely a container for a number of sub-objects. In the context of Mitsuba, an example would be a combined sun & sky emitter instantiated via XML, which recursively expands into a separate sun & sky instance. This functionality is supported by any Mitsuba object, hence it is located this level.
no description available
Return an identifier of the current instance (if available)
no description available
Increase the object’s reference count by one
no description available
Update internal state after applying changes to parameters
This function should be invoked when attributes (obtained via traverse) are modified in some way. The obect can then update its internal state so that derived quantities are consistent with the change.
keys
(List[str]):Optional list of names (obtained via traverse) corresponding to the attributes that have been modified. Can also be used to notify when this function is called from a parent object by adding a “parent” key to the list. When empty, the object should assume that any attribute might have changed.
The default implementation does nothing.
TraversalCallback
no description available
Return the current reference count
no description available
Traverse the attributes and object graph of this instance
Implementing this function enables recursive traversal of C++ scene graphs. It is e.g. used to determine the set of differentiable parameters when using Mitsuba for optimization.
The default implementation does nothing.
TraversalCallback
cb
(mitsuba.core.TraversalCallback
):no description available
no description available
Associative parameter map for constructing subclasses of Object.
Note that the Python bindings for this class do not implement the various type-dependent getters and setters. Instead, they are accessed just like a normal Python map, e.g:
TODO update
myProps = mitsuba.core.Properties("plugin_name")
myProps["stringProperty"] = "hello"
myProps["spectrumProperty"] = mitsuba.core.Spectrum(1.0)
Construct an empty property container
Construct an empty property container with a specific plugin name
arg0
(str):no description available
Copy constructor
arg0
(mitsuba.core.Properties
):no description available
Copy a single attribute from another Properties object and potentially rename it
arg0
(mitsuba.core.Properties
):no description available
arg1
(str):no description available
arg2
(str):no description available
no description available
Verify if a value with the specified name exists
arg0
(str):no description available
no description available
Returns a unique identifier associated with this instance (or an empty string)
no description available
Manually mark a certain property as queried
arg0
(str):no description available
True
upon success
Merge another properties record into the current one.
Existing properties will be overwritten with the values from props
if they have the same name.
arg0
(mitsuba.core.Properties
):no description available
no description available
Get the associated plugin name
no description available
Return an array containing the names of all stored properties
no description available
Remove a property with the specified name
arg0
(str):no description available
True
upon success
Set the unique identifier associated with this instance
arg0
(str):no description available
no description available
Set the associated plugin name
arg0
(str):no description available
no description available
Return the list of un-queried attributed
no description available
Check if a certain property was queried
arg0
(str):no description available
no description available
Base class: mitsuba.core.Object
General-purpose bitmap class with read and write support for several common file formats.
This class handles loading of PNG, JPEG, BMP, TGA, as well as OpenEXR files, and it supports writing of PNG, JPEG and OpenEXR files.
PNG and OpenEXR files are optionally annotated with string-valued metadata, and the gamma setting can be stored as well. Please see the class methods and enumerations for further detail.
Create a bitmap of the specified type and allocate the necessary amount of memory
pixel_format
(mitsuba.core.Bitmap.PixelFormat
):Specifies the pixel format (e.g. RGBA or Luminance-only)
component_format
(mitsuba.core.Struct.Type
):Specifies how the per-pixel components are encoded (e.g. unsigned 8 bit integers or 32-bit floating point values). The component format struct_type_v<Float> will be translated to the corresponding compile-time precision type (Float32 or Float64).
size
(enoki.scalar.Vector2u):Specifies the horizontal and vertical bitmap size in pixels
channel_count
(int):Channel count of the image. This parameter is only required when
pixel_format
= PixelFormat::MultiChannel
data
:External pointer to the image data. If set to nullptr
, the
implementation will allocate memory itself.
Initialize a Bitmap from a NumPy array
array
(array):no description available
pixel_format
(object):no description available
arg0
(mitsuba.core.Bitmap
):no description available
path
(mitsuba.core.filesystem.path
):no description available
format
(mitsuba.core.Bitmap.FileFormat
):no description available
stream
(mitsuba.core.Stream
):no description available
format
(mitsuba.core.Bitmap.FileFormat
):no description available
Members:
None : No transformation (default)
Premultiply : No transformation (default)
Unpremultiply : No transformation (default)
arg0
(int):no description available
Supported image file formats
Members:
Portable network graphics
The following is supported:
Loading and saving of 8/16-bit per component bitmaps for all pixel formats (Y, YA, RGB, RGBA)
Loading and saving of 1-bit per component mask bitmaps
Loading and saving of string-valued metadata fields
OpenEXR high dynamic range file format developed by Industrial Light & Magic (ILM)
The following is supported:
Loading and saving of Float16 / Float32/ UInt32 bitmaps with all supported RGB/Luminance/Alpha combinations
Loading and saving of spectral bitmaps
Loading and saving of XYZ tristimulus bitmaps
Loading and saving of string-valued metadata fields
The following is not supported:
Saving of tiled images, tile-based read access
Display windows that are different than the data window
Loading of spectrum-valued bitmaps
RGBE image format by Greg Ward
The following is supported
Loading and saving of Float32 - based RGB bitmaps
PFM (Portable Float Map) image format
The following is supported
Loading and saving of Float32 - based Luminance or RGB bitmaps
PPM (Portable Pixel Map) image format
The following is supported
Loading and saving of UInt8 and UInt16 - based RGB bitmaps
Joint Photographic Experts Group file format
The following is supported:
Loading and saving of 8 bit per component RGB and luminance bitmaps
Truevision Advanced Raster Graphics Array file format
The following is supported:
Loading of uncompressed 8-bit RGB/RGBA files
Windows Bitmap file format
The following is supported:
Loading of uncompressed 8-bit luminance and RGBA bitmaps
Unknown file format
Automatically detect the file format
Note: this flag only applies when loading a file. In this case, the
source stream must support the seek()
operation.
arg0
(int):no description available
This enumeration lists all pixel format types supported by the Bitmap class. This both determines the number of channels, and how they should be interpreted
Members:
Single-channel luminance bitmap
Two-channel luminance + alpha bitmap
RGB bitmap
RGB bitmap + alpha channel
XYZ tristimulus bitmap
XYZ tristimulus + alpha channel
XYZ tristimulus + alpha channel + weight
Arbitrary multi-channel bitmap without a fixed interpretation
arg0
(int):no description available
Accumulate the contents of another bitmap into the region with the specified offset
Out-of-bounds regions are safely ignored. It is assumed that bitmap
!= this
.
This function throws an exception when the bitmaps use different component formats or channels.
bitmap
(mitsuba.core.Bitmap
):no description available
source_offset
(enoki.scalar.Vector2i):no description available
target_offset
(enoki.scalar.Vector2i):no description available
size
(enoki.scalar.Vector2i):no description available
Accumulate the contents of another bitmap into the region with the specified offset
This convenience function calls the main accumulate()
implementation with size
set to bitmap->size()
and
source_offset
set to zero. Out-of-bounds regions are ignored. It
is assumed that bitmap != this
.
This function throws an exception when the bitmaps use different component formats or channels.
bitmap
(mitsuba.core.Bitmap
):no description available
target_offset
(enoki.scalar.Vector2i):no description available
Accumulate the contents of another bitmap into the region with the specified offset
This convenience function calls the main accumulate()
implementation with size
set to bitmap->size()
and
source_offset
and target_offset
set to zero. Out-of-bounds
regions are ignored. It is assumed that bitmap != this
.
This function throws an exception when the bitmaps use different component formats or channels.
bitmap
(mitsuba.core.Bitmap
):no description available
Return the bitmap size in bytes (excluding metadata)
no description available
Return the number bytes of storage used per pixel
no description available
Return the number of channels used by this bitmap
no description available
Clear the bitmap to zero
no description available
Return the component format of this bitmap
mitsuba.core.Struct.Type
:no description available
Convert the bitmap into another pixel and/or component format
This helper function can be used to efficiently convert a bitmap between different underlying representations. For instance, it can translate a uint8 sRGB bitmap to a linear float32 XYZ bitmap based on half-, single- or double-precision floating point-backed storage.
This function roughly does the following:
For each pixel and channel, it converts the associated value into a normalized linear-space form (any gamma of the source bitmap is removed)
gamma correction (sRGB ramp) is applied if srgb_gamma
is
True
The corrected value is clamped against the representable range of the desired component format.
The clamped gamma-corrected value is then written to the new bitmap
If the pixel formats differ, this function will also perform basic conversions (e.g. spectrum to rgb, luminance to uniform spectrum values, etc.)
Note that the alpha channel is assumed to be linear in both the source and target bitmap, hence it won’t be affected by any gamma-related transformations.
This convert()
variant usually returns a new bitmap instance.
When the conversion would just involve copying the original
bitmap, the function becomes a no-op and returns the current
instance.
pixel_format Specifies the desired pixel format
component_format Specifies the desired component format
srgb_gamma Specifies whether a sRGB gamma ramp should be applied to the ouutput values.
pixel_format
(mitsuba.core.Bitmap.PixelFormat
):no description available
component_format
(mitsuba.core.Struct.Type
):no description available
srgb_gamma
(bool):no description available
alpha_transform
(mitsuba.core.Bitmap.AlphaTransform
):no description available
mitsuba.core.Bitmap
:no description available
target
(mitsuba.core.Bitmap
):no description available
Attempt to detect the bitmap file format in a given stream
arg0
(mitsuba.core.Stream
):no description available
mitsuba.core.Bitmap.FileFormat
:no description available
Return whether this image has an alpha channel
no description available
Return the bitmap’s height in pixels
no description available
Return a Properties object containing the image metadata
no description available
Return the total number of pixels
no description available
Return the pixel format of this bitmap
mitsuba.core.Bitmap.PixelFormat
:no description available
Return whether the bitmap uses premultiplied alpha
no description available
Up- or down-sample this image to a different resolution
Uses the provided reconstruction filter and accounts for the requested horizontal and vertical boundary conditions when looking up data outside of the input domain.
A minimum and maximum image value can be specified to prevent to prevent out-of-range values that are created by the resampling process.
The optional temp
parameter can be used to pass an image of
resolution Vector2u(target->width(), this->height())
to avoid
intermediate memory allocations.
target
(mitsuba.core.Bitmap
):Pre-allocated bitmap of the desired target resolution
rfilter
(mitsuba.render.ReconstructionFilter
):A separable image reconstruction filter (default: 2-lobe Lanczos filter)
bch
:Horizontal and vertical boundary conditions (default: clamp)
clamp
(Tuple[float, float]):Filtered image pixels will be clamped to the following range. Default: -infinity..infinity (i.e. no clamping is used)
temp
(mitsuba.core.Bitmap
):Optional: image for intermediate computations
bc
(Tuple[mitsuba.core.FilterBoundaryCondition
, mitsuba.core.FilterBoundaryCondition
]):no description available
Up- or down-sample this image to a different resolution
This version is similar to the above resample() function – the main difference is that it does not work with preallocated bitmaps and takes the desired output resolution as first argument.
Uses the provided reconstruction filter and accounts for the requested horizontal and vertical boundary conditions when looking up data outside of the input domain.
A minimum and maximum image value can be specified to prevent to prevent out-of-range values that are created by the resampling process.
res
(enoki.scalar.Vector2u):Desired output resolution
rfilter
(mitsuba.render.ReconstructionFilter
):A separable image reconstruction filter (default: 2-lobe Lanczos filter)
bch
:Horizontal and vertical boundary conditions (default: clamp)
clamp
(Tuple[float, float]):Filtered image pixels will be clamped to the following range. Default: -infinity..infinity (i.e. no clamping is used)
bc
(Tuple[mitsuba.core.FilterBoundaryCondition
, mitsuba.core.FilterBoundaryCondition
]):no description available
mitsuba.core.Bitmap
:no description available
Specify whether the bitmap uses premultiplied alpha
arg0
(bool):no description available
no description available
Specify whether the bitmap uses an sRGB gamma encoding
arg0
(bool):no description available
no description available
Return the bitmap dimensions in pixels
no description available
Split an multi-channel image buffer (e.g. from an OpenEXR image with lots of AOVs) into its constituent layers
mitsuba.core.Bitmap
]]:no description available
Return whether the bitmap uses an sRGB gamma encoding
no description available
Return a Struct
instance describing the contents of the bitmap
(const version)
mitsuba.core.Struct
:no description available
Vertically flip the bitmap
no description available
Return the bitmap’s width in pixels
no description available
Write an encoded form of the bitmap to a stream using the specified file format
stream
(mitsuba.core.Stream
):Target stream that will receive the encoded output
format
(mitsuba.core.Bitmap.FileFormat
):Target file format (OpenEXR, PNG, etc.) Detected from the filename by default.
quality
(int):Depending on the file format, this parameter takes on a slightly different meaning:
PNG images: Controls how much libpng will attempt to compress the output (with 1 being the lowest and 9 denoting the highest compression). The default argument uses the compression level 5.
JPEG images: denotes the desired quality (between 0 and 100). The default argument (-1) uses the highest quality (100).
OpenEXR images: denotes the quality level of the DWAB compressor, with higher values corresponding to a lower quality. A value of 45 is recommended as the default for lossy compression. The default argument (-1) causes the implementation to switch to the lossless PIZ compressor.
Write an encoded form of the bitmap to a file using the specified file format
stream
:Target stream that will receive the encoded output
format
(mitsuba.core.Bitmap.FileFormat
):Target file format (FileFormat::OpenEXR, FileFormat::PNG, etc.) Detected from the filename by default.
quality
(int):Depending on the file format, this parameter takes on a slightly different meaning:
PNG images: Controls how much libpng will attempt to compress the output (with 1 being the lowest and 9 denoting the highest compression). The default argument uses the compression level 5.
JPEG images: denotes the desired quality (between 0 and 100). The default argument (-1) uses the highest quality (100).
OpenEXR images: denotes the quality level of the DWAB compressor, with higher values corresponding to a lower quality. A value of 45 is recommended as the default for lossy compression. The default argument (-1) causes the implementation to switch to the lossless PIZ compressor.
path
(mitsuba.core.filesystem.path
):no description available
Equivalent to write(), but executes asynchronously on a different thread
path
(mitsuba.core.filesystem.path
):no description available
format
(mitsuba.core.Bitmap.FileFormat
):no description available
quality
(int):no description available
no description available
Load a Mitsuba scene or object from an Python dictionary
dict
(dict):Python dictionary containing the object description
no description available
Load a Mitsuba scene from an XML file
path
(str):Filename of the scene XML file
parameters
:Optional list of parameters that can be referenced as $varname
in the scene.
variant
:Specifies the variant of plugins to instantiate (e.g. “scalar_rgb”)
update_scene
(bool):When Mitsuba updates scene to a newer version, should the updated XML file be written back to disk?
no description available
Inverse of the mapping square_to_uniform_cone
v
(enoki.scalar.Vector3f):no description available
alpha
(float):no description available
no description available
Inverse of square_to_bilinear
v00
(float):no description available
v10
(float):no description available
v01
(float):no description available
v11
(float):no description available
sample
(enoki.scalar.Vector2f):no description available
no description available
Inverse of the mapping square_to_cosine_hemisphere
v
(enoki.scalar.Vector3f):no description available
no description available
Importance sample a linear interpolant
Given a linear interpolant on the unit interval with boundary values
v0
, v1
(where v1
is the value at x=1
), warp a
uniformly distributed input sample sample
so that the resulting
probability distribution matches the linear interpolant.
v0
(float):no description available
v1
(float):no description available
sample
(float):no description available
no description available
Warp a uniformly distributed sample on [0, 1] to a nonuniform tent
distribution with nodes {a, b, c}
a
(float):no description available
b
(float):no description available
c
(float):no description available
d
(float):no description available
no description available
Warp a uniformly distributed sample on [0, 1] to a tent distribution
sample
(float):no description available
no description available
Inverse of interval_to_linear
v0
(float):no description available
v1
(float):no description available
sample
(float):no description available
no description available
Warp a uniformly distributed square sample to a Beckmann distribution
sample
(enoki.scalar.Vector2f):no description available
alpha
(float):no description available
no description available
Probability density of square_to_beckmann()
v
(enoki.scalar.Vector3f):no description available
alpha
(float):no description available
no description available
Importance sample a bilinear interpolant
Given a bilinear interpolant on the unit square with corner values
v00
, v10
, v01
, v11
(where v10
is the value at
(x,y) == (0, 0)), warp a uniformly distributed input sample sample
so that the resulting probability distribution matches the linear
interpolant.
The implementation first samples the marginal distribution to obtain
y
, followed by sampling the conditional distribution to obtain
x
.
Returns the sampled point and PDF for convenience.
v00
(float):no description available
v10
(float):no description available
v01
(float):no description available
v11
(float):no description available
sample
(enoki.scalar.Vector2f):no description available
no description available
v00
(float):no description available
v10
(float):no description available
v01
(float):no description available
v11
(float):no description available
sample
(enoki.scalar.Vector2f):no description available
no description available
Sample a cosine-weighted vector on the unit hemisphere with respect to solid angles
sample
(enoki.scalar.Vector2f):no description available
no description available
Density of square_to_cosine_hemisphere() with respect to solid angles
v
(enoki.scalar.Vector3f):no description available
no description available
Warp a uniformly distributed square sample to a rough fiber distribution
sample
(enoki.scalar.Vector3f):no description available
wi
(enoki.scalar.Vector3f):no description available
tangent
(enoki.scalar.Vector3f):no description available
kappa
(float):no description available
no description available
Probability density of square_to_rough_fiber()
v
(enoki.scalar.Vector3f):no description available
wi
(enoki.scalar.Vector3f):no description available
tangent
(enoki.scalar.Vector3f):no description available
kappa
(float):no description available
no description available
Sample a point on a 2D standard normal distribution. Internally uses the Box-Muller transformation
v
(enoki.scalar.Vector2f):no description available
no description available
v
(enoki.scalar.Vector2f):no description available
no description available
Warp a uniformly distributed square sample to a 2D tent distribution
sample
(enoki.scalar.Vector2f):no description available
no description available
Density of square_to_tent per unit area.
v
(enoki.scalar.Vector2f):no description available
no description available
Uniformly sample a vector that lies within a given cone of angles around the Z axis
cos_cutoff
(float):Cosine of the cutoff angle
sample
:A uniformly distributed sample on $[0,1]^2$
v
(enoki.scalar.Vector2f):no description available
no description available
Density of square_to_uniform_cone per unit area.
cos_cutoff
(float):Cosine of the cutoff angle
v
(enoki.scalar.Vector3f):no description available
no description available
Uniformly sample a vector on a 2D disk
sample
(enoki.scalar.Vector2f):no description available
no description available
Low-distortion concentric square to disk mapping by Peter Shirley
sample
(enoki.scalar.Vector2f):no description available
no description available
Density of square_to_uniform_disk per unit area
p
(enoki.scalar.Vector2f):no description available
no description available
Density of square_to_uniform_disk per unit area
p
(enoki.scalar.Vector2f):no description available
no description available
Uniformly sample a vector on the unit hemisphere with respect to solid angles
sample
(enoki.scalar.Vector2f):no description available
no description available
Density of square_to_uniform_hemisphere() with respect to solid angles
v
(enoki.scalar.Vector3f):no description available
no description available
Uniformly sample a vector on the unit sphere with respect to solid angles
sample
(enoki.scalar.Vector2f):no description available
no description available
Density of square_to_uniform_sphere() with respect to solid angles
v
(enoki.scalar.Vector3f):no description available
no description available
Low-distortion concentric square to square mapping (meant to be used in conjunction with another warping method that maps to the sphere)
sample
(enoki.scalar.Vector2f):no description available
no description available
Convert an uniformly distributed square sample into barycentric coordinates
sample
(enoki.scalar.Vector2f):no description available
no description available
Density of square_to_uniform_triangle per unit area.
p
(enoki.scalar.Vector2f):no description available
no description available
Warp a uniformly distributed square sample to a von Mises Fisher distribution
sample
(enoki.scalar.Vector2f):no description available
kappa
(float):no description available
no description available
Probability density of square_to_von_mises_fisher()
v
(enoki.scalar.Vector3f):no description available
kappa
(float):no description available
no description available
Warp a uniformly distributed sample on [0, 1] to a tent distribution
value
(float):no description available
no description available
Warp a uniformly distributed square sample to a 2D tent distribution
value
(enoki.scalar.Vector2f):no description available
no description available
Inverse of the mapping square_to_uniform_cone
v
(enoki.scalar.Vector3f):no description available
cos_cutoff
(float):no description available
no description available
Inverse of the mapping square_to_uniform_disk
p
(enoki.scalar.Vector2f):no description available
no description available
Inverse of the mapping square_to_uniform_disk_concentric
p
(enoki.scalar.Vector2f):no description available
no description available
Inverse of the mapping square_to_uniform_hemisphere
v
(enoki.scalar.Vector3f):no description available
no description available
Inverse of the mapping square_to_uniform_sphere
sample
(enoki.scalar.Vector3f):no description available
no description available
Inverse of the mapping square_to_uniform_triangle
p
(enoki.scalar.Vector2f):no description available
no description available
Inverse of the mapping von_mises_fisher_to_square
v
(enoki.scalar.Vector3f):no description available
kappa
(float):no description available
no description available
Continuous 1D probability distribution defined in terms of a regularly sampled linear interpolant
This data structure represents a continuous 1D probability distribution that is defined as a linear interpolant of a regularly discretized signal. The class provides various routines for transforming uniformly distributed samples so that they follow the stored distribution. Note that unnormalized probability density functions (PDFs) will automatically be normalized during initialization. The associated scale factor can be retrieved using the function normalization().
Continuous 1D probability distribution defined in terms of a regularly sampled linear interpolant
This data structure represents a continuous 1D probability distribution that is defined as a linear interpolant of a regularly discretized signal. The class provides various routines for transforming uniformly distributed samples so that they follow the stored distribution. Note that unnormalized probability density functions (PDFs) will automatically be normalized during initialization. The associated scale factor can be retrieved using the function normalization().
Copy constructor
arg0
(mitsuba.core.ContinuousDistribution
):no description available
Initialize from a given density function on the interval range
range
(enoki.scalar.Vector2f):no description available
pdf
(enoki.dynamic.Float32):no description available
Return the unnormalized discrete cumulative distribution function over intervals
no description available
Is the distribution object empty/uninitialized?
no description available
Evaluate the unnormalized cumulative distribution function (CDF) at
position p
x
(float):no description available
active
(bool):Mask to specify active lanes.
no description available
Evaluate the unnormalized cumulative distribution function (CDF) at
position p
x
(float):no description available
active
(bool):Mask to specify active lanes.
no description available
Evaluate the unnormalized probability mass function (PDF) at position
x
x
(float):no description available
active
(bool):Mask to specify active lanes.
no description available
Evaluate the normalized probability mass function (PDF) at position
x
x
(float):no description available
active
(bool):Mask to specify active lanes.
no description available
Return the original integral of PDF entries before normalization
no description available
Return the normalization factor (i.e. the inverse of sum())
no description available
Return the unnormalized discretized probability density function
no description available
Return the range of the distribution
no description available
%Transform a uniformly distributed sample to the stored distribution
value
(float):A uniformly distributed sample on the interval [0, 1].
active
(bool):Mask to specify active lanes.
The sampled position.
%Transform a uniformly distributed sample to the stored distribution
value
(float):A uniformly distributed sample on the interval [0, 1].
active
(bool):Mask to specify active lanes.
A tuple consisting of
1. the sampled position. 2. the normalized probability density of the sample.
Return the number of discretizations
no description available
Update the internal state. Must be invoked when changing the pdf or range.
no description available
Discrete 1D probability distribution
This data structure represents a discrete 1D probability distribution and provides various routines for transforming uniformly distributed samples so that they follow the stored distribution. Note that unnormalized probability mass functions (PMFs) will automatically be normalized during initialization. The associated scale factor can be retrieved using the function normalization().
Discrete 1D probability distribution
This data structure represents a discrete 1D probability distribution and provides various routines for transforming uniformly distributed samples so that they follow the stored distribution. Note that unnormalized probability mass functions (PMFs) will automatically be normalized during initialization. The associated scale factor can be retrieved using the function normalization().
Copy constructor
arg0
(mitsuba.core.DiscreteDistribution
):no description available
Initialize from a given probability mass function
pmf
(enoki.dynamic.Float32):no description available
Return the unnormalized cumulative distribution function
no description available
Is the distribution object empty/uninitialized?
no description available
Evaluate the unnormalized cumulative distribution function (CDF) at
index index
index
(int):no description available
active
(bool):Mask to specify active lanes.
no description available
Evaluate the normalized cumulative distribution function (CDF) at
index index
index
(int):no description available
active
(bool):Mask to specify active lanes.
no description available
Evaluate the unnormalized probability mass function (PMF) at index
index
index
(int):no description available
active
(bool):Mask to specify active lanes.
no description available
Evaluate the normalized probability mass function (PMF) at index
index
index
(int):no description available
active
(bool):Mask to specify active lanes.
no description available
Return the normalization factor (i.e. the inverse of sum())
no description available
Return the unnormalized probability mass function
no description available
%Transform a uniformly distributed sample to the stored distribution
value
(float):A uniformly distributed sample on the interval [0, 1].
active
(bool):Mask to specify active lanes.
The discrete index associated with the sample
%Transform a uniformly distributed sample to the stored distribution
value
(float):A uniformly distributed sample on the interval [0, 1].
active
(bool):Mask to specify active lanes.
A tuple consisting of
1. the discrete index associated with the sample, and 2. the normalized probability value of the sample.
%Transform a uniformly distributed sample to the stored distribution
The original sample is value adjusted so that it can be reused as a uniform variate.
value
(float):A uniformly distributed sample on the interval [0, 1].
active
(bool):Mask to specify active lanes.
A tuple consisting of
1. the discrete index associated with the sample, and 2. the re-scaled sample value.
%Transform a uniformly distributed sample to the stored distribution.
The original sample is value adjusted so that it can be reused as a uniform variate.
value
(float):A uniformly distributed sample on the interval [0, 1].
active
(bool):Mask to specify active lanes.
A tuple consisting of
1. the discrete index associated with the sample 2. the re-scaled sample value 3. the normalized probability value of the sample
Return the number of entries
no description available
Return the original sum of PMF entries before normalization
no description available
Update the internal state. Must be invoked when changing the pmf.
no description available
Continuous 1D probability distribution defined in terms of an irregularly sampled linear interpolant
This data structure represents a continuous 1D probability distribution that is defined as a linear interpolant of an irregularly discretized signal. The class provides various routines for transforming uniformly distributed samples so that they follow the stored distribution. Note that unnormalized probability density functions (PDFs) will automatically be normalized during initialization. The associated scale factor can be retrieved using the function normalization().
Continuous 1D probability distribution defined in terms of an irregularly sampled linear interpolant
This data structure represents a continuous 1D probability distribution that is defined as a linear interpolant of an irregularly discretized signal. The class provides various routines for transforming uniformly distributed samples so that they follow the stored distribution. Note that unnormalized probability density functions (PDFs) will automatically be normalized during initialization. The associated scale factor can be retrieved using the function normalization().
Copy constructor
arg0
(mitsuba.core.IrregularContinuousDistribution
):no description available
Initialize from a given density function discretized on nodes
nodes
nodes
(enoki.dynamic.Float32):no description available
pdf
(enoki.dynamic.Float32):no description available
Return the unnormalized discrete cumulative distribution function over intervals
no description available
Is the distribution object empty/uninitialized?
no description available
Evaluate the unnormalized cumulative distribution function (CDF) at
position p
x
(float):no description available
active
(bool):Mask to specify active lanes.
no description available
Evaluate the unnormalized cumulative distribution function (CDF) at
position p
x
(float):no description available
active
(bool):Mask to specify active lanes.
no description available
Evaluate the unnormalized probability mass function (PDF) at position
x
x
(float):no description available
active
(bool):Mask to specify active lanes.
no description available
Evaluate the normalized probability mass function (PDF) at position
x
x
(float):no description available
active
(bool):Mask to specify active lanes.
no description available
Return the original integral of PDF entries before normalization
no description available
Return the nodes of the underlying discretization
no description available
Return the normalization factor (i.e. the inverse of sum())
no description available
Return the unnormalized discretized probability density function
no description available
%Transform a uniformly distributed sample to the stored distribution
value
(float):A uniformly distributed sample on the interval [0, 1].
active
(bool):Mask to specify active lanes.
The sampled position.
%Transform a uniformly distributed sample to the stored distribution
value
(float):A uniformly distributed sample on the interval [0, 1].
active
(bool):Mask to specify active lanes.
A tuple consisting of
1. the sampled position. 2. the normalized probability density of the sample.
Return the number of discretizations
no description available
Update the internal state. Must be invoked when changing the pdf or range.
no description available
Implements a hierarchical sample warping scheme for 2D distributions with linear interpolation and an optional dependence on additional parameters
This class takes a rectangular floating point array as input and
constructs internal data structures to efficiently map uniform
variates from the unit square [0, 1]^2
to a function on [0,
1]^2
that linearly interpolates the input array.
The mapping is constructed from a sequence of log2(hmax(res))
hierarchical sample warping steps, where res
is the input array
resolution. It is bijective and generally very well-behaved (i.e. low
distortion), which makes it a good choice for structured point sets
such as the Halton or Sobol sequence.
The implementation also supports conditional distributions, i.e. 2D
distributions that depend on an arbitrary number of parameters
(indicated via the Dimension
template parameter).
In this case, the input array should have dimensions N0 x N1 x ... x
Nn x res.y() x res.x()
(where the last dimension is contiguous in
memory), and the param_res
should be set to { N0, N1, ..., Nn
}
, and param_values
should contain the parameter values where
the distribution is discretized. Linear interpolation is used when
sampling or evaluating the distribution for in-between parameter
values.
The Python API exposes explicitly instantiated versions of this class named Hierarchical2D0, Hierarchical2D1, and Hierarchical2D2 for data that depends on 0, 1, and 2 parameters, respectively.
Construct a hierarchical sample warping scheme for floating point data
of resolution size
.
param_res
and param_values
are only needed for conditional
distributions (see the text describing the Hierarchical2D class).
If normalize
is set to False
, the implementation will not re-
scale the distribution so that it integrates to 1
. It can still be
sampled (proportionally), but returned density values will reflect the
unnormalized values.
If enable_sampling
is set to False
, the implementation will
not construct the hierarchy needed for sample warping, which saves
memory in case this functionality is not needed (e.g. if only the
interpolation in eval()
is used). In this case, sample()
and
invert()
can still be called without triggering undefined
behavior, but they will not return meaningful results.
data
(numpy.ndarray[float32]):no description available
param_values
(List[List[float][0]]):no description available
normalize
(bool):no description available
enable_sampling
(bool):no description available
Evaluate the density at position pos
. The distribution is
parameterized by param
if applicable.
pos
(enoki.scalar.Vector2f):no description available
param
(enoki.scalar.Vector0f):no description available
active
(bool):Mask to specify active lanes.
no description available
Inverse of the mapping implemented in sample()
sample
(enoki.scalar.Vector2f):no description available
param
(enoki.scalar.Vector0f):no description available
active
(bool):Mask to specify active lanes.
no description available
Given a uniformly distributed 2D sample, draw a sample from the
distribution (parameterized by param
if applicable)
Returns the warped sample and associated probability density.
sample
(enoki.scalar.Vector2f):no description available
param
(enoki.scalar.Vector0f):no description available
active
(bool):Mask to specify active lanes.
no description available
Implements a hierarchical sample warping scheme for 2D distributions with linear interpolation and an optional dependence on additional parameters
This class takes a rectangular floating point array as input and
constructs internal data structures to efficiently map uniform
variates from the unit square [0, 1]^2
to a function on [0,
1]^2
that linearly interpolates the input array.
The mapping is constructed from a sequence of log2(hmax(res))
hierarchical sample warping steps, where res
is the input array
resolution. It is bijective and generally very well-behaved (i.e. low
distortion), which makes it a good choice for structured point sets
such as the Halton or Sobol sequence.
The implementation also supports conditional distributions, i.e. 2D
distributions that depend on an arbitrary number of parameters
(indicated via the Dimension
template parameter).
In this case, the input array should have dimensions N0 x N1 x ... x
Nn x res.y() x res.x()
(where the last dimension is contiguous in
memory), and the param_res
should be set to { N0, N1, ..., Nn
}
, and param_values
should contain the parameter values where
the distribution is discretized. Linear interpolation is used when
sampling or evaluating the distribution for in-between parameter
values.
The Python API exposes explicitly instantiated versions of this class named Hierarchical2D0, Hierarchical2D1, and Hierarchical2D2 for data that depends on 0, 1, and 2 parameters, respectively.
Construct a hierarchical sample warping scheme for floating point data
of resolution size
.
param_res
and param_values
are only needed for conditional
distributions (see the text describing the Hierarchical2D class).
If normalize
is set to False
, the implementation will not re-
scale the distribution so that it integrates to 1
. It can still be
sampled (proportionally), but returned density values will reflect the
unnormalized values.
If enable_sampling
is set to False
, the implementation will
not construct the hierarchy needed for sample warping, which saves
memory in case this functionality is not needed (e.g. if only the
interpolation in eval()
is used). In this case, sample()
and
invert()
can still be called without triggering undefined
behavior, but they will not return meaningful results.
data
(numpy.ndarray[float32]):no description available
param_values
(List[List[float][1]]):no description available
normalize
(bool):no description available
build_hierarchy
(bool):no description available
Evaluate the density at position pos
. The distribution is
parameterized by param
if applicable.
pos
(enoki.scalar.Vector2f):no description available
param
(enoki.scalar.Vector1f):no description available
active
(bool):Mask to specify active lanes.
no description available
Inverse of the mapping implemented in sample()
sample
(enoki.scalar.Vector2f):no description available
param
(enoki.scalar.Vector1f):no description available
active
(bool):Mask to specify active lanes.
no description available
Given a uniformly distributed 2D sample, draw a sample from the
distribution (parameterized by param
if applicable)
Returns the warped sample and associated probability density.
sample
(enoki.scalar.Vector2f):no description available
param
(enoki.scalar.Vector1f):no description available
active
(bool):Mask to specify active lanes.
no description available
Implements a hierarchical sample warping scheme for 2D distributions with linear interpolation and an optional dependence on additional parameters
This class takes a rectangular floating point array as input and
constructs internal data structures to efficiently map uniform
variates from the unit square [0, 1]^2
to a function on [0,
1]^2
that linearly interpolates the input array.
The mapping is constructed from a sequence of log2(hmax(res))
hierarchical sample warping steps, where res
is the input array
resolution. It is bijective and generally very well-behaved (i.e. low
distortion), which makes it a good choice for structured point sets
such as the Halton or Sobol sequence.
The implementation also supports conditional distributions, i.e. 2D
distributions that depend on an arbitrary number of parameters
(indicated via the Dimension
template parameter).
In this case, the input array should have dimensions N0 x N1 x ... x
Nn x res.y() x res.x()
(where the last dimension is contiguous in
memory), and the param_res
should be set to { N0, N1, ..., Nn
}
, and param_values
should contain the parameter values where
the distribution is discretized. Linear interpolation is used when
sampling or evaluating the distribution for in-between parameter
values.
The Python API exposes explicitly instantiated versions of this class named Hierarchical2D0, Hierarchical2D1, and Hierarchical2D2 for data that depends on 0, 1, and 2 parameters, respectively.
Construct a hierarchical sample warping scheme for floating point data
of resolution size
.
param_res
and param_values
are only needed for conditional
distributions (see the text describing the Hierarchical2D class).
If normalize
is set to False
, the implementation will not re-
scale the distribution so that it integrates to 1
. It can still be
sampled (proportionally), but returned density values will reflect the
unnormalized values.
If enable_sampling
is set to False
, the implementation will
not construct the hierarchy needed for sample warping, which saves
memory in case this functionality is not needed (e.g. if only the
interpolation in eval()
is used). In this case, sample()
and
invert()
can still be called without triggering undefined
behavior, but they will not return meaningful results.
data
(numpy.ndarray[float32]):no description available
param_values
(List[List[float][2]]):no description available
normalize
(bool):no description available
build_hierarchy
(bool):no description available
Evaluate the density at position pos
. The distribution is
parameterized by param
if applicable.
pos
(enoki.scalar.Vector2f):no description available
param
(enoki.scalar.Vector2f):no description available
active
(bool):Mask to specify active lanes.
no description available
Inverse of the mapping implemented in sample()
sample
(enoki.scalar.Vector2f):no description available
param
(enoki.scalar.Vector2f):no description available
active
(bool):Mask to specify active lanes.
no description available
Given a uniformly distributed 2D sample, draw a sample from the
distribution (parameterized by param
if applicable)
Returns the warped sample and associated probability density.
sample
(enoki.scalar.Vector2f):no description available
param
(enoki.scalar.Vector2f):no description available
active
(bool):Mask to specify active lanes.
no description available
Implements a hierarchical sample warping scheme for 2D distributions with linear interpolation and an optional dependence on additional parameters
This class takes a rectangular floating point array as input and
constructs internal data structures to efficiently map uniform
variates from the unit square [0, 1]^2
to a function on [0,
1]^2
that linearly interpolates the input array.
The mapping is constructed from a sequence of log2(hmax(res))
hierarchical sample warping steps, where res
is the input array
resolution. It is bijective and generally very well-behaved (i.e. low
distortion), which makes it a good choice for structured point sets
such as the Halton or Sobol sequence.
The implementation also supports conditional distributions, i.e. 2D
distributions that depend on an arbitrary number of parameters
(indicated via the Dimension
template parameter).
In this case, the input array should have dimensions N0 x N1 x ... x
Nn x res.y() x res.x()
(where the last dimension is contiguous in
memory), and the param_res
should be set to { N0, N1, ..., Nn
}
, and param_values
should contain the parameter values where
the distribution is discretized. Linear interpolation is used when
sampling or evaluating the distribution for in-between parameter
values.
The Python API exposes explicitly instantiated versions of this class named Hierarchical2D0, Hierarchical2D1, and Hierarchical2D2 for data that depends on 0, 1, and 2 parameters, respectively.
Construct a hierarchical sample warping scheme for floating point data
of resolution size
.
param_res
and param_values
are only needed for conditional
distributions (see the text describing the Hierarchical2D class).
If normalize
is set to False
, the implementation will not re-
scale the distribution so that it integrates to 1
. It can still be
sampled (proportionally), but returned density values will reflect the
unnormalized values.
If enable_sampling
is set to False
, the implementation will
not construct the hierarchy needed for sample warping, which saves
memory in case this functionality is not needed (e.g. if only the
interpolation in eval()
is used). In this case, sample()
and
invert()
can still be called without triggering undefined
behavior, but they will not return meaningful results.
data
(numpy.ndarray[float32]):no description available
param_values
(List[List[float][3]]):no description available
normalize
(bool):no description available
build_hierarchy
(bool):no description available
Evaluate the density at position pos
. The distribution is
parameterized by param
if applicable.
pos
(enoki.scalar.Vector2f):no description available
param
(enoki.scalar.Vector3f):no description available
active
(bool):Mask to specify active lanes.
no description available
Inverse of the mapping implemented in sample()
sample
(enoki.scalar.Vector2f):no description available
param
(enoki.scalar.Vector3f):no description available
active
(bool):Mask to specify active lanes.
no description available
Given a uniformly distributed 2D sample, draw a sample from the
distribution (parameterized by param
if applicable)
Returns the warped sample and associated probability density.
sample
(enoki.scalar.Vector2f):no description available
param
(enoki.scalar.Vector3f):no description available
active
(bool):Mask to specify active lanes.
no description available
Implements a marginal sample warping scheme for 2D distributions with linear interpolation and an optional dependence on additional parameters
This class takes a rectangular floating point array as input and
constructs internal data structures to efficiently map uniform
variates from the unit square [0, 1]^2
to a function on [0,
1]^2
that linearly interpolates the input array.
The mapping is constructed via the inversion method, which is applied to a marginal distribution over rows, followed by a conditional distribution over columns.
The implementation also supports conditional distributions, i.e. 2D
distributions that depend on an arbitrary number of parameters
(indicated via the Dimension
template parameter).
In this case, the input array should have dimensions N0 x N1 x ... x
Nn x res.y() x res.x()
(where the last dimension is contiguous in
memory), and the param_res
should be set to { N0, N1, ..., Nn
}
, and param_values
should contain the parameter values where
the distribution is discretized. Linear interpolation is used when
sampling or evaluating the distribution for in-between parameter
values.
There are two variants of Marginal2D:
when Continuous=false
,
discrete marginal/conditional distributions are used to select a
bilinear bilinear patch, followed by a continuous sampling step that
chooses a specific position inside the patch. When
Continuous=true
, continuous marginal/conditional distributions are
used instead, and the second step is no longer needed. The latter
scheme requires more computation and memory accesses but produces an
overall smoother mapping.
The Python API exposes explicitly instantiated versions of this
class named MarginalDiscrete2D0
to MarginalDiscrete2D3
and
MarginalContinuous2D0
to MarginalContinuous2D3
for data
that depends on 0 to 3 parameters.
Construct a marginal sample warping scheme for floating point data of
resolution size
.
param_res
and param_values
are only needed for conditional
distributions (see the text describing the Marginal2D class).
If normalize
is set to False
, the implementation will not re-
scale the distribution so that it integrates to 1
. It can still be
sampled (proportionally), but returned density values will reflect the
unnormalized values.
If enable_sampling
is set to False
, the implementation will
not construct the cdf needed for sample warping, which saves memory in
case this functionality is not needed (e.g. if only the interpolation
in eval()
is used).
data
(numpy.ndarray[float32]):no description available
param_values
(List[List[float][0]]):no description available
normalize
(bool):no description available
enable_sampling
(bool):no description available
Evaluate the density at position pos
. The distribution is
parameterized by param
if applicable.
pos
(enoki.scalar.Vector2f):no description available
param
(enoki.scalar.Vector0f):no description available
active
(bool):Mask to specify active lanes.
no description available
Inverse of the mapping implemented in sample()
sample
(enoki.scalar.Vector2f):no description available
param
(enoki.scalar.Vector0f):no description available
active
(bool):Mask to specify active lanes.
no description available
Given a uniformly distributed 2D sample, draw a sample from the
distribution (parameterized by param
if applicable)
Returns the warped sample and associated probability density.
sample
(enoki.scalar.Vector2f):no description available
param
(enoki.scalar.Vector0f):no description available
active
(bool):Mask to specify active lanes.
no description available
Implements a marginal sample warping scheme for 2D distributions with linear interpolation and an optional dependence on additional parameters
This class takes a rectangular floating point array as input and
constructs internal data structures to efficiently map uniform
variates from the unit square [0, 1]^2
to a function on [0,
1]^2
that linearly interpolates the input array.
The mapping is constructed via the inversion method, which is applied to a marginal distribution over rows, followed by a conditional distribution over columns.
The implementation also supports conditional distributions, i.e. 2D
distributions that depend on an arbitrary number of parameters
(indicated via the Dimension
template parameter).
In this case, the input array should have dimensions N0 x N1 x ... x
Nn x res.y() x res.x()
(where the last dimension is contiguous in
memory), and the param_res
should be set to { N0, N1, ..., Nn
}
, and param_values
should contain the parameter values where
the distribution is discretized. Linear interpolation is used when
sampling or evaluating the distribution for in-between parameter
values.
There are two variants of Marginal2D:
when Continuous=false
,
discrete marginal/conditional distributions are used to select a
bilinear bilinear patch, followed by a continuous sampling step that
chooses a specific position inside the patch. When
Continuous=true
, continuous marginal/conditional distributions are
used instead, and the second step is no longer needed. The latter
scheme requires more computation and memory accesses but produces an
overall smoother mapping.
The Python API exposes explicitly instantiated versions of this
class named MarginalDiscrete2D0
to MarginalDiscrete2D3
and
MarginalContinuous2D0
to MarginalContinuous2D3
for data
that depends on 0 to 3 parameters.
Construct a marginal sample warping scheme for floating point data of
resolution size
.
param_res
and param_values
are only needed for conditional
distributions (see the text describing the Marginal2D class).
If normalize
is set to False
, the implementation will not re-
scale the distribution so that it integrates to 1
. It can still be
sampled (proportionally), but returned density values will reflect the
unnormalized values.
If enable_sampling
is set to False
, the implementation will
not construct the cdf needed for sample warping, which saves memory in
case this functionality is not needed (e.g. if only the interpolation
in eval()
is used).
data
(numpy.ndarray[float32]):no description available
param_values
(List[List[float][1]]):no description available
normalize
(bool):no description available
build_hierarchy
(bool):no description available
Evaluate the density at position pos
. The distribution is
parameterized by param
if applicable.
pos
(enoki.scalar.Vector2f):no description available
param
(enoki.scalar.Vector1f):no description available
active
(bool):Mask to specify active lanes.
no description available
Inverse of the mapping implemented in sample()
sample
(enoki.scalar.Vector2f):no description available
param
(enoki.scalar.Vector1f):no description available
active
(bool):Mask to specify active lanes.
no description available
Given a uniformly distributed 2D sample, draw a sample from the
distribution (parameterized by param
if applicable)
Returns the warped sample and associated probability density.
sample
(enoki.scalar.Vector2f):no description available
param
(enoki.scalar.Vector1f):no description available
active
(bool):Mask to specify active lanes.
no description available
Implements a marginal sample warping scheme for 2D distributions with linear interpolation and an optional dependence on additional parameters
This class takes a rectangular floating point array as input and
constructs internal data structures to efficiently map uniform
variates from the unit square [0, 1]^2
to a function on [0,
1]^2
that linearly interpolates the input array.
The mapping is constructed via the inversion method, which is applied to a marginal distribution over rows, followed by a conditional distribution over columns.
The implementation also supports conditional distributions, i.e. 2D
distributions that depend on an arbitrary number of parameters
(indicated via the Dimension
template parameter).
In this case, the input array should have dimensions N0 x N1 x ... x
Nn x res.y() x res.x()
(where the last dimension is contiguous in
memory), and the param_res
should be set to { N0, N1, ..., Nn
}
, and param_values
should contain the parameter values where
the distribution is discretized. Linear interpolation is used when
sampling or evaluating the distribution for in-between parameter
values.
There are two variants of Marginal2D:
when Continuous=false
,
discrete marginal/conditional distributions are used to select a
bilinear bilinear patch, followed by a continuous sampling step that
chooses a specific position inside the patch. When
Continuous=true
, continuous marginal/conditional distributions are
used instead, and the second step is no longer needed. The latter
scheme requires more computation and memory accesses but produces an
overall smoother mapping.
The Python API exposes explicitly instantiated versions of this
class named MarginalDiscrete2D0
to MarginalDiscrete2D3
and
MarginalContinuous2D0
to MarginalContinuous2D3
for data
that depends on 0 to 3 parameters.
Construct a marginal sample warping scheme for floating point data of
resolution size
.
param_res
and param_values
are only needed for conditional
distributions (see the text describing the Marginal2D class).
If normalize
is set to False
, the implementation will not re-
scale the distribution so that it integrates to 1
. It can still be
sampled (proportionally), but returned density values will reflect the
unnormalized values.
If enable_sampling
is set to False
, the implementation will
not construct the cdf needed for sample warping, which saves memory in
case this functionality is not needed (e.g. if only the interpolation
in eval()
is used).
data
(numpy.ndarray[float32]):no description available
param_values
(List[List[float][2]]):no description available
normalize
(bool):no description available
build_hierarchy
(bool):no description available
Evaluate the density at position pos
. The distribution is
parameterized by param
if applicable.
pos
(enoki.scalar.Vector2f):no description available
param
(enoki.scalar.Vector2f):no description available
active
(bool):Mask to specify active lanes.
no description available
Inverse of the mapping implemented in sample()
sample
(enoki.scalar.Vector2f):no description available
param
(enoki.scalar.Vector2f):no description available
active
(bool):Mask to specify active lanes.
no description available
Given a uniformly distributed 2D sample, draw a sample from the
distribution (parameterized by param
if applicable)
Returns the warped sample and associated probability density.
sample
(enoki.scalar.Vector2f):no description available
param
(enoki.scalar.Vector2f):no description available
active
(bool):Mask to specify active lanes.
no description available
Implements a marginal sample warping scheme for 2D distributions with linear interpolation and an optional dependence on additional parameters
This class takes a rectangular floating point array as input and
constructs internal data structures to efficiently map uniform
variates from the unit square [0, 1]^2
to a function on [0,
1]^2
that linearly interpolates the input array.
The mapping is constructed via the inversion method, which is applied to a marginal distribution over rows, followed by a conditional distribution over columns.
The implementation also supports conditional distributions, i.e. 2D
distributions that depend on an arbitrary number of parameters
(indicated via the Dimension
template parameter).
In this case, the input array should have dimensions N0 x N1 x ... x
Nn x res.y() x res.x()
(where the last dimension is contiguous in
memory), and the param_res
should be set to { N0, N1, ..., Nn
}
, and param_values
should contain the parameter values where
the distribution is discretized. Linear interpolation is used when
sampling or evaluating the distribution for in-between parameter
values.
There are two variants of Marginal2D:
when Continuous=false
,
discrete marginal/conditional distributions are used to select a
bilinear bilinear patch, followed by a continuous sampling step that
chooses a specific position inside the patch. When
Continuous=true
, continuous marginal/conditional distributions are
used instead, and the second step is no longer needed. The latter
scheme requires more computation and memory accesses but produces an
overall smoother mapping.
The Python API exposes explicitly instantiated versions of this
class named MarginalDiscrete2D0
to MarginalDiscrete2D3
and
MarginalContinuous2D0
to MarginalContinuous2D3
for data
that depends on 0 to 3 parameters.
Construct a marginal sample warping scheme for floating point data of
resolution size
.
param_res
and param_values
are only needed for conditional
distributions (see the text describing the Marginal2D class).
If normalize
is set to False
, the implementation will not re-
scale the distribution so that it integrates to 1
. It can still be
sampled (proportionally), but returned density values will reflect the
unnormalized values.
If enable_sampling
is set to False
, the implementation will
not construct the cdf needed for sample warping, which saves memory in
case this functionality is not needed (e.g. if only the interpolation
in eval()
is used).
data
(numpy.ndarray[float32]):no description available
param_values
(List[List[float][3]]):no description available
normalize
(bool):no description available
build_hierarchy
(bool):no description available
Evaluate the density at position pos
. The distribution is
parameterized by param
if applicable.
pos
(enoki.scalar.Vector2f):no description available
param
(enoki.scalar.Vector3f):no description available
active
(bool):Mask to specify active lanes.
no description available
Inverse of the mapping implemented in sample()
sample
(enoki.scalar.Vector2f):no description available
param
(enoki.scalar.Vector3f):no description available
active
(bool):Mask to specify active lanes.
no description available
Given a uniformly distributed 2D sample, draw a sample from the
distribution (parameterized by param
if applicable)
Returns the warped sample and associated probability density.
sample
(enoki.scalar.Vector2f):no description available
param
(enoki.scalar.Vector3f):no description available
active
(bool):Mask to specify active lanes.
no description available
Implements a marginal sample warping scheme for 2D distributions with linear interpolation and an optional dependence on additional parameters
This class takes a rectangular floating point array as input and
constructs internal data structures to efficiently map uniform
variates from the unit square [0, 1]^2
to a function on [0,
1]^2
that linearly interpolates the input array.
The mapping is constructed via the inversion method, which is applied to a marginal distribution over rows, followed by a conditional distribution over columns.
The implementation also supports conditional distributions, i.e. 2D
distributions that depend on an arbitrary number of parameters
(indicated via the Dimension
template parameter).
In this case, the input array should have dimensions N0 x N1 x ... x
Nn x res.y() x res.x()
(where the last dimension is contiguous in
memory), and the param_res
should be set to { N0, N1, ..., Nn
}
, and param_values
should contain the parameter values where
the distribution is discretized. Linear interpolation is used when
sampling or evaluating the distribution for in-between parameter
values.
There are two variants of Marginal2D:
when Continuous=false
,
discrete marginal/conditional distributions are used to select a
bilinear bilinear patch, followed by a continuous sampling step that
chooses a specific position inside the patch. When
Continuous=true
, continuous marginal/conditional distributions are
used instead, and the second step is no longer needed. The latter
scheme requires more computation and memory accesses but produces an
overall smoother mapping.
The Python API exposes explicitly instantiated versions of this
class named MarginalDiscrete2D0
to MarginalDiscrete2D3
and
MarginalContinuous2D0
to MarginalContinuous2D3
for data
that depends on 0 to 3 parameters.
Construct a marginal sample warping scheme for floating point data of
resolution size
.
param_res
and param_values
are only needed for conditional
distributions (see the text describing the Marginal2D class).
If normalize
is set to False
, the implementation will not re-
scale the distribution so that it integrates to 1
. It can still be
sampled (proportionally), but returned density values will reflect the
unnormalized values.
If enable_sampling
is set to False
, the implementation will
not construct the cdf needed for sample warping, which saves memory in
case this functionality is not needed (e.g. if only the interpolation
in eval()
is used).
data
(numpy.ndarray[float32]):no description available
param_values
(List[List[float][0]]):no description available
normalize
(bool):no description available
enable_sampling
(bool):no description available
Evaluate the density at position pos
. The distribution is
parameterized by param
if applicable.
pos
(enoki.scalar.Vector2f):no description available
param
(enoki.scalar.Vector0f):no description available
active
(bool):Mask to specify active lanes.
no description available
Inverse of the mapping implemented in sample()
sample
(enoki.scalar.Vector2f):no description available
param
(enoki.scalar.Vector0f):no description available
active
(bool):Mask to specify active lanes.
no description available
Given a uniformly distributed 2D sample, draw a sample from the
distribution (parameterized by param
if applicable)
Returns the warped sample and associated probability density.
sample
(enoki.scalar.Vector2f):no description available
param
(enoki.scalar.Vector0f):no description available
active
(bool):Mask to specify active lanes.
no description available
Implements a marginal sample warping scheme for 2D distributions with linear interpolation and an optional dependence on additional parameters
This class takes a rectangular floating point array as input and
constructs internal data structures to efficiently map uniform
variates from the unit square [0, 1]^2
to a function on [0,
1]^2
that linearly interpolates the input array.
The mapping is constructed via the inversion method, which is applied to a marginal distribution over rows, followed by a conditional distribution over columns.
The implementation also supports conditional distributions, i.e. 2D
distributions that depend on an arbitrary number of parameters
(indicated via the Dimension
template parameter).
In this case, the input array should have dimensions N0 x N1 x ... x
Nn x res.y() x res.x()
(where the last dimension is contiguous in
memory), and the param_res
should be set to { N0, N1, ..., Nn
}
, and param_values
should contain the parameter values where
the distribution is discretized. Linear interpolation is used when
sampling or evaluating the distribution for in-between parameter
values.
There are two variants of Marginal2D:
when Continuous=false
,
discrete marginal/conditional distributions are used to select a
bilinear bilinear patch, followed by a continuous sampling step that
chooses a specific position inside the patch. When
Continuous=true
, continuous marginal/conditional distributions are
used instead, and the second step is no longer needed. The latter
scheme requires more computation and memory accesses but produces an
overall smoother mapping.
The Python API exposes explicitly instantiated versions of this
class named MarginalDiscrete2D0
to MarginalDiscrete2D3
and
MarginalContinuous2D0
to MarginalContinuous2D3
for data
that depends on 0 to 3 parameters.
Construct a marginal sample warping scheme for floating point data of
resolution size
.
param_res
and param_values
are only needed for conditional
distributions (see the text describing the Marginal2D class).
If normalize
is set to False
, the implementation will not re-
scale the distribution so that it integrates to 1
. It can still be
sampled (proportionally), but returned density values will reflect the
unnormalized values.
If enable_sampling
is set to False
, the implementation will
not construct the cdf needed for sample warping, which saves memory in
case this functionality is not needed (e.g. if only the interpolation
in eval()
is used).
data
(numpy.ndarray[float32]):no description available
param_values
(List[List[float][1]]):no description available
normalize
(bool):no description available
build_hierarchy
(bool):no description available
Evaluate the density at position pos
. The distribution is
parameterized by param
if applicable.
pos
(enoki.scalar.Vector2f):no description available
param
(enoki.scalar.Vector1f):no description available
active
(bool):Mask to specify active lanes.
no description available
Inverse of the mapping implemented in sample()
sample
(enoki.scalar.Vector2f):no description available
param
(enoki.scalar.Vector1f):no description available
active
(bool):Mask to specify active lanes.
no description available
Given a uniformly distributed 2D sample, draw a sample from the
distribution (parameterized by param
if applicable)
Returns the warped sample and associated probability density.
sample
(enoki.scalar.Vector2f):no description available
param
(enoki.scalar.Vector1f):no description available
active
(bool):Mask to specify active lanes.
no description available
Implements a marginal sample warping scheme for 2D distributions with linear interpolation and an optional dependence on additional parameters
This class takes a rectangular floating point array as input and
constructs internal data structures to efficiently map uniform
variates from the unit square [0, 1]^2
to a function on [0,
1]^2
that linearly interpolates the input array.
The mapping is constructed via the inversion method, which is applied to a marginal distribution over rows, followed by a conditional distribution over columns.
The implementation also supports conditional distributions, i.e. 2D
distributions that depend on an arbitrary number of parameters
(indicated via the Dimension
template parameter).
In this case, the input array should have dimensions N0 x N1 x ... x
Nn x res.y() x res.x()
(where the last dimension is contiguous in
memory), and the param_res
should be set to { N0, N1, ..., Nn
}
, and param_values
should contain the parameter values where
the distribution is discretized. Linear interpolation is used when
sampling or evaluating the distribution for in-between parameter
values.
There are two variants of Marginal2D:
when Continuous=false
,
discrete marginal/conditional distributions are used to select a
bilinear bilinear patch, followed by a continuous sampling step that
chooses a specific position inside the patch. When
Continuous=true
, continuous marginal/conditional distributions are
used instead, and the second step is no longer needed. The latter
scheme requires more computation and memory accesses but produces an
overall smoother mapping.
The Python API exposes explicitly instantiated versions of this
class named MarginalDiscrete2D0
to MarginalDiscrete2D3
and
MarginalContinuous2D0
to MarginalContinuous2D3
for data
that depends on 0 to 3 parameters.
Construct a marginal sample warping scheme for floating point data of
resolution size
.
param_res
and param_values
are only needed for conditional
distributions (see the text describing the Marginal2D class).
If normalize
is set to False
, the implementation will not re-
scale the distribution so that it integrates to 1
. It can still be
sampled (proportionally), but returned density values will reflect the
unnormalized values.
If enable_sampling
is set to False
, the implementation will
not construct the cdf needed for sample warping, which saves memory in
case this functionality is not needed (e.g. if only the interpolation
in eval()
is used).
data
(numpy.ndarray[float32]):no description available
param_values
(List[List[float][2]]):no description available
normalize
(bool):no description available
build_hierarchy
(bool):no description available
Evaluate the density at position pos
. The distribution is
parameterized by param
if applicable.
pos
(enoki.scalar.Vector2f):no description available
param
(enoki.scalar.Vector2f):no description available
active
(bool):Mask to specify active lanes.
no description available
Inverse of the mapping implemented in sample()
sample
(enoki.scalar.Vector2f):no description available
param
(enoki.scalar.Vector2f):no description available
active
(bool):Mask to specify active lanes.
no description available
Given a uniformly distributed 2D sample, draw a sample from the
distribution (parameterized by param
if applicable)
Returns the warped sample and associated probability density.
sample
(enoki.scalar.Vector2f):no description available
param
(enoki.scalar.Vector2f):no description available
active
(bool):Mask to specify active lanes.
no description available
Implements a marginal sample warping scheme for 2D distributions with linear interpolation and an optional dependence on additional parameters
This class takes a rectangular floating point array as input and
constructs internal data structures to efficiently map uniform
variates from the unit square [0, 1]^2
to a function on [0,
1]^2
that linearly interpolates the input array.
The mapping is constructed via the inversion method, which is applied to a marginal distribution over rows, followed by a conditional distribution over columns.
The implementation also supports conditional distributions, i.e. 2D
distributions that depend on an arbitrary number of parameters
(indicated via the Dimension
template parameter).
In this case, the input array should have dimensions N0 x N1 x ... x
Nn x res.y() x res.x()
(where the last dimension is contiguous in
memory), and the param_res
should be set to { N0, N1, ..., Nn
}
, and param_values
should contain the parameter values where
the distribution is discretized. Linear interpolation is used when
sampling or evaluating the distribution for in-between parameter
values.
There are two variants of Marginal2D:
when Continuous=false
,
discrete marginal/conditional distributions are used to select a
bilinear bilinear patch, followed by a continuous sampling step that
chooses a specific position inside the patch. When
Continuous=true
, continuous marginal/conditional distributions are
used instead, and the second step is no longer needed. The latter
scheme requires more computation and memory accesses but produces an
overall smoother mapping.
The Python API exposes explicitly instantiated versions of this
class named MarginalDiscrete2D0
to MarginalDiscrete2D3
and
MarginalContinuous2D0
to MarginalContinuous2D3
for data
that depends on 0 to 3 parameters.
Construct a marginal sample warping scheme for floating point data of
resolution size
.
param_res
and param_values
are only needed for conditional
distributions (see the text describing the Marginal2D class).
If normalize
is set to False
, the implementation will not re-
scale the distribution so that it integrates to 1
. It can still be
sampled (proportionally), but returned density values will reflect the
unnormalized values.
If enable_sampling
is set to False
, the implementation will
not construct the cdf needed for sample warping, which saves memory in
case this functionality is not needed (e.g. if only the interpolation
in eval()
is used).
data
(numpy.ndarray[float32]):no description available
param_values
(List[List[float][3]]):no description available
normalize
(bool):no description available
build_hierarchy
(bool):no description available
Evaluate the density at position pos
. The distribution is
parameterized by param
if applicable.
pos
(enoki.scalar.Vector2f):no description available
param
(enoki.scalar.Vector3f):no description available
active
(bool):Mask to specify active lanes.
no description available
Inverse of the mapping implemented in sample()
sample
(enoki.scalar.Vector2f):no description available
param
(enoki.scalar.Vector3f):no description available
active
(bool):Mask to specify active lanes.
no description available
Given a uniformly distributed 2D sample, draw a sample from the
distribution (parameterized by param
if applicable)
Returns the warped sample and associated probability density.
sample
(enoki.scalar.Vector2f):no description available
param
(enoki.scalar.Vector3f):no description available
active
(bool):Mask to specify active lanes.
no description available
Compute the Chi^2 statistic and degrees of freedom of the given arrays while pooling low-valued entries together
Given a list of observations counts (obs[i]
) and expected
observation counts (exp[i]
), this function accumulates the Chi^2
statistic, that is, (obs-exp)^2 / exp
for each element 0, ...,
n-1
.
Minimum expected cell frequency. The Chi^2 test statistic is not
useful when when the expected frequency in a cell is low (e.g. less
than 5), because normality assumptions break down in this case.
Therefore, the implementation will merge such low-frequency cells when
they fall below the threshold specified here. Specifically, low-valued
cells with exp[i] < pool_threshold
are pooled into larger groups
that are above the threshold before their contents are added to the
Chi^2 statistic.
The function returns the statistic value, degrees of freedom, below- treshold entries and resulting number of pooled regions.
arg0
(enoki.dynamic.Float64):no description available
arg1
(enoki.dynamic.Float64):no description available
arg2
(float):no description available
no description available
Find an interval in an ordered set
This function performs a binary search to find an index i
such
that pred(i)
is True
and pred(i+1)
is False
, where
pred
is a user-specified predicate that monotonically decreases
over this range (i.e. max one True
-> False
transition).
The predicate will be evaluated exactly <tt>floor(log2(size)) + 1<tt>
times. Note that the template parameter Index
is automatically
inferred from the supplied predicate, which takes an index or an index
vector of type Index
as input argument and can (optionally) take a
mask argument as well. In the vectorized case, each vector lane can
use different predicate. When pred
is False
for all entries,
the function returns 0
, and when it is True
for all cases, it
returns <tt>size-2<tt>.
The main use case of this function is to locate an interval (i, i+1) in an ordered list.
float my_list[] = { 1, 1.5f, 4.f, ... };
UInt32 index = find_interval(
sizeof(my_list) / sizeof(float),
[](UInt32 index, mask_t<UInt32> active) {
return gather<Float>(my_list, index, active) < x;
}
);
size
(int):no description available
pred
(Callable[[int], bool]):no description available
no description available
Check whether the provided integer is a power of two
arg0
(int):no description available
no description available
Evaluate the l-th Legendre polynomial using recurrence
l
(int):no description available
x
(float):no description available
no description available
Evaluate the l-th Legendre polynomial using recurrence
l
(int):no description available
m
(int):no description available
x
(float):no description available
no description available
Evaluate the l-th Legendre polynomial and its derivative using recurrence
l
(int):no description available
x
(float):no description available
no description available
Evaluate the function legendre_pd(l+1, x) - legendre_pd(l-1, x)
l
(int):no description available
x
(float):no description available
no description available
Applies the sRGB gamma curve to the given argument.
arg0
(float):no description available
no description available
m
(int):no description available
no description available
m
(int):no description available
no description available
v
(enoki.scalar.Vector2u):no description available
no description available
v
(enoki.scalar.Vector3u):no description available
no description available
Round an unsigned integer to the next integer power of two
arg0
(int):no description available
no description available
Solve a quadratic equation of the form a*x^2 + b*x + c = 0.
a
(float):no description available
b
(float):no description available
c
(float):no description available
True
if a solution could be found
Applies the inverse sRGB gamma curve to the given argument.
arg0
(float):no description available
no description available
Compare the difference in ULPs between a reference value and another given floating point number
arg0
(float):no description available
arg1
(float):no description available
no description available
Evaluate a cubic spline interpolant of a uniformly sampled 1D function
The implementation relies on Catmull-Rom splines, i.e. it uses finite differences to approximate the derivatives at the endpoints of each spline segment.
Extrapolate
:Extrapolate values when x
is out of range? (default:
False
)
min
(float):Position of the first node
max
(float):Position of the last node
values
(numpy.ndarray[float32]):Array containing size
regularly spaced evaluations in the
range [min
, max
] of the approximated function.
size
:Denotes the size of the values
array
x
(float):Evaluation point
The Python API lacks the size
parameter, which is inferred
automatically from the size of the input array.
The Python API provides a vectorized version which evaluates the
function for many arguments x
.
The interpolated value or zero when Extrapolate=false
and
x
lies outside of [min
, max
]
Evaluate a cubic spline interpolant of a non-uniformly sampled 1D function
The implementation relies on Catmull-Rom splines, i.e. it uses finite differences to approximate the derivatives at the endpoints of each spline segment.
Extrapolate
:Extrapolate values when x
is out of range? (default:
False
)
nodes
(numpy.ndarray[float32]):Array containing size
non-uniformly spaced values denoting
positions the where the function to be interpolated was evaluated.
They must be provided in increasing order.
values
(numpy.ndarray[float32]):Array containing function evaluations matched to the entries of
nodes
.
size
:Denotes the size of the nodes
and values
array
x
(float):Evaluation point
The Python API lacks the size
parameter, which is inferred
automatically from the size of the input array
The Python API provides a vectorized version which evaluates the
function for many arguments x
.
The interpolated value or zero when Extrapolate=false
and
x
lies outside of a [min
, max
]
Evaluate a cubic spline interpolant of a uniformly sampled 2D function
This implementation relies on a tensor product of Catmull-Rom splines, i.e. it uses finite differences to approximate the derivatives for each dimension at the endpoints of spline patches.
Extrapolate
:Extrapolate values when p
is out of range? (default:
False
)
nodes1
(numpy.ndarray[float32]):Arrays containing size1
non-uniformly spaced values denoting
positions the where the function to be interpolated was evaluated
on the X
axis (in increasing order)
size1
:Denotes the size of the nodes1
array
nodes
:Arrays containing size2
non-uniformly spaced values denoting
positions the where the function to be interpolated was evaluated
on the Y
axis (in increasing order)
size2
:Denotes the size of the nodes2
array
values
(numpy.ndarray[float32]):A 2D floating point array of size1*size2
cells containing
irregularly spaced evaluations of the function to be interpolated.
Consecutive entries of this array correspond to increments in the
X
coordinate.
x
(float):X
coordinate of the evaluation point
y
(float):Y
coordinate of the evaluation point
The Python API lacks the size1
and size2
parameters, which
are inferred automatically from the size of the input arrays.
nodes2
(numpy.ndarray[float32]):no description available
The interpolated value or zero when Extrapolate=false``tt> and
``(x,y)
lies outside of the node range
Compute the definite integral and derivative of a cubic spline that is
parameterized by the function values and derivatives at the endpoints
of the interval [0, 1]
.
f0
(float):The function value at the left position
f1
(float):The function value at the right position
d0
(float):The function derivative at the left position
d1
(float):The function derivative at the right position
t
(float):The parameter variable
The interpolated function value at t
Compute the value and derivative of a cubic spline that is
parameterized by the function values and derivatives of the interval
[0, 1]
.
f0
(float):The function value at the left position
f1
(float):The function value at the right position
d0
(float):The function derivative at the left position
d1
(float):The function derivative at the right position
t
(float):The parameter variable
The interpolated function value and its derivative at t
Compute the definite integral and value of a cubic spline that is
parameterized by the function values and derivatives of the interval
[0, 1]
.
f0
(float):The function value at the left position
f1
(float):The function value at the right position
d0
(float):The function derivative at the left position
d1
(float):The function derivative at the right position
t
(float):no description available
The definite integral and the interpolated function value at t
Compute weights to perform a spline-interpolated lookup on a uniformly sampled 1D function.
The implementation relies on Catmull-Rom splines, i.e. it uses finite differences to approximate the derivatives at the endpoints of each spline segment. The resulting weights are identical those internally used by sample_1d().
Extrapolate
:Extrapolate values when x
is out of range? (default:
False
)
min
(float):Position of the first node
max
(float):Position of the last node
size
(int):Denotes the number of function samples
x
(float):Evaluation point
weights
:Pointer to a weight array of size 4 that will be populated
In the Python API, the offset
and weights
parameters are
returned as the second and third elements of a triple.
A boolean set to True
on success and False
when
Extrapolate=false
and x
lies outside of [min
, max
]
and an offset into the function samples associated with weights[0]
Compute weights to perform a spline-interpolated lookup on a non-uniformly sampled 1D function.
The implementation relies on Catmull-Rom splines, i.e. it uses finite differences to approximate the derivatives at the endpoints of each spline segment. The resulting weights are identical those internally used by sample_1d().
Extrapolate
:Extrapolate values when x
is out of range? (default:
False
)
nodes
(numpy.ndarray[float32]):Array containing size
non-uniformly spaced values denoting
positions the where the function to be interpolated was evaluated.
They must be provided in increasing order.
size
:Denotes the size of the nodes
array
x
(float):Evaluation point
weights
:Pointer to a weight array of size 4 that will be populated
The Python API lacks the size
parameter, which is inferred
automatically from the size of the input array. The offset
and
weights
parameters are returned as the second and third
elements of a triple.
A boolean set to True
on success and False
when
Extrapolate=false
and x
lies outside of [min
, max
]
and an offset into the function samples associated with weights[0]
Computes a prefix sum of integrals over segments of a uniformly sampled 1D Catmull-Rom spline interpolant
This is useful for sampling spline segments as part of an importance sampling scheme (in conjunction with sample_1d)
min
(float):Position of the first node
max
(float):Position of the last node
values
(numpy.ndarray[float32]):Array containing size
regularly spaced evaluations in the
range [min
, max
] of the approximated function.
size
:Denotes the size of the values
array
out
:An array with size
entries, which will be used to store the
prefix sum
The Python API lacks the size
and out
parameters. The
former is inferred automatically from the size of the input array,
and out
is returned as a list.
no description available
Computes a prefix sum of integrals over segments of a non-uniformly sampled 1D Catmull-Rom spline interpolant
This is useful for sampling spline segments as part of an importance sampling scheme (in conjunction with sample_1d)
nodes
(numpy.ndarray[float32]):Array containing size
non-uniformly spaced values denoting
positions the where the function to be interpolated was evaluated.
They must be provided in increasing order.
values
(numpy.ndarray[float32]):Array containing function evaluations matched to the entries of
nodes
.
size
:Denotes the size of the values
array
out
:An array with size
entries, which will be used to store the
prefix sum
The Python API lacks the size
and out
parameters. The
former is inferred automatically from the size of the input array,
and out
is returned as a list.
no description available
Invert a cubic spline interpolant of a uniformly sampled 1D function. The spline interpolant must be monotonically increasing.
min
(float):Position of the first node
max
:Position of the last node
values
(numpy.ndarray[float32]):Array containing size
regularly spaced evaluations in the
range [min
, max
] of the approximated function.
size
:Denotes the size of the values
array
y
(float):Input parameter for the inversion
eps
(float):Error tolerance (default: 1e-6f)
The spline parameter t
such that eval_1d(..., t)=y
max_
(float):no description available
Invert a cubic spline interpolant of a non-uniformly sampled 1D function. The spline interpolant must be monotonically increasing.
nodes
(numpy.ndarray[float32]):Array containing size
non-uniformly spaced values denoting
positions the where the function to be interpolated was evaluated.
They must be provided in increasing order.
values
(numpy.ndarray[float32]):Array containing function evaluations matched to the entries of
nodes
.
size
:Denotes the size of the values
array
y
(float):Input parameter for the inversion
eps
(float):Error tolerance (default: 1e-6f)
The spline parameter t
such that eval_1d(..., t)=y
Importance sample a segment of a uniformly sampled 1D Catmull-Rom spline interpolant
min
(float):Position of the first node
max
(float):Position of the last node
values
(numpy.ndarray[float32]):Array containing size
regularly spaced evaluations in the
range [min
, max
] of the approximated function.
cdf
(numpy.ndarray[float32]):Array containing a cumulative distribution function computed by integrate_1d().
size
:Denotes the size of the values
array
sample
(float):A uniformly distributed random sample in the interval [0,1]
eps
(float):Error tolerance (default: 1e-6f)
1. The sampled position 2. The value of the spline evaluated at the sampled position 3. The probability density at the sampled position (which only differs from item 2. when the function does not integrate to one)
Importance sample a segment of a non-uniformly sampled 1D Catmull- Rom spline interpolant
nodes
(numpy.ndarray[float32]):Array containing size
non-uniformly spaced values denoting
positions the where the function to be interpolated was evaluated.
They must be provided in increasing order.
values
(numpy.ndarray[float32]):Array containing function evaluations matched to the entries of
nodes
.
cdf
(numpy.ndarray[float32]):Array containing a cumulative distribution function computed by integrate_1d().
size
:Denotes the size of the values
array
sample
(float):A uniformly distributed random sample in the interval [0,1]
eps
(float):Error tolerance (default: 1e-6f)
1. The sampled position 2. The value of the spline evaluated at the sampled position 3. The probability density at the sampled position (which only differs from item 2. when the function does not integrate to one)
Available Log message types
Members:
< Trace message, for extremely verbose debugging
< Debug message, usually turned off
< More relevant debug / information message
< Warning message
< Error message, causes an exception to be thrown
arg0
(int):no description available
Base class: mitsuba.core.Object
Responsible for processing log messages
Upon receiving a log message, the Logger class invokes a Formatter to convert it into a human-readable form. Following that, it sends this information to every registered Appender.
Construct a new logger with the given minimum log level
arg0
(mitsuba.core.LogLevel
):no description available
Add an appender to this logger
arg0
(mitsuba.core.Appender
):no description available
no description available
Return one of the appenders
arg0
(int):no description available
mitsuba.core.Appender
:no description available
Return the number of registered appenders
no description available
Remove all appenders from this logger
no description available
Return the current error level
mitsuba.core.LogLevel
:no description available
Return the logger’s formatter implementation
mitsuba.core.Formatter
:no description available
Return the current log level
mitsuba.core.LogLevel
:no description available
Process a progress message
progress
(float):Percentage value in [0, 100]
name
(str):Title of the progress message
formatted
(str):Formatted string representation of the message
eta
(str):Estimated time until 100% is reached.
ptr
(capsule):Custom pointer payload. This is used to express the context of a
progress message. When rendering a scene, it will usually contain
a pointer to the associated RenderJob
.
no description available
Return the contents of the log file as a string
Throws a runtime exception upon failure
no description available
Remove an appender from this logger
arg0
(mitsuba.core.Appender
):no description available
no description available
Set the error log level (this level and anything above will throw exceptions).
The value provided here can be used for instance to turn warnings into errors. But level must always be less than Error, i.e. it isn’t possible to cause errors not to throw an exception.
arg0
(mitsuba.core.LogLevel
):no description available
no description available
Set the logger’s formatter implementation
arg0
(mitsuba.core.Formatter
):no description available
no description available
Set the log level (everything below will be ignored)
arg0
(mitsuba.core.LogLevel
):no description available
no description available
Base class: mitsuba.core.Object
This class defines an abstract destination for logging-relevant information
Append a line of text with the given log level
level
(mitsuba.core.LogLevel
):no description available
text
(str):no description available
no description available
Process a progress message
progress
(float):Percentage value in [0, 100]
name
(str):Title of the progress message
formatted
(str):Formatted string representation of the message
eta
(str):Estimated time until 100% is reached.
ptr
(capsule):Custom pointer payload. This is used to express the context of a
progress message. When rendering a scene, it will usually contain
a pointer to the associated RenderJob
.
no description available
arg0
(float):no description available
arg0
(enoki.scalar.Vector0f):no description available
arg0
(ndarray):no description available
arg0
(torch_tensor):no description available
arg0
(list):no description available
arg0
(tuple):no description available
arg0
(enoki.scalar.Vector0d):no description available
__init__(self: enoki.scalar.Vector0f, arg0: enoki.scalar.Vector0i) -> None
arg0
(enoki.scalar.Vector0u):no description available
size
(int):no description available
no description available
no description available
value
(float):no description available
size
(int):no description available
no description available
no description available
eval
(bool):no description available
no description available
eval
(bool):no description available
no description available
size
(int):no description available
no description available
arg0
(int):no description available
arg0
(enoki.scalar.Vector0i):no description available
arg0
(ndarray):no description available
arg0
(torch_tensor):no description available
arg0
(list):no description available
arg0
(tuple):no description available
arg0
(enoki.scalar.Vector0f):no description available
__init__(self: enoki.scalar.Vector0i, arg0: enoki.scalar.Vector0u) -> None
arg0
(enoki.scalar.Vector0d):no description available
size
(int):no description available
no description available
no description available
value
(int):no description available
size
(int):no description available
no description available
no description available
eval
(bool):no description available
no description available
eval
(bool):no description available
no description available
size
(int):no description available
no description available
arg0
(int):no description available
arg0
(enoki.scalar.Vector0u):no description available
arg0
(ndarray):no description available
arg0
(torch_tensor):no description available
arg0
(list):no description available
arg0
(tuple):no description available
arg0
(enoki.scalar.Vector0f):no description available
__init__(self: enoki.scalar.Vector0u, arg0: enoki.scalar.Vector0i) -> None
arg0
(enoki.scalar.Vector0d):no description available
size
(int):no description available
no description available
no description available
value
(int):no description available
size
(int):no description available
no description available
no description available
eval
(bool):no description available
no description available
eval
(bool):no description available
no description available
size
(int):no description available
no description available
arg0
(float):no description available
arg0
(enoki.scalar.Vector1f):no description available
arg0
(ndarray):no description available
arg0
(torch_tensor):no description available
arg0
(list):no description available
arg0
(tuple):no description available
arg0
(enoki.scalar.Vector1d):no description available
__init__(self: enoki.scalar.Vector1f, arg0: enoki.scalar.Vector1i) -> None
arg0
(enoki.scalar.Vector1u):no description available
size
(int):no description available
no description available
no description available
value
(float):no description available
size
(int):no description available
no description available
no description available
eval
(bool):no description available
no description available
eval
(bool):no description available
no description available
size
(int):no description available
no description available
arg0
(int):no description available
arg0
(enoki.scalar.Vector1i):no description available
arg0
(ndarray):no description available
arg0
(torch_tensor):no description available
arg0
(list):no description available
arg0
(tuple):no description available
arg0
(enoki.scalar.Vector1f):no description available
__init__(self: enoki.scalar.Vector1i, arg0: enoki.scalar.Vector1u) -> None
arg0
(enoki.scalar.Vector1d):no description available
size
(int):no description available
no description available
no description available
value
(int):no description available
size
(int):no description available
no description available
no description available
eval
(bool):no description available
no description available
eval
(bool):no description available
no description available
size
(int):no description available
no description available
arg0
(int):no description available
arg0
(enoki.scalar.Vector1u):no description available
arg0
(ndarray):no description available
arg0
(torch_tensor):no description available
arg0
(list):no description available
arg0
(tuple):no description available
arg0
(enoki.scalar.Vector1f):no description available
__init__(self: enoki.scalar.Vector1u, arg0: enoki.scalar.Vector1i) -> None
arg0
(enoki.scalar.Vector1d):no description available
size
(int):no description available
no description available
no description available
value
(int):no description available
size
(int):no description available
no description available
no description available
eval
(bool):no description available
no description available
eval
(bool):no description available
no description available
size
(int):no description available
no description available
arg0
(float):no description available
arg0
(enoki.scalar.Vector2f):no description available
arg0
(ndarray):no description available
arg0
(torch_tensor):no description available
arg0
(list):no description available
arg0
(tuple):no description available
x
(float):no description available
y
(float):no description available
__init__(self: enoki.scalar.Vector2f, arg0: enoki.scalar.Vector2u) -> None
__init__(self: enoki.scalar.Vector2f, arg0: enoki.scalar.Vector2i) -> None
arg0
(enoki.scalar.Vector2d):no description available
size
(int):no description available
no description available
no description available
value
(float):no description available
size
(int):no description available
no description available
no description available
eval
(bool):no description available
no description available
eval
(bool):no description available
no description available
size
(int):no description available
no description available
arg0
(int):no description available
arg0
(enoki.scalar.Vector2i):no description available
arg0
(ndarray):no description available
arg0
(torch_tensor):no description available
arg0
(list):no description available
arg0
(tuple):no description available
x
(int):no description available
y
(int):no description available
__init__(self: enoki.scalar.Vector2i, arg0: enoki.scalar.Vector2d) -> None
__init__(self: enoki.scalar.Vector2i, arg0: enoki.scalar.Vector2u) -> None
arg0
(enoki.scalar.Vector2f):no description available
size
(int):no description available
no description available
no description available
value
(int):no description available
size
(int):no description available
no description available
no description available
eval
(bool):no description available
no description available
eval
(bool):no description available
no description available
size
(int):no description available
no description available
arg0
(int):no description available
arg0
(enoki.scalar.Vector2u):no description available
arg0
(ndarray):no description available
arg0
(torch_tensor):no description available
arg0
(list):no description available
arg0
(tuple):no description available
x
(int):no description available
y
(int):no description available
__init__(self: enoki.scalar.Vector2u, arg0: enoki.scalar.Vector2d) -> None
__init__(self: enoki.scalar.Vector2u, arg0: enoki.scalar.Vector2i) -> None
arg0
(enoki.scalar.Vector2f):no description available
size
(int):no description available
no description available
no description available
value
(int):no description available
size
(int):no description available
no description available
no description available
eval
(bool):no description available
no description available
eval
(bool):no description available
no description available
size
(int):no description available
no description available
arg0
(float):no description available
arg0
(enoki.scalar.Vector3f):no description available
arg0
(ndarray):no description available
arg0
(torch_tensor):no description available
arg0
(list):no description available
arg0
(tuple):no description available
x
(float):no description available
y
(float):no description available
z
(float):no description available
__init__(self: enoki.scalar.Vector3f, arg0: enoki.scalar.Vector3u) -> None
__init__(self: enoki.scalar.Vector3f, arg0: enoki.scalar.Vector3i) -> None
arg0
(enoki.scalar.Vector3d):no description available
size
(int):no description available
no description available
no description available
value
(float):no description available
size
(int):no description available
no description available
no description available
eval
(bool):no description available
no description available
eval
(bool):no description available
no description available
size
(int):no description available
no description available
arg0
(int):no description available
arg0
(enoki.scalar.Vector3i):no description available
arg0
(ndarray):no description available
arg0
(torch_tensor):no description available
arg0
(list):no description available
arg0
(tuple):no description available
x
(int):no description available
y
(int):no description available
z
(int):no description available
__init__(self: enoki.scalar.Vector3i, arg0: enoki.scalar.Vector3d) -> None
__init__(self: enoki.scalar.Vector3i, arg0: enoki.scalar.Vector3u) -> None
arg0
(enoki.scalar.Vector3f):no description available
size
(int):no description available
no description available
no description available
value
(int):no description available
size
(int):no description available
no description available
no description available
eval
(bool):no description available
no description available
eval
(bool):no description available
no description available
size
(int):no description available
no description available
arg0
(int):no description available
arg0
(enoki.scalar.Vector3u):no description available
arg0
(ndarray):no description available
arg0
(torch_tensor):no description available
arg0
(list):no description available
arg0
(tuple):no description available
x
(int):no description available
y
(int):no description available
z
(int):no description available
__init__(self: enoki.scalar.Vector3u, arg0: enoki.scalar.Vector3d) -> None
__init__(self: enoki.scalar.Vector3u, arg0: enoki.scalar.Vector3i) -> None
arg0
(enoki.scalar.Vector3f):no description available
size
(int):no description available
no description available
no description available
value
(int):no description available
size
(int):no description available
no description available
no description available
eval
(bool):no description available
no description available
eval
(bool):no description available
no description available
size
(int):no description available
no description available
arg0
(float):no description available
arg0
(list):no description available
arg0
(ndarray):no description available
arg0
(torch_tensor):no description available
arg0
(float):no description available
arg1
(float):no description available
arg2
(float):no description available
arg3
(float):no description available
arg0
(enoki.scalar.Vector2f):no description available
arg1
(enoki.scalar.Vector2f):no description available
value
(float):no description available
size
(int):no description available
no description available
size
(int):no description available
no description available
eval
(bool):no description available
no description available
eval
(bool):no description available
no description available
size
(int):no description available
no description available
arg0
(float):no description available
arg0
(list):no description available
arg0
(ndarray):no description available
arg0
(torch_tensor):no description available
arg0
(float):no description available
arg1
(float):no description available
arg2
(float):no description available
arg3
(float):no description available
arg4
(float):no description available
arg5
(float):no description available
arg6
(float):no description available
arg7
(float):no description available
arg8
(float):no description available
arg0
(enoki.scalar.Vector3f):no description available
arg1
(enoki.scalar.Vector3f):no description available
arg2
(enoki.scalar.Vector3f):no description available
value
(float):no description available
size
(int):no description available
no description available
size
(int):no description available
no description available
eval
(bool):no description available
no description available
eval
(bool):no description available
no description available
size
(int):no description available
no description available
arg0
(float):no description available
arg0
(list):no description available
arg0
(ndarray):no description available
arg0
(torch_tensor):no description available
arg0
(float):no description available
arg1
(float):no description available
arg2
(float):no description available
arg3
(float):no description available
arg4
(float):no description available
arg5
(float):no description available
arg6
(float):no description available
arg7
(float):no description available
arg8
(float):no description available
arg9
(float):no description available
arg10
(float):no description available
arg11
(float):no description available
arg12
(float):no description available
arg13
(float):no description available
arg14
(float):no description available
arg15
(float):no description available
arg0
(enoki.scalar.Vector4f):no description available
arg1
(enoki.scalar.Vector4f):no description available
arg2
(enoki.scalar.Vector4f):no description available
arg3
(enoki.scalar.Vector4f):no description available
value
(float):no description available
size
(int):no description available
no description available
size
(int):no description available
no description available
origin
(enoki.scalar.Vector3f):no description available
target
(enoki.scalar.Vector3f):no description available
up
(enoki.scalar.Vector3f):no description available
no description available
eval
(bool):no description available
no description available
axis
(enoki.scalar.Vector3f):no description available
angle
(float):no description available
no description available
arg0
(enoki.scalar.Vector3f):no description available
no description available
eval
(bool):no description available
no description available
arg0
(enoki.scalar.Vector3f):no description available
no description available
size
(int):no description available
no description available
Generic n-dimensional bounding box data structure
Maintains a minimum and maximum position along each dimension and provides various convenience functions for querying and modifying them.
This class is parameterized by the underlying point data structure, which permits the use of different scalar types and dimensionalities, e.g.
BoundingBox<Point3i> integer_bbox(Point3i(0, 1, 3), Point3i(4, 5, 6));
BoundingBox<Point2d> double_bbox(Point2d(0.0, 1.0), Point2d(4.0, 5.0));
T
:The underlying point data type (e.g. Point2d
)
Create a new invalid bounding box
Initializes the components of the minimum and maximum position to $infty$ and $-infty$, respectively.
Create a collapsed bounding box from a single point
p
(enoki.scalar.Vector2f):no description available
Create a bounding box from two positions
min
(enoki.scalar.Vector2f):no description available
max
(enoki.scalar.Vector2f):no description available
Copy constructor
arg0
(mitsuba.core.BoundingBox2f
):no description available
Return the center point
no description available
Clip this bounding box to another bounding box
arg0
(mitsuba.core.BoundingBox2f
):no description available
no description available
Check whether this bounding box has collapsed to a point, line, or plane
no description available
Check whether a point lies on or inside the bounding box
p
(enoki.scalar.Vector2f):The point to be tested
Strict
:Set this parameter to True
if the bounding box boundary should
be excluded in the test
In the Python bindings, the ‘Strict’ argument is a normal function
parameter with default value False
.
strict
(bool):no description available
no description available
Check whether a specified bounding box lies on or within the current bounding box
Note that by definition, an ‘invalid’ bounding box (where min=$infty$ and max=$-infty$) does not cover any space. Hence, this method will always return true when given such an argument.
Strict
:Set this parameter to True
if the bounding box boundary should
be excluded in the test
In the Python bindings, the ‘Strict’ argument is a normal function
parameter with default value False
.
bbox
(mitsuba.core.BoundingBox2f
):no description available
strict
(bool):no description available
no description available
Return the position of a bounding box corner
arg0
(int):no description available
no description available
Calculate the shortest distance between the axis-aligned bounding box
and the point p
.
arg0
(enoki.scalar.Vector2f):no description available
no description available
Calculate the shortest distance between the axis-aligned bounding box
and bbox
.
arg0
(mitsuba.core.BoundingBox2f
):no description available
no description available
Expand the bounding box to contain another point
arg0
(enoki.scalar.Vector2f):no description available
Expand the bounding box to contain another bounding box
arg0
(mitsuba.core.BoundingBox2f
):no description available
Calculate the bounding box extents
max - min
Return the dimension index with the index associated side length
no description available
Merge two bounding boxes
arg0
(mitsuba.core.BoundingBox2f
):no description available
arg1
(mitsuba.core.BoundingBox2f
):no description available
mitsuba.core.BoundingBox2f
:no description available
Return the dimension index with the shortest associated side length
no description available
Check two axis-aligned bounding boxes for possible overlap.
Strict
:Set this parameter to True
if the bounding box boundary should
be excluded in the test
In the Python bindings, the ‘Strict’ argument is a normal function
parameter with default value False
.
bbox
(mitsuba.core.BoundingBox2f
):no description available
strict
(bool):no description available
True
If overlap was detected.
Mark the bounding box as invalid.
This operation sets the components of the minimum and maximum position to $infty$ and $-infty$, respectively.
no description available
Calculate the shortest squared distance between the axis-aligned
bounding box and the point p
.
arg0
(enoki.scalar.Vector2f):no description available
no description available
Calculate the shortest squared distance between the axis-aligned
bounding box and bbox
.
arg0
(mitsuba.core.BoundingBox2f
):no description available
no description available
Calculate the 2-dimensional surface area of a 3D bounding box
no description available
Check whether this is a valid bounding box
A bounding box bbox
is considered to be valid when
bbox.min[i] <= bbox.max[i]
holds for each component i
.
no description available
Calculate the n-dimensional volume of the bounding box
no description available
Generic n-dimensional bounding box data structure
Maintains a minimum and maximum position along each dimension and provides various convenience functions for querying and modifying them.
This class is parameterized by the underlying point data structure, which permits the use of different scalar types and dimensionalities, e.g.
BoundingBox<Point3i> integer_bbox(Point3i(0, 1, 3), Point3i(4, 5, 6));
BoundingBox<Point2d> double_bbox(Point2d(0.0, 1.0), Point2d(4.0, 5.0));
T
:The underlying point data type (e.g. Point2d
)
Create a new invalid bounding box
Initializes the components of the minimum and maximum position to $infty$ and $-infty$, respectively.
Create a collapsed bounding box from a single point
p
(enoki.scalar.Vector3f):no description available
Create a bounding box from two positions
min
(enoki.scalar.Vector3f):no description available
max
(enoki.scalar.Vector3f):no description available
Copy constructor
arg0
(mitsuba.core.BoundingBox3f
):no description available
Return the center point
no description available
Clip this bounding box to another bounding box
arg0
(mitsuba.core.BoundingBox3f
):no description available
no description available
Check whether this bounding box has collapsed to a point, line, or plane
no description available
Check whether a point lies on or inside the bounding box
p
(enoki.scalar.Vector3f):The point to be tested
Strict
:Set this parameter to True
if the bounding box boundary should
be excluded in the test
In the Python bindings, the ‘Strict’ argument is a normal function
parameter with default value False
.
strict
(bool):no description available
no description available
Check whether a specified bounding box lies on or within the current bounding box
Note that by definition, an ‘invalid’ bounding box (where min=$infty$ and max=$-infty$) does not cover any space. Hence, this method will always return true when given such an argument.
Strict
:Set this parameter to True
if the bounding box boundary should
be excluded in the test
In the Python bindings, the ‘Strict’ argument is a normal function
parameter with default value False
.
bbox
(mitsuba.core.BoundingBox3f
):no description available
strict
(bool):no description available
no description available
Return the position of a bounding box corner
arg0
(int):no description available
no description available
Calculate the shortest distance between the axis-aligned bounding box
and the point p
.
arg0
(enoki.scalar.Vector3f):no description available
no description available
Calculate the shortest distance between the axis-aligned bounding box
and bbox
.
arg0
(mitsuba.core.BoundingBox3f
):no description available
no description available
Expand the bounding box to contain another point
arg0
(enoki.scalar.Vector3f):no description available
Expand the bounding box to contain another bounding box
arg0
(mitsuba.core.BoundingBox3f
):no description available
Calculate the bounding box extents
max - min
Return the dimension index with the index associated side length
no description available
Merge two bounding boxes
arg0
(mitsuba.core.BoundingBox3f
):no description available
arg1
(mitsuba.core.BoundingBox3f
):no description available
mitsuba.core.BoundingBox3f
:no description available
Return the dimension index with the shortest associated side length
no description available
Check two axis-aligned bounding boxes for possible overlap.
Strict
:Set this parameter to True
if the bounding box boundary should
be excluded in the test
In the Python bindings, the ‘Strict’ argument is a normal function
parameter with default value False
.
bbox
(mitsuba.core.BoundingBox3f
):no description available
strict
(bool):no description available
True
If overlap was detected.
Check if a ray intersects a bounding box
Note that this function ignores the (mint, maxt)
interval
associated with the ray.
ray
(mitsuba.core.Ray3f
):no description available
no description available
Mark the bounding box as invalid.
This operation sets the components of the minimum and maximum position to $infty$ and $-infty$, respectively.
no description available
Calculate the shortest squared distance between the axis-aligned
bounding box and the point p
.
arg0
(enoki.scalar.Vector3f):no description available
no description available
Calculate the shortest squared distance between the axis-aligned
bounding box and bbox
.
arg0
(mitsuba.core.BoundingBox3f
):no description available
no description available
Calculate the 2-dimensional surface area of a 3D bounding box
no description available
Check whether this is a valid bounding box
A bounding box bbox
is considered to be valid when
bbox.min[i] <= bbox.max[i]
holds for each component i
.
no description available
Calculate the n-dimensional volume of the bounding box
no description available
Generic n-dimensional bounding sphere data structure
Construct bounding sphere(s) at the origin having radius zero
Create bounding sphere(s) from given center point(s) with given size(s)
arg0
(enoki.scalar.Vector3f):no description available
arg1
(float):no description available
arg0
(mitsuba.core.BoundingSphere3f
):no description available
Check whether a point lies on or inside the bounding sphere
p
(enoki.scalar.Vector3f):The point to be tested
Strict
:Set this parameter to True
if the bounding sphere boundary
should be excluded in the test
In the Python bindings, the ‘Strict’ argument is a normal function
parameter with default value False
.
strict
(bool):no description available
no description available
Return whether this bounding sphere has a radius of zero or less.
no description available
Expand the bounding sphere radius to contain another point.
arg0
(enoki.scalar.Vector3f):no description available
no description available
Check if a ray intersects a bounding box
ray
(mitsuba.core.Ray3f
):no description available
no description available
Encapsulates a 4x4 homogeneous coordinate transformation along with its inverse transpose
The Transform class provides a set of overloaded matrix-vector multiplication operators for vectors, points, and normals (all of them behave differently under homogeneous coordinate transformations, hence the need to represent them using separate types)
Initialize with the identity matrix
Copy constructor
arg0
(mitsuba.core.Transform3f
):no description available
arg0
(array):no description available
arg0
(list):no description available
Initialize the transformation from the given matrix (and compute its inverse transpose)
arg0
(enoki.scalar.Matrix3f):no description available
Initialize from a matrix and its inverse transpose
arg0
(enoki.scalar.Matrix3f):no description available
arg1
(enoki.scalar.Matrix3f):no description available
Test for a scale component in each transform matrix by checking
whether M . M^T == I
(where M
is the matrix in question and
I
is the identity).
no description available
Test for a scale component in each transform matrix by checking
whether M . M^T == I
(where M
is the matrix in question and
I
is the identity).
no description available
Compute the inverse of this transformation (involves just shuffles, no arithmetic)
mitsuba.core.Transform3f
:no description available
Create a rotation transformation in 2D. The angle is specified in degrees
angle
(float):no description available
mitsuba.core.Transform3f
:no description available
Create a scale transformation
v
(enoki.scalar.Vector2f):no description available
mitsuba.core.Transform3f
:no description available
arg0
(enoki.scalar.Vector2f):no description available
no description available
arg0
(enoki.scalar.Vector2f):no description available
no description available
Create a translation transformation
v
(enoki.scalar.Vector2f):no description available
mitsuba.core.Transform3f
:no description available
size
(int):no description available
mitsuba.core.Transform3f
:no description available
Encapsulates a 4x4 homogeneous coordinate transformation along with its inverse transpose
The Transform class provides a set of overloaded matrix-vector multiplication operators for vectors, points, and normals (all of them behave differently under homogeneous coordinate transformations, hence the need to represent them using separate types)
Initialize with the identity matrix
Copy constructor
arg0
(mitsuba.core.Transform4f
):no description available
arg0
(array):no description available
arg0
(list):no description available
Initialize the transformation from the given matrix (and compute its inverse transpose)
arg0
(enoki.scalar.Matrix4f):no description available
Initialize from a matrix and its inverse transpose
arg0
(enoki.scalar.Matrix4f):no description available
arg1
(enoki.scalar.Matrix4f):no description available
Extract a lower-dimensional submatrix
mitsuba.core.Transform3f
:no description available
Creates a transformation that converts from ‘frame’ to the standard basis
frame
(mitsuba.core.Frame3f
):no description available
mitsuba.core.Transform4f
:no description available
Test for a scale component in each transform matrix by checking
whether M . M^T == I
(where M
is the matrix in question and
I
is the identity).
no description available
Test for a scale component in each transform matrix by checking
whether M . M^T == I
(where M
is the matrix in question and
I
is the identity).
no description available
Compute the inverse of this transformation (involves just shuffles, no arithmetic)
mitsuba.core.Transform4f
:no description available
Create a look-at camera transformation
origin
(enoki.scalar.Vector3f):Camera position
target
(enoki.scalar.Vector3f):Target vector
up
(enoki.scalar.Vector3f):Up vector
mitsuba.core.Transform4f
:no description available
Create an orthographic transformation, which maps Z to [0,1] and leaves the X and Y coordinates untouched.
near
(float):Near clipping plane
far
(float):Far clipping plane
mitsuba.core.Transform4f
:no description available
Create a perspective transformation. (Maps [near, far] to [0, 1])
Projects vectors in camera space onto a plane at z=1:
x_proj = x / z y_proj = y / z z_proj = (far * (z - near)) / (z * (far- near))
Camera-space depths are not mapped linearly!
fov
(float):Field of view in degrees
near
(float):Near clipping plane
far
(float):Far clipping plane
mitsuba.core.Transform4f
:no description available
Create a rotation transformation around an arbitrary axis in 3D. The angle is specified in degrees
axis
(enoki.scalar.Vector3f):no description available
angle
(float):no description available
mitsuba.core.Transform4f
:no description available
Create a scale transformation
v
(enoki.scalar.Vector3f):no description available
mitsuba.core.Transform4f
:no description available
Creates a transformation that converts from the standard basis to ‘frame’
frame
(mitsuba.core.Frame3f
):no description available
mitsuba.core.Transform4f
:no description available
arg0
(enoki.scalar.Vector3f):no description available
no description available
arg0
(enoki.scalar.Vector3f):no description available
no description available
arg0
(enoki.scalar.Vector3f):no description available
no description available
Create a translation transformation
v
(enoki.scalar.Vector3f):no description available
mitsuba.core.Transform4f
:no description available
size
(int):no description available
mitsuba.core.Transform4f
:no description available
Base class: mitsuba.core.Object
Encapsulates an animated 4x4 homogeneous coordinate transformation
The animation is stored as keyframe animation with linear segments. The implementation performs a polar decomposition of each keyframe into a 3x3 scale/shear matrix, a rotation quaternion, and a translation vector. These will all be interpolated independently at eval time.
arg0
(mitsuba.core.Transform4f
):no description available
Append a keyframe to the current animated transform
arg0
(float):no description available
arg1
(mitsuba.core.Transform4f
):no description available
arg0
(mitsuba.core.AnimatedTransform.Keyframe
):no description available
Compatibility wrapper, which strips the mask argument and invokes eval()
time
(float):no description available
unused
(bool):no description available
mitsuba.core.Transform4f
:no description available
Determine whether the transformation involves any kind of scaling
no description available
Return the number of keyframes
no description available
Return an axis-aligned box bounding the amount of translation throughout the animation sequence
mitsuba.core.BoundingBox3f
:no description available
Minimal command line argument parser
This class provides a minimal cross-platform command line argument parser in the spirit of to GNU getopt. Both short and long arguments that accept an optional extra value are supported.
The typical usage is
ArgParser p;
auto arg0 = p.register("--myParameter");
auto arg1 = p.register("-f", true);
p.parse(argc, argv);
if (*arg0)
std::cout << "Got --myParameter" << std::endl;
if (*arg1)
std::cout << "Got -f " << arg1->value() << std::endl;
Register a new argument with the given list of prefixes
prefixes
(List[str]):A list of command prefixes (i.e. {“-f”, “–fast”})
extra
(bool):Indicates whether the argument accepts an extra argument value
prefix
(str):no description available
mitsuba.core.ArgParser.Arg
:no description available
Register a new argument with the given prefix
prefix
:A single command prefix (i.e. “-f”)
extra
(bool):Indicates whether the argument accepts an extra argument value
mitsuba.core.ArgParser.Arg
:no description available
no description available
Parse the given set of command line arguments
arg0
(List[str]):no description available
no description available
Atomic floating point data type
The class implements an an atomic floating point data type (which is
not possible with the existing overloads provided by std::atomic
).
It internally casts floating point values to an integer storage format
and uses atomic integer compare and exchange operations to perform
changes.
Initialize the AtomicFloat with a given floating point value
arg0
(float):no description available
Stores meta-information about Object instances.
This class provides a thin layer of RTTI (run-time type information), which is useful for doing things like:
Checking if an object derives from a certain class
Determining the parent of a class at runtime
Instantiating a class by name
Unserializing a class from a binary data stream
ref, Object
Return the scene description-specific alias, if applicable
no description available
Return the name of the class
no description available
Return the Class object associated with the parent class of nullptr if it does not have one.
mitsuba.core.Class
:no description available
Return the variant of the class
no description available
Base class: mitsuba.core.Formatter
The default formatter used to turn log messages into a human-readable form
set_has_class
no description available
set_has_date
no description available
set_has_log_level
no description available
set_has_thread
no description available
Should class information be included? The default is yes.
arg0
(bool):no description available
no description available
Should date information be included? The default is yes.
arg0
(bool):no description available
no description available
Should log level information be included? The default is yes.
arg0
(bool):no description available
no description available
Should thread information be included? The default is yes.
arg0
(bool):no description available
no description available
pos
(enoki.scalar.Vector2u):no description available
active
(bool):Mask to specify active lanes.
no description available
pos
(enoki.scalar.Vector2u):no description available
active
(bool):Mask to specify active lanes.
no description available
sample
(enoki.scalar.Vector2f):no description available
active
(bool):Mask to specify active lanes.
no description available
Base class: mitsuba.core.Stream
Stream implementation that never writes to disk, but keeps track of the size of the content being written. It can be used, for example, to measure the precise amount of memory needed to store serialized content.
Base class: mitsuba.core.Object
Simple class for resolving paths on Linux/Windows/Mac OS
This convenience class looks for a file or directory given its name and a set of search paths. The implementation walks through the search paths in order and stops once the file is found.
Initialize a new file resolver with the current working directory
Copy constructor
arg0
(mitsuba.core.FileResolver
):no description available
Append an entry to the end of the list of search paths
arg0
(mitsuba.core.filesystem.path
):no description available
no description available
Clear the list of search paths
no description available
Prepend an entry at the beginning of the list of search paths
arg0
(mitsuba.core.filesystem.path
):no description available
no description available
Walk through the list of search paths and try to resolve the input path
arg0
(mitsuba.core.filesystem.path
):no description available
mitsuba.core.filesystem.path
:no description available
Base class: mitsuba.core.Stream
Simple Stream implementation backed-up by a file.
The underlying file abstraction is std::fstream, and so most operations can be expected to behave similarly.
Constructs a new FileStream by opening the file pointed by p
.
The file is opened in read-only or read/write mode as specified by
mode
.
Throws if trying to open a non-existing file in with write disabled. Throws an exception if the file cannot be opened / created.
p
(mitsuba.core.filesystem.path
):no description available
mode
(mitsuba.core.FileStream.EMode
):no description available
Members:
Opens a file in (binary) read-only mode
Opens (but never creates) a file in (binary) read-write mode
Opens (and truncates) a file in (binary) read-write mode
arg0
(int):no description available
Return the path descriptor associated with this FileStream
mitsuba.core.filesystem.path
:no description available
When resampling data to a different resolution using Resampler::resample(), this enumeration specifies how lookups outside of the input domain are handled.
Resampler
Members:
Clamp to the outermost sample position (default)
Assume that the input repeats in a periodic fashion
Assume that the input is mirrored along the boundary
Assume that the input function is zero outside of the defined domain
Assume that the input function is equal to one outside of the defined domain
arg0
(int):no description available
Base class: mitsuba.core.Object
Abstract interface for converting log information into a human- readable format
Turn a log message into a human-readable format
level
(mitsuba.core.LogLevel
):The importance of the debug message
class_
:Originating class or nullptr
thread
(mitsuba::Thread):Thread, which is reponsible for creating the message
file
(str):File, which is responsible for creating the message
line
(int):Associated line within the source file
msg
(str):Text content associated with the log message
theClass
(mitsuba.core.Class
):no description available
no description available
Stores a three-dimensional orthonormal coordinate frame
This class is used to convert between different cartesian coordinate
systems and to efficiently evaluate trigonometric functions in a
spherical coordinate system whose pole is aligned with the n
axis
(e.g. cos_theta(), sin_phi(), etc.).
Construct a new coordinate frame from a single vector
Copy constructor
arg0
(mitsuba.core.Frame3f
):no description available
arg0
(enoki.scalar.Vector3f):no description available
arg1
(enoki.scalar.Vector3f):no description available
arg2
(enoki.scalar.Vector3f):no description available
arg0
(enoki.scalar.Vector3f):no description available
Give a unit direction, this function returns the cosine of the azimuth in a reference spherical coordinate system (see the Frame description)
v
(enoki.scalar.Vector3f):no description available
no description available
Give a unit direction, this function returns the squared cosine of the azimuth in a reference spherical coordinate system (see the Frame description)
v
(enoki.scalar.Vector3f):no description available
no description available
Give a unit direction, this function returns the cosine of the elevation angle in a reference spherical coordinate system (see the Frame description)
v
(enoki.scalar.Vector3f):no description available
no description available
Give a unit direction, this function returns the square cosine of the elevation angle in a reference spherical coordinate system (see the Frame description)
v
(enoki.scalar.Vector3f):no description available
no description available
Give a unit direction, this function returns the sine of the azimuth in a reference spherical coordinate system (see the Frame description)
v
(enoki.scalar.Vector3f):no description available
no description available
Give a unit direction, this function returns the squared sine of the azimuth in a reference spherical coordinate system (see the Frame description)
v
(enoki.scalar.Vector3f):no description available
no description available
Give a unit direction, this function returns the sine of the elevation angle in a reference spherical coordinate system (see the Frame description)
v
(enoki.scalar.Vector3f):no description available
no description available
Give a unit direction, this function returns the square sine of the elevation angle in a reference spherical coordinate system (see the Frame description)
v
(enoki.scalar.Vector3f):no description available
no description available
Give a unit direction, this function returns the sine and cosine of the azimuth in a reference spherical coordinate system (see the Frame description)
v
(enoki.scalar.Vector3f):no description available
no description available
Give a unit direction, this function returns the squared sine and cosine of the azimuth in a reference spherical coordinate system (see the Frame description)
v
(enoki.scalar.Vector3f):no description available
no description available
Give a unit direction, this function returns the tangent of the elevation angle in a reference spherical coordinate system (see the Frame description)
v
(enoki.scalar.Vector3f):no description available
no description available
Give a unit direction, this function returns the square tangent of the elevation angle in a reference spherical coordinate system (see the Frame description)
v
(enoki.scalar.Vector3f):no description available
no description available
Convert from world coordinates to local coordinates
v
(enoki.scalar.Vector3f):no description available
no description available
Convert from local coordinates to world coordinates
v
(enoki.scalar.Vector3f):no description available
no description available
size
(int):no description available
mitsuba.core.Frame3f
:no description available
level
(mitsuba.core.LogLevel
):no description available
msg
(str):no description available
no description available
Base class: mitsuba.core.Object
Basic cross-platform abstraction for memory mapped files
The Python API has one additional constructor <tt>MemoryMappedFile(filename, array)<tt>, which creates a new file, maps it into memory, and copies the array contents.
Create a new memory-mapped file of the specified size
filename
(mitsuba.core.filesystem.path
):no description available
size
(int):no description available
Map the specified file into memory
filename
(mitsuba.core.filesystem.path
):no description available
write
(bool):no description available
filename
(mitsuba.core.filesystem.path
):no description available
array
(array):no description available
Return whether the mapped memory region can be modified
no description available
Create a temporary memory-mapped file
When closing the mapping, the file is automatically deleted. Mitsuba additionally informs the OS that any outstanding changes that haven’t yet been written to disk can be discarded (Linux/OSX only).
arg0
(int):no description available
mitsuba.core.MemoryMappedFile
:no description available
Return a pointer to the file contents in memory
no description available
Return the associated filename
mitsuba.core.filesystem.path
:no description available
Resize the memory-mapped file
This involves remapping the file, which will generally change the pointer obtained via data()
arg0
(int):no description available
no description available
Return the size of the mapped region
no description available
Base class: mitsuba.core.Stream
Simple memory buffer-based stream with automatic memory management. It always has read & write capabilities.
The underlying memory storage of this implementation dynamically
expands as data is written to the stream, à la std::vector
.
Creates a new memory stream, initializing the memory buffer with a
capacity of capacity
bytes. For best performance, set this
argument to the estimated size of the content that will be written to
the stream.
capacity
(int):no description available
Return the current capacity of the underlying memory buffer
no description available
Return whether or not the memory stream owns the underlying buffer
no description available
PCG32 pseudorandom number generator proposed by Melissa O’Neill
Initialize the pseudorandom number generator with the seed() function
initstate
(int):no description available
initseq
(int):no description available
Multi-step advance function (jump-ahead, jump-back)
The method used here is based on Brown, “Random Number Generation with Arbitrary Stride”, Transactions of the American Nuclear Society (Nov. 1994). The algorithm is very similar to fast exponentiation.
arg0
(int):no description available
no description available
Generate a single precision floating point value on the interval [0, 1)
no description available
Masked version of next_float32
mask
(bool):no description available
no description available
Generate a uniformly distributed unsigned 32-bit random number
no description available
Masked version of next_uint32
mask
(bool):no description available
no description available
Generate a uniformly distributed integer r, where 0 <= r < bound
bound
(int):no description available
no description available
bound
(int):no description available
mask
(bool):no description available
no description available
Generate a uniformly distributed unsigned 64-bit random number
no description available
Masked version of next_uint64
mask
(bool):no description available
no description available
Generate a uniformly distributed integer r, where 0 <= r < bound
bound
(int):no description available
no description available
bound
(int):no description available
mask
(bool):no description available
no description available
Seed the pseudorandom number generator
Specified in two parts: a state initializer and a sequence selection constant (a.k.a. stream id)
initstate
(int):no description available
initseq
(int):no description available
no description available
The object factory is responsible for loading plugin modules and instantiating object instances.
Ordinarily, this class will be used by making repeated calls to the create_object() methods. The generated instances are then assembled into a final object graph, such as a scene. One such examples is the SceneHandler class, which parses an XML scene file by essentially translating the XML elements into calls to create_object().
Return the class corresponding to a plugin for a specific variant
name
(str):no description available
variant
(str):no description available
mitsuba.core.Class
:no description available
Return the global plugin manager
mitsuba.core.PluginManager
:no description available
Base class: mitsuba.core.Object
Efficient implementation of a radical inverse function with prime bases including scrambled versions.
This class is used to implement Halton and Hammersley sequences for QMC integration in Mitsuba.
max_base
(int):no description available
scramble
(int):no description available
Returns the n-th prime base used by the sequence
These prime numbers are used as bases in the radical inverse function implementation.
arg0
(int):no description available
no description available
Return the number of prime bases for which precomputed tables are available
no description available
Calculate the radical inverse function
This function is used as a building block to construct Halton and
Hammersley sequences. Roughly, it computes a b-ary representation of
the input value index
, mirrors it along the decimal point, and
returns the resulting fractional value. The implementation here uses
prime numbers for b
.
base_index
(int):Selects the n-th prime that is used as a base when computing the radical inverse function (0 corresponds to 2, 1->3, 2->5, etc.). The value specified here must be between 0 and 1023.
index
(int):Denotes the index that should be mapped through the radical inverse function
no description available
Calculate a scrambled radical inverse function
This function is used as a building block to construct permuted Halton and Hammersley sequence variants. It works like the normal radical inverse function eval(), except that every digit is run through an extra scrambling permutation.
base_index
(int):no description available
index
(int):no description available
no description available
Return the inverse permutation corresponding to the given prime number basis
arg0
(int):no description available
no description available
Return the permutation corresponding to the given prime number basis
arg0
(int):no description available
no description available
Return the original scramble value
no description available
Simple n-dimensional ray segment data structure
Along with the ray origin and direction, this data structure additionally stores a ray segment [mint, maxt] (whose entries may include positive/negative infinity), as well as the componentwise reciprocals of the ray direction. That is just done for convenience, as these values are frequently required.
Important: be careful when changing the ray direction. You must call update() to compute the componentwise reciprocals as well, or Mitsuba’s ray-object intersection code may produce undefined results.
Create an unitialized ray
Copy constructor
other
(mitsuba.core.Ray3f
):no description available
o
(enoki.scalar.Vector3f):no description available
d
(enoki.scalar.Vector3f):no description available
time
(float):no description available
wavelengths
(enoki.scalar.Vector0f):no description available
o
(enoki.scalar.Vector3f):no description available
d
(enoki.scalar.Vector3f):no description available
mint
(float):no description available
maxt
(float):no description available
time
(float):no description available
wavelengths
(enoki.scalar.Vector0f):no description available
other
(mitsuba.core.Ray3f
):no description available
mint
(float):no description available
maxt
(float):no description available
< Ray direction
< Componentwise reciprocals of the ray direction
< Maximum position on the ray segment
< Minimum position on the ray segment
< Ray origin
< Time value associated with this ray
Update the reciprocal ray directions after changing ‘d’
no description available
< Wavelength packet associated with the ray
size
(int):no description available
mitsuba.core.Ray3f
:no description available
Base class: mitsuba.core.Ray3f
Ray differential – enhances the basic ray class with offset rays for two adjacent pixels on the view plane
ray
(mitsuba.core.Ray3f
):no description available
Initialize without differentials.
o
(enoki.scalar.Vector3f):no description available
d
(enoki.scalar.Vector3f):no description available
time
(float):no description available
wavelengths
(enoki.scalar.Vector0f):no description available
amount
(float):no description available
no description available
Base class: mitsuba.core.Object
Generic interface to separable image reconstruction filters
When resampling bitmaps or adding samples to a rendering in progress, Mitsuba first convolves them with a image reconstruction filter. Various kinds are implemented as subclasses of this interface.
Because image filters are generally too expensive to evaluate for each sample, the implementation of this class internally precomputes an discrete representation, whose resolution given by MTS_FILTER_RESOLUTION.
Return the block border size required when rendering with this filter
no description available
Evaluate the filter function
x
(float):no description available
active
(bool):Mask to specify active lanes.
no description available
Evaluate a discretized version of the filter (generally faster than ‘eval’)
x
(float):no description available
active
(bool):Mask to specify active lanes.
no description available
Return the filter’s width
no description available
Utility class for efficiently resampling discrete datasets to different resolutions
Scalar
:Denotes the underlying floating point data type (i.e. half
,
float
, or double
)
Create a new Resampler object that transforms between the specified resolutions
This constructor precomputes all information needed to efficiently perform the desired resampling operation. For that reason, it is most efficient if it can be used over and over again (e.g. to resample the equal-sized rows of a bitmap)
source_res
(int):Source resolution
target_res
(int):Desired target resolution
rfilter
(mitsuba.render.ReconstructionFilter
):no description available
Return the boundary condition that should be used when looking up samples outside of the defined input domain
mitsuba.core.FilterBoundaryCondition
:no description available
Returns the range to which resampled values will be clamped
The default is -infinity to infinity (i.e. no clamping is used)
no description available
Resample a multi-channel array and clamp the results to a specified valid range
source
(int):Source array of samples
target
:Target array of samples
source_stride
(array):Stride of samples in the source array. A value of ‘1’ implies that they are densely packed.
target_stride
(int):Stride of samples in the source array. A value of ‘1’ implies that they are densely packed.
channels
(int):Number of channels to be resampled
no description available
Set the boundary condition that should be used when looking up samples outside of the defined input domain
The default is FilterBoundaryCondition::Clamp
arg0
(mitsuba.core.FilterBoundaryCondition
):no description available
no description available
If specified, resampled values will be clamped to the given range
arg0
(Tuple[float, float]):no description available
no description available
Return the reconstruction filter’s source resolution
no description available
Return the number of taps used by the reconstruction filter
no description available
Return the reconstruction filter’s target resolution
no description available
RAII-style class to temporarily switch to another thread’s logger/file resolver
arg0
(mitsuba.core.ThreadEnvironment
):no description available
Base class: mitsuba.core.Object
Abstract seekable stream class
Specifies all functions to be implemented by stream subclasses and provides various convenience functions layered on top of on them.
All read**X**() and write**X**() methods support transparent conversion based on the endianness of the underlying system and the value passed to set_byte_order(). Whenever host_byte_order() and byte_order() disagree, the endianness is swapped.
FileStream, MemoryStream, DummyStream
Defines the byte order (endianness) to use in this Stream
Members:
< PowerPC, SPARC, Motorola 68K
< x86, x86_64
< Network byte order (an alias for big endian)
arg0
(int):no description available
Returns the byte order of this stream.
mitsuba.core.Stream.EByteOrder
:no description available
Can we read from the stream?
no description available
Can we write to the stream?
no description available
Closes the stream.
No further read or write operations are permitted.
This function is idempotent. It may be called automatically by the destructor.
no description available
Flushes the stream’s buffers, if any
no description available
Returns the byte order of the underlying machine.
mitsuba.core.Stream.EByteOrder
:no description available
Writes a specified amount of data into the stream. note This does not handle endianness swapping.
Throws an exception when not all data could be written. Implementations need to handle endianness swap when appropriate.
arg0
(int):no description available
no description available
Reads one object of type T from the stream at the current position by
delegating to the appropriate serialization_helper
.
Endianness swapping is handled automatically if needed.
no description available
Reads one object of type T from the stream at the current position by
delegating to the appropriate serialization_helper
.
Endianness swapping is handled automatically if needed.
no description available
Reads one object of type T from the stream at the current position by
delegating to the appropriate serialization_helper
.
Endianness swapping is handled automatically if needed.
no description available
Reads one object of type T from the stream at the current position by
delegating to the appropriate serialization_helper
.
Endianness swapping is handled automatically if needed.
no description available
Reads one object of type T from the stream at the current position by
delegating to the appropriate serialization_helper
.
Endianness swapping is handled automatically if needed.
no description available
Reads one object of type T from the stream at the current position by
delegating to the appropriate serialization_helper
.
Endianness swapping is handled automatically if needed.
no description available
Reads one object of type T from the stream at the current position by
delegating to the appropriate serialization_helper
.
Endianness swapping is handled automatically if needed.
no description available
Convenience function for reading a line of text from an ASCII file
no description available
Reads one object of type T from the stream at the current position by
delegating to the appropriate serialization_helper
.
Endianness swapping is handled automatically if needed.
no description available
Reads one object of type T from the stream at the current position by
delegating to the appropriate serialization_helper
.
Endianness swapping is handled automatically if needed.
no description available
Reads one object of type T from the stream at the current position by
delegating to the appropriate serialization_helper
.
Endianness swapping is handled automatically if needed.
no description available
Reads one object of type T from the stream at the current position by
delegating to the appropriate serialization_helper
.
Endianness swapping is handled automatically if needed.
no description available
Reads one object of type T from the stream at the current position by
delegating to the appropriate serialization_helper
.
Endianness swapping is handled automatically if needed.
no description available
Reads one object of type T from the stream at the current position by
delegating to the appropriate serialization_helper
.
Endianness swapping is handled automatically if needed.
no description available
Seeks to a position inside the stream.
Seeking beyond the size of the buffer will not modify the length of its contents. However, a subsequent write should start at the seeked position and update the size appropriately.
arg0
(int):no description available
no description available
Sets the byte order to use in this stream.
Automatic conversion will be performed on read and write operations to match the system’s native endianness.
No consistency is guaranteed if this method is called after performing some read and write operations on the system using a different endianness.
arg0
(mitsuba.core.Stream.EByteOrder
):no description available
no description available
Returns the size of the stream
no description available
Skip ahead by a given number of bytes
arg0
(int):no description available
no description available
Gets the current position inside the stream
no description available
Truncates the stream to a given size.
The position is updated to min(old_position, size)
. Throws an
exception if in read-only mode.
arg0
(int):no description available
no description available
Writes a specified amount of data into the stream. note This does not handle endianness swapping.
Throws an exception when not all data could be written. Implementations need to handle endianness swap when appropriate.
arg0
(bytes):no description available
no description available
Reads one object of type T from the stream at the current position by
delegating to the appropriate serialization_helper
.
Endianness swapping is handled automatically if needed.
arg0
(bool):no description available
no description available
Reads one object of type T from the stream at the current position by
delegating to the appropriate serialization_helper
.
Endianness swapping is handled automatically if needed.
arg0
(float):no description available
no description available
Reads one object of type T from the stream at the current position by
delegating to the appropriate serialization_helper
.
Endianness swapping is handled automatically if needed.
arg0
(float):no description available
no description available
Reads one object of type T from the stream at the current position by
delegating to the appropriate serialization_helper
.
Endianness swapping is handled automatically if needed.
arg0
(int):no description available
no description available
Reads one object of type T from the stream at the current position by
delegating to the appropriate serialization_helper
.
Endianness swapping is handled automatically if needed.
arg0
(int):no description available
no description available
Reads one object of type T from the stream at the current position by
delegating to the appropriate serialization_helper
.
Endianness swapping is handled automatically if needed.
arg0
(int):no description available
no description available
Reads one object of type T from the stream at the current position by
delegating to the appropriate serialization_helper
.
Endianness swapping is handled automatically if needed.
arg0
(int):no description available
no description available
Convenience function for writing a line of text to an ASCII file
arg0
(str):no description available
no description available
Reads one object of type T from the stream at the current position by
delegating to the appropriate serialization_helper
.
Endianness swapping is handled automatically if needed.
arg0
(float):no description available
no description available
Reads one object of type T from the stream at the current position by
delegating to the appropriate serialization_helper
.
Endianness swapping is handled automatically if needed.
arg0
(str):no description available
no description available
Reads one object of type T from the stream at the current position by
delegating to the appropriate serialization_helper
.
Endianness swapping is handled automatically if needed.
arg0
(int):no description available
no description available
Reads one object of type T from the stream at the current position by
delegating to the appropriate serialization_helper
.
Endianness swapping is handled automatically if needed.
arg0
(int):no description available
no description available
Reads one object of type T from the stream at the current position by
delegating to the appropriate serialization_helper
.
Endianness swapping is handled automatically if needed.
arg0
(int):no description available
no description available
Reads one object of type T from the stream at the current position by
delegating to the appropriate serialization_helper
.
Endianness swapping is handled automatically if needed.
arg0
(int):no description available
no description available
Base class: mitsuba.core.Appender
%Appender implementation, which writes to an arbitrary C++ output stream
Create a new stream appender
This constructor is not exposed in the Python bindings
arg0
(str):no description available
Does this appender log to a file
no description available
Return the contents of the log file as a string
no description available
Base class: mitsuba.core.Object
Descriptor for specifying the contents and in-memory layout of a POD- style data record
The python API provides an additional dtype()
method, which
returns the NumPy dtype
equivalent of a given Struct
instance.
Create a new Struct
and indicate whether the contents are packed
or aligned
pack
(bool):no description available
byte_order
(mitsuba.core.Struct.ByteOrder
):no description available
Members:
LittleEndian :
BigEndian :
HostByteOrder :
arg0
(int):no description available
Field specifier with size and offset
For use with StructConverter::convert()
Specifies a pair of weights and source field names that will be linearly blended to obtain the output field value. Note that this only works for floating point fields or integer fields with the Flags::Normalized flag. Gamma-corrected fields will be blended in linear space.
Additional flags
no description available
no description available
no description available
no description available
Name of the field
Offset within the Struct
(in bytes)
no description available
Size in bytes
Type identifier
Members:
Specifies whether an integer field encodes a normalized value in the range [0, 1]. The flag is ignored if specified for floating point valued fields.
Specifies whether the field encodes a sRGB gamma-corrected value.
Assumes Normalized
is also specified.
In FieldConverter::convert, when an input structure contains a weight field, the value of all entries are considered to be expressed relative to its value. Converting to an un-weighted structure entails a division by the weight.
In FieldConverter::convert, check that the field value matches the specified default value. Otherwise, return a failure
Specifies whether the field encodes an alpha value
Specifies whether the field encodes an alpha premultiplied value
In FieldConverter::convert, when the field is missing in the source record, replace it by the specified default value
arg0
(int):no description available
Members:
Int8 :
UInt8 :
Int16 :
UInt16 :
Int32 :
UInt32 :
Int64 :
UInt64 :
Float16 :
Float32 :
Float64 :
Invalid :
arg0
(int):no description available
dtype
(dtype):no description available
Return the alignment (in bytes) of the data structure
no description available
Append a new field to the Struct
; determines size and offset
automatically
name
(str):no description available
type
(mitsuba.core.Struct.Type
):no description available
flags
(int):no description available
default
(float):no description available
mitsuba.core.Struct
:no description available
Return the byte order of the Struct
mitsuba.core.Struct.ByteOrder
:no description available
Return a NumPy dtype corresponding to this data structure
no description available
Look up a field by name (throws an exception if not found)
arg0
(str):no description available
mitsuba.core.Struct.Field
:no description available
Return the number of fields
no description available
Check if the Struct
has a field of the specified name
arg0
(str):no description available
no description available
Check whether the given type is a floating point type
arg0
(mitsuba.core.Struct.Type
):no description available
no description available
Check whether the given type is an integer type
arg0
(mitsuba.core.Struct.Type
):no description available
no description available
Check whether the given type is a signed type
arg0
(mitsuba.core.Struct.Type
):no description available
no description available
Check whether the given type is an unsigned type
arg0
(mitsuba.core.Struct.Type
):no description available
no description available
Return the representable range of the given type
arg0
(mitsuba.core.Struct.Type
):no description available
no description available
Return the size (in bytes) of the data structure, including padding
no description available
Base class: mitsuba.core.Object
This class solves the any-to-any problem: effiently converting from one kind of structured data representation to another
Graphics applications often need to convert from one kind of structured representation to another, for instance when loading/saving image or mesh data. Consider the following data records which both describe positions tagged with color data.
struct Source { // <-- Big endian! :(
uint8_t r, g, b; // in sRGB
half x, y, z;
};
struct Target { // <-- Little endian!
float x, y, z;
float r, g, b, a; // in linear space
};
The record Source
may represent what is stored in a file on disk,
while Target
represents the expected input of the implementation.
Not only are the formats (e.g. float vs half or uint8_t, incompatible
endianness) and encodings different (e.g. gamma correction vs linear
space), but the second record even has a different order and extra
fields that don’t exist in the first one.
This class provides a routine convert() which <ol>
reorders entries
converts between many different formats (u[int]8-64, float16-64)
performs endianness conversion
applies or removes gamma correction
optionally checks that certain entries have expected default values
substitutes missing values with specified defaults
performs linear transformations of groups of fields (e.g. between
different RGB color spaces)
applies dithering to avoid banding artifacts when converting 2D
images
</ol>
The above operations can be arranged in countless ways, which makes it hard to provide an efficient generic implementation of this functionality. For this reason, the implementation of this class relies on a JIT compiler that generates fast conversion code on demand for each specific conversion. The function is cached and reused in case the same conversion is needed later on. Note that JIT compilation only works on x86_64 processors; other platforms use a slow generic fallback implementation.
source
(mitsuba.core.Struct
):no description available
target
(mitsuba.core.Struct
):no description available
dither
(bool):no description available
arg0
(bytes):no description available
no description available
Return the source Struct
descriptor
mitsuba.core.Struct
:no description available
Return the target Struct
descriptor
mitsuba.core.Struct
:no description available
Base class: mitsuba.core.Object
Cross-platform thread implementation
Mitsuba threads are internally implemented via the std::thread
class defined in C++11. This wrapper class is needed to attach
additional state (Loggers, Path resolvers, etc.) that is inherited
when a thread launches another thread.
name
(str):no description available
Possible priority values for Thread::set_priority()
Members:
arg0
(int):no description available
Return the core affinity
no description available
Detach the thread and release resources
After a call to this function, join() cannot be used anymore. This releases resources, which would otherwise be held until a call to join().
no description available
Return the file resolver associated with the current thread
mitsuba.core.FileResolver
:no description available
Return the value of the critical flag
no description available
Is this thread still running?
no description available
Wait until the thread finishes
no description available
Return the thread’s logger instance
mitsuba.core.Logger
:no description available
Return the name of this thread
no description available
Return the parent thread
mitsuba.core.Thread
:no description available
Return the thread priority
mitsuba.core.Thread.EPriority
:no description available
Register a new thread (e.g. TBB, Python) with Mituba thread system. Returns true upon success.
arg0
(str):no description available
no description available
Set the core affinity
This function provides a hint to the operating system scheduler that the thread should preferably run on the specified processor core. By default, the parameter is set to -1, which means that there is no affinity.
arg0
(int):no description available
no description available
Specify whether or not this thread is critical
When an thread marked critical crashes from an uncaught exception, the
whole process is brought down. The default is False
.
arg0
(bool):no description available
no description available
Set the file resolver associated with the current thread
arg0
(mitsuba.core.FileResolver
):no description available
no description available
Set the logger instance used to process log messages from this thread
arg0
(mitsuba.core.Logger
):no description available
no description available
Set the name of this thread
arg0
(str):no description available
no description available
Set the thread priority
This does not always work – for instance, Linux requires root privileges for this operation.
arg0
(mitsuba.core.Thread.EPriority
):no description available
True
upon success.
Sleep for a certain amount of time (in milliseconds)
arg0
(int):no description available
no description available
Start the thread
no description available
Return the current thread
mitsuba.core.Thread
:no description available
Return a unique ID that is associated with this thread
no description available
Captures a thread environment (logger, file resolver, profiler flags). Used with ScopedSetThreadEnvironment
Base class: mitsuba.core.Stream
Transparent compression/decompression stream based on zlib
.
This class transparently decompresses and compresses reads and writes to a nested stream, respectively.
Creates a new compression stream with the given underlying stream. This new instance takes ownership of the child stream. The child stream must outlive the ZStream.
child_stream
(mitsuba.core.Stream
):no description available
stream_type
(mitsuba.core.ZStream.EStreamType
):no description available
level
(int):no description available
Members:
< A raw deflate stream
< A gzip-compatible stream
arg0
(int):no description available
Returns the child stream of this compression stream
no description available
Capsule objects let you wrap a C “void *” pointer in a Python object. They’re a way of passing data through the Python interpreter without creating your own custom type.
Capsules are used for communication between extension modules. They provide a way for an extension module to export a C interface to other extension modules, so that extension modules can use the Python import mechanism to link to one another.
Capsule objects let you wrap a C “void *” pointer in a Python object. They’re a way of passing data through the Python interpreter without creating your own custom type.
Capsules are used for communication between extension modules. They provide a way for an extension module to export a C interface to other extension modules, so that extension modules can use the Python import mechanism to link to one another.
Evaluate the CIE 1931 XYZ color matching functions given a wavelength in nanometers
wavelength
(float):no description available
no description available
Evaluate the CIE 1931 Y color matching function given a wavelength in nanometers
wavelength
(float):no description available
no description available
Complete the set {a} to an orthonormal basis {a, b, c}
n
(enoki.scalar.Vector3f):no description available
no description available
arg0
(enoki.scalar.Vector3f):no description available
no description available
Returns an absolute path to the same location pointed by p
,
relative to base
.
http ://en.cppreference.com/w/cpp/experimental/fs/absolute)
arg0
(mitsuba.core.filesystem.path
):no description available
mitsuba.core.filesystem.path
:no description available
Creates a directory at p
as if mkdir
was used. Returns true if
directory creation was successful, false otherwise. If p
already
exists and is already a directory, the function does nothing (this
condition is not treated as an error).
arg0
(mitsuba.core.filesystem.path
):no description available
no description available
Returns the current working directory (equivalent to getcwd)
mitsuba.core.filesystem.path
:no description available
Checks whether two paths refer to the same file system object. Both must refer to an existing file or directory. Symlinks are followed to determine equivalence.
arg0
(mitsuba.core.filesystem.path
):no description available
arg1
(mitsuba.core.filesystem.path
):no description available
no description available
Checks if p
points to an existing filesystem object.
arg0
(mitsuba.core.filesystem.path
):no description available
no description available
Returns the size (in bytes) of a regular file at p
. Attempting to
determine the size of a directory (as well as any other file that is
not a regular file or a symlink) is treated as an error.
arg0
(mitsuba.core.filesystem.path
):no description available
no description available
Checks if p
points to a directory.
arg0
(mitsuba.core.filesystem.path
):no description available
no description available
Checks if p
points to a regular file, as opposed to a directory or
symlink.
arg0
(mitsuba.core.filesystem.path
):no description available
no description available
Represents a path to a filesystem resource. On construction, the path
is parsed and stored in a system-agnostic representation. The path can
be converted back to the system-specific string using native()
or
string()
.
Default constructor. Constructs an empty path. An empty path is considered relative.
Copy constructor.
arg0
(mitsuba.core.filesystem.path
):no description available
Construct a path from a string with native type. On Windows, the path can use both ‘/’ or ‘\’ as a delimiter.
arg0
(str):no description available
Makes the path an empty path. An empty path is considered relative.
no description available
Checks if the path is empty
no description available
Returns the extension of the filename component of the path (the substring starting at the rightmost period, including the period). Special paths ‘.’ and ‘..’ have an empty extension.
mitsuba.core.filesystem.path
:no description available
Returns the filename component of the path, including the extension.
mitsuba.core.filesystem.path
:no description available
Checks if the path is absolute.
no description available
Checks if the path is relative.
no description available
Returns the path in the form of a native string, so that it can be passed directly to system APIs. The path is constructed using the system’s preferred separator and the native string type.
no description available
Returns the path to the parent directory. Returns an empty path if it is already empty or if it has only one element.
mitsuba.core.filesystem.path
:no description available
Replaces the substring starting at the rightmost ‘.’ symbol by the provided string.
A ‘.’ symbol is automatically inserted if the replacement does not start with a dot. Removes the extension altogether if the empty path is passed. If there is no extension, appends a ‘.’ followed by the replacement. If the path is empty, ‘.’ or ‘..’, the method does nothing.
Returns *this.
arg0
(mitsuba.core.filesystem.path
):no description available
mitsuba.core.filesystem.path
:no description available
Removes a file or empty directory. Returns true if removal was successful, false if there was an error (e.g. the file did not exist).
arg0
(mitsuba.core.filesystem.path
):no description available
no description available
Changes the size of the regular file named by p
as if truncate
was called. If the file was larger than target_length
, the
remainder is discarded. The file must exist.
arg0
(mitsuba.core.filesystem.path
):no description available
arg1
(int):no description available
no description available
cpp_type
(capsule):no description available
ptr
(capsule):no description available
parent
(handle):no description available
no description available
value
(enoki.scalar.Vector3f):no description available
wavelengths
(enoki.scalar.Vector3f):no description available
active
(bool):Mask to specify active lanes.
no description available
c
(enoki.scalar.Vector3f):no description available
no description available
PDF for the sample_rgb_spectrum strategy. It is valid to call this function for a single wavelength (Float), a set of wavelengths (Spectrumf), a packet of wavelengths (SpectrumfP), etc. In all cases, the PDF is returned per wavelength.
wavelengths
(float):no description available
no description available
PDF for the sample_rgb_spectrum strategy. It is valid to call this function for a single wavelength (Float), a set of wavelengths (Spectrumf), a packet of wavelengths (SpectrumfP), etc. In all cases, the PDF is returned per wavelength.
wavelengths
(enoki.scalar.Vector3f):no description available
no description available
wavelengths
(float):no description available
no description available
wavelengths
(enoki.scalar.Vector3f):no description available
no description available
Generate pseudorandom permutation vector using a shuffling network and the sample_tea function. This algorithm has a O(log2(sample_count)) complexity but only supports permutation vectors whose lengths are a power of 2.
index
:Input index to be mapped
sample_count
(int):Length of the permutation vector
seed
(int):Seed value used as second input to the Tiny Encryption Algorithm. Can be used to generate different permutation vectors.
rounds
(int):How many rounds should be executed by the Tiny Encryption Algorithm? The default is 2.
value
(int):no description available
The index corresponding to the input index in the pseudorandom permutation vector.
Generate pseudorandom permutation vector using the algorithm described in Pixar’s technical memo “Correlated Multi-Jittered Sampling”:
https://graphics.pixar.com/library/MultiJitteredSampling/
Unlike permute, this function supports permutation vectors of any length.
index
:Input index to be mapped
sample_count
:Length of the permutation vector
seed
:Seed value used as second input to the Tiny Encryption Algorithm. Can be used to generate different permutation vectors.
i
(int):no description available
l
(int):no description available
p
(int):no description available
active
(bool):Mask to specify active lanes.
The index corresponding to the input index in the pseudorandom permutation vector.
Computes the nodes and weights of a composite Simpson quadrature rule with the given number of evaluations.
Integration is over the interval $[-1, 1]$, which will be split into $(n-1) / 2$ sub-intervals with overlapping endpoints. A 3-point Simpson rule is applied per interval, which is exact for polynomials of degree three or less.
n
(int):Desired number of evalution points. Must be an odd number bigger than 3.
A tuple (nodes, weights) storing the nodes and weights of the quadrature rule.
Computes the nodes and weights of a composite Simpson 3/8 quadrature rule with the given number of evaluations.
Integration is over the interval $[-1, 1]$, which will be split into $(n-1) / 3$ sub-intervals with overlapping endpoints. A 4-point Simpson rule is applied per interval, which is exact for polynomials of degree four or less.
n
(int):Desired number of evalution points. Must be an odd number bigger than 3.
A tuple (nodes, weights) storing the nodes and weights of the quadrature rule.
Computes the nodes and weights of a Gauss-Legendre quadrature (aka “Gaussian quadrature”) rule