241242243244245246247248249250251252253254255256257
context.lineTo(20, 5); context.stroke(); ImageData backing = context.getImageData(0, 0, 20, 10); if (null != backing) { if ((backing.getRedAt(3, 5) == 255) && (backing.getBlueAt(3, 5) == 0) && (backing.getGreenAt(3, 5) == 0)) { if ((backing.getRedAt(8, 5) == 0) && (backing.getBlueAt(8, 5) == 255) && (backing.getGreenAt(8, 5) == 0)) { return true; } } }
171819202122232425
context.setFillColor(color); context.fillRect(0, 0, 2, 2); ImageData data = context.getImageData(0, 0, 2, 2); return new Color(data.getRedAt(1, 1), data.getGreenAt(1, 1), data.getBlueAt(1, 1), (((double) data.getAlphaAt(1, 1)) / 255.0)); }
34353637383940414243444546474849505152
{ if (null == source) { return null; } ImageData output = source.copy(); final CanvasPixelArray srcd = source.getData(); if (null == srcd) { return source; } final CanvasPixelArray dstd = output.getData(); if (null == dstd) { return source; }
160161162163164165166167168169170
Context2D context = scratch.getContext(); context.drawImage(m_imageJSO, m_x, m_y, m_width, m_height, 0, 0, m_destinationWidth, m_destinationHeight); ImageData imageData = context.getImageData(0, 0, m_destinationWidth, m_destinationHeight); // Now draw the image again, replacing each color with the color key scratch.clear();
265266267268269270271272273
Context2D context = scratch.getContext(); context.drawImage(m_imageJSO, m_x, m_y, m_width, m_height, 0, 0, m_destinationWidth, m_destinationHeight); ImageData imageData = context.getImageData(0, 0, m_destinationWidth, m_destinationHeight); return imageData; }
5657585960616263646566
{ ImageDataFilter filter = m_filters.get(i); if (null != filter) { ImageData imdata = filter.filter(source, false); if (null != imdata) { source = imdata; }
206207208209210211212213214215216217218219220221222