Search in sources :

Example 16 with CanvasPixelArray

use of com.google.gwt.canvas.dom.client.CanvasPixelArray in project lienzo-core by ahome-it.

the class RGBIgnoreAlphaImageDataFilter method filter.

/**
 * Returns an {@link ImageData} that is transformed based on the passed in RGB color, setting alpha to 255
 */
@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;
}
Also used : CanvasPixelArray(com.google.gwt.canvas.dom.client.CanvasPixelArray)

Example 17 with CanvasPixelArray

use of com.google.gwt.canvas.dom.client.CanvasPixelArray in project lienzo-core by ahome-it.

the class StackBlurImageDataFilter 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, source.getWidth(), source.getHeight(), (int) getValue(), FilterCommonOps);
    return source;
}
Also used : CanvasPixelArray(com.google.gwt.canvas.dom.client.CanvasPixelArray)

Example 18 with CanvasPixelArray

use of com.google.gwt.canvas.dom.client.CanvasPixelArray in project lienzo-core by ahome-it.

the class EdgeDetectImageDataFilter 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 ImageData result = source.create();
    filter_(data, result.getData(), source.getWidth(), source.getHeight());
    return result;
}
Also used : CanvasPixelArray(com.google.gwt.canvas.dom.client.CanvasPixelArray) ImageData(com.ait.lienzo.client.core.types.ImageData)

Example 19 with CanvasPixelArray

use of com.google.gwt.canvas.dom.client.CanvasPixelArray in project lienzo-core by ahome-it.

the class EmbossImageDataFilter 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), source.getWidth(), FilterCommonOps);
    return source;
}
Also used : CanvasPixelArray(com.google.gwt.canvas.dom.client.CanvasPixelArray)

Example 20 with CanvasPixelArray

use of com.google.gwt.canvas.dom.client.CanvasPixelArray in project lienzo-core by ahome-it.

the class HueImageDataFilter 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, source.getWidth(), source.getHeight(), getValue(), FilterCommonOps);
    return source;
}
Also used : CanvasPixelArray(com.google.gwt.canvas.dom.client.CanvasPixelArray)

Aggregations

CanvasPixelArray (com.google.gwt.canvas.dom.client.CanvasPixelArray)20 ImageData (com.ait.lienzo.client.core.types.ImageData)4 Context2d (com.google.gwt.canvas.dom.client.Context2d)2 ImageData (com.google.gwt.canvas.dom.client.ImageData)2