[][src]Struct qt_gui::QColorSpace

#[repr(C)]
pub struct QColorSpace { /* fields omitted */ }

Color values can be interpreted in different ways, and based on the interpretation can live in different spaces. We call this color spaces.

C++ class: QColorSpace.

C++ documentation:

Color values can be interpreted in different ways, and based on the interpretation can live in different spaces. We call this color spaces.

QColorSpace provides access to creating several predefined color spaces and can generate QColorTransforms for converting colors from one color space to another.

QColorSpace can also represent color spaces defined by ICC profiles or embedded in images, that do not otherwise fit the predefined color spaces.

A color space can generally speaking be conceived as a combination of set of primary colors and a transfer function. The primaries defines the axes of the color space, and the transfer function how values are mapped on the axes. The primaries are defined by three primary colors that represent exactly how red, green, and blue look in this particular color space, and a white color that represents where and how bright pure white is. The range of colors expressable by the primary colors is called the gamut, and a color space that can represent a wider range of colors is also known as a wide-gamut color space.

The transfer function or gamma curve determines how each component in the color space is encoded. These are used because human perception does not operate linearly, and the transfer functions try to ensure that colors will seem evenly spaced to human eyes.

Methods

impl QColorSpace[src]

pub unsafe fn copy_from(
    &mut self,
    color_space: impl CastInto<Ref<QColorSpace>>
) -> MutRef<QColorSpace>
[src]

Calls C++ function: QColorSpace& QColorSpace::operator=(const QColorSpace& colorSpace).

This item is available if cpp_lib_version="5.14.0".

pub unsafe fn from_icc_profile(
    icc_profile: impl CastInto<Ref<QByteArray>>
) -> CppBox<QColorSpace>
[src]

Creates a QColorSpace from ICC profile iccProfile.

Calls C++ function: static QColorSpace QColorSpace::fromIccProfile(const QByteArray& iccProfile).

C++ documentation:

Creates a QColorSpace from ICC profile iccProfile.

Note: Not all ICC profiles are supported. QColorSpace only supports RGB-XYZ ICC profiles that are three-component matrix-based.

If the ICC profile is not supported an invalid QColorSpace is returned where you can still read the original ICC profile using iccProfile().

See also iccProfile().

This item is available if cpp_lib_version="5.14.0".

pub unsafe fn gamma(&self) -> c_float[src]

Returns the gamma value of color spaces with TransferFunction::Gamma, an approximate gamma value for other predefined color spaces, or 0.0 if no approximate gamma is known.

Calls C++ function: float QColorSpace::gamma() const.

C++ documentation:

Returns the gamma value of color spaces with TransferFunction::Gamma, an approximate gamma value for other predefined color spaces, or 0.0 if no approximate gamma is known.

See also transferFunction().

This item is available if cpp_lib_version="5.14.0".

pub unsafe fn icc_profile(&self) -> CppBox<QByteArray>[src]

Returns an ICC profile representing the color space.

Calls C++ function: QByteArray QColorSpace::iccProfile() const.

C++ documentation:

Returns an ICC profile representing the color space.

If the color space was generated from an ICC profile, that profile is returned, otherwise one is generated.

Note: Even invalid color spaces may return the ICC profile if they were generated from one, to allow applications to implement wider support themselves.

See also fromIccProfile().

This item is available if cpp_lib_version="5.14.0".

pub unsafe fn is_valid(&self) -> bool[src]

Returns true if the color space is valid.

Calls C++ function: bool QColorSpace::isValid() const.

C++ documentation:

Returns true if the color space is valid.

This item is available if cpp_lib_version="5.14.0".

pub unsafe fn new() -> CppBox<QColorSpace>[src]

Creates a new colorspace object that represents an undefined and invalid colorspace.

Calls C++ function: [constructor] void QColorSpace::QColorSpace().

C++ documentation:

Creates a new colorspace object that represents an undefined and invalid colorspace.

This item is available if cpp_lib_version="5.14.0".

pub unsafe fn from_named_color_space(
    named_color_space: NamedColorSpace
) -> CppBox<QColorSpace>
[src]

Creates a new colorspace object that represents a namedColorSpace.

Calls C++ function: [constructor] void QColorSpace::QColorSpace(QColorSpace::NamedColorSpace namedColorSpace).

C++ documentation:

Creates a new colorspace object that represents a namedColorSpace.

This item is available if cpp_lib_version="5.14.0".

pub unsafe fn from_primaries_transfer_function_float(
    primaries: Primaries,
    fun: TransferFunction,
    gamma: c_float
) -> CppBox<QColorSpace>
[src]

Creates a custom color space with the primaries primaries, using the transfer function fun and optionally gamma.

Calls C++ function: [constructor] void QColorSpace::QColorSpace(QColorSpace::Primaries primaries, QColorSpace::TransferFunction fun, float gamma = …).

C++ documentation:

Creates a custom color space with the primaries primaries, using the transfer function fun and optionally gamma.

This item is available if cpp_lib_version="5.14.0".

pub unsafe fn from_primaries_float(
    primaries: Primaries,
    gamma: c_float
) -> CppBox<QColorSpace>
[src]

Creates a custom color space with the primaries primaries, using a gamma transfer function of gamma.

Calls C++ function: [constructor] void QColorSpace::QColorSpace(QColorSpace::Primaries primaries, float gamma).

C++ documentation:

Creates a custom color space with the primaries primaries, using a gamma transfer function of gamma.

This item is available if cpp_lib_version="5.14.0".

pub unsafe fn from_4_q_point_f_transfer_function_float(
    white_point: impl CastInto<Ref<QPointF>>,
    red_point: impl CastInto<Ref<QPointF>>,
    green_point: impl CastInto<Ref<QPointF>>,
    blue_point: impl CastInto<Ref<QPointF>>,
    fun: TransferFunction,
    gamma: c_float
) -> CppBox<QColorSpace>
[src]

Creates a custom colorspace with a primaries based on the chromaticities of the primary colors whitePoint, redPoint, greenPoint and bluePoint, and using the transfer function fun and optionally gamma.

Calls C++ function: [constructor] void QColorSpace::QColorSpace(const QPointF& whitePoint, const QPointF& redPoint, const QPointF& greenPoint, const QPointF& bluePoint, QColorSpace::TransferFunction fun, float gamma = …).

C++ documentation:

Creates a custom colorspace with a primaries based on the chromaticities of the primary colors whitePoint, redPoint, greenPoint and bluePoint, and using the transfer function fun and optionally gamma.

This item is available if cpp_lib_version="5.14.0".

pub unsafe fn from_primaries_transfer_function(
    primaries: Primaries,
    fun: TransferFunction
) -> CppBox<QColorSpace>
[src]

Creates a custom color space with the primaries primaries, using the transfer function fun and optionally gamma.

Calls C++ function: [constructor] void QColorSpace::QColorSpace(QColorSpace::Primaries primaries, QColorSpace::TransferFunction fun).

C++ documentation:

Creates a custom color space with the primaries primaries, using the transfer function fun and optionally gamma.

This item is available if cpp_lib_version="5.14.0".

pub unsafe fn from_4_q_point_f_transfer_function(
    white_point: impl CastInto<Ref<QPointF>>,
    red_point: impl CastInto<Ref<QPointF>>,
    green_point: impl CastInto<Ref<QPointF>>,
    blue_point: impl CastInto<Ref<QPointF>>,
    fun: TransferFunction
) -> CppBox<QColorSpace>
[src]

Creates a custom colorspace with a primaries based on the chromaticities of the primary colors whitePoint, redPoint, greenPoint and bluePoint, and using the transfer function fun and optionally gamma.

Calls C++ function: [constructor] void QColorSpace::QColorSpace(const QPointF& whitePoint, const QPointF& redPoint, const QPointF& greenPoint, const QPointF& bluePoint, QColorSpace::TransferFunction fun).

C++ documentation:

Creates a custom colorspace with a primaries based on the chromaticities of the primary colors whitePoint, redPoint, greenPoint and bluePoint, and using the transfer function fun and optionally gamma.

This item is available if cpp_lib_version="5.14.0".

pub unsafe fn new_copy(
    color_space: impl CastInto<Ref<QColorSpace>>
) -> CppBox<QColorSpace>
[src]

Calls C++ function: [constructor] void QColorSpace::QColorSpace(const QColorSpace& colorSpace).

This item is available if cpp_lib_version="5.14.0".

pub unsafe fn primaries(&self) -> Primaries[src]

Returns the predefined primaries of the color space or primaries::Custom if it doesn't match any of them.

Calls C++ function: QColorSpace::Primaries QColorSpace::primaries() const.

C++ documentation:

Returns the predefined primaries of the color space or primaries::Custom if it doesn't match any of them.

See also setPrimaries().

This item is available if cpp_lib_version="5.14.0".

pub unsafe fn set_primaries_1a(&mut self, primaries_id: Primaries)[src]

Sets the primaries to those of the primariesId set.

Calls C++ function: void QColorSpace::setPrimaries(QColorSpace::Primaries primariesId).

C++ documentation:

Sets the primaries to those of the primariesId set.

See also primaries().

This item is available if cpp_lib_version="5.14.0".

pub unsafe fn set_primaries_4a(
    &mut self,
    white_point: impl CastInto<Ref<QPointF>>,
    red_point: impl CastInto<Ref<QPointF>>,
    green_point: impl CastInto<Ref<QPointF>>,
    blue_point: impl CastInto<Ref<QPointF>>
)
[src]

Set primaries to the chromaticities of whitePoint, redPoint, greenPoint and bluePoint.

