Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Proposal: Add Span overloads to System.Drawing APIs #10763

Closed
JeremyKuhne opened this issue Jan 30, 2024 · 1 comment
Closed

API Proposal: Add Span overloads to System.Drawing APIs #10763

JeremyKuhne opened this issue Jan 30, 2024 · 1 comment
Assignees
Labels
api-approved (4) API was approved in API review, it can be implemented area-System.Drawing System.Drawing issues
Milestone

Comments

@JeremyKuhne
Copy link
Member

JeremyKuhne commented Jan 30, 2024

Background and motivation

Allocating temporary arrays contributes to the "slowness" of drawing with System.Drawing. To avoid allocating arrays or allow allocating them on the stack we need Span overloads. In addition, where applicable we want to add params to facilitate the params ReadOnlySpan<T> overload pattern.

API Proposal

params on ReadOnlySpan<T> is pending on the feature being implemented. APIs will be added without params until then.

namespace System.Drawing;

public class Graphics
{
-   public void DrawRectangles(Pen pen, Rectangle[] rects);
+   public void DrawRectangles(Pen pen, params Rectangle[] rects);
+   public void DrawRectangles(Pen pen, params ReadOnlySpan<Rectangle> rects);
-   public void DrawRectangles(Pen pen, RectangleF[] rects);
+   public void DrawRectangles(Pen pen, params RectangleF[] rects);
+   public void DrawRectangles(Pen pen, params ReadOnlySpan<RectangleF> rects);
-   public void DrawPolygon(Pen pen, Point[] points);
+   public void DrawPolygon(Pen pen, params Point[] points);
+   public void DrawPolygon(Pen pen, params ReadOnlySpan<Point> points);
-   public void DrawPolygon(Pen pen, PointF[] points);
+   public void DrawPolygon(Pen pen, params PointF[] points);
+   public void DrawPolygon(Pen pen, params ReadOnlySpan<PointF> points);
-   public void DrawCurve(Pen pen, Point[] points);
+   public void DrawCurve(Pen pen, params Point[] points);
+   public void DrawCurve(Pen pen, params ReadOnlySpan<Point> points);
    public void DrawCurve(Pen pen, Point[] points, float tension);
+   public void DrawCurve(Pen pen, ReadOnlySpan<Point> points, float tension);
    public void DrawCurve(Pen pen, Point[] points, int offset, int numberOfSegments);
+   public void DrawCurve(Pen pen, ReadOnlySpan<Point> points, int offset, int numberOfSegments);
    public void DrawCurve(Pen pen, Point[] points, int offset, int numberOfSegments, float tension);
+   public void DrawCurve(Pen pen, ReadOnlySpan<Point> points, int offset, int numberOfSegments, float tension);
-   public void DrawCurve(Pen pen, PointF[] points);
+   public void DrawCurve(Pen pen, params PointF[] points);
+   public void DrawCurve(Pen pen, params ReadOnlySpan<PointF> points);
    public void DrawCurve(Pen pen, PointF[] points, float tension);
+   public void DrawCurve(Pen pen, ReadOnlySpan<PointF> points, float tension);
    public void DrawCurve(Pen pen, PointF[] points, int offset, int numberOfSegments);
+   public void DrawCurve(Pen pen, ReadOnlySpan<PointF> points, int offset, int numberOfSegments);
    public void DrawCurve(Pen pen, PointF[] points, int offset, int numberOfSegments, float tension);
+   public void DrawCurve(Pen pen, ReadOnlySpan<PointF> points, int offset, int numberOfSegments, float tension);
-   public void DrawClosedCurve(Pen pen, Point[] points);
+   public void DrawClosedCurve(Pen pen, params Point[] points);
+   public void DrawClosedCurve(Pen pen, params ReadOnlySpan<Point> points);
    public void DrawClosedCurve(Pen pen, Point[] points, float tension, FillMode fillmode);
+   public void DrawClosedCurve(Pen pen, ReadOnlySpan<Point> points, float tension, FillMode fillmode);
-   public void DrawClosedCurve(Pen pen, PointF[] points);
+   public void DrawClosedCurve(Pen pen, params PointF[] points);
+   public void DrawClosedCurve(Pen pen, params ReadOnlySpan<PointF> points);
    public void DrawClosedCurve(Pen pen, PointF[] points, float tension, FillMode fillmode);
+   public void DrawClosedCurve(Pen pen, ReadOnlySpan<PointF> points, float tension, FillMode fillmode);
-   public void FillRectangles(Brush brush, Rectangle[] rects);
+   public void FillRectangles(Brush brush, params Rectangle[] rects);
+   public void FillRectangles(Brush brush, params ReadOnlySpan<Rectangle> rects);
-   public void FillPolygon(Brush brush, Point[] points);
+   public void FillPolygon(Brush brush, params Point[] points);
+   public void FillPolygon(Brush brush, params ReadOnlySpan<Point> points);
    public void FillPolygon(Brush brush, Point[] points, FillMode fillMode);
+   public void FillPolygon(Brush brush, ReadOnlySpan<Point> points, FillMode fillMode)
-   public void FillRectangles(Brush brush, RectangleF[] rects)
+   public void FillRectangles(Brush brush, params RectangleF[] rects)
+   public void FillRectangles(Brush brush, params ReadOnlySpan<RectangleF> rects);
-   public void FillPolygon(Brush brush, PointF[] points);
+   public void FillPolygon(Brush brush, params PointF[] points);
+   public void FillPolygon(Brush brush, params ReadOnlySpan<PointF> points);
    public void FillPolygon(Brush brush, PointF[] points, FillMode fillMode);
+   public void FillPolygon(Brush brush, ReadOnlySpan<PointF> points, FillMode fillMode);
-   public void FillClosedCurve(Brush brush, Point[] points);
+   public void FillClosedCurve(Brush brush, params Point[] points);
+   public void FillClosedCurve(Brush brush, params ReadOnlySpan<Point> points);
    public void FillClosedCurve(Brush brush, Point[] points, FillMode fillmode);
+   public void FillClosedCurve(Brush brush, ReadOnlySpan<Point> points, FillMode fillmode);
-   public void FillClosedCurve(Brush brush, PointF[] points);
+   public void FillClosedCurve(Brush brush, params PointF[] points);
+   public void FillClosedCurve(Brush brush, params ReadOnlySpan<PointF> points);
    public void FillClosedCurve(Brush brush, PointF[] points, FillMode fillmode);
+   public void FillClosedCurve(Brush brush, ReadOnlySpan<PointF> points, FillMode fillmode);
-   public void DrawLines(Pen pen, Point[] points);
+   public void DrawLines(Pen pen, params Point[] points);
+   public void DrawLines(Pen pen, params ReadOnlySpan<Point> points);
-   public void DrawLines(Pen pen, PointF[] points);
+   public void DrawLines(Pen pen, params PointF[] points);
+   public void DrawLines(Pen pen, params ReadOnlySpan<PointF> points);
-   public void DrawBeziers(Pen pen, Point[] points);
+   public void DrawBeziers(Pen pen, params Point[] points);
+   public void DrawBeziers(Pen pen, params ReadOnlySpan<Point> points);
-   public void DrawBeziers(Pen pen, PointF[] points);
+   public void DrawBeziers(Pen pen, params PointF[] points);
+   public void DrawBeziers(Pen pen, params ReadOnlySpan<PointF> points);
}

namespace System.Drawing.Drawing2D;

public class GraphicsPath
{
    public GraphicsPath(Point[] pts, byte[] types);
    public GraphicsPath(Point[] pts, byte[] types, FillMode fillMode);
+   public GraphicsPath(ReadOnlySpan<Point> pts, ReadOnlySpan<byte> types, FillMode fillMode = FillMode.Alternate);
    public GraphicsPath(PointF[] pts, byte[] types);
    public GraphicsPath(PointF[] pts, byte[] types, FillMode fillMode);
+   public GraphicsPath(ReadOnlySpan<PointF> pts, ReadOnlySpan<byte> types, FillMode fillMode = FillMode.Alternate);
-   public void AddLines(Point[] points);
+   public void AddLines(params Point[] points);
+   public void AddLines(params ReadOnlySpan<Point> points);
-   public void AddLines(PointF[] points);
+   public void AddLines(params PointF[] points);
+   public void AddLines(params ReadOnlySpan<PointF> points);
    public void AddBeziers(params Point[] points);
+   public void AddBeziers(params ReadOnlySpan<Point> points);
-   public void AddBeziers(PointF[] points);
+   public void AddBeziers(params PointF[] points);
+   public void AddBeziers(params ReadOnlySpan<PointF> points);
-   public void AddCurve(Point[] points);
+   public void AddCurve(params Point[] points);
+   public void AddCurve(params ReadOnlySpan<Point> points);
    public void AddCurve(Point[] points, float tension);
+   public void AddCurve(ReadOnlySpan<Point> points, float tension);
    public void AddCurve(Point[] points, int offset, int numberOfSegments, float tension);
+   public void AddCurve(ReadOnlySpan<Point> points, int offset, int numberOfSegments, float tension);
-   public void AddCurve(PointF[] points);
+   public void AddCurve(params PointF[] points);
+   public void AddCurve(params ReadOnlySpan<PointF> points);
    public void AddCurve(PointF[] points, float tension);
+   public void AddCurve(ReadOnlySpan<PointF> points, float tension);
    public void AddCurve(PointF[] points, int offset, int numberOfSegments, float tension);
+   public void AddCurve(ReadOnlySpan<PointF> points, int offset, int numberOfSegments, float tension);
-   public void AddClosedCurve(Point[] points);
+   public void AddClosedCurve(params Point[] points);
+   public void AddClosedCurve(params ReadOnlySpan<Point> points);
    public void AddClosedCurve(Point[] points, float tension);
+   public void AddClosedCurve(ReadOnlySpan<Point> points, float tension);
-   public void AddRectangles(Rectangle[] rects);
+   public void AddRectangles(params Rectangle[] rects);
+   public void AddRectangles(params ReadOnlySpan<Rectangle> rects);
-   public void AddPolygon(PointF[] points);
+   public void AddPolygon(params PointF[] points);
+   public void AddPolygon(params ReadOnlySpan<PointF; points);
-   public void AddClosedCurve(PointF[] points);
+   public void AddClosedCurve(params PointF[] points);
+   public void AddClosedCurve(params ReadOnlySpan<PointF> points);
    public void AddClosedCurve(PointF[] points, float tension);
+   public void AddClosedCurve(ReadOnlySpan<PointF> points, float tension);
-   public void AddRectangles(RectangleF[] rects);
+   public void AddRectangles(params RectangleF[] rects);
+   public void AddRectangles(params ReadOnlySpan<RectangleF> rects);
-   public void AddPolygon(PointF[] points);
+   public void AddPolygon(params PointF[] points);
+   public void AddPolygon(params ReadOnlySpan<PointF; points);
    public void Warp(PointF[] destPoints, RectangleF srcRect, Matrix? matrix, WarpMode warpMode, float flatness);
+   public void Warp(ReadOnlySpan<PointF> destPoints, RectangleF srcRect, Matrix? matrix = default, WarpMode warpMode WarpMode.Perspective, float flatness = 0.25f);
    public byte[] PathTypes { get; }
+   public bool TryGetPathTypes(Span<bytes> types, out int count);
    
    // Everything in GDI+ is float internally, so there is no Point version of this
    public PointF[] PathPoints { get; }
+   public bool TryGetPathPoints(Span<PointF> points, out int count);
}

public class ColorMap
{
    public Color OldColor { get; set; }
    public Color NewColor { get; set; }
}

+public readonly record struct ValueColorMap(Color OldColor, Color NewColor);

public class ImageAttributes
{
    public void SetBrushRemapTable(ColorMap[] map);
+   public void SetBrushRemapTable(params ReadOnlySpan<ColorMap> map);

    public void SetRemapTable(ColorMap[] map);
+   public void SetRemapTable(params ReadOnlySpan<ColorMap> map);
+   public void SetRemapTable(params ReadOnlySpan<ValueColorMap> map);
    public void SetRemapTable(ColorMap[] map, ColorAdjustType type);
+   public void SetRemapTable(ColorAdjustType type, params ReadOnlySpan<ColorMap> map);
+   public void SetRemapTable(ColorAdjustType type, params ReadOnlySpan<ValueColorMap> map);
}

API Usage

GraphicsPath path = new();
path.AddLines(new(0,0), new(10,10), new(32, 10), new(40, 40));

using Graphics graphics = Graphics.FromImage(image);
ReadOnlySpan<Rectangle> rectangles = stackalloc Rectangle
[
    new(10, 300, 200, 200),
    new(300, 300, 200, 200),
    new(10, 10, 200, 200),
    new(300, 10, 200, 200)
];

graphics.FillRectangles(Brushes.Red, rectangles);
@JeremyKuhne JeremyKuhne added api-suggestion (1) Early API idea and discussion, it is NOT ready for implementation untriaged The team needs to look at this issue in the next triage labels Jan 30, 2024
@elachlan elachlan added the area-System.Drawing System.Drawing issues label Jan 30, 2024
@JeremyKuhne JeremyKuhne added this to the .NET 9.0 milestone Jan 30, 2024
@merriemcgaw merriemcgaw added api-ready-for-review (2) API is ready for formal API review; applied by the issue owner and removed untriaged The team needs to look at this issue in the next triage labels Jan 30, 2024
@JeremyKuhne JeremyKuhne removed the api-suggestion (1) Early API idea and discussion, it is NOT ready for implementation label Feb 13, 2024
@bartonjs
Copy link
Member

  • GraphicsPath.TryGetPathTypes/TryGetPathPoints changed to non-Try variants and changed the span name to destination.
  • ValueColorMap is replaced with (Color OldColor, Color NewColor).
  • Adjusted ImageAttributes to also do params-array for SetBrushRemapTable/SetRemapTable.
  • The existing SetRemapTable is now marked as EB-Never so .NET9+ callers won't see the shape twist in overloads.
namespace System.Drawing;

public class Graphics
{
-   public void DrawRectangles(Pen pen, Rectangle[] rects);
+   public void DrawRectangles(Pen pen, params Rectangle[] rects);
+   public void DrawRectangles(Pen pen, params ReadOnlySpan<Rectangle> rects);
-   public void DrawRectangles(Pen pen, RectangleF[] rects);
+   public void DrawRectangles(Pen pen, params RectangleF[] rects);
+   public void DrawRectangles(Pen pen, params ReadOnlySpan<RectangleF> rects);
-   public void DrawPolygon(Pen pen, Point[] points);
+   public void DrawPolygon(Pen pen, params Point[] points);
+   public void DrawPolygon(Pen pen, params ReadOnlySpan<Point> points);
-   public void DrawPolygon(Pen pen, PointF[] points);
+   public void DrawPolygon(Pen pen, params PointF[] points);
+   public void DrawPolygon(Pen pen, params ReadOnlySpan<PointF> points);
-   public void DrawCurve(Pen pen, Point[] points);
+   public void DrawCurve(Pen pen, params Point[] points);
+   public void DrawCurve(Pen pen, params ReadOnlySpan<Point> points);
    public void DrawCurve(Pen pen, Point[] points, float tension);
+   public void DrawCurve(Pen pen, ReadOnlySpan<Point> points, float tension);
    public void DrawCurve(Pen pen, Point[] points, int offset, int numberOfSegments);
+   public void DrawCurve(Pen pen, ReadOnlySpan<Point> points, int offset, int numberOfSegments);
    public void DrawCurve(Pen pen, Point[] points, int offset, int numberOfSegments, float tension);
+   public void DrawCurve(Pen pen, ReadOnlySpan<Point> points, int offset, int numberOfSegments, float tension);
-   public void DrawCurve(Pen pen, PointF[] points);
+   public void DrawCurve(Pen pen, params PointF[] points);
+   public void DrawCurve(Pen pen, params ReadOnlySpan<PointF> points);
    public void DrawCurve(Pen pen, PointF[] points, float tension);
+   public void DrawCurve(Pen pen, ReadOnlySpan<PointF> points, float tension);
    public void DrawCurve(Pen pen, PointF[] points, int offset, int numberOfSegments);
+   public void DrawCurve(Pen pen, ReadOnlySpan<PointF> points, int offset, int numberOfSegments);
    public void DrawCurve(Pen pen, PointF[] points, int offset, int numberOfSegments, float tension);
+   public void DrawCurve(Pen pen, ReadOnlySpan<PointF> points, int offset, int numberOfSegments, float tension);
-   public void DrawClosedCurve(Pen pen, Point[] points);
+   public void DrawClosedCurve(Pen pen, params Point[] points);
+   public void DrawClosedCurve(Pen pen, params ReadOnlySpan<Point> points);
    public void DrawClosedCurve(Pen pen, Point[] points, float tension, FillMode fillmode);
+   public void DrawClosedCurve(Pen pen, ReadOnlySpan<Point> points, float tension, FillMode fillmode);
-   public void DrawClosedCurve(Pen pen, PointF[] points);
+   public void DrawClosedCurve(Pen pen, params PointF[] points);
+   public void DrawClosedCurve(Pen pen, params ReadOnlySpan<PointF> points);
    public void DrawClosedCurve(Pen pen, PointF[] points, float tension, FillMode fillmode);
+   public void DrawClosedCurve(Pen pen, ReadOnlySpan<PointF> points, float tension, FillMode fillmode);
-   public void FillRectangles(Brush brush, Rectangle[] rects);
+   public void FillRectangles(Brush brush, params Rectangle[] rects);
+   public void FillRectangles(Brush brush, params ReadOnlySpan<Rectangle> rects);
-   public void FillPolygon(Brush brush, Point[] points);
+   public void FillPolygon(Brush brush, params Point[] points);
+   public void FillPolygon(Brush brush, params ReadOnlySpan<Point> points);
    public void FillPolygon(Brush brush, Point[] points, FillMode fillMode);
+   public void FillPolygon(Brush brush, ReadOnlySpan<Point> points, FillMode fillMode)
-   public void FillRectangles(Brush brush, RectangleF[] rects)
+   public void FillRectangles(Brush brush, params RectangleF[] rects)
+   public void FillRectangles(Brush brush, params ReadOnlySpan<RectangleF> rects);
-   public void FillPolygon(Brush brush, PointF[] points);
+   public void FillPolygon(Brush brush, params PointF[] points);
+   public void FillPolygon(Brush brush, params ReadOnlySpan<PointF> points);
    public void FillPolygon(Brush brush, PointF[] points, FillMode fillMode);
+   public void FillPolygon(Brush brush, ReadOnlySpan<PointF> points, FillMode fillMode);
-   public void FillClosedCurve(Brush brush, Point[] points);
+   public void FillClosedCurve(Brush brush, params Point[] points);
+   public void FillClosedCurve(Brush brush, params ReadOnlySpan<Point> points);
    public void FillClosedCurve(Brush brush, Point[] points, FillMode fillmode);
+   public void FillClosedCurve(Brush brush, ReadOnlySpan<Point> points, FillMode fillmode);
-   public void FillClosedCurve(Brush brush, PointF[] points);
+   public void FillClosedCurve(Brush brush, params PointF[] points);
+   public void FillClosedCurve(Brush brush, params ReadOnlySpan<PointF> points);
    public void FillClosedCurve(Brush brush, PointF[] points, FillMode fillmode);
+   public void FillClosedCurve(Brush brush, ReadOnlySpan<PointF> points, FillMode fillmode);
-   public void DrawLines(Pen pen, Point[] points);
+   public void DrawLines(Pen pen, params Point[] points);
+   public void DrawLines(Pen pen, params ReadOnlySpan<Point> points);
-   public void DrawLines(Pen pen, PointF[] points);
+   public void DrawLines(Pen pen, params PointF[] points);
+   public void DrawLines(Pen pen, params ReadOnlySpan<PointF> points);
-   public void DrawBeziers(Pen pen, Point[] points);
+   public void DrawBeziers(Pen pen, params Point[] points);
+   public void DrawBeziers(Pen pen, params ReadOnlySpan<Point> points);
-   public void DrawBeziers(Pen pen, PointF[] points);
+   public void DrawBeziers(Pen pen, params PointF[] points);
+   public void DrawBeziers(Pen pen, params ReadOnlySpan<PointF> points);
}

