Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (*
- Fonction level
- *)
- let level (r, g, b) = (0.3 *. r +. 0.59 *. g +. 0.11 *. b) / 255
- (*
- Fonction color2grey
- *)
- let color2grey (r, g, b) =
- let gr = (int)(level(r, g, b) *. 255.) in
- (gr, gr, gr)
- (*
- Fonction image2grey src dst
- *)
- let image2grey scr dst =
- let (w,h) = get_dims img in
- for y = 0 to h do
- for x = 0 to w do
- Sdlvideo.put_pixel_color scr x y color2grey (Sdlvideo.get_pixel_color img x y)
Add Comment
Please, Sign In to add comment