public int filterRGB(int x, int y, int rgb) { // int a = rgb & 0xff000000; int r = (rgb >> 16) & 0xff; int g = (rgb >> 8) & 0xff; int b = rgb & 0xff; rgb = (r + g + b) / 3; return colormap.getColor(rgb/255.0f); }
private void squareGradient(int[] pixels, int y, int w, int h) { int off = 0; float radius = Math.max(Math.abs(p2.x-p1.x), Math.abs(p2.y-p1.y)); for (int x = 0; x < w; x++) { float distance = Math.max(Math.abs(x-p1.x), Math.abs(y-p1.y)); float ratio = distance / radius; if (repeat) ratio = ratio % 2; else if (ratio > 1.0) ratio = 1.0f; int rgb = colormap.getColor(map(ratio)); pixels[off] = PixelUtils.combinePixels(rgb, pixels[off], paintMode); off++; } }
for (y = 0; y < height; y++) { for (x = 0; x < width; x++) { outPixels[index] = colormap.getColor(outPixels[index] / (float)max); index++;
private void conicalGradient(int[] pixels, int y, int w, int h) { int off = 0; float angle0 = (float)Math.atan2(p2.x-p1.x, p2.y-p1.y); for (int x = 0; x < w; x++) { float angle = (float)(Math.atan2(x-p1.x, y-p1.y) - angle0) / (ImageMath.TWO_PI); angle += 1.0f; angle %= 1.0f; if (type == BICONICAL) angle = ImageMath.triangle(angle); int rgb = colormap.getColor(map(angle)); pixels[off] = PixelUtils.combinePixels(rgb, pixels[off], paintMode); off++; } }
int rgb; if (colrel <= 0.0) { rgb = colormap.getColor(0); do { pixels[off] = PixelUtils.combinePixels(rgb, pixels[off], paintMode); rgb = colormap.getColor(map(ImageMath.triangle(colrel))); else rgb = colormap.getColor(map(colrel)); pixels[off] = PixelUtils.combinePixels(rgb, pixels[off], paintMode); off++; rgb = colormap.getColor(0.0f); else rgb = colormap.getColor(1.0f); do { pixels[off] = PixelUtils.combinePixels(rgb, pixels[off], paintMode);
private void repeatGradient(int[] pixels, int w, int h, float rowrel, float dx, float dy) { int off = 0; for (int y = 0; y < h; y++) { float colrel = rowrel; int j = w; int rgb; while (--j >= 0) { if (type == BILINEAR) rgb = colormap.getColor(map(ImageMath.triangle(colrel))); else rgb = colormap.getColor(map(ImageMath.mod(colrel, 1.0f))); pixels[off] = PixelUtils.combinePixels(rgb, pixels[off], paintMode); off++; colrel += dx; } rowrel += dy; } }
float perturb = (float)Math.sin(40.*chaos); f += .2 * perturb; return colormap.getColor(f); } else { float red, grn, blu;
int v; if (colormap != null) { v = colormap.getColor(f); } else { v = PixelUtils.clamp((int)(f*255));
pixel = colormap.getColor((float)i/iterations); else pixel = newColor;
pixel = colormap.getColor((float)i/iterations); else pixel = newColor;
private void radialGradient(int[] pixels, int y, int w, int h) { int off = 0; float radius = distance(p2.x-p1.x, p2.y-p1.y); for (int x = 0; x < w; x++) { float distance = distance(x-p1.x, y-p1.y); float ratio = distance / radius; if (repeat) ratio = ratio % 2; else if (ratio > 1.0) ratio = 1.0f; int rgb = colormap.getColor(map(ratio)); pixels[off] = PixelUtils.combinePixels(rgb, pixels[off], paintMode); off++; } }
int v; if (colormap != null) { v = colormap.getColor(f); if (useColor) { Point[] results = resultsTL.get();
public int filterRGB(int x, int y, int rgb) { float nx = m00*x + m01*y; float ny = m10*x + m11*y; nx /= scale; ny /= scale * stretch; float f = Noise.noise2(nx, ny); f += 0.1f*turbulence * Noise.noise2(nx*0.05f, ny*20); f = (f * 0.5f) + 0.5f; f *= rings*50; f = f-(int)f; f *= 1-ImageMath.smoothStep(gain, 1.0f, f); f += fibres*Noise.noise2(nx*scale, ny*50); int a = rgb & 0xff000000; int v; if (colormap != null) v = colormap.getColor(f); else { v = PixelUtils.clamp((int)(f*255)); int r = v << 16; int g = v << 8; int b = v; v = a|r|g|b; } return v; }
rgb = colormap.getColor( l * strength * (1/3f) ); } else { r = PixelUtils.clamp((int)(r * strength));
public int filterRGB(int x, int y, int rgb) { float nx = m00*x + m01*y; float ny = m10*x + m11*y; nx /= scale; ny /= scale * stretch; float f = fBm.evaluate(nx, ny); // Normalize to 0..1 f = (f-min)/(max-min); f = ImageMath.gain(f, gain); f = ImageMath.bias(f, bias); f *= amount; int a = rgb & 0xff000000; int v; if (colormap != null) v = colormap.getColor(f); else { v = PixelUtils.clamp((int)(f*255)); int r = v << 16; int g = v << 8; int b = v; v = a|r|g|b; } if (operation != PixelUtils.REPLACE) v = PixelUtils.combinePixels(rgb, v, operation); return v; }
int rgb = colors.getValue().getColor(1.0f - where); colorLookup[depth] = new Color(rgb);
public int filterRGB(int x, int y, int rgb) { float nx = m00*x + m01*y; float ny = m10*x + m11*y; nx /= scale; ny /= scale * stretch; float f = turbulence == 1.0 ? Noise.noise2(nx, ny) : Noise.turbulence2(nx, ny, turbulence); f = (f * 0.5f) + 0.5f; f = ImageMath.gain(f, gain); f = ImageMath.bias(f, bias); f *= amount; int a = rgb & 0xff000000; int v; if (colormap != null) v = colormap.getColor(f); else { v = PixelUtils.clamp((int)(f*255)); int r = v << 16; int g = v << 8; int b = v; v = a|r|g|b; } if (operation != PixelUtils.REPLACE) v = PixelUtils.combinePixels(rgb, v, operation); return v; }