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::ImageCreatorUtils::PaintableImageAssetHelper< EditorComponentType, EditorComponentModeType > Class Template Reference

#include <PaintableImageAssetHelper.h>

Inherits GradientSignal::ImageCreatorUtils::PaintableImageAssetHelperBase.

Public Member Functions

 AZ_CLASS_ALLOCATOR (PaintableImageAssetHelper, AZ::SystemAllocator)
 
 AZ_RTTI ((PaintableImageAssetHelper, "{A06517E2-9D6B-4AD6-AD7C-FBE3BF0FD57B}", EditorComponentType, EditorComponentModeType), PaintableImageAssetHelperBase)
 
- Public Member Functions inherited from GradientSignal::ImageCreatorUtils::PaintableImageAssetHelperBase
 AZ_CLASS_ALLOCATOR (PaintableImageAssetHelperBase, AZ::SystemAllocator)
 
 AZ_TYPE_INFO (PaintableImageAssetHelperBase, "{7E269EDA-7A80-4B02-9491-96F66BEF5171}")
 
void Activate (AZ::EntityComponentIdPair ownerEntityComponentIdPair, OutputFormat defaultOutputFormat, AZStd::string baseAssetLabel, DefaultSaveNameCallback defaultSaveNameCallback, OnCreateImageCallback onCreateImageCallback)
 
AZStd::string Refresh (AZ::Data::Asset< AZ::Data::AssetData > imageAsset)
 
void Deactivate ()
 
AZStd::optional< AZ::Data::Asset< AZ::Data::AssetData > > SaveImage (int imageResolutionX, int imageResolutionY, OutputFormat format, AZStd::span< const uint8_t > pixelBuffer)
 

Static Public Member Functions

static void Reflect (AZ::ReflectContext *context)
 
- Static Public Member Functions inherited from GradientSignal::ImageCreatorUtils::PaintableImageAssetHelperBase
static void Reflect (AZ::ReflectContext *context)
 

Protected Member Functions

void EnableComponentMode () override
 Enable component mode for this image asset.
 
- Protected Member Functions inherited from GradientSignal::ImageCreatorUtils::PaintableImageAssetHelperBase
void CreateNewImage ()
 Create a new image.
 
AZ::IO::Path GetIncrementingAutoSavePath (const AZ::IO::Path &currentPath) const
 Create a new filename with an incrementing number for the "auto save with incrementing names" mode.
 
bool GetSaveLocation (AZ::IO::Path &fullPath, AZStd::string &relativePath, PaintableImageAssetAutoSaveMode autoSaveMode)
 Determine where to save the image based on the autosave mode.
 
bool RefreshImageAssetStatus (AZ::Data::Asset< AZ::Data::AssetData > imageAsset)
 Refresh the current image asset load status.
 
AZStd::string GetImageAssetStatusLabel ()
 
AZStd::string GetRelativePathFromAbsolutePath (AZStd::string_view absolutePath)
 
AZ::Crc32 GetPaintModeVisibility () const
 Returns whether or not the edit mode should currently be visible.
 
void RefreshComponentModeStatus ()
 
virtual void EnableComponentMode ()=0
 
bool InComponentMode () const
 Return whether or not component mode is currently active.
 
void DisableComponentMode ()
 Disable component mode for this image asset.
 

Additional Inherited Members

- Public Types inherited from GradientSignal::ImageCreatorUtils::PaintableImageAssetHelperBase
using DefaultSaveNameCallback = AZStd::function< AZ::IO::Path()>
 Callback that provides the default name to use when creating or saving an image.
 
using OnCreateImageCallback = AZStd::function< void(AZ::Data::Asset< AZ::Data::AssetData > createdAsset)>
 
- Protected Types inherited from GradientSignal::ImageCreatorUtils::PaintableImageAssetHelperBase
using ComponentModeDelegate = AzToolsFramework::ComponentModeFramework::ComponentModeDelegate
 Delegates the handling of component editing mode to a paint controller.
 
- Static Protected Member Functions inherited from GradientSignal::ImageCreatorUtils::PaintableImageAssetHelperBase
static bool ImageHasPendingJobs (const AZ::Data::AssetId &assetId)
 Check to see if an image asset has any pending asset jobs.
 
- Protected Attributes inherited from GradientSignal::ImageCreatorUtils::PaintableImageAssetHelperBase
ComponentModeDelegate m_componentModeDelegate
 
AZ::Data::AssetData::AssetStatus m_currentImageAssetStatus = AZ::Data::AssetData::AssetStatus::NotLoaded
 
bool m_currentImageJobsPending = false
 
bool m_waitingForImageReload = false
 
AZStd::string m_baseAssetLabel
 
PaintableImageAssetAutoSaveMode m_autoSaveMode = PaintableImageAssetAutoSaveMode::AutoSave
 Offer a choice of different autosave modes.
 
bool m_promptedForSaveLocation = false
 
AZ::EntityComponentIdPair m_ownerEntityComponentIdPair = {}
 
DefaultSaveNameCallback m_defaultSaveNameCallback = {}
 
OnCreateImageCallback m_onCreateImageCallback = {}
 
OutputFormat m_defaultOutputFormat = OutputFormat::R8G8B8A8
 

Detailed Description

template<typename EditorComponentType, typename EditorComponentModeType>
class GradientSignal::ImageCreatorUtils::PaintableImageAssetHelper< EditorComponentType, EditorComponentModeType >

Helper class to manage all the common logic and UX for paintable image creation, editing, and saving. This class requires templatized parameters for the EditorComponentType and the EditorComponentModeType so that it can hook up to a specific type of editor component mode.

Member Function Documentation

◆ EnableComponentMode()

template<typename EditorComponentType , typename EditorComponentModeType >
void GradientSignal::ImageCreatorUtils::PaintableImageAssetHelper< EditorComponentType, EditorComponentModeType >::EnableComponentMode ( )
inlineoverrideprotectedvirtual

Enable component mode for this image asset.

Implements GradientSignal::ImageCreatorUtils::PaintableImageAssetHelperBase.


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