Namespace Egami
Classes
- CorruptDataException
Thrown when data matches a format but breaks its rules, such as a bad checksum, a truncated stream or an invalid table.
- DiagnosticReporter
One call's link to Diagnostics, with the same level filter and per-id cap Egami's own readers and writers use. Get one from StartDiagnostics() at the start of a call (format plug-ins use Diagnostics) and dispose it when the call ends. When the context has no handler it is a shared instance that does nothing, so reporting costs one check.
- EgamiContext
Every setting that is not specific to one call: where memory comes from, how many threads an operation may use, and the safety limits. Contexts are immutable and safe to share. Change one with a
withexpression.
- EgamiException
The base class of every exception Egami throws for problems with image data or limits.
- EgamiTracing
Names the ActivitySource through which Egami times its loads, probes, saves and transcodes, for OpenTelemetry or any other ActivityListener. Nothing is started, timed or allocated while nobody listens to it.
- FrameList<TPixel>
The frames of a raster, all the same size and pixel type. There is always at least one. Frames added from anywhere are copied, so a frame belongs to one raster only.
- Frame<TPixel>
One frame of a raster: a pixel plane the size of the raster plus per-frame metadata.
- InkCoverage
How much ink an InkRaster prints, from MeasureCoverage(float).
- InkPlate
One plane of an InkRaster: an ink's plate, or the alpha plane. Rows are read and written in place; AsRaster<TPixel>() shows the plane as a gray raster without copying.
- InkRaster
A printed page as plates: one plane per ink of an InkSet (a disabled spot has none) plus one alpha plane, each 8 or 16 bits. A plane holds the ink as it prints over paper, 0 for none to the depth's maximum for full ink: drawing translucently leaves less ink, so the planes are premultiplied by the alpha plane, and a plate is ready to print as it is. A new raster is blank: no ink, alpha 0.
- InkTiffOptions
How an InkRaster is saved as a separated TIFF.
- LimitExceededException
Thrown when a SafetyLimits limit is exceeded.
- MipChain
A chain of ever-halved copies of an image, for making many smaller sizes fast: each resize starts from the smallest level that is still at least twice the target, so a gallery of thumbnail sizes reads each source pixel about once instead of once per size. Level 0 is the source itself; each next level halves the size, rounding up, by averaging 2 × 2 blocks of premultiplied pixels.
- PixelMemoryLeakEventArgs
Describes a pixel memory block that was collected without being disposed.
- PixelMemoryUsage
What a PooledPixelMemorySource has handed out and not yet had back, and opt-in tracking of blocks that were never disposed. Get it from Usage; most callers want
PooledPixelMemorySource.Shared.Usage.
- PixelPlane<TPixel>
A width × height grid of pixels, stored row by row. A row is always one contiguous span, but the plane as a whole may be split into several blocks of whole rows. Planes belong to the raster or operation that hands them out, which returns their memory; user code reads and writes them but never frees them.
- PooledPixelMemorySource
The default IPixelMemorySource. Small blocks are arrays rented from a shared pool; larger blocks are unmanaged memory aligned to 64 bytes, which stays off the large object heap and suits SIMD. Planes larger than MaxBlockBytes are split into several blocks of whole rows.
- ProofOptions
How Proof<TPixel>(ProofOptions?) shows the plates on screen.
- Raster
Measuring images: comparison, statistics, histograms, colors and a pixel signature. Nothing here changes a raster.
- RasterDecoder
One open image, decoded a band of rows or a frame at a time. Opening reads the header and the metadata that comes before the image data; ReadRows<TPixel>(Raster<TPixel>) and ReadFrame<TPixel>(Raster<TPixel>) then hand out the image in any pixel type, with Region and MinimumSize applied as in Load(Stream, EgamiContext?, ReaderOptions?).
- RasterEncoder
Creates a RasterEncoder<TPixel>, which writes an image a band of rows or a frame at a time.
- RasterEncoder<TPixel>
An image being written a band of rows or a frame at a time, so a huge image never has to exist whole. The bytes are the ones Save(Stream, FormatInfo, WriterOptions?) writes for the same pixels and options, except where a format must write differently without seeking: top-down BMP and TGA rows, and run-length TGA, which is always top-down. Options that need every pixel before the first byte (automatic palettes, PNG's Reduce, automatic alpha) throw at Create instead of quietly writing something else.
- RasterList
The images of a file that holds several, each its own raster with its own size, pixel type and metadata: a TIFF's pages, an icon's entries. The list owns them: disposing it disposes every raster.
- Raster<TPixel>
An image whose pixels are of type
TPixel. Pixel access is by row span.
- SafetyLimits
Limits that protect against hostile or broken files. Readers check sizes from the header before allocating any pixel memory. The defaults let normal photos and screenshots through. Change them with a
withexpression.
- SpritePackOptions
How Pack(IReadOnlyList<Raster>, SpritePackOptions?) lays sprites out.
- SpriteSheet
A sprite sheet: many images packed into one, with the rectangle of each. Packing uses the MaxRects algorithm with the best short side fit (Jylänki, "A Thousand Ways to Pack the Bin", 2010), the images taken by height, tallest first, and then by input order, so the same inputs always give the same sheet. Sprites are never rotated.
- UnsupportedFormatException
Thrown when no registered format matches the data, or the matching format cannot read or write.
- YuvConvertOptions
The chroma filters for conversions between a YuvRaster and a Raster.
- YuvPlane<TSample>
One plane of a YuvRaster<TSample>: a width × height grid of raw samples, stored row by row. A row is always one contiguous span. Samples are stored low-bit aligned: a 10-bit sample is 0 to 1023 in a ushort.
- YuvRaster
A picture held as separate luma (Y) and chroma (U, V) planes, plus an optional alpha plane, the way video codecs, AVIF, lossy WebP and JPEG store it. This base class is used when the sample type is not known at compile time; YuvRaster<TSample> gives the planes. Convert to and from a Raster with ToRaster(YuvConvertOptions?), CopyTo<TPixel>(Raster<TPixel>, YuvConvertOptions?, CancellationToken) and FromRaster(Raster, ChromaFormat, YuvColor, bool, YuvConvertOptions?).
- YuvRasterInfo
What Probe(Stream, EgamiContext?, ReaderOptions?) reads from a header: the image as Probe(Stream, EgamiContext?, ReaderOptions?) describes it, and the planes Load(Stream, EgamiContext?, ReaderOptions?) would give, if any.
- YuvRaster<TSample>
A picture held as separate Y, U, V and optional alpha planes of
TSamplesamples. See YuvRaster.
Structs
- EgamiDiagnostic
One event reported to Diagnostics, and the type of each entry in Warnings. Ids are listed in the diagnostics article and never renamed or reused.
- Point
A position in pixels. X grows to the right and Y downward; the top-left pixel is (0, 0).
- Rect
A rectangle of pixels: the top-left corner and a size.
- SaveProgress
How far a save such as Save(string, WriterOptions?, IProgress<SaveProgress>?, CancellationToken) has come. A save reports once as it starts, then at most every 250 ms, then once more with IsFinal set.
- Size
A width and height in pixels.
Interfaces
- IPixelMemorySource
Supplies the memory behind every PixelPlane<TPixel>. Implement it to control where pixel memory comes from. Implementations must be thread-safe.
Enums
- Alignment
Where a smaller image sits across the layout's direction: at the start (left or top), the center or the end.
- Axis
The direction images are laid out in by Append(IReadOnlyList<Raster>, Axis, int, Rgba8, Alignment).
- ChromaDownsampling
How chroma is reduced to the chroma resolution when a raster converts to a subsampled YuvRaster.
- ChromaUpsampling
How chroma is brought up to luma resolution when a YuvRaster converts to RGB.
- ClearMode
Says whether new pixel memory is cleared.
- DecodeStatus
Where a RasterDecoder stands, as Status reports it.
- DiagnosticLevel
How much an EgamiDiagnostic matters. Maps one to one onto the Debug, Information and Warning log levels.
Delegates
- RowAction<TPixel>
Processes one row of pixels.