Search in sources :

Example 11 with CanvasPixelArray

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

the class AbstractValueTransformImageDataFilter 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();
    FilterCommonOps.doFilterTransform(data, result.getData(), getTransform(getValue()), 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 12 with CanvasPixelArray

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

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

Example 13 with CanvasPixelArray

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

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

Example 14 with CanvasPixelArray

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

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

Example 15 with CanvasPixelArray

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

the class LuminosityGrayScaleImageDataFilter 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.dofilterLuminosity(data, FilterCommonOps.getLength(source));
    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