MCPcopy Create free account
hub / github.com/Kitware/VTK / FindPowerOfTwo

Function FindPowerOfTwo

Rendering/OpenGL2/vtkOpenGLTexture.cxx:424–439  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

422
423//------------------------------------------------------------------------------
424static int FindPowerOfTwo(int i, int maxDimGL)
425{
426 int size = vtkMath::NearestPowerOfTwo(i);
427
428 // [these lines added by Tim Hutton (implementing Joris Vanden Wyngaerd's
429 // suggestions)]
430 // limit the size of the texture to the maximum allowed by OpenGL
431 // (slightly more graceful than texture failing but not ideal)
432 if (size < 0 || size > maxDimGL)
433 {
434 size = maxDimGL;
435 }
436 // end of Tim's additions
437
438 return size;
439}
440
441//------------------------------------------------------------------------------
442// Creates resampled unsigned char texture map that is a power of two in both

Callers 1

ResampleToPowerOfTwoMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected