PreviewImageProviderOutput Struct Reference

#include <previewimageprovider.h>

Detailed Description

Defines the current preview image result. It is possible to define differently resoluted intermediate results, e.g. providing progressively upscaled and temporarily accumulated renderings to listeners such PreviewImageRequest instances. In case multiple images have been requested, it is valid to return only some entries, or multiple entries in different states. However, updating the 'stack' in lockstep may be the safest approach. For example: First Iteration: [roughness, 64 x 64], [alpha, 64 x 64] Second iteration: [roughness, 128 x 128], [alpha, 128 x 128]

Public Member Functions

template<typename KEY >
Result< void > SetArrayResult (const KEY &key, const PreviewImageProviderOutputImage &image)
 
Result< void > SetResult (const PreviewImageProviderOutputImage &image)
 
const DataDictionary & GetResults () const
 
const PreviewImageProviderOutputImage GetResult () const
 

Public Attributes

Int _currentIterationIndex
 
Int _iterationCount
 
Bool _isFinal
 
DataDictionary _metadata
 

Private Attributes

DataDictionary _results
 

Member Function Documentation

◆ SetArrayResult()

Result<void> SetArrayResult ( const KEY &  key,
const PreviewImageProviderOutputImage image 
)

Sets a result image under the provided key. For viewport support it is expected to store under the requested maxon::Id's from PREVIEWIMAGEREQUEST::TEXTUREIDS.

Parameters
[in]keyThe key under which the image is stored.
[in]imageThe (immutable) preview image.
Returns
OK on success.

◆ SetResult()

Result<void> SetResult ( const PreviewImageProviderOutputImage image)

Sets a result image under the default key. This storage location is read by GUI components where no image stacks are requested.

Parameters
[in]imageThe (immutable) preview image.
Returns
OK on success.

◆ GetResults()

const DataDictionary& GetResults ( ) const

Returns the container for all preview images. It can be assumed that entries are of type Tuple<KEY=maxon::Data, VALUE=maxon::nodes::PreviewImageProviderOutputImage> where KEY is often, but not always of type maxon::Id.

Returns
The preview image container.

◆ GetResult()

const PreviewImageProviderOutputImage GetResult ( ) const

Returns the preview image stored under the default key.

Returns
The preview image..

Member Data Documentation

◆ _currentIterationIndex

Int _currentIterationIndex

The index of the current preview iteration. A valid value in is range [0, n - 1] where n is the total number of iterations @_iterationCount. The final iteration has the value n - 1;

This parameter must be set properly, but is subject to removal in the future.

◆ _iterationCount

Int _iterationCount

The total number of n iterations. A valid value is in range [1, n]. The iteration count may vary and dynamically increase during computation.

This parameter must be set properly, but is subject to removal in the future.

◆ _isFinal

Bool _isFinal

Defines whether the preview result computation has finished and there's no need for further iterations. In the case of handling multiple preview images in lockstep, this approach is recommended:

const maxon::Bool isFinal = (previewImageResolutionsPyramid.GetCount() - _lastFinishedPreviewImageResolutionsPyramidIndex) <= 1;
bool Bool
boolean type, possible values are only false/true, 8 bit
Definition: apibase.h:181

◆ _metadata

DataDictionary _metadata

This container allows the attachment of generic data to the requesting component.

◆ _results

DataDictionary _results
private

This container holds all result images.