public static void main(String[] args) { DefaultImageRender r = new DefaultImageRender(); Img.source(randomPixels(200, 70, Color.WHITE)) .text("Hello World") .color(Img.Random.darkColor()) .makeNoise() .setMaxLines(7) .setMaxLineWidth(3) .pipeline(r.optionalA) .writeTo("/tmp/1/x.png"); Img.source(randomPixels(200, 70, Color.WHITE)) .text("Hello World") .color(Img.Random.darkColor()) .makeNoise() .setMaxLines(7) .setMaxLineWidth(3) .pipeline(r.optionalB) .writeTo("/tmp/1/y.png"); } }
public TextWriter.Stage watermark() { return new TextWriter.Stage(get()); }
public static void main(String[] args) { DefaultImageRender r = new DefaultImageRender(); Img.source(randomPixels(200, 70, Color.WHITE)) .text("Hello World") .color(Img.Random.darkColor()) .makeNoise() .setMaxLines(7) .setMaxLineWidth(3) .pipeline(r.optionalA) .writeTo("/tmp/1/x.png"); Img.source(randomPixels(200, 70, Color.WHITE)) .text("Hello World") .color(Img.Random.darkColor()) .makeNoise() .setMaxLines(7) .setMaxLineWidth(3) .pipeline(r.optionalB) .writeTo("/tmp/1/y.png"); } }
public TextWriter.Stage text(String text) { return new TextWriter.Stage(get()).text(text); }
public TextWriter.Stage text(String text) { return new TextWriter.Stage(get()).text(text); }
public TextWriter.Stage watermark() { return new TextWriter.Stage(get()); }
@Override protected Stage createStage(BufferedImage source) { return new Stage(source, this); }
@Override protected Stage createStage(BufferedImage source) { return new Stage(source, this); }
@Override public BufferedImage render(String text) { List<? extends Img.Processor> processors = $.random(true, false) ? optionalA : optionalB; return Img.source(backgroundGenerator) .text(text) .color(Img.Random.darkColor()) .makeNoise() .setMaxLines(2 + randInt(5)) .setMaxLineWidth(3) .pipeline(processors) .get(); }
@Override public BufferedImage render(String text) { List<? extends Img.Processor> processors = $.random(true, false) ? optionalA : optionalB; return Img.source(backgroundGenerator) .text(text) .color(Img.Random.darkColor()) .makeNoise() .setMaxLines(2 + randInt(5)) .setMaxLineWidth(3) .pipeline(processors) .get(); }