How to create a custom Pixel Format? #2274
-
How do I implement a custom pixel format for R8? The docs say the pixel formats are extensible so I looked at the source code and tried implement an R8 pixel format by copying and adapting the A8 struct but then found out 2 of the methods called in the A8 struct are internal i.e. cannot be accessed from an implementing project. At least one of these is required for it to work. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The
You can use one of the public constructors to instantiate a |
Beta Was this translation helpful? Give feedback.
The
PixelOperations<T>
type is not abstract, and the constructor is public, you should be able to instantiate anew PixelOperations<R8>()
. Subclassing is needed to optimize conversion operations: you can create your ownR8PixelOperations : PixelOperations<R8>
subclass and override methods with optimized ones.You can use one of the public constructors to instantiate a
PixelTypeInfo
.Create<TPixel>
is really just a thin wrapper around them.