Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RawImage: document encodings in schemas #273

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions python/foxglove-sdk/src/generated/schemas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1466,11 +1466,11 @@ impl From<Quaternion> for foxglove::schemas::Quaternion {
///
/// :param timestamp: Timestamp of image
/// :param frame_id: Frame of reference for the image. The origin of the frame is the optical center of the camera. +x points to the right in the image, +y points down, and +z points into the plane of the image.
/// :param width: Image width
/// :param height: Image height
/// :param encoding: Encoding of the raw image data
/// :param step: Byte length of a single row
/// :param data: Raw image data
/// :param width: Image width in pixels
/// :param height: Image heigh in pixels
/// :param encoding: Encoding of the raw image data. See the `data` field description for supported values.
/// :param step: Byte length of a single row. This is usually some multiple of `width` depending on the encoding, but can be greater to incorporate padding.
/// :param data: Raw image data.
///
/// See https://docs.foxglove.dev/docs/visualization/message-schemas/raw-image
#[pyclass(module = "foxglove.schemas")]
Expand Down
56 changes: 49 additions & 7 deletions ros/foxglove_msgs/ros1/RawImage.msg

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 49 additions & 7 deletions ros/foxglove_msgs/ros2/RawImage.msg

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 49 additions & 7 deletions rust/foxglove/src/schemas/foxglove.rs
Original file line number Diff line number Diff line change
Expand Up @@ -848,21 +848,63 @@ pub struct RawImage {
/// Frame of reference for the image. The origin of the frame is the optical center of the camera. +x points to the right in the image, +y points down, and +z points into the plane of the image.
#[prost(string, tag = "7")]
pub frame_id: ::prost::alloc::string::String,
/// Image width
/// Image width in pixels
#[prost(fixed32, tag = "2")]
pub width: u32,
/// Image height
/// Image heigh in pixels
#[prost(fixed32, tag = "3")]
pub height: u32,
/// Encoding of the raw image data
///
/// Supported values: `8UC1`, `8UC3`, `16UC1` (little endian), `32FC1` (little endian), `bayer_bggr8`, `bayer_gbrg8`, `bayer_grbg8`, `bayer_rggb8`, `bgr8`, `bgra8`, `mono8`, `mono16`, `rgb8`, `rgba8`, `uyvy` or `yuv422`, `yuyv` or `yuv422_yuy2`
/// Encoding of the raw image data. See the `data` field description for supported values.
#[prost(string, tag = "4")]
pub encoding: ::prost::alloc::string::String,
/// Byte length of a single row
/// Byte length of a single row. This is usually some multiple of `width` depending on the encoding, but can be greater to incorporate padding.
#[prost(fixed32, tag = "5")]
pub step: u32,
/// Raw image data
/// Raw image data.
///
/// The requirements for each `encoding` value are:
/// - `yuv422`, `uyvy`:
/// - 8-bit [Y'UV](<https://en.wikipedia.org/wiki/Y%E2%80%B2UV>).
/// - U and V values are shared between horizontal pairs of pixels. Each pair of output pixels is encoded as \[U, Y1, V, Y2\].
/// - `step` must be greater than or equal to `width` * 2.
/// - `yuv422_yuy2`, `yuyv`:
/// - 8-Bit [Y'UV](<https://en.wikipedia.org/wiki/Y%E2%80%B2UV>).
/// - U and V values are shared between horizontal pairs of pixels. Each pair of output pixels is encoded as \[Y1, U, Y2, V\].
/// - `step` must be greater than or equal to `width` * 2.
/// - `rgb8`:
/// - 8-bit RGB.
/// - Each output pixel is encoded as \[R, G, B\].
/// - `step` must be greater than or equal to `width` * 3.
/// - `rgba8`:
/// - 8-bit RGB + Alpha.
/// - Each output pixel is encoded as \[R, G, B, Alpha\].
/// - `step` must be greater than or equal to `width` * 4.
/// - `bgr8`:
/// - RGB, one byte per component.
/// - Each output pixel is encoded as \[B, G, R\].
/// - `step` must be greater than or equal to `width` * 3.
/// - `bgra8`, `8UC3`:
/// - RGB + Alpha, one byte per component.
/// - Each output pixel is encoded as \[B, G, R, Alpha\].
/// - `step` must be greater than or equal to `width` * 4.
/// - `32FC1`:
/// - 32-bit little-endian IEEE754 float brightness values, from 0.0 (black) to 1.0 (white).
/// - `step` must be greater than or equal to `width` * 4.
/// - `bayer_rggb8`, `bayer_bggr8`, `bayer_rggb8`, `bayer_gbrg8`, `bayer_grgb8`:
/// - 8-bit Bayer filter pattern RGB values.
/// - The order of the four letters after `bayer_` determine the layout, so for `bayer_wxyz8` the pattern is:
/// ```plaintext
/// w | x
/// - | -
/// y | z
/// ```
/// - `step` must be greater than or equal to `width`.
/// - `mono8`, `8UC1`:
/// - 8-bit brightness values from 0 (black) to 255 (white).
/// - `step` must be greater than or equal to `width`.
/// - `mono16`, `16UC1`:
/// - 16-bit abstract per-pixel values. Rendering of these values is controlled in [Image panel color mode settings](<https://docs.foxglove.dev/docs/visualization/panels/image#general>).
/// - `step` must be greater than or equal to `width` * 2.
#[prost(bytes = "bytes", tag = "6")]
pub data: ::prost::bytes::Bytes,
}
Expand Down
57 changes: 50 additions & 7 deletions schemas/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 49 additions & 7 deletions schemas/flatbuffer/RawImage.fbs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading