Skip to content

Commit 56ee4b5

Browse files
committed
base: add IMAGE__DIMENSION_MAX_INCL comment
1 parent abdfa0d commit 56ee4b5

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

internal/cgen/base/image-public.h

+15
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,21 @@
1010

1111
// ---------------- Images
1212

13+
// WUFFS_BASE__IMAGE__DIMENSION_MAX_INCL is the largest width or height
14+
// (measured in pixels) supported by Wuffs' standard library's image codecs.
15+
//
16+
// Any non-negative integer N less than or equal to ((1 << 24) - 1) can be
17+
// losslessly converted to and from single-precision floating point (what C
18+
// calls the "float" type and what Go calls "float32").
19+
//
20+
// A Wuffs image can have up to 4 channels and up to 8 bytes per channel (8 is
21+
// also known as sizeof(double)), combining for up to 32 bytes per pixel. When
22+
// calculating memory requirements, the 0xFFFFFF upper bound also means that:
23+
// - (32 * N) will not overflow an int32_t or uint32_t.
24+
// - (32 * N * N) will not overflow an int64_t or uint64_t, provided that N
25+
// already has a 64-bit type.
26+
//
27+
// 0xFFFFFF in decimal is 16777215.
1328
#define WUFFS_BASE__IMAGE__DIMENSION_MAX_INCL 0xFFFFFF
1429

1530
// wuffs_base__color_u32_argb_premul is an 8 bit per channel premultiplied

release/c/wuffs-unsupported-snapshot.c

+15
Original file line numberDiff line numberDiff line change
@@ -4064,6 +4064,21 @@ wuffs_base__malloc_slice_u64(void* (*malloc_func)(size_t), uint64_t num_u64) {
40644064

40654065
// ---------------- Images
40664066

4067+
// WUFFS_BASE__IMAGE__DIMENSION_MAX_INCL is the largest width or height
4068+
// (measured in pixels) supported by Wuffs' standard library's image codecs.
4069+
//
4070+
// Any non-negative integer N less than or equal to ((1 << 24) - 1) can be
4071+
// losslessly converted to and from single-precision floating point (what C
4072+
// calls the "float" type and what Go calls "float32").
4073+
//
4074+
// A Wuffs image can have up to 4 channels and up to 8 bytes per channel (8 is
4075+
// also known as sizeof(double)), combining for up to 32 bytes per pixel. When
4076+
// calculating memory requirements, the 0xFFFFFF upper bound also means that:
4077+
// - (32 * N) will not overflow an int32_t or uint32_t.
4078+
// - (32 * N * N) will not overflow an int64_t or uint64_t, provided that N
4079+
// already has a 64-bit type.
4080+
//
4081+
// 0xFFFFFF in decimal is 16777215.
40674082
#define WUFFS_BASE__IMAGE__DIMENSION_MAX_INCL 0xFFFFFF
40684083

40694084
// wuffs_base__color_u32_argb_premul is an 8 bit per channel premultiplied

0 commit comments

Comments
 (0)