summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeuin <[email protected]>2022-04-12 11:07:12 +0800
committerKeuin <[email protected]>2022-04-12 11:07:12 +0800
commit8b88692ea17885b9f191c08fbcb5dc1093269878 (patch)
tree0b7cf04fcfd4d4fddc429d41a413d3618af3d84a
parenta97b38299d5f8297d15077160df5439d274bd571 (diff)
Improve comments.
-rw-r--r--bitmap.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/bitmap.h b/bitmap.h
index 09f3711..3ce4ba8 100644
--- a/bitmap.h
+++ b/bitmap.h
@@ -28,8 +28,9 @@ struct pixel {
T r, g, b;
/**
- * Create a pixel with given depth, from normalized color values.
- * For example: for 8bit pixel, with (1, 0.5, 0.25), we get: (255, 127, 63).
+ * Create a pixel of given depth, from normalized color values.
+ * r, g, b must in range [0, 1].
+ * 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) {
const auto mod = (1ULL << (sizeof(T) * 8U)) - 1ULL;