12.07.2015 Views

Algorithmes de la morphologie mathématique pour - Pastel - HAL

Algorithmes de la morphologie mathématique pour - Pastel - HAL

Algorithmes de la morphologie mathématique pour - Pastel - HAL

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Annexe BDéfinitions <strong>de</strong>s fonctions utilitaires en HaskellFonctions c3e et c4e <strong>de</strong> création <strong>de</strong>s vecteurs <strong>de</strong> couleurLa fonction c3e crée à partir d’un triplet d’éléments <strong>de</strong> couleur CElmnt un vecteur <strong>de</strong> couleur composéC en utilisant <strong>la</strong> fonction pvec, cf. 4.3.1.3 page 64 :c3e :: (CElmnt, CElmnt, CElmnt) → Cc3e (c 1 ,c 2 ,c 3 ) = pvec (1,3) [ (1,c 1 ) , (2,c 2 ) , (3,c 3 ) ]Suivant <strong>la</strong> même logique, <strong>la</strong> fonction c4e crée à partir d’un quadruplet d’éléments <strong>de</strong> couleur CElmnt unvecteur <strong>de</strong> couleur composé C :c4e :: (CElmnt, CElmnt, CElmnt, CElmnt) → Cc4e (c 1 ,c 2 ,c 3 , c 4 ) = array (1,4) [ (1,c 1 ) , (2,c 2 ) , (3,c 3 ) , (4,c 4 ) ]Fonctions p2D et p3D <strong>de</strong> création <strong>de</strong>s pointsLa fonction p2D crée un point <strong>de</strong> 2D à partir d’un tuple <strong>de</strong> coordonnées :p2D :: ( Pos , Pos ) → Pp2D (x 1 ,x 2 ) = pvec (1,2) [ (1,x 1 ) , (2,x 2 ) ]La fonction p3D crée un point <strong>de</strong> 3D à partir d’un triplet <strong>de</strong> coordonnées :p3D :: ( Pos , Pos , Pos ) → Pp3D (x 1 ,x 2 ,x 3 ) = pvec (1,3) [ (1,x 1 ) , (2,x 2 ) , (3,x 3 ) ]Fonctions mkTX, getArFromTX et getTXBFromTX <strong>de</strong> manipu<strong>la</strong>tion <strong>de</strong>s texturesLa fonction mkTX crée une texture à partir <strong>de</strong> ses composantes. La fonction (, ) prend <strong>de</strong>ux paramètreset crée un tuple.mkTX :: Ar ( I , I ) C → [TXB] → TXmkTX ar txbs = ( , ) ar txbsLa fonction getArFromTX retourne l’array <strong>de</strong> couleur à partir <strong>de</strong> <strong>la</strong> texture TX :getArFromTX :: TX → Ar ( I , I ) CgetArFromTX (x , _) = xLa fonction getTXBFromTX retourne <strong>la</strong> valeur <strong>de</strong> bord TXB d’une texture TX :getTXBFromTX :: TX → TXBgetTXBFromTX (_, x) = x ! ! 0201

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!