MCPcopy Create free account
hub / github.com/carbonengine/trinity / CreateDescription

Function CreateDescription

trinity/Resources/TriTextureRes.cpp:78–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76const uint32_t INVALID_LOD = std::numeric_limits<uint32_t>::max();
77
78void CreateDescription( const ImageIO::HostBitmap& bitmap, uint32_t lod, Tr2BitmapDimensions& desc )
79{
80 uint32_t mipCount = bitmap.GetTrueMipCount();
81 uint32_t mip = std::min( lod, mipCount - 1 );
82 desc = Tr2BitmapDimensions(
83 bitmap.GetType(),
84 bitmap.GetFormat(),
85 bitmap.GetMipWidth( mip ),
86 bitmap.GetMipHeight( mip ),
87 bitmap.GetMipDepth( mip ),
88 mipCount - mip,
89 bitmap.GetArraySize() );
90}
91
92void CreateDescription( const ImageIO::HostBitmap& bitmap, uint32_t lod, Tr2BitmapDimensions& desc, std::vector<Tr2SubresourceData>& initialData )
93{

Callers 2

ProcessLodRequestMethod · 0.85
TrimLodsMethod · 0.85

Calls 6

GetTrueMipCountMethod · 0.80
GetMipSizeMethod · 0.80
GetTypeMethod · 0.45
GetFormatMethod · 0.45
GetArraySizeMethod · 0.45
GetMipCountMethod · 0.45

Tested by

no test coverage detected