Class InkPlate
- Namespace
- Egami
- Assembly
- Egami.dll
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.
public sealed class InkPlate
- Inheritance
-
InkPlate
- Inherited Members
Examples
// A page as plates: CMYK and the spot, 8 bits each, plus alpha. Rows are written in place; a plate is also a gray raster.
using InkRaster page = new(inks, 200, 100, InkDepth.Unorm8);
page.Plate("PANTONE 186 C")!.Row8(10).Fill(255); // a full-tint line of the spot
page.Alpha.Row8(10).Fill(255);
using Raster<Gray8> spot = page.Plate("PANTONE 186 C")!.AsRaster<Gray8>(); // no copy: 0 = no ink, 255 = full ink
Properties
Colorant
Gets the ink, or null for the alpha plane.
public Colorant? Colorant { get; }
Property Value
Depth
Gets the bits per pixel.
public InkDepth Depth { get; }
Property Value
Height
Gets the height in pixels.
public int Height { get; }
Property Value
Name
Gets the ink's name, or Alpha for the alpha plane.
public string Name { get; }
Property Value
Width
Gets the width in pixels.
public int Width { get; }
Property Value
Methods
AsRaster<TPixel>()
Returns the plane as a gray raster over the same memory, without copying: Gray8 for an 8-bit plane, Gray16 for a 16-bit one. Writing to it writes the plate. 0 is no ink and the maximum full ink, so saved as an image the plate shows ink as light. Dispose the raster when done; it frees nothing, and stops working when the ink raster is disposed. An operation that changes its size gives it memory of its own.
public Raster<TPixel> AsRaster<TPixel>() where TPixel : unmanaged, IPixelType<TPixel>
Returns
- Raster<TPixel>
The raster.
Type Parameters
Exceptions
- InvalidOperationException
TPixeldoes not match the plane's depth.- ObjectDisposedException
The raster has been disposed.
Row16(int)
Returns a row of a 16-bit plane, to read or write in place.
public Span<ushort> Row16(int y)
Parameters
Returns
Exceptions
- InvalidOperationException
The plane is 8-bit.
- ArgumentOutOfRangeException
yis outside the plane.- ObjectDisposedException
The raster has been disposed.
Row8(int)
Returns a row of an 8-bit plane, to read or write in place.
public Span<byte> Row8(int y)
Parameters
Returns
Exceptions
- InvalidOperationException
The plane is 16-bit.
- ArgumentOutOfRangeException
yis outside the plane.- ObjectDisposedException
The raster has been disposed.
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.