86 FTextureLayoutNode& Node = Nodes[NodeIndex];
117 for (
int32 NodeIndex = 0; NodeIndex < Nodes.Num(); NodeIndex++)
119 FTextureLayoutNode& Node = Nodes[NodeIndex];
138 ParentNodeIndex = (ParentNodeIndex !=
INDEX_NONE && IsNodeUsed(ParentNodeIndex)) ?
INDEX_NONE : ParentNodeIndex;
141 && !IsNodeUsed(Nodes[ParentNodeIndex].ChildA)
142 && !IsNodeUsed(Nodes[ParentNodeIndex].ChildB))
145 ParentNodeIndex = FindParentNode(ParentNodeIndex);
161 for (
int32 NodeIndex = 0; NodeIndex < Nodes.Num(); NodeIndex++)
163 const FTextureLayoutNode& Node = Nodes[NodeIndex];
167 UpdateSize(Node.MinX + Node.SizeX, Node.MinY + Node.SizeY);
190 struct FTextureLayoutNode
200 FTextureLayoutNode() {}
218 bool bPowerOfTwoSize;
228 const FTextureLayoutNode CurrentNode = Nodes[NodeIndex];
323 Nodes[NodeIndex].ChildA = Nodes.
Num();
335 Nodes[NodeIndex].ChildB = Nodes.
Num();
345 Nodes[NodeIndex].ChildA = Nodes.
Num();
353 Nodes[NodeIndex].ChildB = Nodes.
Num();
371 SizeX = FMath::Max<uint32>(SizeX, FMath::RoundUpToPowerOfTwo(
ElementMaxX));
372 SizeY = FMath::Max<uint32>(SizeY, FMath::RoundUpToPowerOfTwo(
ElementMaxY));
379 SizeX = FMath::Max(SizeX, SizeY);
383 SizeX = FMath::Max( SizeX, SizeY * 2 );
384 SizeY = FMath::Max( SizeY, SizeX / 2 );
402 for (
int32 NodeIndex = 0; NodeIndex < Nodes.
Num(); NodeIndex++)
404 FTextureLayoutNode& Node = Nodes[NodeIndex];
405 if (Node.ChildA == SearchNodeIndex || Node.ChildB == SearchNodeIndex)
414 bool IsNodeUsed(
int32 NodeIndex)
420 bChildrenUsed = IsNodeUsed(Nodes[NodeIndex].ChildA) || IsNodeUsed(Nodes[NodeIndex].ChildB);
547 template<
typename ValueType>
571 template<
typename ValueType>
#define checkSlow(expr)
Definition AssertionMacros.h:332
#define checkNoEntry()
Definition AssertionMacros.h:316
@ INDEX_NONE
Definition CoreMiscDefines.h:150
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
@ MAX_TEXTURE_MIP_COUNT
Definition RHIDefinitions.h:268
ETextureLayoutAspectRatio
Definition TextureLayout.h:13
Definition TextureLayout.h:489
FBinnedTextureLayout(FIntPoint InMaxSize, int32 InBinSizeTexels)
Definition TextureLayout.h:492
Definition TextureLayout.h:24
uint32 GetSizeY() const
Definition TextureLayout.h:186
bool AddElement(uint32 &OutBaseX, uint32 &OutBaseY, uint32 ElementSizeX, uint32 ElementSizeY)
Definition TextureLayout.h:60
uint32 GetSizeX() const
Definition TextureLayout.h:181
FTextureLayout(uint32 InMinSizeX, uint32 InMinSizeY, uint32 MaxSizeX, uint32 MaxSizeY, bool bInPowerOfTwoSize=false, ETextureLayoutAspectRatio InAspect=ETextureLayoutAspectRatio::None, bool bInAlignByFour=true)
Definition TextureLayout.h:37
bool RemoveElement(uint32 ElementBaseX, uint32 ElementBaseY, uint32 ElementSizeX, uint32 ElementSizeY)
Definition TextureLayout.h:105
UE_REWRITE SizeType Num() const
Definition Array.h:1144
void RemoveAt(SizeType Index, EAllowShrinking AllowShrinking=UE::Core::Private::AllowShrinkingByDefault< AllocatorType >())
Definition Array.h:2083
UE_FORCEINLINE_HINT SizeType Emplace(ArgsType &&... Args)
Definition Array.h:2561
Definition TextureLayout.h:538
void ComputeDifferenceArray(const ValueType *ValuesA, const ValueType *ValuesB, const int32 ValueCount, TArray< double > &OutValueDifferences)
Definition TextureLayout.h:548
double ComputeRootMeanSquareDeviation(const ValueType *Values, const int32 ValueCount)
Definition TextureLayout.h:572
UE_STRING_CLASS Result(Forward< LhsType >(Lhs), RhsLen)
Definition String.cpp.inl:732
@ false
Definition radaudio_common.h:23