daily pastebin goal
24%
SHARE
TWEET

Untitled

a guest Jan 17th, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (*
  2.   Fonction level
  3. *)
  4. let level (r, g, b) = (0.3 *. r +. 0.59 *. g +. 0.11 *. b) / 255
  5.  
  6. (*
  7.   Fonction color2grey
  8. *)
  9. let color2grey (r, g, b) =
  10.   let gr = (int)(level(r, g, b) *. 255.) in
  11.     (gr, gr, gr)
  12.  
  13. (*
  14.   Fonction image2grey src dst
  15. *)
  16. let image2grey scr dst =
  17.   let (w,h) = get_dims img in
  18.     for y = 0 to h do
  19.       for x = 0 to w do
  20.         Sdlvideo.put_pixel_color scr x y color2grey (Sdlvideo.get_pixel_color img x y)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top