[PR #3] [MERGED] OS/2 icons/pointers #3

Closed
opened 2026-01-29 20:30:07 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/rupertwh/bmplib/pull/3
Author: @rupertwh
Created: 5/25/2025
Status: ✅ Merged
Merged: 6/3/2025
Merged by: @rupertwh

Base: main ← Head: icons


📝 Commits (5)

  • 62c4fa4 Add support for OS/2 icons and pointers (IC/PT/CI/CP)
  • 8c27ca0 Add support for OS/2 BA bitmap arrays
  • e8c7ddd OS/2 icons/pointers: refactor boolean flags
  • 7c4f7a6 refuse 64bit for icons/pointers
  • 23ff590 OS/2 icons/pointers: require INT result format

📊 Changes

7 files changed (+581 additions, -21 deletions)

View changed files

📝 bmp-common.h (+19 -0)
➕ bmp-read-icons.c (+353 -0)
➕ bmp-read-icons.h (+28 -0)
📝 bmp-read-loadimage.c (+43 -1)
📝 bmp-read.c (+126 -19)
📝 bmplib.h (+7 -1)
📝 meson.build (+5 -0)

📄 Description

Add support for OS/2 bitmap arrays, icons and pointers.

Bitmap arrays:

bmpread_load_info() will return BMP_RESULT_ARRAY.
Added two functions

  • int bmpread_array_num(BMPHANDLE h) returns the number of images contained in the file
  • BMPRESULT bmpread_array_info(BMPHANDLE h, struct BmpArrayInfo *ai, int idx) returns info about and enables access to the contained images.
struct BmpArrayInfo {
	BMPIMAGETYPE type;
	BMPHANDLE    handle;
	int          width, height;
	int          ncolors;                   /* 0 = RGB */
	int          screenwidth, screenheight; /* typically 0, or 1024x768 for 'hi-res' */
};

The handle contained in the BmpArrayInfo struct can be used to load the respective image like any other BMP file.

Icons/Pointers

Still a bit rough around the edges, but it works.

Some limitations apply to both color and b/w icons and pointers:

  • Max size 512x512. Should be more than generous for actual OS/2 icons and pointers.
  • no RLE (yet). Conflicting alpha (from RLE and icons's AND mask) will have to be dealt with.
  • Image can only be loaded as RGBA image, not as index + palette. The alpha channel from the icon's AND mask makes this a bit more complicated.

Needs more work, especially robustness with regards to possibly conflicting settings.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/rupertwh/bmplib/pull/3 **Author:** [@rupertwh](https://github.com/rupertwh) **Created:** 5/25/2025 **Status:** ✅ Merged **Merged:** 6/3/2025 **Merged by:** [@rupertwh](https://github.com/rupertwh) **Base:** `main` ← **Head:** `icons` --- ### 📝 Commits (5) - [`62c4fa4`](https://github.com/rupertwh/bmplib/commit/62c4fa484902742d7c0477f56711f06e6d1c4013) Add support for OS/2 icons and pointers (IC/PT/CI/CP) - [`8c27ca0`](https://github.com/rupertwh/bmplib/commit/8c27ca0431300a41697cecc203c36a39348d00fd) Add support for OS/2 BA bitmap arrays - [`e8c7ddd`](https://github.com/rupertwh/bmplib/commit/e8c7ddd39849e9bc858eeaf48919901b29c7d05a) OS/2 icons/pointers: refactor boolean flags - [`7c4f7a6`](https://github.com/rupertwh/bmplib/commit/7c4f7a60a4a7d1c6debedd52212081ed737f93b1) refuse 64bit for icons/pointers - [`23ff590`](https://github.com/rupertwh/bmplib/commit/23ff5907b4c60e2876e92677f047fa073f99dae8) OS/2 icons/pointers: require INT result format ### 📊 Changes **7 files changed** (+581 additions, -21 deletions) <details> <summary>View changed files</summary> 📝 `bmp-common.h` (+19 -0) ➕ `bmp-read-icons.c` (+353 -0) ➕ `bmp-read-icons.h` (+28 -0) 📝 `bmp-read-loadimage.c` (+43 -1) 📝 `bmp-read.c` (+126 -19) 📝 `bmplib.h` (+7 -1) 📝 `meson.build` (+5 -0) </details> ### 📄 Description Add support for OS/2 bitmap arrays, icons and pointers. ### Bitmap arrays: `bmpread_load_info()` will return `BMP_RESULT_ARRAY`. Added two functions - `int bmpread_array_num(BMPHANDLE h)` returns the number of images contained in the file - `BMPRESULT bmpread_array_info(BMPHANDLE h, struct BmpArrayInfo *ai, int idx)` returns info about and enables access to the contained images. ``` struct BmpArrayInfo { BMPIMAGETYPE type; BMPHANDLE handle; int width, height; int ncolors; /* 0 = RGB */ int screenwidth, screenheight; /* typically 0, or 1024x768 for 'hi-res' */ }; ``` The `handle` contained in the BmpArrayInfo struct can be used to load the respective image like any other BMP file. ### Icons/Pointers Still a bit rough around the edges, but it works. Some limitations apply to both color and b/w icons and pointers: - Max size 512x512. Should be more than generous for actual OS/2 icons and pointers. - no RLE (yet). Conflicting alpha (from RLE and icons's AND mask) will have to be dealt with. - Image can only be loaded as RGBA image, not as index + palette. The alpha channel from the icon's AND mask makes this a bit more complicated. Needs more work, especially robustness with regards to possibly conflicting settings. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 20:30:07 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/bmplib#3