package torch

  1. Overview
  2. Docs
PyTorch bindings for OCaml

Install

Dune Dependency

Authors

Maintainers

Sources

0.7.tar.gz
md5=e8681bb78ee902c7df73d8569ac92ed9
sha512=335064169516f456f1f123e52ec8ab1b5e0c7f9d036bd72e0171b19a2a57c2eb8ea70d1a64ae0d43b05775307d7a017b742f6f6af9d44e3e4d6dc57f478b15a3

doc/torch.vision/Torch_vision/Stb_image_write/index.html

Module Torch_vision.Stb_image_writeSource

Image writing

buffer simply is an alias to a bigarray with c_layout. Two kind of pixel buffers are manipulated:

  • int8 for images with 8-bit channels
  • float32 for images with floating point channels

Content of an image with c channels of width w and height h is represented as a contiguous sequence of items such that:

  • channels are interleaved
  • each pixel is made of c items
  • each line is made of w pixels
  • image is made of h lines
Sourcetype 'kind buffer = ('a, 'b, Bigarray.c_layout) Bigarray.Array1.t constraint 'kind = ('a, 'b) Bigarray.kind
Sourceval png : string -> w:int -> h:int -> c:int -> int8 buffer -> unit
Sourceval bmp : string -> w:int -> h:int -> c:int -> int8 buffer -> unit
Sourceval tga : string -> w:int -> h:int -> c:int -> int8 buffer -> unit
Sourceval hdr : string -> w:int -> h:int -> c:int -> float32 buffer -> unit
Sourceval jpg : string -> w:int -> h:int -> c:int -> quality:int -> int8 buffer -> unit
OCaml

Innovation. Community. Security.

On This Page
  1. Image writing