We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Line 65 in method readPixels the conversion from ARGB to RGBA give AGBA, not RGBA
Current conversion method :
public function readPixels (x :Int, y :Int, width :Int, height :Int) :Bytes { assertNotDisposed(); var bitmapData = _renderer.batcher.readPixels(this, x, y, width, height); var pixels = Bytes.ofData(bitmapData.getPixels(new Rectangle(0, 0, width, height))); bitmapData.dispose(); var ii = 0, ll = pixels.length; while (ii < ll) { // Convert from ARGB to RGBA var alpha = pixels.get(ii); pixels.set(ii, pixels.get(++ii)); pixels.set(ii, pixels.get(++ii)); pixels.set(ii, pixels.get(++ii)); pixels.set(ii, alpha); ++ii; } return pixels; }
Fixed conversion :
public function readPixels (x :Int, y :Int, width :Int, height :Int) :Bytes { assertNotDisposed(); var bitmapData = _renderer.batcher.readPixels(this, x, y, width, height); var pixels = Bytes.ofData(bitmapData.getPixels(new Rectangle(0, 0, width, height))); bitmapData.dispose(); var ii = 0, ll = pixels.length; while (ii < ll) { // Convert from ARGB to RGBA var alpha = pixels.get(ii); pixels.set(ii, pixels.get(ii+1)); pixels.set(ii+1, pixels.get(ii+2)); pixels.set(ii+2, pixels.get(ii+3)); pixels.set(ii+3, alpha); ii+=4; } return pixels; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Line 65 in method readPixels the conversion from ARGB to RGBA give AGBA, not RGBA
Current conversion method :
Fixed conversion :
The text was updated successfully, but these errors were encountered: