public MChannelStatistics(ChannelStatistics channelStatistics) { ViewCount = channelStatistics.ViewCount; CommentCount = channelStatistics.CommentCount; SubscriberCount = channelStatistics.SubscriberCount; HiddenSubscriberCount = channelStatistics.HiddenSubscriberCount; VideoCount = channelStatistics.VideoCount; }
public void updateStatistics(ChannelStatistics statistics) { if (State.Statistics != null) { NrVideos = statistics.VideoCount < State.Statistics.VideoCount ? 0 : statistics.VideoCount - State.Statistics.VideoCount; } State.Statistics = statistics; (Children[0] as YoutubeChannelVideosNode).NrVideos = statistics.VideoCount; }
public void Test_Statistics() { IMagickImage image = new MagickImage(Files.SnakewarePNG); Statistics statistics = image.Statistics(); ChannelStatistics red = statistics.GetChannel(PixelChannel.Red); Assert.IsNotNull(red); #if Q8 Assert.AreEqual(7, red.Depth); Assert.AreEqual(0.98, red.Entropy, 0.01); Assert.AreEqual(-1.89, red.Kurtosis, 0.01); Assert.AreEqual(2, red.Maximum); Assert.AreEqual(0.83, red.Mean, 0.01); Assert.AreEqual(0, red.Minimum); Assert.AreEqual(0.32, red.Skewness, 0.01); Assert.AreEqual(0.98, red.StandardDeviation, 0.01); Assert.AreEqual(0.83, red.Sum, 0.01); Assert.AreEqual(3.35, red.SumCubed, 0.01); Assert.AreEqual(6.71, red.SumFourthPower, 0.01); Assert.AreEqual(1.67, red.SumSquared, 0.01); #elif Q16 || Q16HDRI Assert.AreEqual(8, red.Depth); Assert.AreEqual(0.98, red.Entropy, 0.01); Assert.AreEqual(-1.89, red.Kurtosis, 0.01); Assert.AreEqual(514, red.Maximum); Assert.AreEqual(215.79, red.Mean, 0.01); Assert.AreEqual(0, red.Minimum); Assert.AreEqual(0.32, red.Skewness, 0.01); Assert.AreEqual(253.68, red.StandardDeviation, 0.01); Assert.AreEqual(215.79, red.Sum, 0.01); Assert.AreEqual(57013088.69, red.SumCubed, 0.01); Assert.AreEqual(29304727586.71, red.SumFourthPower, 0.01); Assert.AreEqual(110920.40, red.SumSquared, 0.01); #else #error Not implemented! #endif Assert.IsNotNull(statistics.Composite()); Assert.IsNotNull(statistics.GetChannel(PixelChannel.Alpha)); Assert.IsNull(statistics.GetChannel(PixelChannel.Green)); Assert.IsNull(statistics.GetChannel(PixelChannel.Blue)); Assert.IsNull(statistics.GetChannel(PixelChannel.Black)); }