GNU Octave  4.0.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Public Member Functions | Private Attributes | Friends | List of all members
CharacterColor Class Reference

Describes the color of a single character in the terminal. More...

#include "CharacterColor.h"

Collaboration diagram for CharacterColor:
Collaboration graph
[legend]

Public Member Functions

 CharacterColor ()
 Constructs a new CharacterColor whoose color and color space are undefined. More...
 
 CharacterColor (quint8 colorSpace, int co)
 Constructs a new CharacterColor using the specified colorSpace and with color value co. More...
 
QColor color (const ColorEntry *palette) const
 Returns the color within the specified color . More...
 
bool isValid ()
 Returns true if this character color entry is valid. More...
 
void toggleIntensive ()
 Toggles the value of this color between a normal system color and the corresponding intensive system color. More...
 

Private Attributes

quint8 _colorSpace
 
quint8 _u
 
quint8 _v
 
quint8 _w
 

Friends

class Character
 
bool operator!= (const CharacterColor &a, const CharacterColor &b)
 Compares two colors and returns true if they represent different color values or use different color spaces. More...
 
bool operator== (const CharacterColor &a, const CharacterColor &b)
 Compares two colors and returns true if they represent the same color value and use the same color space. More...
 

Detailed Description

Describes the color of a single character in the terminal.

Definition at line 143 of file CharacterColor.h.

Constructor & Destructor Documentation

CharacterColor::CharacterColor ( )
inline

Constructs a new CharacterColor whoose color and color space are undefined.

Definition at line 149 of file CharacterColor.h.

CharacterColor::CharacterColor ( quint8  colorSpace,
int  co 
)
inline

Constructs a new CharacterColor using the specified colorSpace and with color value co.

The meaning of co depends on the colorSpace used.

TODO : Document how co relates to colorSpace

TODO : Add documentation about available color spaces.

Definition at line 166 of file CharacterColor.h.

References _colorSpace, _u, _v, _w, COLOR_SPACE_256, COLOR_SPACE_DEFAULT, COLOR_SPACE_RGB, COLOR_SPACE_SYSTEM, and COLOR_SPACE_UNDEFINED.

Member Function Documentation

QColor CharacterColor::color ( const ColorEntry palette) const
inline

Returns the color within the specified color .

The palette is only used if this color is one of the 16 system colors, otherwise it is ignored.

Definition at line 267 of file CharacterColor.h.

References _colorSpace, _u, _v, _w, BASE_COLORS, color256(), COLOR_SPACE_256, COLOR_SPACE_DEFAULT, COLOR_SPACE_RGB, COLOR_SPACE_SYSTEM, and COLOR_SPACE_UNDEFINED.

Referenced by HTMLDecoder::decodeLine(), TerminalView::drawCharacters(), TerminalView::drawTextFragment(), and TerminalView::paintFilters().

bool CharacterColor::isValid ( )
inline

Returns true if this character color entry is valid.

Definition at line 197 of file CharacterColor.h.

References _colorSpace, and COLOR_SPACE_UNDEFINED.

Referenced by Screen::setBackColor(), and Screen::setForeColor().

void CharacterColor::toggleIntensive ( )
inline

Toggles the value of this color between a normal system color and the corresponding intensive system color.

This is only applicable if the color is using the COLOR_SPACE_DEFAULT or COLOR_SPACE_SYSTEM color spaces.

Definition at line 283 of file CharacterColor.h.

References _colorSpace, _v, COLOR_SPACE_DEFAULT, and COLOR_SPACE_SYSTEM.

Referenced by Screen::effectiveRendition().

Friends And Related Function Documentation

friend class Character
friend

Definition at line 145 of file CharacterColor.h.

bool operator!= ( const CharacterColor a,
const CharacterColor b 
)
friend

Compares two colors and returns true if they represent different color values or use different color spaces.

Definition at line 247 of file CharacterColor.h.

bool operator== ( const CharacterColor a,
const CharacterColor b 
)
friend

Compares two colors and returns true if they represent the same color value and use the same color space.

Definition at line 239 of file CharacterColor.h.

Member Data Documentation

quint8 CharacterColor::_colorSpace
private
quint8 CharacterColor::_u
private
quint8 CharacterColor::_v
private
quint8 CharacterColor::_w
private

Definition at line 236 of file CharacterColor.h.

Referenced by CharacterColor(), color(), and operator==().


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