{"_id":"@bun-win32/mscms","_rev":"3-3de699c7dd0364d40153a61a1107f429","name":"@bun-win32/mscms","dist-tags":{"latest":"2.0.1"},"versions":{"1.0.0":{"name":"@bun-win32/mscms","version":"1.0.0","keywords":["bun","ffi","win32","windows","mscms","icm","icc","color-management","color-profile","bindings","typescript","dll"],"author":"Stev Peifer <stev@bell.net>","license":"MIT","_id":"@bun-win32/mscms@1.0.0","maintainers":[{"name":"obscuritysrl","email":"stev@bell.net"}],"homepage":"https://github.com/ObscuritySRL/bun-win32#readme","bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"dist":{"shasum":"f1164dbdc4de2f729322fce9f9768e0da745dff6","tarball":"https://registry.npmjs.org/@bun-win32/mscms/-/mscms-1.0.0.tgz","fileCount":6,"integrity":"sha512-dgw4jh0XVd/Jx+BK+FqvKQeBTvA4T6v2JkPbLfnTTWp/GPexO4XOXeTesYvxvKaV6LGlw3p3EPsNXwEKtifA3g==","signatures":[{"sig":"MEYCIQDUitJoIgK55Djyu1pu32I8Uw5RqCc1L3cQU9BVh6JjEgIhAIwWW95V9GE+Tbzpt+WYhZ6rV/d7yk/hxW6Zl7/1+kIN","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":51039},"main":"./index.ts","type":"module","module":"index.ts","shasum":"f1164dbdc4de2f729322fce9f9768e0da745dff6","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:color-spectrum":"bun ./example/color-spectrum.ts","example:profile-inspector":"bun ./example/profile-inspector.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev@bell.net"},"_integrity":"sha512-dgw4jh0XVd/Jx+BK+FqvKQeBTvA4T6v2JkPbLfnTTWp/GPexO4XOXeTesYvxvKaV6LGlw3p3EPsNXwEKtifA3g==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/mscms"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 MSCMS bindings for Bun (FFI) on Windows.","directories":{},"sideEffects":false,"_nodeVersion":"24.3.0","dependencies":{"@bun-win32/core":"1.1.2"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/mscms_1.0.0_1778847647661_0.9186740639135167","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@bun-win32/mscms","version":"2.0.0","keywords":["bun","ffi","win32","windows","mscms","icm","icc","color-management","color-profile","bindings","typescript","dll"],"author":"Stev Peifer <stev.p@outlook.com>","license":"MIT","_id":"@bun-win32/mscms@2.0.0","maintainers":[{"name":"obscuritysrl","email":"stev.p@outlook.com"}],"homepage":"https://github.com/ObscuritySRL/bun-win32#readme","bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"dist":{"shasum":"2623800fb21f1599790ec4a4d75b3eea1d8221d4","tarball":"https://registry.npmjs.org/@bun-win32/mscms/-/mscms-2.0.0.tgz","fileCount":6,"integrity":"sha512-NZI5bxMwKMST4rgoBcvLykDdilMP1W0Jaxl9HN11sS5I9gir/RfIhAS8jLouCPTXK1CXEZZ6a3pNfo4hf3E/4Q==","signatures":[{"sig":"MEQCIHCZlzBin94S+XFnk3+8XKEEEkFpkVKOYUDPGEnVUFi4AiB96apL6DmD3kp7nY2Az2uly3c6yJa0ptlwdIPtnOdoKg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":53015},"main":"./index.ts","type":"module","module":"index.ts","shasum":"2623800fb21f1599790ec4a4d75b3eea1d8221d4","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:color-spectrum":"bun ./example/color-spectrum.ts","example:profile-inspector":"bun ./example/profile-inspector.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev.p@outlook.com"},"_integrity":"sha512-NZI5bxMwKMST4rgoBcvLykDdilMP1W0Jaxl9HN11sS5I9gir/RfIhAS8jLouCPTXK1CXEZZ6a3pNfo4hf3E/4Q==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/mscms"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 MSCMS bindings for Bun (FFI) on Windows.","directories":{},"sideEffects":false,"_nodeVersion":"26.3.0","dependencies":{"@bun-win32/core":"2.0.0"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/mscms_2.0.0_1782435474645_0.6970756637817335","host":"s3://npm-registry-packages-npm-production"}},"2.0.1":{"author":"Stev Peifer <stev.p@outlook.com>","bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"dependencies":{"@bun-win32/core":"2.0.1"},"description":"Zero-dependency, zero-overhead Win32 MSCMS bindings for Bun (FFI) on Windows.","devDependencies":{"@types/bun":"latest"},"exports":{".":"./index.ts"},"license":"MIT","module":"index.ts","name":"@bun-win32/mscms","peerDependencies":{"typescript":"^5"},"private":false,"homepage":"https://github.com/ObscuritySRL/bun-win32#readme","repository":{"type":"git","url":"git://github.com/ObscuritySRL/bun-win32.git","directory":"packages/mscms"},"type":"module","version":"2.0.1","main":"./index.ts","keywords":["bun","ffi","win32","windows","mscms","icm","icc","color-management","color-profile","bindings","typescript","dll"],"sideEffects":false,"engines":{"bun":">=1.1.0"},"scripts":{"example:color-spectrum":"bun ./example/color-spectrum.ts","example:profile-inspector":"bun ./example/profile-inspector.ts"},"_id":"@bun-win32/mscms@2.0.1","_integrity":"sha512-A8sFD49eS0P+ZX8L09OuzXHvrFiqYXdFVAWiDWGZ7dAGphXlJcWbMlLpcWj2nMzKZdMk0FflP4Be9+6bHu+GcQ==","_nodeVersion":"26.3.0","_npmVersion":"10.8.3","shasum":"a7cdf7fa730dcc43ac26d576559c6b4f91fa43cf","dist":{"integrity":"sha512-A8sFD49eS0P+ZX8L09OuzXHvrFiqYXdFVAWiDWGZ7dAGphXlJcWbMlLpcWj2nMzKZdMk0FflP4Be9+6bHu+GcQ==","shasum":"a7cdf7fa730dcc43ac26d576559c6b4f91fa43cf","tarball":"https://registry.npmjs.org/@bun-win32/mscms/-/mscms-2.0.1.tgz","fileCount":6,"unpackedSize":53015,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQD+Yq1i88Mg9ITrXYMANkwnFtDJkKC7Xl5dk2mXeTbp2wIhAJDAlrRPO38nYYfp7ade7haogIiBS4QQ3ZkghPF46SOA"}]},"_npmUser":{"name":"obscuritysrl","email":"stev.p@outlook.com"},"directories":{},"maintainers":[{"name":"obscuritysrl","email":"stev.p@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mscms_2.0.1_1782438132859_0.5592952743850925"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-15T12:20:47.538Z","modified":"2026-06-26T01:42:13.148Z","1.0.0":"2026-05-15T12:20:47.834Z","2.0.0":"2026-06-26T00:57:54.783Z","2.0.1":"2026-06-26T01:42:13.006Z"},"bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"author":"Stev Peifer <stev.p@outlook.com>","license":"MIT","homepage":"https://github.com/ObscuritySRL/bun-win32#readme","keywords":["bun","ffi","win32","windows","mscms","icm","icc","color-management","color-profile","bindings","typescript","dll"],"repository":{"type":"git","url":"git://github.com/ObscuritySRL/bun-win32.git","directory":"packages/mscms"},"description":"Zero-dependency, zero-overhead Win32 MSCMS bindings for Bun (FFI) on Windows.","maintainers":[{"name":"obscuritysrl","email":"stev.p@outlook.com"}],"readme":"# @bun-win32/mscms\n\nZero-dependency, zero-overhead Win32 MSCMS bindings for [Bun](https://bun.sh) on Windows.\n\n## Overview\n\n`@bun-win32/mscms` exposes the `mscms.dll` exports using [Bun](https://bun.sh)'s FFI. It provides a single class, `Mscms`, which lazily binds native symbols on first use. You can optionally preload a subset or all symbols up-front via `Preload()`.\n\nThe bindings are strongly typed for a smooth DX in TypeScript.\n\n## Features\n\n- [Bun](https://bun.sh)-first ergonomics on Windows 10/11.\n- Direct FFI to `mscms.dll` (ICC color profiles, color transforms, color space conversion, display calibration, and Windows Color System).\n- In-source docs in `structs/Mscms.ts` with links to Microsoft Docs.\n- Lazy binding on first call; optional eager preload (`Mscms.Preload()`).\n- No wrapper overhead; calls map 1:1 to native APIs.\n- Strongly-typed Win32 aliases (see `types/Mscms.ts`).\n\n## Requirements\n\n- [Bun](https://bun.sh) runtime\n- Windows 10 or later\n\n## Installation\n\n```sh\nbun add @bun-win32/mscms\n```\n\n## Quick Start\n\n```ts\nimport Mscms, { PROFILE_ACCESS, PROFILE_TYPE } from '@bun-win32/mscms';\n\n// Preload the symbols you'll use\nMscms.Preload(['OpenColorProfileW', 'GetColorProfileHeader', 'CloseColorProfile']);\n\n// Build a PROFILE struct that points at a filename\nconst path = Buffer.from('C:\\\\Windows\\\\System32\\\\spool\\\\drivers\\\\color\\\\sRGB Color Space Profile.icm\\0', 'utf16le');\nconst profile = Buffer.alloc(24);\nprofile.writeUInt32LE(PROFILE_TYPE.PROFILE_FILENAME, 0);\nprofile.writeBigUInt64LE(BigInt(path.ptr!), 8);\nprofile.writeUInt32LE(path.byteLength, 16);\n\nconst hProfile = Mscms.OpenColorProfileW(profile.ptr!, PROFILE_ACCESS.PROFILE_READ, 0, 3 /* OPEN_EXISTING */);\nif (hProfile !== 0n) {\n  // 128-byte ICC profile header\n  const header = Buffer.alloc(128);\n  if (Mscms.GetColorProfileHeader(hProfile, header.ptr!)) {\n    console.log('Profile size:', header.readUInt32LE(0));\n  }\n  Mscms.CloseColorProfile(hProfile);\n}\n```\n\n> [!NOTE]\n> AI agents: see `AI.md` for the package binding contract and source-navigation guidance. It explains how to use the package without scanning the entire implementation.\n\n## Examples\n\nRun the included examples:\n\n```sh\nbun run example:color-spectrum     # Animated sRGB <-> Adobe RGB gamut visualization\nbun run example:profile-inspector  # Full ICC profile dump for every installed display profile\n```\n\n## Notes\n\n- Either rely on lazy binding or call `Mscms.Preload()`.\n- Windows only. Bun runtime required.\n- **SAL types & naming:** nullability is in the **type** — `Optional<T>` (formally optional, SAL `_*opt_`) and `Nullable<T>` (plain `[in]`/`[out]` the docs say can be NULL), the null sentinel derived from `T` (`null` for pointers `LP*`/`P*`, `0n` for handles/by-value addresses); direction is in the **parameter name** — `_out` (`_Out_`), `_in_out` (`_Inout_`), `_In_` bare. See `AI.md` and the repo `AGENTS.md`.\n","readmeFilename":"README.md"}