package bimage

  1. Overview
  2. Docs

Source file input.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
open Image

type ('a, 'b, 'c) t = ('a, 'b, 'c) Image.t array

type index = int

let index i = i

let int_of_index i = i

let get inputs i =
  if i < Array.length inputs then inputs.(i) else Error.exc (`Invalid_input i)

let make_output ?width ?height inputs =
  let a = get inputs 0 in
  let width = match width with None -> a.width | Some w -> w in
  let height = match height with None -> a.height | Some h -> h in
  create (kind a) a.color width height