Forum ada95000 Dernière connexion : 19/06/2025 à 04:19
Fin de session : 19/06/2025 à 04:29

Vous n'êtes pas connecté [Connexion - Inscription]
Go Bottom
Répondre
Qui peut poster ? Tous les membres peuvent lancer des Nouveaux Sujets, et tout membre peut répondre.
Pseudo:  Voulez-vous vous inscrire ?
Mot de passe:  Mot de passe oublié ?
Sujet: (optionnel)
Icône:

biggrin.gif

bigsmile.gif

cool.gif

cool2.gif

diablotin.gif

eureka.gif

flaming.gif

lol.gif

mad.gif

no.gif

puzzled.gif

roll.gif

rolleyes.gif

sad.gif

saint.gif

shocked.gif

smile.gif

thumbdown.gif

thumbup.gif

tongue.gif

wink.gif
Mode d'édition :
Normal Avancé Aide

Insérer du texte en gras Insérer du texte en italique Insérer du texte souligné Insérer du texte centré Insérer un lien hypertexte Insérer un lien vers un Email Insérer une image Insérer du code Insérer une citation Insérer une liste Insérer du texte caché
Message:
HTML activé ? Non
Smileys activés ? Oui
BBCode activé ? Oui
Activer fonction [img] ? Oui
:D:grin::cool:8)
:eldiablo::eureka::x:hot:
:lol::mad::no::-?
:-p:-o:(:ange:
Plus de smileys
Options Désactiver les smileys ?
Utiliser une signature ?
Désactiver le BBCode ?
Recevoir une notification par Email lors de nouvelles réponses ?

Revoir le sujet
ftbass
Administrator
StaffStaffStaffStaffStaffStaffStaffStaffStaff

images/avatars/WC3HumanOp1.gif

Messages: 72
Inscrit(e) le: 27/02/2004
Déconnecté(e)
Publié le 11/07/2004 à 02:48
Elargir le spectre d'une image .pgm

code:

function GetIntensiteMax(Matrice : in TypeMatrice) return integer is

Resultat : integer := 0;
i, j : integer := 0;

begin
while (i <= Matrice'Last(1)) and (j <= Matrice'Last(2)) and (Resultat /= 255) loop
if character'pos(Matrice(i, j)) > Resultat then
Resultat := character'pos(Matrice(i, j));
end if;
if j = 255 and i < 255 then
j := 0;
i := i + 1;
else
j := j + 1;
end if;
end loop;

return Resultat;


end GetIntensiteMax;

-- Fonction qui retourne l'intensité min des pixels d'une image
function GetIntensiteMin(Matrice : in TypeMatrice) return integer is

Resultat : integer := 255;
i, j : integer := 0;

begin
while (i <= Matrice'Last(1)) and (j <= Matrice'Last(2)) and (Resultat /= 0) loop
if character'pos(Matrice(i, j)) < Resultat then
Resultat := character'pos(Matrice(i, j));
end if;
if j = 255 and i < 255 then
j := 0;
i := i + 1;
else
j := j + 1;
end if;
end loop;

return Resultat;

end GetIntensiteMin;



-- Fonction qui étend le spectre à 0..255
function ElargirSpectre(MatriceI : in typeMatrice) return TypeMatrice is

Resultat : TypeMatrice(MatriceI'range(1), MatriceI'range(2));

Max, Min : Integer;
Coeff : Float;

begin
  -- Détermination du max de l'image originale
  Max := GetIntensiteMax(MatriceI);
  -- Détermination de son min
  Min := GetIntensiteMin(MatriceI);
  -- Détemination du Coeff
  Coeff := 255.0 / (Float(Max) - Float(Min));
  for i in MatriceI'range(1) loop
     for j in MatriceI'range(2) loop
        Resultat(i, j) := character'val(Integer((Float(character'pos(MatriceI(i, j))) - Float(Min)) * Coeff));
     end loop;
  end loop;
 
  return Resultat;
 
end ElargirSpectre;

Go Top
10.3.122.74 04:19 - 19 Juin 2025 10.3.122.74
[ 0.3262670 secondes | Effacer le cookie | 18 requêtes ]
Oxygen v1.0.11 © 2002  |  Oxygen WebSite © 2002