int (int srcR, int srcG, int srcB, double dstR, double dstG, double dstB) { if (Double.isNaN(dstR)) dstR = 0; if (Double.isNaN(dstG)) dstG = 0; if (Double.isNaN(dstB)) dstB = 0; if (myWeight != null) { dstR = dstR * myWeight + srcR * (1 - myWeight); dstG = dstG * myWeight + srcG * (1 - myWeight); dstB = dstB * myWeight + srcB * (1 - myWeight); } srcR = (int)dstR; srcG = (int)dstG; srcB = (int)dstB; return (srcR << 16) | (srcG << 8) | srcB; }