diff options
author | Keuin <[email protected]> | 2022-12-24 17:08:15 +0800 |
---|---|---|
committer | Keuin <[email protected]> | 2022-12-24 17:26:01 +0800 |
commit | 0987464cf99120b6728949496ee41bd14a35b225 (patch) | |
tree | 749e84bcd17ec002bc486aa308c8636df2e21de2 /bitmap.h | |
parent | da03ccd81467af87452b45763da87a4e3ce603a1 (diff) |
Diffstat (limited to 'bitmap.h')
-rw-r--r-- | bitmap.h | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -47,7 +47,7 @@ struct pixel { * For example: Set color depth to 8bit, for normalized color (1, 0.5, 0.25), we get: (255, 127, 63). */ static inline pixel<T> from_normalized(double r, double g, double b) { - return pixel<T>{.r = (T) (mod * r), .g = (T) (mod * g), .b = (T) (mod * b)}; + return pixel<T>{(T) (mod * r), (T) (mod * g), (T) (mod * b)}; } // v3d must be a normalized vector @@ -120,12 +120,12 @@ template< typename = typename std::enable_if<std::is_arithmetic<S>::value, S>::type > 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)}; + return ::pixel < T > {(T) (pixel.r * scale), (T) (pixel.g * scale), (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)}; + return ::pixel < T > {(T) (pixel.r * scale.x), (T) (pixel.g * scale.y), (T) (pixel.b * scale.z)}; } // Mix two colors a and b. Returns a*u + b*v |