CImg.Builder (cimg v0.1.8) View Source

Build and excecute image processing sequence. under construction

Link to this section Summary

Functions

Building image processing sequence. It allows to execute mutable operation in this sequence.

Building image processing sequence. This one creates empty image object instead recieving a image.

Return %CImg{} converted from %Builder{}. Of course, mutable operations cannot be applied to %CImg{}.

Link to this section Functions

Building image processing sequence. It allows to execute mutable operation in this sequence.

Parameters

  • image - %CImg{} or %Builder{} object. if %CImg{} is passed, `builder' duplicates the image object and returns it wrapped with %Builder{}. ## Examples Elixir img = CImg.load("sample.jpg") res = CImg.builder(img) |> CImg.draw_circle(100, 100, 30, {0, 255, 0}) # draw a circle on the duplicated img.
Link to this function

builder(x, y, z, c, val)

View Source

Building image processing sequence. This one creates empty image object instead recieving a image.

Parameters

  • x, y, z, c - image shape.
  • val - filling value

Examples

  res = CImg.builder(100, 100, 1, 3, 0)   # 0 filled color image {100, 100, 1, 3}
    |> CImg.draw_circle(100, 100, 30, {0, 255, 0})  # draw a circle on the duplicated img.
Link to this function

resize(builder, size, align, fill)

View Source

Return %CImg{} converted from %Builder{}. Of course, mutable operations cannot be applied to %CImg{}.

Parameters

  • builder - %Builder{} object.

Examples

  cimg = CImg.builder(100, 100, 1, 3, 0)
    |> CImg.draw_circle(100, 100, 30, {0, 255, 0})  # draw a circle on the duplicated img.
    |> CImg.runit()

  # cimg is %CImg{} object with a circle drawn on it.