-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathimage.lua
More file actions
41 lines (31 loc) · 795 Bytes
/
image.lua
File metadata and controls
41 lines (31 loc) · 795 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
--- Image-related functions.
-- Modules --
local array = require("impl.array")
-- Imports --
local CallWrap = array.CallWrap
-- Exports --
local M = {}
-- See also: https://github.com/arrayfire/arrayfire/blob/devel/src/api/cpp/histogram.cpp
--
local function HistEqual (in_arr, hist)
return CallWrap("af_hist_equal", in_arr:get(), hist:get())
end
--
function M.Add (into)
for k, v in pairs{
--
histEqual = HistEqual, histequal = HistEqual,
--
histogram = function(in_arr, nbins, minval, maxval)
if not minval then
local lib = into -- possibly delayed load
minval, maxval = lib.min("f64", in_arr), lib.max("f64", in_arr)
end
return CallWrap("af_histogram", in_arr:get(), nbins, minval, maxval)
end
} do
into[k] = v
end
end
-- Export the module.
return M