namespace System.Drawing.Drawing2D;

public class GraphicsPath
{
    public GraphicsPath(Point[] pts, byte[] types);
    public GraphicsPath(Point[] pts, byte[] types, FillMode fillMode);
+   public GraphicsPath(ReadOnlySpan<Point> pts, ReadOnlySpan<byte> types, FillMode fillMode = FillMode.Alternate);
    public GraphicsPath(PointF[] pts, byte[] types);
    public GraphicsPath(PointF[] pts, byte[] types, FillMode fillMode);
+   public GraphicsPath(ReadOnlySpan<PointF> pts, ReadOnlySpan<byte> types, FillMode fillMode = FillMode.Alternate);
-   public void AddLines(Point[] points);
+   public void AddLines(params Point[] points);
+   public void AddLines(params ReadOnlySpan<Point> points);
-   public void AddLines(PointF[] points);
+   public void AddLines(params PointF[] points);
+   public void AddLines(params ReadOnlySpan<PointF> points);
    public void AddBeziers(params Point[] points);
+   public void AddBeziers(params ReadOnlySpan<Point> points);
-   public void AddBeziers(PointF[] points);
+   public void AddBeziers(params PointF[] points);
+   public void AddBeziers(params ReadOnlySpan<PointF> points);
-   public void AddCurve(Point[] points);
+   public void AddCurve(params Point[] points);
+   public void AddCurve(params ReadOnlySpan<Point> points);
    public void AddCurve(Point[] points, float tension);
+   public void AddCurve(ReadOnlySpan<Point> points, float tension);
    public void AddCurve(Point[] points, int offset, int numberOfSegments, float tension);
+   public void AddCurve(ReadOnlySpan<Point> points, int offset, int numberOfSegments, float tension);
-   public void AddCurve(PointF[] points);
+   public void AddCurve(params PointF[] points);
+   public void AddCurve(params ReadOnlySpan<PointF> points);
    public void AddCurve(PointF[] points, float tension);
+   public void AddCurve(ReadOnlySpan<PointF> points, float tension);
    public void AddCurve(PointF[] points, int offset, int numberOfSegments, float tension);
+   public void AddCurve(ReadOnlySpan<PointF> points, int offset, int numberOfSegments, float tension);
-   public void AddClosedCurve(Point[] points);
+   public void AddClosedCurve(params Point[] points);
+   public void AddClosedCurve(params ReadOnlySpan<Point> points);
    public void AddClosedCurve(Point[] points, float tension);
+   public void AddClosedCurve(ReadOnlySpan<Point> points, float tension);
-   public void AddRectangles(Rectangle[] rects);
+   public void AddRectangles(params Rectangle[] rects);
+   public void AddRectangles(params ReadOnlySpan<Rectangle> rects);
-   public void AddPolygon(PointF[] points);
+   public void AddPolygon(params PointF[] points);
+   public void AddPolygon(params ReadOnlySpan<PointF; points);
-   public void AddClosedCurve(PointF[] points);
+   public void AddClosedCurve(params PointF[] points);
+   public void AddClosedCurve(params ReadOnlySpan<PointF> points);
    public void AddClosedCurve(PointF[] points, float tension);
+   public void AddClosedCurve(ReadOnlySpan<PointF> points, float tension);
-   public void AddRectangles(RectangleF[] rects);
+   public void AddRectangles(params RectangleF[] rects);
+   public void AddRectangles(params ReadOnlySpan<RectangleF> rects);
-   public void AddPolygon(PointF[] points);
+   public void AddPolygon(params PointF[] points);
+   public void AddPolygon(params ReadOnlySpan<PointF; points);
    public void Warp(PointF[] destPoints, RectangleF srcRect, Matrix? matrix, WarpMode warpMode, float flatness);
+   public void Warp(ReadOnlySpan<PointF> destPoints, RectangleF srcRect, Matrix? matrix = default, WarpMode warpMode WarpMode.Perspective, float flatness = 0.25f);
    public byte[] PathTypes { get; }
+   public int GetPathTypes(Span<bytes> destination);
    
