MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / calcTextureRes

Function calcTextureRes

source/MRViewer/MRRenderHelpers.cpp:6–16  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4{
5
6Vector2i calcTextureRes( int bufferSize, int maxTextWidth )
7{
8 if ( bufferSize <= maxTextWidth )
9 return { bufferSize, 1 };
10 int space = maxTextWidth - ( bufferSize % maxTextWidth );
11 int height = ( bufferSize + maxTextWidth - 1 ) / maxTextWidth;
12 if ( space == maxTextWidth )
13 return { maxTextWidth, height };
14 int shift = space / height;
15 return { maxTextWidth - shift, height };
16}
17
18}

Callers 12

bindPositions_Method · 0.85
calcAndBindLength_Method · 0.85
bindLines_Method · 0.85
bindMesh_Method · 0.85
bindEdges_Method · 0.85
bindBorders_Method · 0.85
bindSelectedEdges_Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected