Skip to content
Discussion options

You must be logged in to vote

In ImageSharp, Image<TPixel> is the in-memory surface type. TPixel is any unmanaged struct that implements IPixel<TPixel>, which in turn extends the non generic IPixel. The key part of that base interface is the conversion contract:

  • Every TPixel must be able to:
    • Convert to and from Rgba32 (ToRgba32, FromRgba32)
    • Convert to and from a Vector4 view (ToScaledVector4, FromScaledVector4, ToVector4, FromVector4)
      See IPixel and IPixel<TSelf>.

ToScaledVector4 and FromScaledVector4 use normalized 0-1 values in least to most significant channel order (R, G, B, A for Rgba32). This is documented on IPixel<TSelf>.

All processors operate on that RGBA Vector4 view. Blend modes, filters, drawing, qua…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Socolin
Comment options

@JimBobSquarePants
Comment options

Answer selected by Socolin
@Socolin
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
2 participants