Open 3D Engine GradientSignal Gem API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
GradientSignal::ImageGradientModifications Class Referenceabstract

#include <ImageGradientModificationBus.h>

Inherits AZ::ComponentBus.

Public Member Functions

virtual void StartImageModification ()=0
 
virtual void EndImageModification ()=0
 
virtual void GetPixelIndicesForPositions (AZStd::span< const AZ::Vector3 > positions, AZStd::span< PixelIndex > outIndices) const =0
 
virtual void GetPixelValuesByPosition (AZStd::span< const AZ::Vector3 > positions, AZStd::span< float > outValues) const =0
 
virtual void GetPixelValuesByPixelIndex (AZStd::span< const PixelIndex > indices, AZStd::span< float > outValues) const =0
 
virtual void SetPixelValuesByPosition (AZStd::span< const AZ::Vector3 > positions, AZStd::span< const float > values)=0
 
virtual void SetPixelValuesByPixelIndex (AZStd::span< const PixelIndex > indices, AZStd::span< const float > values)=0
 

Static Public Attributes

static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single
 

Detailed Description

EBus that can be used to modify the image data for an Image Gradient. The following APIs are the low-level image modification APIs that enable image modifications at the per-pixel level.

Member Function Documentation

◆ EndImageModification()

virtual void GradientSignal::ImageGradientModifications::EndImageModification ( )
pure virtual

Finish an image modification session. Clean up any helper structures used during image modification.

◆ GetPixelIndicesForPositions()

virtual void GradientSignal::ImageGradientModifications::GetPixelIndicesForPositions ( AZStd::span< const AZ::Vector3 >  positions,
AZStd::span< PixelIndex >  outIndices 
) const
pure virtual

Given a list of world positions, return a list of pixel indices into the image.

Parameters
positionsThe list of world positions to query
outIndices[out] The list of output PixelIndex values giving the (x,y) pixel coordinates for each world position.

◆ GetPixelValuesByPixelIndex()

virtual void GradientSignal::ImageGradientModifications::GetPixelValuesByPixelIndex ( AZStd::span< const PixelIndex >  indices,
AZStd::span< float >  outValues 
) const
pure virtual

Get the image pixel values at a list of pixel indices. This provides different results than GradientRequestBus::GetValues because it's returning raw pixel values.

  • This will always use point sampling instead of the Image Gradient sampler type
  • This will always return back an unscaled value, instead of using the Image Gradient scale mode and range
    Parameters
    positionsThe list of pixel indices to query
    outValues[out] The list of output values. This list is expected to be the same size as the positions list.

◆ GetPixelValuesByPosition()

virtual void GradientSignal::ImageGradientModifications::GetPixelValuesByPosition ( AZStd::span< const AZ::Vector3 >  positions,
AZStd::span< float >  outValues 
) const
pure virtual

Get the image pixel values at a list of positions. This provides different results than GradientRequestBus::GetValues because it's returning raw pixel values.

  • This will always use point sampling instead of the Image Gradient sampler type
  • This will always return back an unscaled value, instead of using the Image Gradient scale mode and range
    Parameters
    positionsThe list of world positions to query
    outValues[out] The list of output values. This list is expected to be the same size as the positions list.

◆ SetPixelValuesByPixelIndex()

virtual void GradientSignal::ImageGradientModifications::SetPixelValuesByPixelIndex ( AZStd::span< const PixelIndex >  indices,
AZStd::span< const float >  values 
)
pure virtual

Given a list of pixel indices, set those pixels to the given values.

Parameters
indicdesThe list of pixel indices to set the values for.
valuesThe list of values to set. This list is expected to be the same size as the positions list.

◆ SetPixelValuesByPosition()

virtual void GradientSignal::ImageGradientModifications::SetPixelValuesByPosition ( AZStd::span< const AZ::Vector3 >  positions,
AZStd::span< const float >  values 
)
pure virtual

Given a list of world positions, set the pixels at those positions to the given values.

Parameters
positionsThe list of world positions to set the values for.
valuesThe list of values to set. This list is expected to be the same size as the positions list.

◆ StartImageModification()

virtual void GradientSignal::ImageGradientModifications::StartImageModification ( )
pure virtual

Start an image modification session. This will create a modification buffer that contains an uncompressed copy of the current image data.


The documentation for this class was generated from the following file: