SharpAstro
NuGet publisher profile
Packages (46)
TianWen.Lib
Astronomical imaging and device-control library for .NET: cameras, mounts, focusers, filter wheels, cover/calibrators and guiders over ASCOM, Alpaca, ZWO, QHYCCD, Meade LX200, Skywatcher, OnStep and PHD2, plus plate solving, deep-sky and planetary stacking, auto-focus and unattended session automation. First-class multi-OTA (dual rig) support. AOT compatible.
DIR.Lib
Device-Independent input and Rendering library for .NET: surface-neutral drawing primitives, an immutable layout DSL, a widget toolkit, font rasterization (bitmap + SDF) and font fallback, shared by GPU (SDL3 + Vulkan), terminal and browser (WebGL2 / Blazor WebAssembly) front ends. Pure managed, AOT compatible, no native dependencies.
FC.SDK
Canon EOS camera control via PTP over USB and WiFi — pure managed C#, no EDSDK binary required
SharpAstro.Png
Pure-managed PNG encoder + decoder for .NET. Writer: adaptive per-row filter selection (libpng "minimum sum of absolute values" heuristic), 8/16-bit RGBA/Gray. Reader: chunk parsing with CRC validation, color types 0/2/4/6 at 8/16-bit. Both sides handle iCCP / sRGB / gAMA / cHRM / eXIf metadata plus PNG-3 HDR signaling chunks cICP (Coding-Independent Code Points), mDCv (Mastering Display Color Volume), cLLI (Content Light Level Info) — full HDR10 / HLG round-trip. Also exports PngPredictor as a reusable row-unfilter building block (TIFF Predictor=2 / PDF FlateDecode). AOT-compatible.
SharpAstro.LALR.CC
LALR(1) parser-table generator and runtime in C#. Includes a YAML grammar source generator that emits a typed AST + visitor surface from `*.lalr.yaml` files at build time.
SharpAstro.Color.Icc
ICC v4 colour-management primitives for .NET image-codec consumers. Bundled sRGB v4 profile (588-byte LittleCMS-generated, ReadOnlyMemory<byte> for embedding in TIFF/PNG/JPEG) plus a WithCicp(...) helper that injects an ICC v4.4 cicp tag carrying H.273 colour-primaries / transfer-function codepoints, so HDR10, HLG, wide-gamut, and linear-scene-light signalling can be added on top of any base profile. The H.273 ColorPrimaries / TransferFunction / MatrixCoefficients enums (shared with SharpAstro.Png's PNG-3 cICP chunk) live in SharpAstro.Codecs.Abstractions as of 3.5. AOT-compatible.
SharpAstro.Fonts
Pure-managed, MIT-licensed C# OpenType / TrueType font loader and rasterizer.
SharpAstro.Codecs.Abstractions
Shared abstractions for the SharpAstro image codec family: IImageDecoder (magic-byte sniff + fidelity/zero-copy decode) and IDecodedImage / RasterImage (a codec-neutral decoded raster). Ships the ITU-T H.273 colour vocabulary (ColorPrimaries / TransferFunction / MatrixCoefficients) and a ColorEncoding record surfacing what decoded samples mean (sRGB, PQ/HLG HDR, linear light). AOT-compatible, zero runtime dependencies.
SharpAstro.Tiff
Pure-managed TIFF reader/writer for .NET. Supports multi-page, 8/16/32-bit uint and IEEE-Float samples, Uncompressed/Deflate/ZlibPkzip/LZW, Predictor 2 (horizontal differencing) on read, contig planar config, SampleFormat/SMin/SMax/ICC round-trip, both II and MM byte order. AOT-compatible.
TianWen.DAL
Defines a vendor-neutral access layer for consumer astronomical devices like ZWO, SvBony, etc.
SdlVulkan.Renderer
SDL3 + Vulkan rendering backend for DIR.Lib's Renderer<TSurface>: window, device and swapchain lifecycle, pre-baked SPIR-V pipelines, bitmap and MSDF glyph atlases, and a surfaceless offscreen path for headless rendering and tests. Desktop and Android, AOT compatible.
SharpAstro.Jpeg
Pure-managed JPEG (ITU-T T.81 / ISO 10918) codec for .NET. Decoder: baseline sequential + progressive DCT, restart intervals, 4:4:4 / 4:2:2 / 4:2:0 / arbitrary chroma subsampling, grayscale, YCbCr, RGB-marked, and Adobe CMYK / YCCK (APP14) streams, plus scaled decode at 1/2, 1/4, 1/8 resolution via reduced inverse DCT — a 33-megapixel source can decode straight to a thumbnail-sized raster without the full-resolution intermediate ever existing. Encoder (3.6): baseline sequential DCT, 4:4:4 / 4:2:0, quality 1..100 — a faithful port of the stb_image_write JPEG writer, byte-for-byte identical to that reference. Decode-to-caller-buffer API with ArrayPool-backed internals; JpegSegmentScanner surfaces APPn metadata segments. Full-scale decode is byte-exact against the StbImageSharp (stb_image) reference decoder. AOT-compatible.
ZWOptical.SDK
Implements accessing the ZWO ASI, EAF and EFW devices using .NET
Console.Lib
Terminal application toolkit for .NET: dock-based layouts that recompute on resize, a widget set (text bars, scrollable lists, tree views, text areas, menus, Markdown), mouse and keyboard input, VT styling, and a fast Sixel graphics encoder with sextant / half-block fallbacks. Built on DIR.Lib, AOT compatible.
SharpAstro.Exif
Pure-managed EXIF metadata reader for .NET. Parses EXIF blobs from JPEG (APP1), TIFF (sub-IFD), and PNG (eXIf chunk) — all of which share the same TIFF-IFD structure. Strongly-typed projection of well-known tags + raw tag map for the long tail / vendor MakerNote.
FITS.Lib
Supports reading and writing FITS files
FC.SDK.Raw
Canon CR2 / CR3 raw-file decoder — pure managed C#, no external libraw / dcraw / EDSDK. Sibling to FC.SDK (Canon PTP device communication): one package for talking to the camera, one for decoding the files it writes.
SharpAstro.Jxr
Pure-managed JPEG XR (ITU-T T.832 / ISO/IEC 29199-2) encoder/decoder for .NET. AOT-compatible. The codec core is ported faithfully from Microsoft's jxrlib reference implementation and validated bit-exactly against it (byte-for-byte vs JxrEncApp; round-trips through JxrDecApp and Windows Photo / WIC). Reuses SharpAstro.Tiff for the T.833 .jxr container. Current pipeline: single-tile spatial YUV444 BD8 RGB, lossless and lossy, all three overlap levels.
SharpAstro.Exr
Pure-managed OpenEXR (.exr) reader/writer for .NET. Scanline images, HALF/FLOAT/UINT channels, NONE/RLE/ZIP/ZIPS/PIZ compression. AOT-compatible.
SharpAstro.Jbig2
Pure-managed JBIG2 (ITU-T T.88) bilevel image decoder for .NET, written clean-room from the specification and aimed at PDF's /JBIG2Decode filter. A PDF-embedded JBIG2 stream is not a file — it has no file header, its segment dictionaries live out of band in /DecodeParms /JBIG2Globals, and its dimensions come from the image dictionary — so the primary entry point takes exactly those pieces: Jbig2Decoder.Decode(embedded, globals, width, height). Standalone .jb2 files (sequential and random-access organisation) also decode, and register with the SharpAstro.Codecs facade by magic bytes. Scope in 3.7: the complete arithmetic decoding path — MQ arithmetic decoder (Annex E), generic regions both ways (templates 0-3 with TPGDON and arbitrary AT pixels, and MMR / ITU-T T.6, the CCITT Group 4 coding), generic refinement regions, symbol dictionaries and text regions (every reference corner, transposed strips, per-instance refinement, refine/aggregate symbols, and cross-stream dictionaries via /JBIG2Globals), pattern dictionaries and halftone regions, page information, and region composition (OR/AND/XOR/XNOR/REPLACE). Validated against jbig2enc output, libtiff Group 4 output, and the jbig2dec reference decoder. Not implemented: the Huffman-coded variants (SDHUFF/SBHUFF and custom table segments), MMR inside pattern dictionaries and halftone regions, HENABLESKIP, and TPGRON in a refinement region — each throws NotSupportedException naming the feature rather than returning a wrong raster. Output is one byte per pixel (1 = black, T.88's own polarity) plus an 8-bit grey projection; /Decode inversion and ImageMask semantics stay in the caller's PDF layer. Hardened in 3.8 against hostile streams — since a PDF-supplied codestream chooses its own region dimensions and T.88's arithmetic decoder keeps producing decisions past the end of its data, decoding is bounded by a 2^28-pixel ceiling per bitmap plus a total budget scaled to the caller's page size, and every decoding loop is guaranteed to make progress; malformed input raises InvalidDataException rather than exhausting memory or spinning. AOT-compatible.
QHYCCD.SDK
Implements accessing the QHYCCD cameras using .NET
SharpAstro.Jxl
Pure-managed JPEG XL (.jxl) codec for .NET. Clean-room implementation against ISO/IEC 18181, validated against the Magick.NET (libjxl) oracle. AOT-compatible.
SharpAstro.Codecs
Image-codec facade over the SharpAstro codec family: sniff a byte stream's format by its magic-byte signature and dispatch to the matching decoder (PNG, JPEG, TIFF, JPEG XR, OpenEXR, JPEG XL, JBIG2), returning a codec-neutral IDecodedImage (fidelity tier: native bit depth + ColorEncoding colour signalling, with a ToFloats() RGBA float32 view) or decoding zero-copy into a caller-provided 8-bit RGBA buffer (display tier, integer-sample formats). AOT-compatible.
SharpAstro.Jpeg.GainMap
Gain-map ("Ultra HDR") JPEG support: read, assemble, and generate Adobe hdrgm 1.0 / Android Ultra HDR v1 gain-map JPEGs (GContainer XMP + MPF, the form Chromium renders as HDR). Splices metadata around baseline JPEGs from any encoder (the IccInjector pattern), decodes both renditions via SharpAstro.Jpeg, and reconstructs display-adaptive HDR linear floats. Pure-managed, AOT-compatible.
SdlVulkan.Renderer.WebView.Native
Native WebView2Loader.dll assets (win-x64 / win-arm64 / win-x86) for SdlVulkan.Renderer.WebView.
WebGl.Renderer
WebGL2 rendering backend for DIR.Lib's Renderer<TSurface> — Blazor WebAssembly, command-buffer JS interop, MSDF text via the shared SdfFontAtlas core. AOT compatible.
SER.Lib
Reader and writer for the SER planetary-imaging video format (Lucam Recorder, spec v3), with memory-mapped frame-accurate random access and per-frame timestamps. Pure managed, AOT/trim friendly.
SharpAstro.Jpeg.IccInjector
Splice an ICC profile (APP2 segment) into an existing JPEG byte stream produced by any encoder. Pure-managed, AOT-compatible, single-segment ICC only (up to 65519-byte profiles). Note: this is NOT a JPEG codec — the JPEG decoder and encoder both live in the SharpAstro.Jpeg package; this stays a focused metadata-splicing helper.
SdlVulkan.Renderer.WebView
Cross-platform native WebView (WebView2 / WebKitGTK / WKWebView) hosted inside an SdlVulkan.Renderer window.
SdlVulkan.Renderer.Inspector
MCP server that discovers running Debug-build SDL3+Vulkan apps (built on SdlVulkan.Renderer) on the LAN and lets an AI agent inspect, screenshot, and drive their live UI.
Lzip.Lib
Pure-managed lzip (LZMA1) codec: a fast, AOT/trim-friendly compressor and decompressor for the lzip container format, including multi-member files with parallel decode and -b-style member splitting. Output is read by the reference lzip binary. No external lzip binary required.
SharpAstro.AppShell
Desktop app-shell plumbing for single-window native applications: a named-pipe single-instance gate that hands a later launch's file to the already-running process, scoped by whatever identity the app chooses (whole-app, or one instance per open folder), plus the Windows foreground-activation handshake that lets the running window actually come to the front.
DIR.Lib.Shaping
Pure-managed OpenType text-shaping adapter for DIR.Lib: an ITextShaper backed by SharpAstro.Fonts.Shaping (script itemization, GSUB/GPOS, Arabic joining, RTL). Optional satellite — DIR.Lib core stays shaping-free.
SharpAstro.StbImage
SharpAstro fork of StbImageSharp — pure-managed C# port of stb_image.h. Decodes JPG (baseline), PNG, BMP, TGA, PSD, GIF, HDR. AOT-compatible, no native binaries.
SharpAstro.Fonts.Shaping
Pure-managed OpenType text-shaping engine (GSUB/GPOS/GDEF) over SharpAstro.Fonts. AOT-compatible, no native dependencies. Staged scope: OT-layout core, ligatures/kerning/marks, Arabic joining; Indic/USE out of scope.
TianWen.Devices.Native
Native vendor device drivers for TianWen: ZWO (ASI cameras, EAF focusers, EFW filter wheels) and QHYCCD (cameras, filter wheels, QFOC focusers), over the vendors' own SDKs. Reference this alongside TianWen.Lib to drive that hardware; TianWen.Lib alone covers ASCOM, Alpaca and the serial-native drivers and carries no vendor binaries.
LAN.Lib
Zero-dependency LAN peer discovery: a symmetric UDP announce beacon + self-expiring peer table over a shared broadcast domain, filtered by service name, with a stable-node-id concept and an extensible property bag. TimeProvider-driven (deterministic in tests), AOT/trim friendly, with a DI extension for the .NET generic host.
mdcat
A 'cat' for Markdown — render Markdown files (and stdin) to styled terminal output: headings, lists, code blocks, OSC 8 hyperlinks, and LaTeX math (sixel/sextant/half-block).
PlayerOne.SDK
Implements accessing Player One cameras and filter wheels using .NET
ToupTek.SDK
Implements accessing ToupTek cameras, and the rebadged families on the same SDK, using .NET
Console.Lib.Inspector
MCP server that discovers running Debug-build terminal apps (built on Console.Lib) and lets an AI agent read their screen as text, inspect app state, and drive them with injected keys and clicks.
DIR.Lib.IconBaker
Bakes font glyphs into coverage-run tables as generated C#, so an app can draw icons as tintable rectangles with no font installed at runtime. Wraps DIR.Lib's IconBaker.
SharpAstro.Jpeg2000
Pure-managed JPEG 2000 (ITU-T T.800 / ISO-IEC 15444-1, Part 1) image decoder for .NET, written clean-room from the specification and aimed at PDF's /JPXDecode filter. Decodes the raw J2K codestream and the JP2 container, registering with the SharpAstro.Codecs facade by magic bytes. AOT-compatible. Decode only, Part 1 only.
SharpAstro.FreeType
Cross-platform managed FreeType2 library with COLRv1 color glyph support. Fork of FreeTypeSharp with FreeType 2.14.2.
SharpAstro.FreeTypeBindings
Cross-platform managed FreeType2 library with COLRv1 color glyph support. Fork of FreeTypeSharp with FreeType 2.14.2.
Serial.Lib
Serial port I/O that does one job well: cancellable, deadline-honouring reads and writes that never abort spuriously (the CH34x ERROR_OPERATION_ABORTED trap of System.IO.Ports async reads), a bounded open and close, typed failures (timeout with the partial reply, framing, device removed, port busy, I/O the driver never completed), and port enumeration with a stable hardware identity (USB VID/PID, serial number, socket location).