3 ms·
Don't leave us hanging - what did you _do?_ Did you fix this?
by eckza 4y ago
Don't leave us hanging - what did you _do?_ Did you fix this?
- Jorge1o1 4y agoNot the parent so I can’t tell you exactly what he did, but some suggestions: - The PNG specification contains plenty of information including width and length that allow you to use 2d arrays rather than ArrayLists - The RGBA 32bit integer doesn’t need to be unpacked.. you can just perform shifts and transformations of each of the 8bit channels. - If you do unpack, you should use native 8bit unsigned ints - You don’t need an unmodified copy.. that’s your file - Undo stack should contain deltas, not the whole image over and over again. Edit: formatting
- prewett 4y agoThe obvious thing to do would be to store the image in memory as just an array of 8-bit of native unsigned integers (RGBARGBARGBARGBA...) and see where that got you. I assume C# has the equivalent of a Java byte[], except that fortunately it is unsigned in C# instead of signed in Java. I expect that you would get quite a performance boost with just that.