private void makeMap(int[] pixels, int[] map, int width, int height) { for (int y = 0; y < height; y++) { for (int x = 0; x < width; x++) { int offset = x + y * width; int b = useAlpha ? (pixels[offset] >> 24) & 0xff : PixelUtils.brightness(pixels[offset]); // map[offset] = b * one; map[offset] = b * one / 10; } } }
public int filterRGB( int x, int y, int rgb ) { return lut[ PixelUtils.brightness( rgb ) ]; }
@Override public int filterRGB( int x, int y, int rgb ) { return lut[ PixelUtils.brightness( rgb ) ]; }
public int filterRGB(int x, int y, int rgb) { int v = PixelUtils.brightness( rgb ); float f = ImageMath.smoothStep( lowerThreshold, upperThreshold, v ); return (rgb & 0xff000000) | (ImageMath.mixColors( f, black, white ) & 0xffffff); }
bumpPixels = new int[bumpMapWidth * bumpMapHeight]; for (int i = 0; i < inPixels.length; i++) bumpPixels[i] = PixelUtils.brightness(inPixels[i]);
r[1][x] = (short)PixelUtils.brightness( rgb ); for (int x = 0; x < width; x++) { int rgb = inPixels[nextRowIndex++]; r[2][x] = (short)PixelUtils.brightness( rgb );
public float evaluate(float x, float y) { int ix = (int)x; int iy = (int)y; if (edgeAction == WRAP) { ix = ImageMath.mod(ix, width); iy = ImageMath.mod(iy, height); } else if (ix < 0 || iy < 0 || ix >= width || iy >= height) { if (edgeAction == ZERO) return 0; if (ix < 0) ix = 0; else if (ix >= width) ix = width-1; if (iy < 0) iy = 0; else if (iy >= height) iy = height-1; } return alpha ? ((pixels[iy*width+ix] >> 24) & 0xff) / 255.0f : PixelUtils.brightness(pixels[iy*width+ix]) / 255.0f; }
public float evaluate(float x, float y) { int ix = (int)x; int iy = (int)y; if (edgeAction == WRAP) { ix = ImageMath.mod(ix, width); iy = ImageMath.mod(iy, height); } else if (ix < 0 || iy < 0 || ix >= width || iy >= height) { if (edgeAction == ZERO) return 0; if (ix < 0) ix = 0; else if (ix >= width) ix = width-1; if (iy < 0) iy = 0; else if (iy >= height) iy = height-1; } return alpha ? ((pixels[iy*width+ix] >> 24) & 0xff) / 255.0f : PixelUtils.brightness(pixels[iy*width+ix]) / 255.0f; }
bumpPixels = new int[bumpMapWidth * bumpMapHeight]; for (int i = 0; i < inPixels.length; i++) { bumpPixels[i] = PixelUtils.brightness(inPixels[i]);
int maskRGB = maskPixels[x % maskWidth]; int inRGB = inPixels[x]; int v = PixelUtils.brightness( maskRGB ); float f = ImageMath.smoothStep( lower, upper, v ); int a = (int)(255 * f);
maskRGB ^= 0xffffff; if ( monochrome ) { int v = PixelUtils.brightness( maskRGB ); int iv = PixelUtils.brightness( inRGB ); float f = 1-ImageMath.smoothStep( iv-s, iv+s, v ); int a = (int)(255 * f);
int v = PixelUtils.brightness(maskRGB); int iv = PixelUtils.brightness(inRGB); float f = 1 - ImageMath.smoothStep(iv - s, iv + s, v); int a = (int) (255 * f);
sa = useAlpha ? (pixels[offset] >> 24) & 0xff : PixelUtils.brightness(pixels[offset]);