Example #1
0
 /// <summary>
 /// Returns statistics about transparent and translucent pixels in the
 /// texture.
 /// </summary>
 /// <returns>Statistics</returns>
 public TextureStats GetStats()
 {
     if (_stats == null)
     {
         Logger.Warn("Stats of texture {0} requested, but has not been analyzed.", Data.Name);
         _stats = new TextureStats(1, 0, 0);
     }
     return(_stats);
 }
 public void Analyze()
 {
     if (!HasTransparentFormat)
     {
         _stats = new TextureStats(1, 0, 0);
         return;
     }
     using (var image = GetImage()) {
         _stats = image != null && image.HasAlpha()
                                 ? AnalyzeAlpha()
                                 : new TextureStats(1, 0, 0);
     }
 }