Java 类android.media.effect.EffectFactory 实例源码

项目:libcommon    文件:MediaEffect.java   
/**
 * コンストラクタ
 * GLコンテキスト内で生成すること
 * @param effect_context
 */
public MediaEffect(final EffectContext effect_context, final String effectName) {
    mEffectContext = effect_context;
    final EffectFactory factory = effect_context.getFactory();
    if (TextUtils.isEmpty(effectName)) {
        mEffect = null;
    } else {
        mEffect = factory.createEffect(effectName);
    }
}
项目:WiCamera3D    文件:RedEyeFilter.java   
@Override
public void process(Photo src, Photo dst) {
    Effect effect = getEffect(EffectFactory.EFFECT_REDEYE);
    float[] centers = new float[redeyes.size() * 2];
    int i = 0;
    for (PointF eye : redeyes) {
        centers[i++] = eye.x;
        centers[i++] = eye.y;
    }
    effect.setParameter("centers", centers);
    effect.apply(src.texture(), src.width(), src.height(), dst.texture());
}
项目:binea_project_for_android    文件:MainActivity.java   
@Override
public void onDrawFrame(GL10 gl10) {
    if(effectContext==null) {
        effectContext = EffectContext.createWithCurrentGlContext();
    }
    if(effect!=null){
        effect.release();
    }
    if(null == effectType){
        effectType = EffectFactory.EFFECT_DOCUMENTARY;
    }
    grayScaleEffect(effectType);
    square.draw(textures[1]);
}
项目:PhotoPhase    文件:PhotoPhaseEffect.java   
/**
 * An abstract constructor of <code>Effect</code> to follow the rules
 * defined by {@link EffectFactory}.
 *
 * @param ctx The effect context
 * @param name The effect name
 */
public PhotoPhaseEffect(EffectContext ctx, String name) {
    super();
    mName = name;

    // Stand on MCA identity effect for the initialization work
    EffectFactory effectFactory = ctx.getFactory();
    mIdentityEffect = effectFactory.createEffect(MCA_IDENTITY_EFFECT);
}
项目:PhotoPhase    文件:Border.java   
/**
 * An abstract constructor of <code>Border</code> to follow the rules
 * defined by {@link EffectFactory}.
 *
 * @param ctx The effect context
 * @param name The effect name
 */
public Border(EffectContext ctx, String name) {
    super();
    mName = name;
    mColor = new GLESUtil.GLColor(1, 0, 0, 0);
    mBgColor = new GLESUtil.GLColor(1, 0, 0, 0);

    // Stand on MCA identity effect for the initialization work
    EffectFactory effectFactory = ctx.getFactory();
    mIdentityEffect = effectFactory.createEffect(MCA_IDENTITY_EFFECT);
}
项目:binea_project_for_android    文件:MainActivity.java   
private void grayScaleEffect(String effectType){
    EffectFactory factory = effectContext.getFactory();
    effect = factory.createEffect(effectType);
    effect.apply(textures[0], photoWidth, photoHeight, textures[1]);
}
项目:libcommon    文件:MediaEffectFlip.java   
/**
 * コンストラクタ
 * GLコンテキスト内で生成すること
 *
 * @param effect_context
 * @param flip_vertical
 * @param flip_horizontal
 */
public MediaEffectFlip(final EffectContext effect_context,
    final boolean flip_vertical, final boolean flip_horizontal) {

    super(effect_context, EffectFactory.EFFECT_FLIP);
    setParameter(flip_vertical, flip_horizontal);
}
项目:libcommon    文件:MediaEffectCrop.java   
/**
 * コンストラクタ
 * GLコンテキスト内で生成すること
 *
 * @param effect_context
 * @param x The origin's x-value. between 0 and width of the image.
 * @param y The origin's y-value. between 0 and height of the image.
 * @param width The width of the cropped image.
 *          between 1 and the width of the image minus xorigin.
 * @param height The height of the cropped image.
 *          between 1 and the height of the image minus yorigin.
 */
public MediaEffectCrop(final EffectContext effect_context,
    final int x, final int y, final int width, final int height) {

    super(effect_context, EffectFactory.EFFECT_CROP);
    setParameter(x, y, width, height);
}
项目:libcommon    文件:MediaEffectDuoTone.java   
/**
 * コンストラクタ
 * GLコンテキスト内で生成すること
 *
 * @param effect_context
 * @param first_color The first color tone.
 *          representing an ARGB color with 8 bits per channel.
 *          May be created using Color class.
 * @param second_color The second color tone. Integer,
 *          representing an ARGB color with 8 bits per channel.
 *          May be created using Color class.
 */
public MediaEffectDuoTone(final EffectContext effect_context,
    final int first_color, final int second_color) {

    super(effect_context, EffectFactory.EFFECT_DUOTONE);
    setParameter(first_color, second_color);
}
项目:libcommon    文件:MediaEffectBitmapOverlay.java   
/**
 * コンストラクタ
 * GLコンテキスト内で生成すること
 *
 * @param effect_context
 * @param bitmap The overlay bitmap.
 */