    // Everything in GDI+ is float internally, so there is no Point version of this
    public PointF[] PathPoints { get; }
+   public int GetPathPoints(Span<PointF> destination);
}

public class ImageAttributes
{
-   public void SetBrushRemapTable(ColorMap[] map);
+   public void SetBrushRemapTable(params ColorMap[] map);
+   public void SetBrushRemapTable(params ReadOnlySpan<ColorMap> map);
+   public void SetBrushRemapTable(params ReadOnlySpan<(Color OldColor, Color NewColor)> map);

-   public void SetRemapTable(ColorMap[] map);
+   public void SetRemapTable(params ColorMap[] map);
+   public void SetRemapTable(params ReadOnlySpan<ColorMap> map);
+   public void SetRemapTable(params ReadOnlySpan<(Color OldColor, Color NewColor)> map);
+   public void SetRemapTable(ColorAdjustType type, params ColorMap[] map);
+   public void SetRemapTable(ColorAdjustType type, params ReadOnlySpan<ColorMap> map);
+   public void SetRemapTable(ColorAdjustType type, params ReadOnlySpan<(Color OldColor, Color NewColor)> map);

+   [EditorBrowsable(EditorBrowsableState.Never)]
    public void SetRemapTable(ColorMap[] map, ColorAdjustType type);
}

@bartonjs bartonjs added api-approved (4) API was approved in API review, it can be implemented and removed api-ready-for-review (2) API is ready for formal API review; applied by the issue owner labels Feb 20, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Mar 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api-approved (4) API was approved in API review, it can be implemented area-System.Drawing System.Drawing issues
Projects
None yet
Development

No branches or pull requests

5 participants