Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitk::ColorSequenceCycleH Class Reference

Generates ~36 distinguishable colors by cycling through HSV space. More...

#include <mitkColorSequenceCycleH.h>

Inheritance diagram for mitk::ColorSequenceCycleH:
Collaboration diagram for mitk::ColorSequenceCycleH:

Public Member Functions

 ColorSequenceCycleH ()
 Construct and initialize to the first color (red, H=0). More...
 
 ~ColorSequenceCycleH () override
 Destructor. More...
 
Color GetNextColor () override
 Return the next color in the HSV cycle. More...
 
void GoToBegin () override
 Rewind to the first color in the sequence. More...
 
virtual void ChangeHueValueByCycleSteps (int steps)
 Advance the hue by a given number of cycle steps. More...
 
virtual void ChangeHueValueByAbsoluteNumber (float number)
 Set the hue to an absolute value. More...
 
virtual void SetColorCycle (unsigned short cycle)
 Set the color cycle index (0–5). More...
 
- Public Member Functions inherited from mitk::ColorSequence
 ColorSequence ()
 Default constructor. More...
 
virtual ~ColorSequence ()
 Virtual destructor. More...
 

Protected Attributes

float color_h
 
float color_s
 
float color_v
 
unsigned short color_cycle
 

Detailed Description

Generates ~36 distinguishable colors by cycling through HSV space.

Starting from fully saturated red (H=0), the sequence cycles through:

  1. Fully saturated colors (hue increments of 60 degrees)
  2. Colors with halved saturation
  3. Colors with halved value

After exhausting all combinations the colors repeat.

See also
ColorSequence, ColorSequenceRainbow

Definition at line 32 of file mitkColorSequenceCycleH.h.

Constructor & Destructor Documentation

◆ ColorSequenceCycleH()

mitk::ColorSequenceCycleH::ColorSequenceCycleH ( )

Construct and initialize to the first color (red, H=0).

◆ ~ColorSequenceCycleH()

mitk::ColorSequenceCycleH::~ColorSequenceCycleH ( )
override

Destructor.

Member Function Documentation

◆ ChangeHueValueByAbsoluteNumber()

virtual void mitk::ColorSequenceCycleH::ChangeHueValueByAbsoluteNumber ( float  number)
virtual

Set the hue to an absolute value.

Values below 0 are clamped to 0. The range is [0, 360).

Parameters
[in]numberThe absolute hue value.

◆ ChangeHueValueByCycleSteps()

virtual void mitk::ColorSequenceCycleH::ChangeHueValueByCycleSteps ( int  steps)
virtual

Advance the hue by a given number of cycle steps.

Each step corresponds to a 60-degree hue increment. Negative values are clamped to 0.

Note
This does not change saturation or value (i.e., the color cycle). Use SetColorCycle() to change those.
Parameters
[in]stepsNumber of 60-degree hue increments.

◆ GetNextColor()

Color mitk::ColorSequenceCycleH::GetNextColor ( )
overridevirtual

Return the next color in the HSV cycle.

Returns
The next mitk::Color.

Implements mitk::ColorSequence.

◆ GoToBegin()

void mitk::ColorSequenceCycleH::GoToBegin ( )
overridevirtual

Rewind to the first color in the sequence.

Implements mitk::ColorSequence.

◆ SetColorCycle()

virtual void mitk::ColorSequenceCycleH::SetColorCycle ( unsigned short  cycle)
virtual

Set the color cycle index (0–5).

Controls the saturation/value combination used. Combine with hue changes to select specific colors.

Parameters
[in]cycleThe cycle index (0–5).

Member Data Documentation

◆ color_cycle

unsigned short mitk::ColorSequenceCycleH::color_cycle
protected

Definition at line 90 of file mitkColorSequenceCycleH.h.

◆ color_h

float mitk::ColorSequenceCycleH::color_h
protected

Definition at line 86 of file mitkColorSequenceCycleH.h.

◆ color_s

float mitk::ColorSequenceCycleH::color_s
protected

Definition at line 87 of file mitkColorSequenceCycleH.h.

◆ color_v

float mitk::ColorSequenceCycleH::color_v
protected

Definition at line 88 of file mitkColorSequenceCycleH.h.


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