public MediaEffectBitmapOverlay(final EffectContext effect_context,
    final Bitmap bitmap) {

    super(effect_context, EffectFactory.EFFECT_BITMAPOVERLAY);
    setParameter(bitmap);
}
项目:libcommon    文件:MediaEffectDocumentary.java   
/**
 * コンストラクタ
 * GLコンテキスト内で生成すること
 *
 * @param effect_context
 */
public MediaEffectDocumentary(final EffectContext effect_context) {
    super(effect_context, EffectFactory.EFFECT_DOCUMENTARY);
}
项目:libcommon    文件:MediaEffectCrossProcess.java   
/**
 * コンストラクタ
 * GLコンテキスト内で生成すること
 *
 * @param effect_context
 */
public MediaEffectCrossProcess(final EffectContext effect_context) {
    super(effect_context, EffectFactory.EFFECT_CROSSPROCESS);
}
项目:libcommon    文件:MediaEffectSaturate.java   
/**
 * コンストラクタ
 * GLコンテキスト内で生成すること
 *
 * @param effect_context
 * @param scale The scale of color saturation.
 *          between -1 and 1. 0 means no change,
 *          while -1 indicates full desaturation, i.e. grayscale.
 */
public MediaEffectSaturate(final EffectContext effect_context, final float scale) {
    super(effect_context, EffectFactory.EFFECT_SATURATE);
    setParameter(scale);
}
项目:libcommon    文件:MediaEffectVignette.java   
/**
 * コンストラクタ
 * GLコンテキスト内で生成すること
 *
 * @param effect_context
 * @param scale The scale of vignetting. between 0 and 1. 0 means no change.
 */
public MediaEffectVignette(final EffectContext effect_context, final float scale) {
    super(effect_context, EffectFactory.EFFECT_SHARPEN);
    setParameter(scale);
}
项目:libcommon    文件:MediaEffectStraighten.java   
/**
 * コンストラクタ
 * GLコンテキスト内で生成すること
 *
 * @param effect_context
 * @param angle The angle of rotation. between -45 and +45.
 */
public MediaEffectStraighten(final EffectContext effect_context, final float angle) {
    super(effect_context, EffectFactory.EFFECT_STRAIGHTEN);
    setParameter(angle);
}
项目:libcommon    文件:MediaEffectContrast.java   
/**
 * コンストラクタ
 * GLコンテキスト内で生成すること
 *
 * @param effect_context
 * @param contrast The contrast multiplier. Float. 1.0 means no change; larger values will increase contrast.
 */
public MediaEffectContrast(final EffectContext effect_context, final float contrast) {
    super(effect_context, EffectFactory.EFFECT_CONTRAST);
    setParameter(contrast);
}
项目:libcommon    文件:MediaEffectTint.java   
/**
 * コンストラクタ
 * GLコンテキスト内で生成すること
 *
 * @param effect_context
 * @param tint The color of the tint.
 *          representing an ARGB color with 8 bits per channel.
 *          May be created using Color class.
 */
public MediaEffectTint(final EffectContext effect_context, final int tint) {
    super(effect_context, EffectFactory.EFFECT_TINT);
    setParameter(tint);
}
项目:libcommon    文件:MediaEffectTemperature.java   
/**
 * コンストラクタ
 * GLコンテキスト内で生成すること
 *
 * @param effect_context
 * @param scale The value of color temperature. between 0 and 1,
 * with 0 indicating cool, and 1 indicating warm.
 * A value of of 0.5 indicates no change.
 */
public MediaEffectTemperature(final EffectContext effect_context, final float scale) {
    super(effect_context, EffectFactory.EFFECT_TEMPERATURE);
    setParameter(scale);
}
项目:libcommon    文件:MediaEffectGrain.java   
/**
 * コンストラクタ
 * GLコンテキスト内で生成すること
 *
 * @param effect_context
 * @param strength The strength of the grain effect. between 0 and 1. Zero means no change.
 */
public MediaEffectGrain(final EffectContext effect_context, final float strength) {
    super(effect_context, EffectFactory.EFFECT_GRAIN);
    setParameter(strength);
}
项目:libcommon    文件:MediaEffectFishEye.java   
/**
 * コンストラクタ
 * GLコンテキスト内で生成すること
 *
 * @param effect_context
 * @param scale The scale of the distortion. between 0 and 1. Zero means no distortion.
 */
public MediaEffectFishEye(final EffectContext effect_context, final float scale) {
    super(effect_context, EffectFactory.EFFECT_FISHEYE);
    setParameter(scale);
}
项目:libcommon    文件:MediaEffectGrayScale.java   
/**
 * コンストラクタ
 * GLコンテキスト内で生成すること
 *
 * @param effect_context
 */
public MediaEffectGrayScale(final EffectContext effect_context) {
    super(effect_context, EffectFactory.EFFECT_GRAYSCALE);
}
项目:libcommon    文件:MediaEffectLomoish.java   
/**
 * コンストラクタ
 * GLコンテキスト内で生成すること
 *
 * @param effect_context
 */
public MediaEffectLomoish(final EffectContext effect_context) {
    super(effect_context, EffectFactory.EFFECT_LOMOISH);
}
项目:libcommon    文件:MediaEffectRedEye.java   
/**
 * コンストラクタ
 * GLコンテキスト内で生成すること
 *
 * @param effect_context
 * @param centers Multiple center points (x, y) of the red eye regions.
 *          An array of floats, where (f[2*i], f[2*i+1])
 *          specifies the center of the i'th eye.
 *          Coordinate values are expected to be normalized between 0 and 1.
 */
public MediaEffectRedEye(final EffectContext effect_context, final float[] centers) {
    super(effect_context, EffectFactory.EFFECT_REDEYE);
    setParameter(centers);
}
项目:libcommon    文件:MediaEffectBlackWhite.java   
/**
 * コンストラクタ
 * GLコンテキスト内で生成すること
 *
 * @param effect_context
 * @param black The value of the minimal pixel. 0-1
 * @param white The value of the maximal pixel. 0-1
 */
public MediaEffectBlackWhite(final EffectContext effect_context, final float black, final float white) {
    super(effect_context, EffectFactory.EFFECT_BLACKWHITE);
    setParameter(black, white);
}
项目:libcommon    文件:MediaEffectRotate.java   
/**
 * コンストラクタ
 * GLコンテキスト内で生成すること
 *
 * @param effect_context
 * @param angle The angle of rotation in degrees.
 *          This will be rounded to the nearest multiple of 90.
 */
public MediaEffectRotate(final EffectContext effect_context, final int angle) {
    super(effect_context, EffectFactory.EFFECT_ROTATE);
    setParameter(angle);
}
项目:libcommon    文件:MediaEffectFillLight.java   
/**
 * コンストラクタ
 * GLコンテキスト内で生成すること
 *
 * @param effect_context
 * @param strength between 0 and 1. between 0 and 1. Zero means no change.
 */
public MediaEffectFillLight(final EffectContext effect_context, final float strength) {
    super(effect_context, EffectFactory.EFFECT_FILLLIGHT);
    setParameter(strength);
}
项目:libcommon    文件:MediaEffectSepia.java   
/**
 * コンストラクタ
 * GLコンテキスト内で生成すること
 *
 * @param effect_context
 */
public MediaEffectSepia(final EffectContext effect_context) {
    super(effect_context, EffectFactory.EFFECT_SEPIA);
}
项目:libcommon    文件:MediaEffectBackDropper.java   
/**
 * コンストラクタ
 * GLコンテキスト内で生成すること
 *
 * @param effect_context
 * @param source A URI for the background video to use.
 * This parameter must be supplied before calling apply() for the first time.
 */
public MediaEffectBackDropper(final EffectContext effect_context, final String source) {
    super(effect_context, EffectFactory.EFFECT_BACKDROPPER);
    setParameter(source);
}
项目:libcommon    文件:MediaEffectSharpen.java   
/**
 * コンストラクタ
 * GLコンテキスト内で生成すること
 *
 * @param effect_context
 * @param scale The degree of sharpening. Float, between 0 and 1. 0 means no change.
 */
public MediaEffectSharpen(final EffectContext effect_context, final float scale) {
    super(effect_context, EffectFactory.EFFECT_SHARPEN);
    setParameter(scale);
}
项目:libcommon    文件:MediaEffectNegative.java   
/**
 * コンストラクタ
 * GLコンテキスト内で生成すること
 *
 * @param effect_context
 */
public MediaEffectNegative(final EffectContext effect_context) {
    super(effect_context, EffectFactory.EFFECT_NEGATIVE);
}
项目:libcommon    文件:MediaEffectNull.java   
/**
 * コンストラクタ
 * GLコンテキスト内で生成すること
 * 入力テクスチャを無変換で出力テクスチャにコピーする
 * @param effect_context
 */
public MediaEffectNull(final EffectContext effect_context) {
    super(effect_context, EffectFactory.EFFECT_AUTOFIX);
    setParameter("scale", 0.0f);    // scale=0.0fならコピー
}
项目:libcommon    文件:MediaEffectAutoFix.java   
/**
 * コンストラクタ
 * GLコンテキスト内で生成すること
 *
 * @param effect_context
 * @param scale The scale of the adjustment. between 0 and 1.
 * Zero means no adjustment, while 1 indicates the maximum amount of adjustment.
 */
public MediaEffectAutoFix(final EffectContext effect_context, final float scale) {
    super(effect_context, EffectFactory.EFFECT_AUTOFIX);
    setParameter(scale);
}
项目:android-base-framework    文件:BaseActivity.java   
@Subscribe
public void sampleMethodPreventEventbusCrash(EffectFactory event) {

}