Search in sources :

Example 1 with FrameType

use of androidx.media.filterfw.FrameType in project android_frameworks_base by ResurrectionRemix.

the class StatsFilter method getSignature.

@Override
public Signature getSignature() {
    FrameType inputFrame = FrameType.buffer2D(FrameType.ELEMENT_INT8);
    FrameType floatT = FrameType.single(float.class);
    return new Signature().addInputPort("buffer", Signature.PORT_REQUIRED, inputFrame).addInputPort("cropRect", Signature.PORT_OPTIONAL, FrameType.single(Quad.class)).addOutputPort("mean", Signature.PORT_REQUIRED, floatT).addOutputPort("stdev", Signature.PORT_REQUIRED, floatT).disallowOtherPorts();
}
Also used : FrameType(androidx.media.filterfw.FrameType) Signature(androidx.media.filterfw.Signature)

Example 2 with FrameType

use of androidx.media.filterfw.FrameType in project android_frameworks_base by ResurrectionRemix.

the class RotateFilter method getSignature.

@Override
public Signature getSignature() {
    FrameType imageIn = FrameType.image2D(FrameType.ELEMENT_RGBA8888, FrameType.READ_GPU);
    FrameType imageOut = FrameType.image2D(FrameType.ELEMENT_RGBA8888, FrameType.WRITE_GPU);
    return new Signature().addInputPort("image", Signature.PORT_REQUIRED, imageIn).addInputPort("rotateAngle", Signature.PORT_REQUIRED, FrameType.single(float.class)).addInputPort("sourceRect", Signature.PORT_OPTIONAL, FrameType.single(Quad.class)).addOutputPort("image", Signature.PORT_REQUIRED, imageOut).disallowOtherPorts();
}
Also used : Quad(androidx.media.filterfw.geometry.Quad) FrameType(androidx.media.filterfw.FrameType) Signature(androidx.media.filterfw.Signature)

Example 3 with FrameType

use of androidx.media.filterfw.FrameType in project android_frameworks_base by ResurrectionRemix.

the class TransformUtils method makeMipMappedFrame.

public static FrameImage2D makeMipMappedFrame(FrameImage2D current, int[] dimensions) {
    // Note: Future versions of GLES will support NPOT mipmapping. When these become more
    // widely used, we can add a check here to disable frame expansion on such devices.
    int[] pow2Dims = new int[] { powOf2(dimensions[0]), powOf2(dimensions[1]) };
    if (current == null) {
        FrameType imageType = FrameType.image2D(FrameType.ELEMENT_RGBA8888, FrameType.READ_GPU | FrameType.WRITE_GPU);
        current = Frame.create(imageType, pow2Dims).asFrameImage2D();
    } else if (!Arrays.equals(dimensions, current.getDimensions())) {
        current.resize(pow2Dims);
    }
    return current;
}
Also used : FrameType(androidx.media.filterfw.FrameType)

Example 4 with FrameType

use of androidx.media.filterfw.FrameType in project android_frameworks_base by ResurrectionRemix.

the class AvgBrightnessFilter method getSignature.

@Override
public Signature getSignature() {
    FrameType imageIn = FrameType.image2D(FrameType.ELEMENT_RGBA8888, FrameType.READ_CPU);
    FrameType floatT = FrameType.single(float.class);
    return new Signature().addInputPort("image", Signature.PORT_REQUIRED, imageIn).addOutputPort("brightnessRating", Signature.PORT_OPTIONAL, floatT).disallowOtherPorts();
}
Also used : FrameType(androidx.media.filterfw.FrameType) Signature(androidx.media.filterfw.Signature)

Example 5 with FrameType

use of androidx.media.filterfw.FrameType in project android_frameworks_base by ResurrectionRemix.

the class BrightnessFilter method getSignature.

@Override
public Signature getSignature() {
    FrameType imageIn = FrameType.image2D(FrameType.ELEMENT_RGBA8888, FrameType.READ_GPU);
    FrameType imageOut = FrameType.image2D(FrameType.ELEMENT_RGBA8888, FrameType.WRITE_GPU);
    return new Signature().addInputPort("image", Signature.PORT_REQUIRED, imageIn).addInputPort("brightness", Signature.PORT_OPTIONAL, FrameType.single(float.class)).addOutputPort("image", Signature.PORT_REQUIRED, imageOut).disallowOtherPorts();
}
Also used : FrameType(androidx.media.filterfw.FrameType) Signature(androidx.media.filterfw.Signature)

Aggregations

FrameType (androidx.media.filterfw.FrameType)72 Signature (androidx.media.filterfw.Signature)64 Camera (android.hardware.Camera)4 Quad (androidx.media.filterfw.geometry.Quad)4