Geen cache-versie.

Caching uitgeschakeld. Standaardinstelling voor deze pagina:ingeschakeld (code LNG204)
Als het scherm te langzaam is, kunt u de gebruikersmodus uitschakelen om de cacheversie te bekijken.

Histogram.cs

Description du code

Histogram.cs est un fichier du projet PhotoBrol.
Ce fichier est situé dans /var/www/bin/sniplets/bibliobrol/photobrol/.

Projet PhotoBrol :

Editeur d'images en CSharp.

Code source ou contenu du fichier

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4.  
  5. namespace be.gaudry.model.math
  6. {
  7. public class Histogram
  8. {
  9. private int[] values;
  10. private double mean = 0;
  11. private double stdDev = 0;
  12. private int median = 0;
  13. private int min;
  14. private int max;
  15.  
  16. /// <summary>
  17. /// Values of the histogram
  18. /// </summary>
  19. ///
  20. public int[] Values
  21. {
  22. get { return values; }
  23. }
  24.  
  25. /// <summary>
  26. /// Mean value
  27. /// </summary>
  28. ///
  29. public double Mean
  30. {
  31. get { return mean; }
  32. }
  33.  
  34. /// <summary>
  35. /// Standard deviation
  36. /// </summary>
  37. ///
  38. public double StdDev
  39. {
  40. get { return stdDev; }
  41. }
  42.  
  43. /// <summary>
  44. /// Median value
  45. /// </summary>
  46. ///
  47. public int Median
  48. {
  49. get { return median; }
  50. }
  51.  
  52. /// <summary>
  53. /// Minimum value
  54. /// </summary>
  55. ///
  56. /// <remarks>Minimum value of the histogram with non zero
  57. /// hits count.</remarks>
  58. ///
  59. public int Min
  60. {
  61. get { return min; }
  62. }
  63.  
  64. /// <summary>
  65. /// Maximum value
  66. /// </summary>
  67. ///
  68. /// <remarks>Maximum value of the histogram with non zero
  69. /// hits count.</remarks>
  70. ///
  71. public int Max
  72. {
  73. get { return max; }
  74. }
  75.  
  76. /// <summary>
  77. /// Initializes a new instance of the <see cref="Histogram"/> class
  78. /// </summary>
  79. ///
  80. /// <param name="values">Values of the histogram</param>
  81. ///
  82. public Histogram(int[] values)
  83. {
  84. this.values = values;
  85.  
  86. int i, n = values.Length;
  87.  
  88. max = 0;
  89. min = n;
  90.  
  91. // calculate min and max
  92. for (i = 0; i < n; i++)
  93. {
  94. if (values[i] != 0)
  95. {
  96. // max
  97. if (i > max)
  98. max = i;
  99. // min
  100. if (i < min)
  101. min = i;
  102. }
  103. }
  104.  
  105. mean = Statistics.Mean(values);
  106. stdDev = Statistics.StdDev(values);
  107. median = Statistics.Median(values);
  108. }
  109.  
  110. /// <summary>
  111. /// Get range around median containing specified percentage of values
  112. /// </summary>
  113. ///
  114. /// <param name="percent">Values percentage around median</param>
  115. ///
  116. /// <returns>Returns the range which containes specifies percentage
  117. /// of values.</returns>
  118. ///
  119. public IntRange GetRange(double percent)
  120. {
  121. return Statistics.GetRange(values, percent);
  122. }
  123. }
  124. }

Structure et Fichiers du projet

Afficher/masquer...


Répertoires contenus dans /var/www/bin/sniplets/bibliobrol/photobrol/model/math/ 
IcôneNomTailleModification
Pas de sous-répertoires.
IcôneNomTailleModification
| _ Répertoire parent0 octets1718506155 16/06/2024 04:49:15
Fichiers contenus dans /var/www/bin/sniplets/bibliobrol/photobrol/model/math/ 
IcôneNomTailleModificationAction
IcôneNomTailleModificationAction
Afficher le fichier .cs|.csStatistics.cs6.11 Ko31/10/2018 18:32:51-refusé-
Afficher le fichier .cs|.csIntRange.cs2.64 Ko31/10/2018 18:32:51-refusé-
Afficher le fichier .cs|.csHistogram.cs2.96 Ko31/10/2018 18:32:51-refusé-

Utilisation de l'explorateur de code

  • Navigation :
    • Un clic sur une icône de répertoire ouvre ce répertoire pour en afficher les fichiers.
    • Lorsque le répertoire en cours ne contient pas de sous-répertoires il est possible de remonter vers le répertoire parent.
    • La structure de répertoires en treetable (tableau en forme d'arborescence) n'est plus possibledans cette version.
    • Un clic sur une icône de fichier ouvre ce fichier pour en afficher le code avec la coloration syntaxique adaptée en fonction du langage principal utilisé dans le fichier.
  • Affichage :
    • Il est possible de trier les répertoires ou les fichiers selon certains critères (nom, taille, date).
  • Actions :
    • Les actions possible sur les fichiers dépendent de vos droits d'utilisateur sur le site. Veuillez activer le mode utilisateur pour activer les actions.

Nederlandse vertaling

U hebt gevraagd om deze site in het Nederlands te bezoeken. Voor nu wordt alleen de interface vertaald, maar nog niet alle inhoud.

Als je me wilt helpen met vertalingen, is je bijdrage welkom. Het enige dat u hoeft te doen, is u op de site registreren en mij een bericht sturen waarin u wordt gevraagd om u toe te voegen aan de groep vertalers, zodat u de gewenste pagina's kunt vertalen. Een link onderaan elke vertaalde pagina geeft aan dat u de vertaler bent en heeft een link naar uw profiel.

Bij voorbaat dank.

Document heeft de 30/10/2009 gemaakt, de laatste keer de 26/10/2018 gewijzigd
Bron van het afgedrukte document:https://www.gaudry.be/nl/cs-photobrol-source-rf-model/math//Histogram.cs.html

De infobrol is een persoonlijke site waarvan de inhoud uitsluitend mijn verantwoordelijkheid is. De tekst is beschikbaar onder CreativeCommons-licentie (BY-NC-SA). Meer info op de gebruiksvoorwaarden en de auteur.