#include <previewimageprovider.h>
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 |
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.
[in] | key | The key under which the image is stored. |
[in] | image | The (immutable) preview image. |
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.
[in] | image | The (immutable) preview image. |
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.
const PreviewImageProviderOutputImage GetResult | ( | ) | const |
Returns the preview image stored under the default key.
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.
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.
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:
DataDictionary _metadata |
This container allows the attachment of generic data to the requesting component.
|
private |
This container holds all result images.