Into

Modules

Documentation

classPiiColor4

#include <PiiColor.h>

A four-channel color.

Inherits PiiColorBase< T >, PiiArithmeticBase< PiiColor4< T >, PiiColor4Traits< T > >

Description

Fourth color channel is sometimes useful in aligning the color values to word boundaries in memory. Furthermore, some colors are composed of four distinct channels.

The class functions equivalently to PiiColor, but provides space for a fourth channel. One can access the fourth color channel of the CMYK and RGBA color spaces via cmykK and rgbaA. All channels can be accessed via the channel array and the color channel names inherited from PiiColor.

Public types

enum
@11
{ ChannelCount = 4 }

Shorthand for the base class type.

Constructors and destructor

(
  • T value = 0
)

Create a new color with the same value on each color channel.

( )

Create a new four-channel color with the three channel values taken from the given three-channel color and the fourth channel set to zero.

(
  • T channel0
  • T channel1
  • T channel2
  • T channel3 = 0
)

Create a new color with the given values for each color channel.

template<class U>
( )

Create a typecasted copy.

template<class U>
( )

Create a typecasted copy of a three-channel color.

( )

Copy another color.

Public member functions

end
( )

An stl-style const iterator to the end of color channels.

end
( )

An stl-style iterator to the end of color channels.

Friends

friend struct

Enumeration details

  • enum @11

Function details

  • PiiColor4

    (
    • T value = 0
    )
    [inline]

    Create a new color with the same value on each color channel.

  • PiiColor4

    ( )
    [inline]

    Create a new four-channel color with the three channel values taken from the given three-channel color and the fourth channel set to zero.

  • PiiColor4

    (
    • T channel0
    • T channel1
    • T channel2
    • T channel3 = 0
    )
    [inline]

    Create a new color with the given values for each color channel.

    To create an RGBA color, do this:

     // Parameters:              R, G,  B,   A
     PiiColor4<> transparentBlue(0, 0, 255, 127);
    
  • template<class U>

    PiiColor4

    ( )
    [inline]

    Create a typecasted copy.

  • template<class U>

    PiiColor4

    ( )
    [inline]

    Create a typecasted copy of a three-channel color.

    The fourt channel will be set to zero.

  • PiiColor4

    ( )
    [inline]

    Copy another color.

  • template<class Archive>

    void serialize

    (
    • Archive & archive
    • const unsigned int
    )
    [inline]
  • BaseType::ConstIterator end

    ()
    [inline]

    An stl-style const iterator to the end of color channels.

  • BaseType::Iterator end

    ()
    [inline]

    An stl-style iterator to the end of color channels.

Notes (0)

Add a note

Not a single note added yet. Be the first, add yours.