Visual Computing Library  devel
Loading...
Searching...
No Matches
vcl::comp::Color< ParentElemType, OPT > Class Template Reference

The Color class represents a RGBA color that will be part of an Element (e.g. Vertex, Face, ...) or Mesh. More...

#include <vclib/mesh/components/color.h>

Inheritance diagram for vcl::comp::Color< ParentElemType, OPT >:

Public Types

using ColorType = vcl::Color
 Expose the type of the Color.
 

Public Member Functions

vcl::Colorcolor ()
 Returns a reference pf the color of the element.
 
const vcl::Colorcolor () const
 Returns a const reference of the color of the element.
 
 Color ()=default
 Initilizes the color to black (with alpha 255).
 

Protected Member Functions

void deserialize (std::istream &is)
 
template<typename Element >
void importFrom (const Element &e, bool=true)
 
void serialize (std::ostream &os) const
 

Private Types

using Base = Component< Color< ParentElemType, OPT >, CompId::COLOR, vcl::Color, ParentElemType, !std::is_same_v< ParentElemType, void >, OPT >
 

Detailed Description

template<typename ParentElemType = void, bool OPT = false>
class vcl::comp::Color< ParentElemType, OPT >

The Color class represents a RGBA color that will be part of an Element (e.g. Vertex, Face, ...) or Mesh.

Allows to get and set an object of type Color.

For example, if you have a Vertex Element v with the Color component, you'll be able to access to this component member functions from v:

vcl::Color c = v.color();
The Color class represents a 32 bit color.
Definition color.h:48
Note
This component can be both used for Elements and Meshes.
Template Parameters
ParentElemTypeThis template argument must be void if the component needs to be stored horizontally, or the type of the parent element that will contain this component if the component needs to be stored vertically.
OPTIf true, the component will be optional. This argument is considered only if the component is stored vertically.

Member Function Documentation

◆ color() [1/2]

template<typename ParentElemType = void, bool OPT = false>
vcl::Color & vcl::comp::Color< ParentElemType, OPT >::color ( )
inline

Returns a reference pf the color of the element.

Returns
a reference pf the color of the element.

◆ color() [2/2]

template<typename ParentElemType = void, bool OPT = false>
const vcl::Color & vcl::comp::Color< ParentElemType, OPT >::color ( ) const
inline

Returns a const reference of the color of the element.

Returns
a const reference of the color of the element.

The documentation for this class was generated from the following file: