How to read a bitmap in OCAML?

后端 未结 4 1124
情歌与酒
情歌与酒 2021-01-13 00:34

I want to read a bitmap file (from the file system) using OCAML and store the pixels (the colors) inside an array which have th dimension of the bitmap, each pixel will take

4条回答
  •  忘掉有多难
    2021-01-13 01:16

    You could also use one of the numerous SDL bindings for OCaml, specifically the SDL_image ones, which let you load all kinds of images easily, and provides functions to access individual pixels and raw data as an array.

    OCamlSDL is a popular one.

提交回复
热议问题