@Override public void compose(Raster src, Raster dstIn, WritableRaster dstOut) { int width = Math.min(src.getWidth(), dstIn.getWidth()); int height = Math.min(src.getHeight(), dstIn.getHeight()); int[] srcPixels = new int[width], dstPixels = new int[width]; for (int yy = 0; yy < height; yy++) { src.getDataElements(0, yy, width, 1, srcPixels); dstIn.getDataElements(0, yy, width, 1, dstPixels); blender.blend(srcPixels, dstPixels, width, alpha); dstOut.setDataElements(0, yy, width, 1, dstPixels); } }
public void blend (int[] srcPixels, int[] dstPixels, int width, float alpha) { for (int xx = 0; xx < width; xx++) { // pixels are stored as INT_ARGB int srcARGB = srcPixels[xx], dstARGB = dstPixels[xx]; int srcA = (srcARGB >> 24) & 0xFF, dstA = (dstARGB >> 24) & 0xFF; int srcR = (srcARGB >> 16) & 0xFF, dstR = (dstARGB >> 16) & 0xFF; int srcG = (srcARGB >> 8) & 0xFF, dstG = (dstARGB >> 8) & 0xFF; int srcB = (srcARGB ) & 0xFF, dstB = (dstARGB ) & 0xFF; dstPixels[xx] = blend(srcA, srcR, srcG, srcB, dstA, dstR, dstG, dstB, alpha); } }
public void blend (int[] srcPixels, int[] dstPixels, int width, float alpha) { for (int xx = 0; xx < width; xx++) { // pixels are stored as INT_ARGB int srcARGB = srcPixels[xx], dstARGB = dstPixels[xx]; int srcA = (srcARGB >> 24) & 0xFF, dstA = (dstARGB >> 24) & 0xFF; int srcR = (srcARGB >> 16) & 0xFF, dstR = (dstARGB >> 16) & 0xFF; int srcG = (srcARGB >> 8) & 0xFF, dstG = (dstARGB >> 8) & 0xFF; int srcB = (srcARGB ) & 0xFF, dstB = (dstARGB ) & 0xFF; dstPixels[xx] = blend(srcA, srcR, srcG, srcB, dstA, dstR, dstG, dstB, alpha); } }
public void blend (int[] srcPixels, int[] dstPixels, int width, float alpha) { for (int xx = 0; xx < width; xx++) { // pixels are stored as INT_ARGB int srcARGB = srcPixels[xx], dstARGB = dstPixels[xx]; int srcA = (srcARGB >> 24) & 0xFF, dstA = (dstARGB >> 24) & 0xFF; int srcR = (srcARGB >> 16) & 0xFF, dstR = (dstARGB >> 16) & 0xFF; int srcG = (srcARGB >> 8) & 0xFF, dstG = (dstARGB >> 8) & 0xFF; int srcB = (srcARGB ) & 0xFF, dstB = (dstARGB ) & 0xFF; dstPixels[xx] = blend(srcA, srcR, srcG, srcB, dstA, dstR, dstG, dstB, alpha); } }
@Override public void compose(Raster src, Raster dstIn, WritableRaster dstOut) { int width = Math.min(src.getWidth(), dstIn.getWidth()); int height = Math.min(src.getHeight(), dstIn.getHeight()); int[] srcPixels = new int[width], dstPixels = new int[width]; for (int yy = 0; yy < height; yy++) { src.getDataElements(0, yy, width, 1, srcPixels); dstIn.getDataElements(0, yy, width, 1, dstPixels); blender.blend(srcPixels, dstPixels, width, alpha); dstOut.setDataElements(0, yy, width, 1, dstPixels); } }
@Override public void compose(Raster src, Raster dstIn, WritableRaster dstOut) { int width = Math.min(src.getWidth(), dstIn.getWidth()); int height = Math.min(src.getHeight(), dstIn.getHeight()); int[] srcPixels = new int[width], dstPixels = new int[width]; for (int yy = 0; yy < height; yy++) { src.getDataElements(0, yy, width, 1, srcPixels); dstIn.getDataElements(0, yy, width, 1, dstPixels); blender.blend(srcPixels, dstPixels, width, alpha); dstOut.setDataElements(0, yy, width, 1, dstPixels); } }
@Override public void compose(Raster src, Raster dstIn, WritableRaster dstOut) { int width = Math.min(src.getWidth(), dstIn.getWidth()); int height = Math.min(src.getHeight(), dstIn.getHeight()); int[] srcPixels = new int[width], dstPixels = new int[width]; for (int yy = 0; yy < height; yy++) { src.getDataElements(0, yy, width, 1, srcPixels); dstIn.getDataElements(0, yy, width, 1, dstPixels); blender.blend(srcPixels, dstPixels, width, alpha); dstOut.setDataElements(0, yy, width, 1, dstPixels); } }
public void blend (int[] srcPixels, int[] dstPixels, int width, float alpha) { for (int xx = 0; xx < width; xx++) { // pixels are stored as INT_ARGB int srcARGB = srcPixels[xx], dstARGB = dstPixels[xx]; int srcA = (srcARGB >> 24) & 0xFF, dstA = (dstARGB >> 24) & 0xFF; int srcR = (srcARGB >> 16) & 0xFF, dstR = (dstARGB >> 16) & 0xFF; int srcG = (srcARGB >> 8) & 0xFF, dstG = (dstARGB >> 8) & 0xFF; int srcB = (srcARGB ) & 0xFF, dstB = (dstARGB ) & 0xFF; dstPixels[xx] = blend(srcA, srcR, srcG, srcB, dstA, dstR, dstG, dstB, alpha); } }