Open 3D Engine Atom 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.
AZ::RPI::ImageMipChainAssetCreator Class Reference

#include <ImageMipChainAssetCreator.h>

Inherits AZ::RPI::AssetCreator< ImageMipChainAsset >.

Public Member Functions

void Begin (const Data::AssetId &assetId, uint16_t mipLevels, uint16_t arraySize)
 
void BeginMip (const RHI::ImageSubresourceLayout &layout)
 
void AddSubImage (const void *data, size_t dataSize)
 
void EndMip ()
 Ends construction of the current mip level. This must be called after adding all sub images.
 
bool End (Data::Asset< ImageMipChainAsset > &result)
 
- Public Member Functions inherited from AZ::RPI::AssetCreator< ImageMipChainAsset >
void SetElevateWarnings (bool elevated)
 When true, treat all subsequent warnings as errors. Any warnings already reported will not be elevated.
 
bool GetElevateWarnings () const
 
int GetErrorCount () const
 
int GetWarningCount () const
 
bool IsFailed () const
 
void ReportError (const char *format, Args... args)
 
void ReportWarning (const char *format, Args... args)
 

Additional Inherited Members

- Protected Member Functions inherited from AZ::RPI::AssetCreator< ImageMipChainAsset >
 AZ_DISABLE_COPY_MOVE (AssetCreator)
 
void BeginCommon (const Data::AssetId &assetId)
 
bool EndCommon (Data::Asset< ImageMipChainAsset > &result)
 
bool ValidateIsReady ()
 
bool ValidateNotNull (void *pointer, const char *name)
 Reports errors when a pointer is null.
 
bool ValidateNotNull (const AZ::Data::Asset< AZ::Data::AssetData > &pointer, const char *name)
 
bool ValidateNotNull (const AZStd::intrusive_ptr< T > &pointer, const char *name)
 
- Protected Attributes inherited from AZ::RPI::AssetCreator< ImageMipChainAsset >
Data::Asset< ImageMipChainAssetm_asset
 This is the asset that subclass creators will build.
 

Detailed Description

This class constructs an instance of an ImageMipChainAsset. It is designed to be easy-to-use in order to abstract away details of how data is packed. The API exists separately from the asset in order to promote immutability at runtime. The builder also does extensive validation to ensure that data is packed properly. (Note this class generally follows the builder design pattern, but is called a "creator" rather than a "builder" to avoid confusion with the AssetBuilderSDK).

Member Function Documentation

◆ AddSubImage()

void AZ::RPI::ImageMipChainAssetCreator::AddSubImage ( const void *  data,
size_t  dataSize 
)

Inserts a sub-image into the current mip level. You must call this method for each array element in the mip. Every mip level must have the same number of array elements matching arraySize passed in Begin().

◆ Begin()

void AZ::RPI::ImageMipChainAssetCreator::Begin ( const Data::AssetId &  assetId,
uint16_t  mipLevels,
uint16_t  arraySize 
)

Begins the build process for a ImageMipChainAsset instance. Resets the builder to a fresh state.

Parameters
mipLevelsThe number of mip levels in the mip chain.
arraySizethe number of sub-images within a mip level.

◆ BeginMip()

void AZ::RPI::ImageMipChainAssetCreator::BeginMip ( const RHI::ImageSubresourceLayout layout)

Begins construction of a new mip level in the group. The number of mips in the chain must exactly match mipLevels passed to Begin().

◆ End()

bool AZ::RPI::ImageMipChainAssetCreator::End ( Data::Asset< ImageMipChainAsset > &  result)

Finalizes and assigns ownership of the asset to result, if successful. Otherwise false is returned and result is left untouched.


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