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

Method setPixel

ij/src/main/java/ij/macro/Functions.java:1058–1080  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1056 }
1057
1058 void setPixel() {
1059 interp.getLeftParen();
1060 int a1 = (int)interp.getExpression();
1061 interp.getComma();
1062 double a2 = interp.getExpression();
1063 interp.getToken();
1064 ImageProcessor ip = getProcessor();
1065 if (interp.token==',') {
1066 double a3 = interp.getExpression();
1067 interp.getRightParen();
1068 if (ip instanceof FloatProcessor)
1069 ip.putPixelValue(a1, (int)a2, a3);
1070 else
1071 ip.putPixel(a1, (int)a2, (int)a3);
1072 } else {
1073 if (interp.token!=')') interp.error("')' expected");
1074 if (ip instanceof ColorProcessor)
1075 ip.set(a1, (int)a2);
1076 else
1077 ip.setf(a1, (float)a2);
1078 }
1079 updateNeeded = true;
1080 }
1081
1082 double getPixel() {
1083 interp.getLeftParen();

Callers 1

doFunctionMethod · 0.95

Calls 11

getProcessorMethod · 0.95
putPixelValueMethod · 0.95
putPixelMethod · 0.95
setMethod · 0.95
setfMethod · 0.95
getLeftParenMethod · 0.80
getExpressionMethod · 0.80
getCommaMethod · 0.80
getRightParenMethod · 0.80
getTokenMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected