Ejemplo n.º 1
0
        public float Ratio(P3dColor color)
        {
            if (total > 0)
            {
                return(Count(color) / (float)total);
            }

            return(0.0f);
        }
Ejemplo n.º 2
0
        /// <summary>The <b>Count</b> of the specified counters.</summary>
        public static long GetCount(P3dColor color, ICollection <P3dColorCounter> counters = null)
        {
            var count = 0L; foreach (var counter in counters ?? Instances)

            {
                count += counter.Count(color);
            }
            return(count);
        }
Ejemplo n.º 3
0
        /// <summary>This tells you how many pixels of the specified color are in the current <b>PaintableTexture</b>.</summary>
        public int Count(P3dColor color)
        {
            foreach (var contribution in contributions)
            {
                if (contribution.Color == color)
                {
                    return(contribution.Count);
                }
            }

            return(0);
        }
Ejemplo n.º 4
0
 /// <summary>The <b>Ratio</b> of the specified counters.</summary>
 public static float GetRatio(P3dColor color, ICollection <P3dColorCounter> counters = null)
 {
     return(P3dHelper.Divide(GetCount(color, counters), GetTotal(counters)));
 }