mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-04 18:06:22 +03:00
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 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.
32 lines
2.0 KiB
Plaintext
32 lines
2.0 KiB
Plaintext
puts "============"
|
|
puts "OCC28004"
|
|
puts "Visualization, AIS_ColorScale - allow defining labels list not equal to intervals list"
|
|
puts "============"
|
|
puts ""
|
|
|
|
vclear
|
|
vinit View1
|
|
vaxo
|
|
|
|
# create default color scale
|
|
vcolorscale cs1 -demo -smooth 0 -xy 0 0
|
|
vcolorscale cs2 -demo -smooth 1 -xy 60 0
|
|
foreach {y aColor} {20 RED 60 DARKORANGE1 100 GOLD 140 GREENYELLOW 180 CHARTREUSE2 220 GREEN 250 MEDIUMSPRINGGREEN 290 CYAN 330 DODGERBLUE1 370 BLUE} { if { [vreadpixel 15 $y rgb name] != "$aColor" } { puts "Error: wrong color at $y" } }
|
|
foreach {y aColor} {20 RED 60 DARKORANGE1 100 GOLD 140 GREENYELLOW 180 CHARTREUSE2 220 GREEN 250 MEDIUMSPRINGGREEN 290 CYAN 330 DODGERBLUE1 370 BLUE} { if { [vreadpixel 15 $y rgb name] != "$aColor" } { puts "Error: wrong color at $y" } }
|
|
|
|
# reduce color scale range and number of intervals
|
|
vcolorscale cs3 -range 0 20 5 -font 16 -colors white 0 0 1 green 1 0 0 1 1 1 -labels start 1 2 3 4 end -smooth 0 -xy 120 0
|
|
vcolorscale cs4 -range 0 20 5 -font 16 -colors white 0 0 1 green 1 0 0 1 1 1 -labels start 1 2 3 4 end -smooth 1 -xy 180 0
|
|
foreach {y aColor} {40 WHITE 120 RED 200 GREEN 280 BLUE 350 WHITE} { if { [vreadpixel 135 $y rgb name] != "$aColor" } { puts "Error: wrong color at $y" } }
|
|
|
|
# color scale with overridden hue range
|
|
vcolorscale cs5 -demo -smooth 0 -hueRange 300 130 -xy 240 0
|
|
vcolorscale cs6 -demo -smooth 1 -hueRange 300 130 -xy 300 0
|
|
foreach {y aColor} {20 GREEN 60 SPRINGGREEN 100 CYAN2 140 TURQUOISE2 180 DODGERBLUE1 220 BLUE 250 BLUE 290 BLUEVIOLET 330 PURPLE 370 MAGENTA} { if { [vreadpixel 245 $y rgb name] != "$aColor" } { puts "Error: wrong color at $y" } }
|
|
foreach {y aColor} {20 GREEN 60 SPRINGGREEN 100 CYAN2 140 TURQUOISE2 180 DODGERBLUE1 220 DODGERBLUE2 250 BLUE 290 BLUE 330 PURPLE 370 MAGENTA2} { if { [vreadpixel 315 $y rgb name] != "$aColor" } { puts "Error: wrong color at $y" } }
|
|
|
|
# free labels
|
|
vcolorscale cs7 -demo -smooth 0 -colorRange BLACK WHITE -xy 360 0 -freeLabels 3 l1 l2 l3
|
|
|
|
vdump ${imagedir}/${casename}.png
|