Struct re_types::datatypes::ImageFormat
source · pub struct ImageFormat {
pub width: u32,
pub height: u32,
pub pixel_format: Option<PixelFormat>,
pub color_model: Option<ColorModel>,
pub channel_datatype: Option<ChannelDatatype>,
}
Expand description
Datatype: The metadata describing the contents of a components::ImageBuffer
.
Fields§
§width: u32
The width of the image in pixels.
height: u32
The height of the image in pixels.
pixel_format: Option<PixelFormat>
Used mainly for chroma downsampled formats and differing number of bits per channel.
If specified, this takes precedence over both datatypes::ColorModel
and datatypes::ChannelDatatype
(which are ignored).
color_model: Option<ColorModel>
L, RGB, RGBA, …
Also requires a datatypes::ChannelDatatype
to fully specify the pixel format.
channel_datatype: Option<ChannelDatatype>
The data type of each channel (e.g. the red channel) of the image data (U8, F16, …).
Also requires a datatypes::ColorModel
to fully specify the pixel format.
Implementations§
source§impl ImageFormat
impl ImageFormat
sourcepub fn depth([width, height]: [u32; 2], datatype: ChannelDatatype) -> Self
pub fn depth([width, height]: [u32; 2], datatype: ChannelDatatype) -> Self
Create a new depth image format with the given resolution and datatype.
sourcepub fn segmentation(
[width, height]: [u32; 2],
datatype: ChannelDatatype
) -> Self
pub fn segmentation( [width, height]: [u32; 2], datatype: ChannelDatatype ) -> Self
Create a new segmentation image format with the given resolution and datatype.
sourcepub fn rgb8([width, height]: [u32; 2]) -> Self
pub fn rgb8([width, height]: [u32; 2]) -> Self
Create a new rgb image format with 8 bit per channel with the given resolution.
sourcepub fn rgba8([width, height]: [u32; 2]) -> Self
pub fn rgba8([width, height]: [u32; 2]) -> Self
Create a new rgba image format with 8 bit per channel with the given resolution.
sourcepub fn from_pixel_format(
[width, height]: [u32; 2],
pixel_format: PixelFormat
) -> Self
pub fn from_pixel_format( [width, height]: [u32; 2], pixel_format: PixelFormat ) -> Self
From a speicifc pixel format.
sourcepub fn color_model(&self) -> ColorModel
pub fn color_model(&self) -> ColorModel
The color model represented by this image format.
sourcepub fn datatype(&self) -> ChannelDatatype
pub fn datatype(&self) -> ChannelDatatype
The datatype represented by this image format.
Trait Implementations§
source§impl Borrow<ImageFormat> for ImageFormat
impl Borrow<ImageFormat> for ImageFormat
source§fn borrow(&self) -> &ImageFormat
fn borrow(&self) -> &ImageFormat
source§impl Clone for ImageFormat
impl Clone for ImageFormat
source§fn clone(&self) -> ImageFormat
fn clone(&self) -> ImageFormat
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ImageFormat
impl Debug for ImageFormat
source§impl Default for ImageFormat
impl Default for ImageFormat
source§fn default() -> ImageFormat
fn default() -> ImageFormat
source§impl<'a> From<&'a ImageFormat> for Cow<'a, ImageFormat>
impl<'a> From<&'a ImageFormat> for Cow<'a, ImageFormat>
source§fn from(value: &'a ImageFormat) -> Self
fn from(value: &'a ImageFormat) -> Self
source§impl<'a> From<ImageFormat> for Cow<'a, ImageFormat>
impl<'a> From<ImageFormat> for Cow<'a, ImageFormat>
source§fn from(value: ImageFormat) -> Self
fn from(value: ImageFormat) -> Self
source§impl Hash for ImageFormat
impl Hash for ImageFormat
source§impl Loggable for ImageFormat
impl Loggable for ImageFormat
type Name = DatatypeName
source§fn name() -> Self::Name
fn name() -> Self::Name
rerun.datatypes.Vec2D
.source§fn arrow_datatype() -> DataType
fn arrow_datatype() -> DataType
arrow2::datatypes::DataType
], excluding datatype extensions.source§fn to_arrow_opt<'a>(
data: impl IntoIterator<Item = Option<impl Into<Cow<'a, Self>>>>
) -> SerializationResult<Box<dyn Array>>where
Self: Clone + 'a,
fn to_arrow_opt<'a>(
data: impl IntoIterator<Item = Option<impl Into<Cow<'a, Self>>>>
) -> SerializationResult<Box<dyn Array>>where
Self: Clone + 'a,
source§fn from_arrow_opt(
arrow_data: &dyn Array
) -> DeserializationResult<Vec<Option<Self>>>where
Self: Sized,
fn from_arrow_opt(
arrow_data: &dyn Array
) -> DeserializationResult<Vec<Option<Self>>>where
Self: Sized,
Loggable
s.source§fn to_arrow<'a>(
data: impl IntoIterator<Item = impl Into<Cow<'a, Self>>>
) -> Result<Box<dyn Array>, SerializationError>where
Self: 'a,
fn to_arrow<'a>(
data: impl IntoIterator<Item = impl Into<Cow<'a, Self>>>
) -> Result<Box<dyn Array>, SerializationError>where
Self: 'a,
source§fn from_arrow(
data: &(dyn Array + 'static)
) -> Result<Vec<Self>, DeserializationError>
fn from_arrow( data: &(dyn Array + 'static) ) -> Result<Vec<Self>, DeserializationError>
Loggable
s.source§impl PartialEq for ImageFormat
impl PartialEq for ImageFormat
source§fn eq(&self, other: &ImageFormat) -> bool
fn eq(&self, other: &ImageFormat) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl SizeBytes for ImageFormat
impl SizeBytes for ImageFormat
source§fn heap_size_bytes(&self) -> u64
fn heap_size_bytes(&self) -> u64
self
on the heap, in bytes.source§fn total_size_bytes(&self) -> u64
fn total_size_bytes(&self) -> u64
self
in bytes, accounting for both stack and heap space.source§fn stack_size_bytes(&self) -> u64
fn stack_size_bytes(&self) -> u64
self
on the stack, in bytes. Read moreimpl Copy for ImageFormat
impl Eq for ImageFormat
impl StructuralPartialEq for ImageFormat
Auto Trait Implementations§
impl Freeze for ImageFormat
impl RefUnwindSafe for ImageFormat
impl Send for ImageFormat
impl Sync for ImageFormat
impl Unpin for ImageFormat
impl UnwindSafe for ImageFormat
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more