164 Commits

Author SHA1 Message Date
Rupert
e7910ac36b add bmpread_image_type() API call 2025-06-22 02:05:35 +02:00
Rupert
7ece494541 Docs update 2025-06-21 16:18:45 +02:00
Rupert
c8ead48e33 add icon/pointer settings-sanity check 2025-06-21 13:24:54 +02:00
Rupert
8b38742ea3 icons/pointers: allow only BMP_UNDEFINED_LEAVE as undefined mode 2025-06-21 09:32:50 +02:00
Rupert
3a673da403 icons/pointers/arrays: minor changes to error handling 2025-06-21 09:32:19 +02:00
Rupert
fabbe4f8af arrays: bmpread_load_info() didn't set rp->getinfo_return
also icons/pointers: minor changes, comments
2025-06-06 16:24:14 +02:00
Rupert
22ef9d73aa Add BA and icon/pointer documentation v1.8.0 2025-06-04 00:03:26 +02:00
Rupert
abd3ea2db2 remove long deprecated symbols, bump version to 1.8.0 2025-06-03 23:16:10 +02:00
Rupert
3c5723b740 OS/2 icons/pointers: require INT result format 2025-06-03 23:21:32 +02:00
Rupert
8dd7182bf1 refuse 64bit for icons/pointers 2025-06-03 23:21:32 +02:00
Rupert
07d3bf6086 OS/2 icons/pointers: refactor boolean flags
one icon flag and and mono flag instead of two color-icon/mono-icon
flags
2025-06-03 23:21:32 +02:00
Rupert
5cd33b22ca Add support for OS/2 BA bitmap arrays 2025-06-03 23:21:32 +02:00
Rupert
10657851d1 Add support for OS/2 icons and pointers (IC/PT/CI/CP)
Still somewhat crude, but it works.

Limitations:
- max size 512x512
- no RLE
- no support yet to load index values, result is
  always returned as RGBA
2025-06-03 23:21:32 +02:00
Rupert
044fa148ed bmp-write: remove duplicate code 2025-05-30 22:22:24 +02:00
Rupert
b9244c0766 embrace C11 VLA syntax 2025-05-30 17:01:10 +02:00
Rupert
84a0f0f49d struct Bmpread - reorder some fields wrt alignment 2025-05-30 16:50:16 +02:00
Rupert
1b67440d29 docs: add section numbering 2025-05-27 15:08:47 +02:00
Rupert
5166bdb1e7 bmplib.h: some houskeeping and preparation for OS/2 icon/pointers 2025-05-14 23:36:08 +02:00
Rupert
c02804cdbf asserts
- use static_assert macro instead of _Static_assert
- make assertion in bmpwrite_set_iccprofile static
2025-05-09 08:12:07 +02:00
Rupert
fd8583d568 unit tests: add libreoffice spreadsheet to help construct test data 2025-05-08 15:14:32 +02:00
Rupert
845223bf62 add unit test for s_imgrgb_to_outbytes() 2025-05-08 13:20:47 +02:00
Rupert
952c10324f bmp-write: update float_to_s2_13() to version from bmp-read
should obviously eventually go into a header file instead of
duplicating it.
2025-05-07 20:56:56 +02:00
Rupert
668cc352e3 add unit tests for write_<xnn>_le() functions 2025-05-07 17:55:07 +02:00
Rupert
1bba98e395 refactor cm_align4size() macro 2025-05-03 18:41:08 +02:00
Rupert
0815eb3a7b remove unused function cm_align2padding() 2025-05-03 14:55:40 +02:00
Rupert
94dceb5812 read_u<nn>_le(): eliminate implementation defined behavior
relatively pointless but fun ;o)

- while not making any assumptions about the host's bit representation
  or the implementation defined behavior of assigning an unsigned int
  > INT_MAX to a signed int, the lack of range (INT_MIN) would
  still break it on non-two's complement unless larger int types were
  used.
- both gcc and clang recognize the pattern and generate the same code as
  for the simple assignment, so doing it this way doesn't cost any
  performance.
2025-05-03 13:25:21 +02:00
Rupert
c733595aed add unit test for read_s32_le() 2025-05-03 11:40:31 +02:00
Rupert
920ba8ea7e add unit test for read_u32_le() 2025-05-03 11:32:51 +02:00
Rupert
0882f1796a add unit test for read_s16_le() 2025-05-03 11:32:51 +02:00
Rupert
da95bcb0ae add unit test for read_u16_le() 2025-05-03 11:32:51 +02:00
Rupert
e5584c3b0f s_buffer32_bits(): make assert more precise 2025-05-01 12:13:32 +02:00
Rupert
3af484b238 update copyright notice dates 2025-05-01 12:11:32 +02:00
Rupert
6c33d975b5 add unit test for s_read_rgb_pixel() 2025-05-01 12:04:27 +02:00
Rupert
0ab592c357 add unit test for s_buffer_32_bits() 2025-04-30 13:23:55 +02:00
Rupert
e9b047b857 add unit test for s_buffer32_fill() 2025-04-30 13:23:55 +02:00
Rupert
71b3853327 s_buffer32_fill(): allow partial fill
this can make sense if the very last (padding) bytes of an indexed
file are truncated.
2025-04-30 13:23:55 +02:00
Rupert
5ce902ce1b add unit test for s_int8_to_result_format() 2025-04-30 13:23:55 +02:00
Rupert
abf93c1a77 reafactor s_int_to_result_format()
the in-place conversion made me feel a bit queezy; also, it's only ever
called for rgb conversion of indexed images, meaning always with
8-bit integers.

- Changed the name to s_int8_to_result_format()
- made it 8-bit only
- source values are now supplied as separate int array 'frombits' and
  stored into the result buffer 'px'.
2025-04-30 13:23:55 +02:00
Rupert
bc7dd1423c add unit test for s_srgb_gamma_float(), rename test source file 2025-04-29 00:59:13 +02:00
Rupert
100715fe9d add unit tests for s2.13 conversion 2025-04-28 22:59:12 +02:00
Rupert
e195d1d918 bmpread: use conversion functions
instead of manual conversions,
- use new s_float_to_s2_13()
- use s_int_to_float() in s_int_to_result_format()
2025-04-28 22:59:12 +02:00
Rupert
3989e07e05 fix rounding error in s2.13 conversion, eliminate impl.defined behavior
also eliminate some duplicate code while we're at it
2025-04-28 22:56:34 +02:00
Rupert
df8d9e44ca read state, minor changes 2025-04-28 22:56:34 +02:00
Rupert
7d2ff7fca5 C23 doesn't define __bool_true_false_are_defined anymore
this is still very kludgy, but seems to work for any c std
2025-04-28 22:56:34 +02:00
Rupert
2ba0910acc static assert of 32bit requirement
be more specific, requiring 32bits, not necessarily 4 bytes
2025-04-28 19:41:02 +02:00
Rupert
7494855af6 cleanup insane handling
- fix: setting a new insanity limit can cause previously ok result to
  be insane
- refactor for simpler expressions / more symmetry
2025-04-19 19:23:46 +02:00
Rupert
1d9a3faad4 icc profile error handling, minor changes 2025-04-19 12:53:52 +02:00
Rupert
3d31aa93cd minor fixes:
- require integer format when loading palette
- don't auto-load info in bmpread_is_64bit, as we cannot return result
2025-04-19 01:30:41 +02:00
Rupert
91d93cba9b refactor read state
instead of several bools, have one enum to keep track of where in the
reading process we are
2025-04-19 01:27:22 +02:00
Rupert
b43fd940e6 bump version to 1.7.7 v1.7.7 2025-04-18 15:53:08 +02:00