Search in sources :

Example 1 with ColorableRenderer

use of org.signal.imageeditor.core.ColorableRenderer in project Signal-Android by WhisperSystems.

the class ImageEditorFragment method changeEntityColor.

private void changeEntityColor(int selectedColor) {
    if (currentSelection != null) {
        Renderer renderer = currentSelection.getRenderer();
        if (renderer instanceof ColorableRenderer) {
            ((ColorableRenderer) renderer).setColor(selectedColor);
            onDrawingChanged(false, true);
        }
    }
}
Also used : SelectableRenderer(org.signal.imageeditor.core.SelectableRenderer) Renderer(org.signal.imageeditor.core.Renderer) ColorableRenderer(org.signal.imageeditor.core.ColorableRenderer) BezierDrawingRenderer(org.signal.imageeditor.core.renderers.BezierDrawingRenderer) MultiLineTextRenderer(org.signal.imageeditor.core.renderers.MultiLineTextRenderer) FaceBlurRenderer(org.signal.imageeditor.core.renderers.FaceBlurRenderer) ColorableRenderer(org.signal.imageeditor.core.ColorableRenderer)

Example 2 with ColorableRenderer

use of org.signal.imageeditor.core.ColorableRenderer in project Signal-Android by WhisperSystems.

the class EditorModel method getUniqueColorsIgnoringAlpha.

public Set<Integer> getUniqueColorsIgnoringAlpha() {
    final Set<Integer> colors = new LinkedHashSet<>();
    editorElementHierarchy.getRoot().forAllInTree(element -> {
        Renderer renderer = element.getRenderer();
        if (renderer instanceof ColorableRenderer) {
            colors.add(((ColorableRenderer) renderer).getColor() | 0xff000000);
        }
    });
    return colors;
}
Also used : LinkedHashSet(java.util.LinkedHashSet) MultiLineTextRenderer(org.signal.imageeditor.core.renderers.MultiLineTextRenderer) Renderer(org.signal.imageeditor.core.Renderer) ColorableRenderer(org.signal.imageeditor.core.ColorableRenderer) FaceBlurRenderer(org.signal.imageeditor.core.renderers.FaceBlurRenderer) ColorableRenderer(org.signal.imageeditor.core.ColorableRenderer)

Aggregations

ColorableRenderer (org.signal.imageeditor.core.ColorableRenderer)2 Renderer (org.signal.imageeditor.core.Renderer)2 FaceBlurRenderer (org.signal.imageeditor.core.renderers.FaceBlurRenderer)2 MultiLineTextRenderer (org.signal.imageeditor.core.renderers.MultiLineTextRenderer)2 LinkedHashSet (java.util.LinkedHashSet)1 SelectableRenderer (org.signal.imageeditor.core.SelectableRenderer)1 BezierDrawingRenderer (org.signal.imageeditor.core.renderers.BezierDrawingRenderer)1