MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / setOpacity

Method setOpacity

ij/src/main/java/ij/gui/ImageRoi.java:71–79  ·  view source on GitHub ↗

Sets the composite mode using the specified opacity (alpha), in the range 0.0-1.0, where 0.0 is fully transparent and 1.0 is fully opaque.

(double opacity)

Source from the content-addressed store, hash-verified

69 /** Sets the composite mode using the specified opacity (alpha), in the
70 range 0.0-1.0, where 0.0 is fully transparent and 1.0 is fully opaque. */
71 public void setOpacity(double opacity) {
72 if (opacity<0.0) opacity = 0.0;
73 if (opacity>1.0) opacity = 1.0;
74 this.opacity = opacity;
75 if (opacity!=1.0)
76 composite = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, (float)opacity);
77 else
78 composite = null;
79 }
80
81 /** Returns a serialized version of the image. */
82 public byte[] getSerializedImage() {

Callers 5

getImageRoiMethod · 0.95
cloneMethod · 0.95
showImageDialogMethod · 0.95
addImageMethod · 0.80
setPropertiesMethod · 0.80

Calls 1

getInstanceMethod · 0.45

Tested by

no test coverage detected