pub struct ColorSpace {
pub primaries: Primaries,
pub transfer_function: TransferFunction,
pub ycbcr_encoding: YcbcrEncoding,
pub range: Range,
}Expand description
Represents libcamera::ColorSpace.
Fields§
§primaries: Primaries§transfer_function: TransferFunction§ycbcr_encoding: YcbcrEncoding§range: RangeImplementations§
Source§impl ColorSpace
impl ColorSpace
pub const fn new( primaries: Primaries, transfer_function: TransferFunction, ycbcr_encoding: YcbcrEncoding, range: Range, ) -> Self
pub fn raw() -> Self
pub fn srgb() -> Self
pub fn sycc() -> Self
pub fn smpte170m() -> Self
pub fn rec709() -> Self
pub fn rec2020() -> Self
Sourcepub fn to_repr(&self) -> String
pub fn to_repr(&self) -> String
Returns libcamera string representation (e.g. “Smpte170m/Rec709/Full”).
Sourcepub fn from_string(s: &str) -> Option<Self>
pub fn from_string(s: &str) -> Option<Self>
Parse color space from libcamera string representation. Returns None on failure.
Sourcepub fn adjust_for_format(&mut self, pixel_format: PixelFormat) -> bool
pub fn adjust_for_format(&mut self, pixel_format: PixelFormat) -> bool
Adjust this color space for a given pixel format.
Returns true if the color space was modified to make it compatible with the pixel format,
or false if it was already compatible.
Sourcepub fn with_adjusted_for_format(
&self,
pixel_format: PixelFormat,
) -> Option<Self>
pub fn with_adjusted_for_format( &self, pixel_format: PixelFormat, ) -> Option<Self>
Returns a clone of this color space adjusted for the given pixel format.
libcamera always treats the color space as compatible (possibly changing it), so this
will always return Some.
Trait Implementations§
Source§impl Clone for ColorSpace
impl Clone for ColorSpace
Source§fn clone(&self) -> ColorSpace
fn clone(&self) -> ColorSpace
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ColorSpace
impl Debug for ColorSpace
Source§impl Display for ColorSpace
impl Display for ColorSpace
Source§impl From<ColorSpace> for libcamera_color_space_t
impl From<ColorSpace> for libcamera_color_space_t
Source§fn from(cs: ColorSpace) -> Self
fn from(cs: ColorSpace) -> Self
Converts to this type from the input type.
Source§impl From<libcamera_color_space> for ColorSpace
impl From<libcamera_color_space> for ColorSpace
Source§fn from(cs: libcamera_color_space_t) -> Self
fn from(cs: libcamera_color_space_t) -> Self
Converts to this type from the input type.
Source§impl PartialEq for ColorSpace
impl PartialEq for ColorSpace
impl Copy for ColorSpace
impl Eq for ColorSpace
impl StructuralPartialEq for ColorSpace
Auto Trait Implementations§
impl Freeze for ColorSpace
impl RefUnwindSafe for ColorSpace
impl Send for ColorSpace
impl Sync for ColorSpace
impl Unpin for ColorSpace
impl UnwindSafe for ColorSpace
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
Mutably borrows from an owned value. Read more