本文整理匯總了Java中processing.core.PGraphics.blendMode方法的典型用法代碼示例。如果您正苦於以下問題:Java PGraphics.blendMode方法的具體用法?Java PGraphics.blendMode怎麽用?Java PGraphics.blendMode使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類processing.core.PGraphics
的用法示例。
在下文中一共展示了PGraphics.blendMode方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: apply
import processing.core.PGraphics; //導入方法依賴的package包/類
@Override
public Object apply(WarpScriptStack stack) throws WarpScriptException {
List<Object> params = ProcessingUtil.parseParams(stack, 1);
PGraphics pg = (PGraphics) params.get(0);
String mode = params.get(1).toString();
if ("BLEND".equals(mode)) {
pg.blendMode(PGraphics.BLEND);
} else if ("ADD".equals(mode)) {
pg.blendMode(PGraphics.ADD);
} else if ("SUBTRACT".equals(mode)) {
pg.blendMode(PGraphics.SUBTRACT);
} else if ("DARKEST".equals(mode)) {
pg.blendMode(PGraphics.DARKEST);
} else if ("LIGHTEST".equals(mode)) {
pg.blendMode(PGraphics.LIGHTEST);
} else if ("DIFFERENCE".equals(mode)) {
pg.blendMode(PGraphics.DIFFERENCE);
} else if ("EXCLUSION".equals(mode)) {
pg.blendMode(PGraphics.EXCLUSION);
} else if ("MULTIPLY".equals(mode)) {
pg.blendMode(PGraphics.MULTIPLY);
} else if ("SCREEN".equals(mode)) {
pg.blendMode(PGraphics.SCREEN);
} else if ("REPLACE".equals(mode)) {
pg.blendMode(PGraphics.REPLACE);
} else {
throw new WarpScriptException(getName() + ": invalid mode, should be 'BLEND', 'ADD', 'SUBTRACT', 'DARKEST', 'LIGHTEST', 'DIFFERENCE', 'EXCLUSION', 'MULTIPLY', 'SCREEN', or 'REPLACE'.");
}
stack.push(pg);
return stack;
}