{"_id":"@bun-win32/magnification","_rev":"3-8c28c76e8afe5141109117e5e7c3cff7","name":"@bun-win32/magnification","dist-tags":{"latest":"2.0.1"},"versions":{"1.0.0":{"name":"@bun-win32/magnification","version":"1.0.0","keywords":["bun","ffi","win32","windows","magnification","bindings","typescript","dll"],"author":"Stev Peifer <stev@bell.net>","license":"MIT","_id":"@bun-win32/magnification@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":"e97e606eafad9bde5e2b5e552968ccc7b0317b16","tarball":"https://registry.npmjs.org/@bun-win32/magnification/-/magnification-1.0.0.tgz","fileCount":6,"integrity":"sha512-0oxIbhtKehDmgNlHP2TrH8Mrrjrj7XXHd4kDI1Q01BRzvFjAUnBUQDVBxdMBSCPWkoV/0QoMWrBdt+208VyVIA==","signatures":[{"sig":"MEUCIHynFJPGzS4U5CQwCSnU2UmElX0e7sFx7tAVkivyrw9wAiEAlYor1acTlnOUTjZXDgZwxFBoAZmJi15V5/Juy7t5nl0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":16123},"main":"./index.ts","type":"module","module":"index.ts","shasum":"e97e606eafad9bde5e2b5e552968ccc7b0317b16","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:screen-color-lab":"bun ./example/screen-color-lab.ts","example:magnification-diagnostic":"bun ./example/magnification-diagnostic.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev@bell.net"},"_integrity":"sha512-0oxIbhtKehDmgNlHP2TrH8Mrrjrj7XXHd4kDI1Q01BRzvFjAUnBUQDVBxdMBSCPWkoV/0QoMWrBdt+208VyVIA==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/magnification"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 Magnification 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","@bun-win32/user32":"3.0.20","@bun-win32/kernel32":"1.0.21"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/magnification_1.0.0_1779073011268_0.13601042449795409","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@bun-win32/magnification","version":"2.0.0","keywords":["bun","ffi","win32","windows","magnification","bindings","typescript","dll"],"author":"Stev Peifer <stev.p@outlook.com>","license":"MIT","_id":"@bun-win32/magnification@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":"c9add7cfc3650b1ecdf7fdc1efb4de90d272fd55","tarball":"https://registry.npmjs.org/@bun-win32/magnification/-/magnification-2.0.0.tgz","fileCount":6,"integrity":"sha512-fa3mHCXhhu0fOdkg+V3dVS7SjPxObsuqlHiQP1MEwHs/DZNzc3jyHeE5cz4rpBLOgaECGsLgL0aUJAPWoG1HlA==","signatures":[{"sig":"MEUCIFkPrUuIeRwOnenlvEioFUTgZgVtKq1VnPqKYID/U2mFAiEAgoprlBeBybygcQn7dQy2AbrScuQTRrza3l0pOpmN3ag=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":17488},"main":"./index.ts","type":"module","module":"index.ts","shasum":"c9add7cfc3650b1ecdf7fdc1efb4de90d272fd55","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:screen-color-lab":"bun ./example/screen-color-lab.ts","example:magnification-diagnostic":"bun ./example/magnification-diagnostic.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev.p@outlook.com"},"_integrity":"sha512-fa3mHCXhhu0fOdkg+V3dVS7SjPxObsuqlHiQP1MEwHs/DZNzc3jyHeE5cz4rpBLOgaECGsLgL0aUJAPWoG1HlA==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/magnification"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 Magnification 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","@bun-win32/user32":"4.0.0","@bun-win32/kernel32":"2.0.0"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/magnification_2.0.0_1782435326655_0.8911766933296581","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 Magnification bindings for Bun (FFI) on Windows.","devDependencies":{"@bun-win32/kernel32":"2.0.1","@bun-win32/user32":"4.0.1","@types/bun":"latest"},"exports":{".":"./index.ts"},"license":"MIT","module":"index.ts","name":"@bun-win32/magnification","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/magnification"},"type":"module","version":"2.0.1","main":"./index.ts","keywords":["bun","ffi","win32","windows","magnification","bindings","typescript","dll"],"sideEffects":false,"engines":{"bun":">=1.1.0"},"scripts":{"example:screen-color-lab":"bun ./example/screen-color-lab.ts","example:magnification-diagnostic":"bun ./example/magnification-diagnostic.ts"},"_id":"@bun-win32/magnification@2.0.1","_integrity":"sha512-RKW53Y73zFBkBCvFIBSm1SGiM5onDjdo23UVT4I4h2DZaYTdnNjPpXFVzby7e+z8+0PvH0EhtUd5B6YdhccKXQ==","_nodeVersion":"26.3.0","_npmVersion":"10.8.3","shasum":"21915c20a5f1ebebe24f16295b89a0a58d24aeaf","dist":{"integrity":"sha512-RKW53Y73zFBkBCvFIBSm1SGiM5onDjdo23UVT4I4h2DZaYTdnNjPpXFVzby7e+z8+0PvH0EhtUd5B6YdhccKXQ==","shasum":"21915c20a5f1ebebe24f16295b89a0a58d24aeaf","tarball":"https://registry.npmjs.org/@bun-win32/magnification/-/magnification-2.0.1.tgz","fileCount":6,"unpackedSize":17488,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIC1qPbwg+xTiHnrWmDyYCXZRFW6tvoD5wmz4U6b8cgvZAiAfmYYK8/r+a/kL/o0Zlh1dvMzdh73bgLaCjMSN9E45sw=="}]},"_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/magnification_2.0.1_1782438120579_0.48192053909882726"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-18T02:56:51.118Z","modified":"2026-06-26T01:42:00.809Z","1.0.0":"2026-05-18T02:56:51.407Z","2.0.0":"2026-06-26T00:55:26.801Z","2.0.1":"2026-06-26T01:42:00.710Z"},"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","magnification","bindings","typescript","dll"],"repository":{"type":"git","url":"git://github.com/ObscuritySRL/bun-win32.git","directory":"packages/magnification"},"description":"Zero-dependency, zero-overhead Win32 Magnification bindings for Bun (FFI) on Windows.","maintainers":[{"name":"obscuritysrl","email":"stev.p@outlook.com"}],"readme":"# @bun-win32/magnification\n\nZero-dependency, zero-overhead Win32 Magnification bindings for [Bun](https://bun.sh) on Windows.\n\n## Overview\n\n`@bun-win32/magnification` exposes the `magnification.dll` exports using [Bun](https://bun.sh)'s FFI. It provides a single class, `Magnification`, 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 `magnification.dll` (full-screen color effects, magnifier transforms, window filtering, and pen/touch input remapping).\n- In-source docs in `structs/Magnification.ts` with links to Microsoft Docs.\n- Lazy binding on first call; optional eager preload (`Magnification.Preload()`).\n- No wrapper overhead; calls map 1:1 to native APIs.\n- Strongly-typed Win32 aliases (see `types/Magnification.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/magnification\n```\n\n## Quick Start\n\n```ts\nimport Magnification from '@bun-win32/magnification';\n\n// Create the magnifier runtime objects.\nMagnification.MagInitialize();\n\n// Recolor the ENTIRE desktop with a 5x5 color-transform matrix\n// (MAGCOLOREFFECT = float transform[5][5], row-major, 100 bytes).\n// This one converts the whole screen to grayscale.\nconst grayscale = Buffer.from(new Float32Array([0.3, 0.3, 0.3, 0, 0, 0.59, 0.59, 0.59, 0, 0, 0.11, 0.11, 0.11, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1]).buffer);\nMagnification.MagSetFullscreenColorEffect(grayscale.ptr);\n\n// Read the current full-screen zoom factor and pan offsets.\nconst magLevel = Buffer.alloc(4);\nconst xOffset = Buffer.alloc(4);\nconst yOffset = Buffer.alloc(4);\nMagnification.MagGetFullscreenTransform(magLevel.ptr, xOffset.ptr, yOffset.ptr);\nconsole.log(magLevel.readFloatLE(0), xOffset.readInt32LE(0), yOffset.readInt32LE(0));\n\n// Pass null to MagSetColorEffect to remove a magnifier-control color effect.\n// Always undo a full-screen effect when done (identity matrix restores colors).\nMagnification.MagUninitialize();\n```\n\n> [!NOTE]\n> `MagSetWindowSource` takes a `RECT` **by value**. On the x64 ABI a 16-byte\n> aggregate is passed by a pointer to a caller-allocated copy, so allocate a\n> 16-byte `Buffer` (`LONG left, top, right, bottom`) and pass `.ptr`.\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/screen-color-lab.ts          # creative: recolor the whole desktop live\nbun run example/magnification-diagnostic.ts  # professional: full read-only audit\n```\n\n## Notes\n\n- Either rely on lazy binding or call `Magnification.Preload()`.\n- Full-screen effects (`MagSetFullscreenColorEffect`, `MagSetFullscreenTransform`) require Windows 8+ and a local desktop session; they are typically rejected over RDP.\n- `MagSetInputTransform` requires the calling process to have UIAccess privileges.\n- `MagSetImageScalingCallback` / `MagGetImageScalingCallback` are deprecated since Windows 7 and only function with DWM off.\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"}