MCPcopy Create free account
hub / github.com/benfry/processing4 / checkAlpha

Method checkAlpha

core/src/processing/core/PImage.java:282–294  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

280 * Check the alpha on an image, using a really primitive loop.
281 */
282 public void checkAlpha() {
283 if (pixels == null) return;
284
285 //noinspection ForLoopReplaceableByForEach
286 for (int i = 0; i < pixels.length; i++) {
287 // since transparency is often at corners, hopefully this
288 // will find a non-transparent pixel quickly and exit
289 if ((pixels[i] & 0xff000000) != 0xff000000) {
290 format = ARGB;
291 break;
292 }
293 }
294 }
295
296
297 //////////////////////////////////////////////////////////////

Callers 4

PImageMethod · 0.95
parseBase64ImageMethod · 0.45
loadImageMethod · 0.45
loadImageIOMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected