MCPcopy Index your code
hub / github.com/processing/processing / checkAlpha

Method checkAlpha

core/src/processing/core/PImage.java:273–284  ·  view source on GitHub ↗

Check the alpha on an image, using a really primitive loop.

()

Source from the content-addressed store, hash-verified

271 * Check the alpha on an image, using a really primitive loop.
272 */
273 protected void checkAlpha() {
274 if (pixels == null) return;
275
276 for (int i = 0; i < pixels.length; i++) {
277 // since transparency is often at corners, hopefully this
278 // will find a non-transparent pixel quickly and exit
279 if ((pixels[i] & 0xff000000) != 0xff000000) {
280 format = ARGB;
281 break;
282 }
283 }
284 }
285
286
287 //////////////////////////////////////////////////////////////

Callers 3

loadImageMethod · 0.95
loadImageIOMethod · 0.95
loadBase64ImageMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected