// Copyright Epic Games, Inc. All Rights Reserved. #pragma once #include "HAL/Platform.h" #include "MuR/Image.h" #include "MuR/Operations.h" #include "MuR/Ptr.h" #include "MuT/AST.h" namespace mu { struct FProgram; //--------------------------------------------------------------------------------------------- //! //--------------------------------------------------------------------------------------------- class ASTOpImageLayer final : public ASTOp { public: ASTChild base; ASTChild blend; ASTChild mask; /** Blend type used for the colour channels. */ EBlendType blendType = EBlendType::BT_NONE; /** Blend type used for the alpha channel if any. */ EBlendType blendTypeAlpha = EBlendType::BT_NONE; /** Channel to use from the source color argument to apply blendTypeAlpha, if any. */ uint8 BlendAlphaSourceChannel = 0; /** See ImageLayerArgs::Flags .*/ uint8 Flags = 0; public: ASTOpImageLayer(); ASTOpImageLayer(const ASTOpImageLayer&) = delete; ~ASTOpImageLayer(); virtual EOpType GetOpType() const override { return EOpType::IM_LAYER; } virtual uint64 Hash() const override; virtual bool IsEqual(const ASTOp& otherUntyped) const override; virtual Ptr Clone(MapChildFuncRef mapChild) const override; virtual void ForEachChild(const TFunctionRef) override; virtual void Link(FProgram& program, FLinkerOptions*) override; virtual FImageDesc GetImageDesc(bool returnBestOption, FGetImageDescContext*) const override; virtual void GetLayoutBlockSize(int* pBlockX, int* pBlockY) override; virtual Ptr GetImageSizeExpression() const override; virtual Ptr OptimiseSemantic(const FModelOptimizationOptions&, int32 Pass) const override; virtual Ptr OptimiseSink(const FModelOptimizationOptions&, FOptimizeSinkContext&) const override; virtual FSourceDataDescriptor GetSourceDataDescriptor(FGetSourceDataDescriptorContext*) const override; }; }