3 namespace TextureTools.TexLibraries
 
   21                 throw new ArgumentOutOfRangeException(
"Value must be > 0", 
"size");
 
   24             if (minimumSizeLastMip <= 0)
 
   26                 throw new ArgumentOutOfRangeException(
"Value must be > 0", 
"minimumSizeLastMip");
 
   30             while ((size/2) >= minimumSizeLastMip)
 
   32                 size = Math.Max(1, size / 2);
 
   49             return Math.Min(CalculateMipCountFromSize(width, minimumSizeLastMip), CalculateMipCountFromSize(height, minimumSizeLastMip));
 
static int CalculateMipCount(int width, int height, int minimumSizeLastMip=4)
Calculates the mip level from a specified width,height,depth. 
 
static int CalculateMipCountFromSize(int size, int minimumSizeLastMip=4)
Calculates the mip level from a specified size. 
 
_In_ size_t _In_ size_t size