BB.Message.Sensor.Image (bb v0.2.1)
View SourceRaw image data from a camera sensor.
Fields
height- Image height in pixelswidth- Image width in pixelsencoding- Pixel encoding formatis_bigendian- Whether data is big-endianstep- Full row length in bytesdata- Actual image data as binary
Encodings
Common encodings include:
:rgb8- RGB 8-bit per channel:rgba8- RGBA 8-bit per channel:bgr8- BGR 8-bit per channel:bgra8- BGRA 8-bit per channel:mono8- Grayscale 8-bit:mono16- Grayscale 16-bit
Examples
alias BB.Message.Sensor.Image
{:ok, msg} = Image.new(:camera,
height: 480,
width: 640,
encoding: :rgb8,
is_bigendian: false,
step: 1920,
data: <<0, 0, 0, ...>>
)
Summary
Types
@type encoding() ::
:rgb8
| :rgba8
| :rgb16
| :rgba16
| :bgr8
| :bgra8
| :bgr16
| :bgra16
| :mono8
| :mono16
| :bayer_rggb8
| :bayer_bggr8
| :bayer_gbrg8
| :bayer_grbg8
@type t() :: %BB.Message.Sensor.Image{ data: binary(), encoding: encoding(), height: non_neg_integer(), is_bigendian: boolean(), step: non_neg_integer(), width: non_neg_integer() }
Functions
@spec new( atom(), keyword() ) :: {:ok, BB.Message.t()} | {:error, term()}