use of com.google.gwt.canvas.dom.client.CanvasPixelArray in project playn by threerings.
the class HtmlCanvasImage method setRgb.
@Override
public void setRgb(int startX, int startY, int width, int height, int[] rgbArray, int offset, int scanSize) {
Context2d ctx = canvas.canvas().getContext2d();
ImageData imageData = ctx.createImageData(width, height);
CanvasPixelArray pixelData = imageData.getData();
int i = 0;
int dst = offset;
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
int argb = rgbArray[dst + x];
pixelData.set(i++, (argb >> 16) & 255);
pixelData.set(i++, (argb >> 8) & 255);
pixelData.set(i++, (argb) & 255);
pixelData.set(i++, (argb >> 24) & 255);
}
dst += scanSize;
}
ctx.putImageData(imageData, startX, startY);
}
use of com.google.gwt.canvas.dom.client.CanvasPixelArray in project lienzo-core by ahome-it.
the class AbstractConvolveImageDataFilter method filter.
@Override
public ImageData filter(ImageData source, final boolean copy) {
if (null == source) {
return null;
}
if (copy) {
source = source.copy();
}
if (false == isActive()) {
return source;
}
final CanvasPixelArray data = source.getData();
if (null == data) {
return source;
}
final FilterConvolveMatrix matrix = getMatrix();
if (matrix.size() < 1) {
return source;
}
final ImageData result = source.create();
FilterCommonOps.doFilterConvolve(data, result.getData(), matrix, source.getWidth(), source.getHeight());
return result;
}
use of com.google.gwt.canvas.dom.client.CanvasPixelArray in project lienzo-core by ahome-it.
the class AbstractTableImageDataFilter method filter.
@Override
public ImageData filter(ImageData source, final boolean copy) {
if (null == source) {
return null;
}
if (copy) {
source = source.copy();
}
if (false == isActive()) {
return source;
}
final CanvasPixelArray data = source.getData();
if (null == data) {
return source;
}
FilterCommonOps.doFilterTable(data, getTable(), source.getWidth(), source.getHeight());
return source;
}
use of com.google.gwt.canvas.dom.client.CanvasPixelArray in project lienzo-core by ahome-it.
the class AverageGrayScaleImageDataFilter method filter.
@Override
public ImageData filter(ImageData source, final boolean copy) {
if (null == source) {
return null;
}
if (copy) {
source = source.copy();
}
if (false == isActive()) {
return source;
}
final CanvasPixelArray data = source.getData();
if (null == data) {
return source;
}
filter_(data, FilterCommonOps.getLength(source));
return source;
}
use of com.google.gwt.canvas.dom.client.CanvasPixelArray in project lienzo-core by ahome-it.
the class ColorLuminosityImageDataFilter method filter.
@Override
public ImageData filter(ImageData source, final boolean copy) {
if (null == source) {
return null;
}
if (copy) {
source = source.copy();
}
if (false == isActive()) {
return source;
}
final CanvasPixelArray data = source.getData();
if (null == data) {
return source;
}
filter_(data, FilterCommonOps.getLength(source), getR(), getG(), getB());
return source;
}
Aggregations