Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upPixel remapping/Swizzling #1115
Comments
|
As far as I remember our discussion, remapping should actually alter the image. This could be implemented easily in a single |
This comment has been minimized.
This comment has been minimized.
|
This also seems a pretty good candidate to use the value delegate trick (for those unfamiliar, I mean using a |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@Sergio0694 Of course having 2 delegates calling for each coordinate x and y could hit performance in the situation you described. That's why I also included a sample from Kanvas, where a Point struct is just taken in, modified, and then returned. That might at least reduce the delegate count to one. But however you want to implement it, is of course the decision of this team here. I just gave my input on already existing examples for this kind of operation. |
This feature is implemented in many graphics hardwares at least of most gaming consoles. Adding this feature would enable ImageSharp to natively allow for these specifications of graphics hardware to be supported out of the box.
As per OpenCV naming and implementation this feature is most likely known as "Remapping" or "Point remapping". So as the naming goes, it should incorporate either one.
Point remappings are, as the name suggests, a process to rearrange the pixels from a source to a destination point, where each source point is modified as per following method:
dst(x,y) = src(fx(x,y), fy(x,y))As for the implementation following this function, it should allow executing an action for both the x- and y-coordinate, and return its modified value respectively. Or an even simpler approach as seen in the Kanvas library of the Kuriimu2 project, where it just takes in a
Pointand returns a new one with the modified coordinates.Sources:
OpenCV documentation on remapping: https://docs.opencv.org/2.4/modules/imgproc/doc/geometric_transformations.html?highlight=remap
Kuriimu2's Kanvas Swizzle interface:https://github.com/FanTranslatorsInternational/Kuriimu2/blob/dev/src/Kontract/Kanvas/IImageSwizzle.cs