Archived issue #0030969
Coding Rules - refactor Quantity_Color.cxx color table definition
Description
Quantity_Color.cxx defines a large table of standard colors.
It is desired refactoring this table to be better aligned.
It is desired refactoring this table to be better aligned.
static Standard_Integer VColTable (Draw_Interpretor& theDI, Standard_Integer theArgNb, const char** theArgVec)
{
FILE* aFile = OSD_OpenFile ("col.hxx", "wb");
if (aFile == NULL) { std::cerr << "FAILED\n"; return 1; }
for (int aColIter = 0; aColIter <= Quantity_NOC_WHITE; ++aColIter)
{
Quantity_Color aColor ((Quantity_NameOfColor )aColIter);
TCollection_AsciiString aHex = Quantity_Color::ColorToHex(aColor).SubString (2, 7);
Fprintf (aFile, "RawColor(%-20s, 0x%s, %f, %f, %f),\n",
Quantity_Color::StringName ((Quantity_NameOfColor )aColIter), aHex.ToCString(),
aColor.Red(), aColor.Green(), aColor.Blue());
}
fclose(aFile);
return 0;
}
Steps to reproduce
N/A
Public activity
31 archived notes
Participants are labeled by their role within this record.
Branch [archived branch] has been created by Author.
[revision removed]
Detailed log of new commits:
Author: Author
Date: Mon Sep 16 23:06:38 2019 +0300
0030969: Coding Rules - refactor Quantity_Color.cxx color table definition
The table of named colors has been compressed and moved out
from Quantity_Color.cxx into Quantity_ColorTable.pxx.
Quantity_NameOfColor - grayscale enumeration values
have been re-ordered to fix discontinuity.
Quantity_Color class definition has been cleaned to follow OCCT coding style.
Quantity_Color now stores NCollection_Vec3<float> as class field instead of separate components.
New methods Quantity_Color::Convert_LinearRGB_To_sRGB() and Quantity_Color::Convert_sRGB_To_LinearRGB()
converting RGB components from linear to non-linear sRGB colorspace and vice versa.
[revision removed]
Detailed log of new commits:
Author: Author
Date: Mon Sep 16 23:06:38 2019 +0300
0030969: Coding Rules - refactor Quantity_Color.cxx color table definition
The table of named colors has been compressed and moved out
from Quantity_Color.cxx into Quantity_ColorTable.pxx.
Quantity_NameOfColor - grayscale enumeration values
have been re-ordered to fix discontinuity.
Quantity_Color class definition has been cleaned to follow OCCT coding style.
Quantity_Color now stores NCollection_Vec3<float> as class field instead of separate components.
New methods Quantity_Color::Convert_LinearRGB_To_sRGB() and Quantity_Color::Convert_sRGB_To_LinearRGB()
converting RGB components from linear to non-linear sRGB colorspace and vice versa.
Branch [archived branch] has been updated forcibly by Author.
[revision removed]
[revision removed]
Let's postpone it till 7.5.0. Minor remark: there is no sense in prefixing calls to the class' own methods by its name within the class definition, like calls to Quantity_Color::valuesOf() in Quantity_Color.hxx.
Branch [archived branch] has been updated forcibly by Author.
[revision removed]
[revision removed]
Branch [archived branch] has been updated forcibly by Author.
[revision removed]
[revision removed]
Branch [archived branch] has been updated forcibly by Author.
[revision removed]
[revision removed]
Branch [archived branch] has been updated forcibly by Author.
[revision removed]
[revision removed]
Branch [archived branch] has been updated forcibly by Author.
[revision removed]
[revision removed]
Branch [archived branch] has been updated forcibly by Author.
[revision removed]
[revision removed]
Branch [archived branch] has been updated forcibly by Author.
[revision removed]
[revision removed]
Branch [archived branch] has been updated forcibly by Author.
[revision removed]
[revision removed]
Branch [archived branch] has been updated forcibly by Author.
[revision removed]
[revision removed]
Branch [archived branch] has been updated forcibly by Author.
[revision removed]
[revision removed]
Branch [archived branch] has been created by Author.
[revision removed]
Detailed log of new commits:
Author: Author
Date: Mon Sep 16 23:06:38 2019 +0300
0030969: Coding Rules - refactor Quantity_Color.cxx color table definition
The table of named colors has been compressed and moved out
from Quantity_Color.cxx into Quantity_ColorTable.pxx.
Quantity_NameOfColor - grayscale enumeration values have been re-ordered to fix discontinuity.
Duplicating colors has been merged within enumeration:
CHARTREUSE=CHARTREUSE1, GOLD=GOLD1, GREEN=GREEN1, ORANGE=ORANGE1,
ORANGERED=ORANGERED1, RED=RED1, TOMATO=TOMATO1, YELLOW=YELLOW1.
Added aliases to several other common colors:
BLUE=BLUE1, CYAN=CYAN1, LIGHTCYAN=LIGHTCYAN1, MAGENTA=MAGENTA1.
Quantity_Color::ColorToHex() now rounds-up float values to closest integer.
Quantity_ColorRGBA::ColorToHex() - added method formatting color into hex with alpha component.
Quantity_Color class definition has been cleaned to follow OCCT coding style.
Quantity_Color now stores NCollection_Vec3<float> as class field instead of separate components.
Removed unused class Quantity_ColorDefinitionError.
New methods Quantity_Color::Convert_LinearRGB_To_sRGB() and Quantity_Color::Convert_sRGB_To_LinearRGB()
converting RGB components from linear to non-linear sRGB colorspace and vice versa.
Image_PixMap::PixelColor() and Image_PixMap::SetPixelColor() methods have been extended
with an optional argument for performing linearization/delinearization of 8-bit sRGB pixel formats.
Draw Harness command AISColor has been corrected to take color name instead of enumeration index.
vdrawtext command now uses ViewerTest::ParseColor() for parsing color argument, so that it accepts hex.
vreadpixel command now has been extended with -hex argument for printing color in hex format.
[revision removed]
Detailed log of new commits:
Author: Author
Date: Mon Sep 16 23:06:38 2019 +0300
0030969: Coding Rules - refactor Quantity_Color.cxx color table definition
The table of named colors has been compressed and moved out
from Quantity_Color.cxx into Quantity_ColorTable.pxx.
Quantity_NameOfColor - grayscale enumeration values have been re-ordered to fix discontinuity.
Duplicating colors has been merged within enumeration:
CHARTREUSE=CHARTREUSE1, GOLD=GOLD1, GREEN=GREEN1, ORANGE=ORANGE1,
ORANGERED=ORANGERED1, RED=RED1, TOMATO=TOMATO1, YELLOW=YELLOW1.
Added aliases to several other common colors:
BLUE=BLUE1, CYAN=CYAN1, LIGHTCYAN=LIGHTCYAN1, MAGENTA=MAGENTA1.
Quantity_Color::ColorToHex() now rounds-up float values to closest integer.
Quantity_ColorRGBA::ColorToHex() - added method formatting color into hex with alpha component.
Quantity_Color class definition has been cleaned to follow OCCT coding style.
Quantity_Color now stores NCollection_Vec3<float> as class field instead of separate components.
Removed unused class Quantity_ColorDefinitionError.
New methods Quantity_Color::Convert_LinearRGB_To_sRGB() and Quantity_Color::Convert_sRGB_To_LinearRGB()
converting RGB components from linear to non-linear sRGB colorspace and vice versa.
Image_PixMap::PixelColor() and Image_PixMap::SetPixelColor() methods have been extended
with an optional argument for performing linearization/delinearization of 8-bit sRGB pixel formats.
Draw Harness command AISColor has been corrected to take color name instead of enumeration index.
vdrawtext command now uses ViewerTest::ParseColor() for parsing color argument, so that it accepts hex.
vreadpixel command now has been extended with -hex argument for printing color in hex format.
Branch [archived branch] has been updated forcibly by Author.
[revision removed]
[revision removed]
Branch [archived branch] has been updated forcibly by Author.
[revision removed]
[revision removed]
Branch [archived branch] has been updated forcibly by Author.
[revision removed]
[revision removed]
Branch [archived branch] has been updated forcibly by Author.
[revision removed]
[revision removed]
Branch [archived branch] has been updated forcibly by Author.
[revision removed]
[revision removed]
Branch [archived branch] has been updated forcibly by Author.
[revision removed]
[revision removed]
Branch [archived branch] has been updated forcibly by Author.
[revision removed]
[revision removed]
Branch [archived branch] has been updated forcibly by Author.
[revision removed]
[revision removed]
Branch [archived branch] has been updated forcibly by Author.
[revision removed]
[revision removed]
Branch [archived branch] has been updated forcibly by Author.
[revision removed]
[revision removed]
Branch [archived branch] has been created by Author.
[revision removed]
No new revisions were added by this update.
[revision removed]
No new revisions were added by this update.
Patch is ready for review.
http://jenkins-test-12.nnov.opencascade.com:8080/view/CR29528_4-CR29528_4-KGV/
http://jenkins-test-12.nnov.opencascade.com:8080/view/CR29528_4-CR29528_4-KGV/
The patches were reviewed without remarks
Branch [archived branch] has been updated forcibly by Author.
[revision removed]
[revision removed]
Branch [archived branch] has been deleted by Author.
[revision removed]
[revision removed]
Branch [archived branch] has been deleted by Author.
[revision removed]
[revision removed]
Branch [archived branch] has been deleted by Author.
[revision removed]
[revision removed]
Related records