core: Update Hillshade Algorithms and add Color-Relief Layer support (#3965)
This commit is contained in:
@@ -26,15 +26,14 @@ const std::map<std::string, std::optional<Color>> testCases = {
|
||||
{"rgb(-10, 0, 0)", Color(0.0f, 0.0f, 0.0f, 1.0f)}, // Clamped to 0
|
||||
{"rgba(300, 0, 0, 1.0)", Color(1.0f, 0.0f, 0.0f, 1.0f)}, // Clamped to 1
|
||||
{"rgba(100,100,100,0.2)", Color(20.0f / 255, 20.0f / 255, 20.0f / 255, 0.2f)},
|
||||
// {"#GGGGGG", Color(0.0f, 0.0f, 0.0f, 1.0f)}, // Treated as fallback black
|
||||
// not supported right now
|
||||
// {"#0F0F", Color(0.0f, 1.0f, 0.0f, 1.0f)},
|
||||
// {"#123F", Color(
|
||||
// static_cast<float>(0x1) / (0xF + 1),
|
||||
// static_cast<float>(0x2) / (0xF + 1),
|
||||
// static_cast<float>(0x3) / (0xF + 1),
|
||||
// static_cast<float>(0x4) / (0xF + 1)
|
||||
// )},
|
||||
// 4-digit hex with alpha (#RGBA)
|
||||
{"#0F0F", Color(0.0f, 1.0f, 0.0f, 1.0f)},
|
||||
{"#F00C", Color(0.8f, 0.0f, 0.0f, 0.8f)}, // Red with ~80% alpha
|
||||
{"#123F", Color(0.067f, 0.133f, 0.2f, 1.0f)}, // Same as #123 but with full alpha
|
||||
// 8-digit hex with alpha (#RRGGBBAA)
|
||||
{"#FF0000FF", Color(1.0f, 0.0f, 0.0f, 1.0f)}, // Red with full alpha
|
||||
{"#00FF0080", Color(0.0f, 0.5f, 0.0f, 0.5f)}, // Green with 50% alpha
|
||||
{"#0000FF00", Color(0.0f, 0.0f, 0.0f, 0.0f)}, // Blue with 0% alpha (transparent)
|
||||
|
||||
// Invalid inputs
|
||||
{"not-a-color", std::nullopt},
|
||||
|
||||
Reference in New Issue
Block a user