Calls C++ function: void QColorSpace::setPrimaries(const QPointF& whitePoint, const QPointF& redPoint, const QPointF& greenPoint, const QPointF& bluePoint).

C++ documentation:

Set primaries to the chromaticities of whitePoint, redPoint, greenPoint and bluePoint.

See also primaries().

This item is available if cpp_lib_version="5.14.0".

pub unsafe fn set_transfer_function_2a(
    &mut self,
    transfer_function: TransferFunction,
    gamma: c_float
)
[src]

Sets the transfer function to transferFunction and gamma.

Calls C++ function: void QColorSpace::setTransferFunction(QColorSpace::TransferFunction transferFunction, float gamma = …).

C++ documentation:

Sets the transfer function to transferFunction and gamma.

See also transferFunction(), gamma(), and withTransferFunction().

This item is available if cpp_lib_version="5.14.0".

pub unsafe fn set_transfer_function_1a(
    &mut self,
    transfer_function: TransferFunction
)
[src]

Sets the transfer function to transferFunction and gamma.

Calls C++ function: void QColorSpace::setTransferFunction(QColorSpace::TransferFunction transferFunction).

C++ documentation:

Sets the transfer function to transferFunction and gamma.

See also transferFunction(), gamma(), and withTransferFunction().

This item is available if cpp_lib_version="5.14.0".

pub unsafe fn static_meta_object() -> Ref<QMetaObject>[src]

Returns a reference to the staticMetaObject field.

This item is available if cpp_lib_version="5.14.0".

pub unsafe fn swap(&mut self, color_space: impl CastInto<MutRef<QColorSpace>>)[src]

Swaps color space other with this color space. This operation is very fast and never fails.

Calls C++ function: void QColorSpace::swap(QColorSpace& colorSpace).

C++ documentation:

Swaps color space other with this color space. This operation is very fast and never fails.

This item is available if cpp_lib_version="5.14.0".

pub unsafe fn transfer_function(&self) -> TransferFunction[src]

Returns the predefined transfer function of the color space or TransferFunction::Custom if it doesn't match any of them.

Calls C++ function: QColorSpace::TransferFunction QColorSpace::transferFunction() const.

C++ documentation:

Returns the predefined transfer function of the color space or TransferFunction::Custom if it doesn't match any of them.

See also gamma(), setTransferFunction(), and withTransferFunction().

This item is available if cpp_lib_version="5.14.0".

pub unsafe fn transformation_to_color_space(
    &self,
    colorspace: impl CastInto<Ref<QColorSpace>>
) -> CppBox<QColorTransform>
[src]

Generates and returns a color space transformation from this color space to colorspace.

Calls C++ function: QColorTransform QColorSpace::transformationToColorSpace(const QColorSpace& colorspace) const.

C++ documentation:

Generates and returns a color space transformation from this color space to colorspace.

This item is available if cpp_lib_version="5.14.0".

pub unsafe fn with_transfer_function_2a(
    &self,
    transfer_function: TransferFunction,
    gamma: c_float
) -> CppBox<QColorSpace>
[src]

Returns a copy of this color space, except using the transfer function transferFunction and gamma.

Calls C++ function: QColorSpace QColorSpace::withTransferFunction(QColorSpace::TransferFunction transferFunction, float gamma = …) const.

C++ documentation:

Returns a copy of this color space, except using the transfer function transferFunction and gamma.

See also transferFunction(), gamma(), and setTransferFunction().

This item is available if cpp_lib_version="5.14.0".

pub unsafe fn with_transfer_function_1a(
    &self,
    transfer_function: TransferFunction
) -> CppBox<QColorSpace>
[src]

Returns a copy of this color space, except using the transfer function transferFunction and gamma.

Calls C++ function: QColorSpace QColorSpace::withTransferFunction(QColorSpace::TransferFunction transferFunction) const.

C++ documentation:

Returns a copy of this color space, except using the transfer function transferFunction and gamma.

See also transferFunction(), gamma(), and setTransferFunction().

This item is available if cpp_lib_version="5.14.0".

Trait Implementations

impl CppDeletable for QColorSpace[src]

unsafe fn delete(&mut self)[src]

Calls C++ function: [destructor] void QColorSpace::~QColorSpace().

impl PartialEq<Ref<QColorSpace>> for QColorSpace[src]

fn eq(&self, color_space2: &Ref<QColorSpace>) -> bool[src]

Returns true if v1 is equal to v2; otherwise returns false. This operator uses an exact floating-point comparison.

Calls C++ function: bool operator==(const QColorSpace& colorSpace1, const QColorSpace& colorSpace2).

Warning: no exact match found in C++ documentation. Below is the C++ documentation for bool operator==(const QVector2D &v1, const QVector2D &v2):

Returns true if v1 is equal to v2; otherwise returns false. This operator uses an exact floating-point comparison.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> CastInto<U> for T where
    U: CastFrom<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> StaticUpcast<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.