vivid_png/lib/vivid/png/frame.ex

18 lines
355 B
Elixir
Raw Normal View History

2017-01-12 08:40:31 +13:00
defimpl Vivid.PNG, for: Vivid.Frame do
alias Vivid.{PNG, Frame}
2017-01-12 08:55:58 +13:00
@moduledoc """
Convert a Vivid frame into a PNG file.
"""
@doc """
Convert a Vivid frame into a PNG file.
"""
2018-09-04 14:52:12 +12:00
@spec to_png(Frame.t(), Path.t()) :: :ok | {:error, any}
2017-01-12 08:40:31 +13:00
def to_png(frame, file) do
frame
|> Frame.buffer(:horizontal)
|> PNG.to_png(file)
end
2018-09-04 14:52:12 +12:00
end