Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 048c978a authored by Jason Sams's avatar Jason Sams
Browse files

Allow single channel and float convolve.

Change-Id: If448ea2ae38de2f8b95fc884ea0dbf8222964012
parent 8ace2acb
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -48,7 +48,10 @@ public final class ScriptIntrinsicConvolve3x3 extends ScriptIntrinsic {
     */
    public static ScriptIntrinsicConvolve3x3 create(RenderScript rs, Element e) {
        float f[] = { 0, 0, 0, 0, 1, 0, 0, 0, 0};
        if (!e.isCompatible(Element.U8_4(rs))) {
        if (!e.isCompatible(Element.U8(rs)) &&
            !e.isCompatible(Element.U8_4(rs)) &&
            !e.isCompatible(Element.F32(rs)) &&
            !e.isCompatible(Element.F32_4(rs))) {
            throw new RSIllegalArgumentException("Unsuported element type.");
        }
        int id = rs.nScriptIntrinsicCreate(1, e.getID(rs));
+7 −0
Original line number Diff line number Diff line
@@ -48,6 +48,13 @@ public final class ScriptIntrinsicConvolve5x5 extends ScriptIntrinsic {
     * @return ScriptIntrinsicConvolve5x5
     */
    public static ScriptIntrinsicConvolve5x5 create(RenderScript rs, Element e) {
        if (!e.isCompatible(Element.U8(rs)) &&
            !e.isCompatible(Element.U8_4(rs)) &&
            !e.isCompatible(Element.F32(rs)) &&
            !e.isCompatible(Element.F32_4(rs))) {
            throw new RSIllegalArgumentException("Unsuported element type.");
        }

        int id = rs.nScriptIntrinsicCreate(4, e.getID(rs));
        return new ScriptIntrinsicConvolve5x5(id, rs);