diff options
author | Keuin <[email protected]> | 2022-04-15 14:06:27 +0800 |
---|---|---|
committer | Keuin <[email protected]> | 2022-04-15 14:06:27 +0800 |
commit | 2d4671d5469116b05709bb1acb614d784d339964 (patch) | |
tree | afa839deea5e01ab3cd062968eae30ca56310370 /bitmap.h | |
parent | 50cd8dd3dd029ce432f8e517b4c054e75b5cfe8e (diff) |
Make ray3::decay_ distinguishable between different color channels.
Diffstat (limited to 'bitmap.h')
-rw-r--r-- | bitmap.h | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -123,6 +123,11 @@ pixel<T> operator*(S scale, const pixel <T> &pixel) { return ::pixel < T > {.r=(T) (pixel.r * scale), .g=(T) (pixel.g * scale), .b=(T) (pixel.b * scale)}; } +template<typename S, typename T> +pixel<T> operator*(const vec3<S> &scale, const pixel <T> &pixel) { + return ::pixel < T > {.r=(T) (pixel.r * scale.x), .g=(T) (pixel.g * scale.y), .b=(T) (pixel.b * scale.z)}; +} + // Mix two colors a and b. Returns a*u + b*v template<typename T> inline pixel<T> mix(const pixel<T> &a, const pixel<T> &b, double u, double v) { |