Imageflow.Native (imageflow v0.4.1) View Source

Low-level FFI bindings to imageflow

Example usage:

alias Imageflow.Native

# create a job
{:ok, job} = Native.create()

# add an input file, with id `0`
:ok = Native.add_input_file(job, 0, "input.jpg")

# you could also add input buffers directly from memory
:ok = Native.add_input_buffer(job, 1, <<0x89, 0x50, 0x4E, 0x47, 0x0D, ... >>)

# call `get_image_info` on buffer with id 0
{:ok, resp} = Native.message("v0.1/get_image_info", %{io_id: 0})

Link to this section Summary

Link to this section Types

Specs

native_ret_t() :: :ok | {:error, binary()}

Specs

t() :: %Imageflow.Native{id: term()}

Link to this section Functions

Link to this function

add_input_buffer(native, io_id, bytes)

View Source

Specs

add_input_buffer(t(), number(), binary()) :: native_ret_t()
Link to this function

add_input_file(native, io_id, path)

View Source

Specs

add_input_file(t(), number(), binary()) :: native_ret_t()
Link to this function

add_output_buffer(native, io_id)

View Source

Specs

add_output_buffer(t(), number()) :: native_ret_t()

Specs

create() :: {:ok, t()}

Specs

create!() :: t()
Link to this function

get_output_buffer(job, io_id)

View Source

Specs

get_output_buffer(t(), number()) :: {:ok, binary()} | {:error, binary()}
Link to this function

message(native, method, message)

View Source

Specs

message(t(), binary(), binary()) :: {:ok, any()} | {:error, binary()}
Link to this function

save_output_to_file(native, io_id, path)

View Source

Specs

save_output_to_file(t(), number(), binary()) :: native_ret_t()