类android.media.effect.EffectContext源码实例Demo

下面列出了怎么用android.media.effect.EffectContext的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: graphics-samples   文件: MediaEffectsFragment.java
@Override
public void onDrawFrame(GL10 gl) {
    if (!mInitialized) {
        //Only need to do this once
        mEffectContext = EffectContext.createWithCurrentGlContext();
        mTexRenderer.init();
        loadTextures();
        mInitialized = true;
    }
    if (mCurrentEffect != R.id.none) {
        //if an effect is chosen initialize it and apply it to the texture
        initEffect();
        applyEffect();
    }
    renderResult();
}
 
源代码2 项目: Rocko-Android-Demos   文件: MainActivity.java
@Override
public void onDrawFrame(GL10 gl) {
    if (!mInitialized) {
        //Only need to do this once
        mEffectContext = EffectContext.createWithCurrentGlContext();
        mTexRenderer.init();
        loadTextures();
        mInitialized = true;
    }
    if (mCurrentEffect != R.id.none) {
        //if an effect is chosen initialize it and apply it to the texture
        initEffect();
        applyEffect();
    }
    renderResult();
}
 
源代码3 项目: ImageEffects   文件: EffectsFilterActivity.java
@Override
public void onDrawFrame(GL10 gl) {
	if (!mInitialized) {
		// Only need to do this once
		mEffectContext = EffectContext.createWithCurrentGlContext();
		mTexRenderer.init();
		loadTextures();
		mInitialized = true;
	}
	if (mCurrentEffect != R.id.none) {
		// if an effect is chosen initialize it and apply it to the texture
		initEffect();
		applyEffect();
	}
	renderResult();
	if (saveFrame) {
		saveBitmap(takeScreenshot(gl));
	}
}
 
@Override
public void onDrawFrame(GL10 gl) {
    if (!mInitialized) {
        //Only need to do this once
        mEffectContext = EffectContext.createWithCurrentGlContext();
        mTexRenderer.init();
        loadTextures();
        mInitialized = true;
    }
    if (mCurrentEffect != R.id.none) {
        //if an effect is chosen initialize it and apply it to the texture
        initEffect();
        applyEffect();
    }
    renderResult();
}
 
源代码5 项目: PhotoEditor   文件: ImageFilterView.java
@Override
public void onDrawFrame(GL10 gl) {

    if (!mInitialized) {
        //Only need to do this once
        mEffectContext = EffectContext.createWithCurrentGlContext();
        mTexRenderer.init();
        loadTextures();
        mInitialized = true;
    }
    if (mCurrentEffect != NONE || mCustomEffect != null) {
        //if an effect is chosen initialize it and apply it to the texture
        initEffect();
        applyEffect();
    }
    renderResult();
    if (isSaveImage) {
        final Bitmap mFilterBitmap = BitmapUtil.createBitmapFromGLSurface(this, gl);
        Log.e(TAG, "onDrawFrame: " + mFilterBitmap);
        isSaveImage = false;
        if (mOnSaveBitmap != null) {
            new Handler(Looper.getMainLooper()).post(new Runnable() {
                @Override
                public void run() {
                    mOnSaveBitmap.onBitmapReady(mFilterBitmap);
                }
            });
        }
    }
}
 
源代码6 项目: 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);
	}
}
 
源代码7 项目: 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);
}
 
源代码8 项目: 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);
}
 
源代码9 项目: 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);
}
 
源代码10 项目: 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);
}
 
源代码11 项目: libcommon   文件: MediaEffectDocumentary.java
/**
 * コンストラクタ
 * GLコンテキスト内で生成すること
 *
 * @param effect_context
 */
public MediaEffectDocumentary(final EffectContext effect_context) {
	super(effect_context, EffectFactory.EFFECT_DOCUMENTARY);
}
 
源代码12 项目: libcommon   文件: MediaEffectCrossProcess.java
/**
 * コンストラクタ
 * GLコンテキスト内で生成すること
 *
 * @param effect_context
 */
public MediaEffectCrossProcess(final EffectContext effect_context) {
	super(effect_context, EffectFactory.EFFECT_CROSSPROCESS);
}
 
源代码13 项目: 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);
}
 
源代码14 项目: 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);
}
 
源代码15 项目: 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);
}
 
源代码16 项目: libcommon   文件: MediaEffectFlipVertical.java
/**
 * コンストラクタ
 * GLコンテキスト内で生成すること
 *
 * @param effect_context
 */
public MediaEffectFlipVertical(final EffectContext effect_context) {
	super(effect_context, true, false);
}
 
源代码17 项目: 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);
}
 
源代码18 项目: 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);
}
 
源代码19 项目: 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);
}
 
源代码20 项目: 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);
}
 
源代码21 项目: 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);
}
 
源代码22 项目: libcommon   文件: MediaEffectFlipHorizontal.java
/**
 * コンストラクタ
 * GLコンテキスト内で生成すること
 *
 * @param effect_context
 */
public MediaEffectFlipHorizontal(final EffectContext effect_context) {
	super(effect_context, false, true);
}
 
源代码23 项目: libcommon   文件: MediaEffectGrayScale.java
/**
 * コンストラクタ
 * GLコンテキスト内で生成すること
 *
 * @param effect_context
 */
public MediaEffectGrayScale(final EffectContext effect_context) {
	super(effect_context, EffectFactory.EFFECT_GRAYSCALE);
}
 
源代码24 项目: libcommon   文件: MediaEffectLomoish.java
/**
 * コンストラクタ
 * GLコンテキスト内で生成すること
 *
 * @param effect_context
 */
public MediaEffectLomoish(final EffectContext effect_context) {
	super(effect_context, EffectFactory.EFFECT_LOMOISH);
}
 
源代码25 项目: 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);
}
 
源代码26 项目: libcommon   文件: MediaEffectBlackWhite.java
/**
 * コンストラクタ
 * GLコンテキスト内で生成すること
 *
 * @param effect_context
 */
public MediaEffectBlackWhite(final EffectContext effect_context) {
	this(effect_context, 0.0f, 1.0f);
}
 
源代码27 项目: 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);
}
 
源代码28 项目: 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);
}
 
源代码29 项目: 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);
}
 
源代码30 项目: libcommon   文件: MediaEffectSepia.java
/**
 * コンストラクタ
 * GLコンテキスト内で生成すること
 *
 * @param effect_context
 */
public MediaEffectSepia(final EffectContext effect_context) {
	super(effect_context, EffectFactory.EFFECT_SEPIA);
}
 
 类所在包
 同包方法