Refactor to use MHP_ENABLE_SAFETY_CHECKS, MHP_ENABLE_STACKTRACE, and MHP_ENABLE_MIMALLOC for feature toggling. Remove FreeList allocator in JobSchedular and debug-layer code, simplifying memory management. Improve memory leak detection and reporting, update memory allocation API, and guard all safety/debug features with new defines. Update csproj files, README, and code samples to match new API and toggles. Fix and improve collection types for correct behavior with and without safety checks. The codebase is now more modular and easier to configure for different build environments. BREAKING CHANGE: Old defines (ENABLE_SAFETY_CHECKS, ENABLE_DEBUG_LAYER, ENABLE_MIMALLOC) are replaced with MHP_* equivalents. FreeList allocator and related debug features are removed. Some APIs and behaviors have changed for safety/debug configuration.
Misaki.HighPerformance.Image
STB-based image loading and translation helpers for C#.
This package focuses on practical image decoding with low-level control over memory ownership and result handling.
What it includes
- image loading from streams and memory
- animated GIF frame enumeration
- image metadata and result wrappers
- runtime helpers and native memory statistics
- translation layers for STB image formats
Highlights
- allocates image data in unmanaged memory
- exposes width, height, and component information alongside the pixel buffer
- useful when you need simple decoding without a heavy graphics dependency
- supports animated frame workflows in addition to single image loads
Main types
StbImageImageResultImageInfoAnimatedGifEnumeratorAnimatedFrameResultImageResultFloatColorComponents
Example
using Misaki.HighPerformance.Image;
using var stream = File.OpenRead("image.png");
using ImageResult image = ImageResult.FromStream(stream);
Span<byte> pixels = image.AsSpan();
Package reference
dotnet add package Misaki.HighPerformance.Image
Notes
This project targets net10.0 and uses unsafe code for image memory handling.