-
I'm trying to use ImageSharp to render polygon data to raster data, where the underlying pixel values represent data values rather than colors. At first the ability to define a custom I'm looking for an implementation of the SolidBrush that takes a I could probably put together a PR pretty quick by tweaking the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 19 replies
-
This idea sounds fine to me, from an API/implementation POV I would suggest creating a new class Both versions of However saying all that I would like to add you can actually create a custom |
Beta Was this translation helpful? Give feedback.
This idea sounds fine to me, from an API/implementation POV I would suggest creating a new class
SolidBush<TPixel>
whoesCreateApplicator<T>
throws if the pixels do not match....alternatively we could fast path with the same pixel type, otherwise we could then callnew Color(TBrushPixel.ToRgba32()).ToPixel<TImagePixel>()
(or equivalent) to translate between pixel types.Both versions of
SolidBrush
(generic and not) would then both use the same internalSolidBrushApplicator<T>
(it would just need to be made internal rather than private.)However saying all that I would like to add you can actually create a custom
BrushApplicator<T>
in your own codebase, the protected constructor just mean …