attempts to improve images

This commit is contained in:
Ben Fry
2014-02-09 11:02:51 -05:00
parent c350407d01
commit 12bdaa21fe
2 changed files with 14 additions and 0 deletions

View File

@@ -1335,6 +1335,7 @@ public class PGraphicsJava2D extends PGraphics {
int tintedColor;
int[] tintedTemp; // one row of tinted pixels
BufferedImage image;
// BufferedImage compat;
// public ImageCache(PImage source) {
//// this.source = source;
@@ -1484,6 +1485,15 @@ public class PGraphicsJava2D extends PGraphics {
}
this.tinted = tint;
this.tintedColor = tintColor;
// GraphicsConfiguration gc = parent.getGraphicsConfiguration();
// compat = gc.createCompatibleImage(image.getWidth(),
// image.getHeight(),
// Transparency.TRANSLUCENT);
//
// Graphics2D g = compat.createGraphics();
// g.drawImage(image, 0, 0, null);
// g.dispose();
}
}
@@ -1750,6 +1760,7 @@ public class PGraphicsJava2D extends PGraphics {
g2.setColor(fillColorObject);
int length = stop - start;
if (length != 0) {
g2.drawChars(buffer, start, length, (int) (x + 0.5f), (int) (y + 0.5f));
// better to use round here? also, drawChars now just calls drawString
// g2.drawString(new String(buffer, start, stop - start), Math.round(x), Math.round(y));
@@ -1762,6 +1773,7 @@ public class PGraphicsJava2D extends PGraphics {
// java.awt.font.GlyphVector gv =
// font.createGlyphVector(g2.getFontRenderContext(), new String(buffer, start, stop - start));
// g2.drawGlyphVector(gv, x, y);
}
// return to previous smoothing state if it was changed
//g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, textAntialias);

View File

@@ -37,6 +37,8 @@ high
_ zero alpha values still a problem with retina renderer
_ https://github.com/processing/processing/issues/2030
_ Sort out blending differences with P2D/P3D
_ might be that compatible images not setting alpha mode correctly
_ image = gc.createCompatibleVolatileImage(source.width, source.height, Transparency.TRANSLUCENT);
_ https://github.com/processing/processing/issues/1844
_ 'collector' class.. Dict that points to a list
_ String as a key, int/float/string list as values