当前位置: 首页>>代码示例>>Java>>正文


Java EffectContext.createWithCurrentGlContext方法代码示例

本文整理汇总了Java中android.media.effect.EffectContext.createWithCurrentGlContext方法的典型用法代码示例。如果您正苦于以下问题:Java EffectContext.createWithCurrentGlContext方法的具体用法?Java EffectContext.createWithCurrentGlContext怎么用?Java EffectContext.createWithCurrentGlContext使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.media.effect.EffectContext的用法示例。

在下文中一共展示了EffectContext.createWithCurrentGlContext方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: onDrawFrame

import android.media.effect.EffectContext; //导入方法依赖的package包/类
@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();
}
 
开发者ID:sdrausty,项目名称:buildAPKsSamples,代码行数:17,代码来源:HelloEffects.java


示例2: onDrawFrame

import android.media.effect.EffectContext; //导入方法依赖的package包/类
@Override
public void onDrawFrame(GL10 gl) {
    if (!mInitialized) {
        //Only need to do this once
        mEffectContext = EffectContext.createWithCurrentGlContext();
        init();
        loadTextures();
        mInitialized = true;
    }
    if (mEffectChanged) {
        initEffect();
        applyEffect();
        mEffectChanged = false;
    }
    renderResult();
}
 
开发者ID:Gyebro,项目名称:android-demos,代码行数:17,代码来源:TextureRenderer.java


示例3: onDrawFrame

import android.media.effect.EffectContext; //导入方法依赖的package包/类
@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));
	}
}
 
开发者ID:Grishu,项目名称:ImageEffects,代码行数:20,代码来源:EffectsFilterActivity.java


示例4: getEffect

import android.media.effect.EffectContext; //导入方法依赖的package包/类
protected Effect getEffect(String name) {
       Effect effect = null;
        if (context == null) {
            context = EffectContext.createWithCurrentGlContext();
        }
        effect = context.getFactory().createEffect(name);
        effect.setParameter("tile_size", DEFAULT_TILE_SIZE);
        effects.put(this, effect);
    return effect;
}
 
开发者ID:hubert1002,项目名称:WiCamera3D,代码行数:11,代码来源:Filter.java


示例5: onDrawFrame

import android.media.effect.EffectContext; //导入方法依赖的package包/类
@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]);
}
 
开发者ID:xu6148152,项目名称:binea_project_for_android,代码行数:15,代码来源:MainActivity.java


示例6: onSurfaceCreated

import android.media.effect.EffectContext; //导入方法依赖的package包/类
@Override
public void onSurfaceCreated(GL10 gl, EGLConfig config) {
    TypedValue a = new TypedValue();
    getContext().getTheme().resolveAttribute(android.R.attr.colorBackground, a, true);
    if (a.type >= TypedValue.TYPE_FIRST_COLOR_INT
            && a.type <= TypedValue.TYPE_LAST_COLOR_INT) {
        mBackgroundColor = new GLColor(a.data);
    } else {
        mBackgroundColor = new GLColor(Color.WHITE);
    }

    // We have a 2d (fake) scenario, disable all unnecessary tests. Deep are
    // necessary for some 3d effects
    GLES20.glDisable(GL10.GL_DITHER);
    GLESUtil.glesCheckError("glDisable");
    GLES20.glDisable(GL10.GL_CULL_FACE);
    GLESUtil.glesCheckError("glDisable");
    GLES20.glEnable(GL10.GL_DEPTH_TEST);
    GLESUtil.glesCheckError("glEnable");
    GLES20.glDepthMask(false);
    GLESUtil.glesCheckError("glDepthMask");
    GLES20.glDepthFunc(GLES20.GL_LEQUAL);
    GLESUtil.glesCheckError("glDepthFunc");

    // Recreate the effect contexts
    recycle();
    synchronized (mLock) {
        mEffectContext = EffectContext.createWithCurrentGlContext();
        mEffectsFactory = new Effects(mContext, mEffectContext);
        mBordersFactory = new Borders(mContext, mEffectContext);

        recreateContext();
        boolean singleTexture = mTransitionType.equals(Transitions.TRANSITIONS.NO_TRANSITION);
        mTextureManager = new SimpleTextureManager(mContext, mEffect, mBorder, singleTexture);
        mTransition = Transitions.createTransition(mContext, mTextureManager, mTransitionType);
    }

    mRecycled = false;
}
 
开发者ID:jruesga,项目名称:PhotoPhase,代码行数:40,代码来源:LivePreviewView.java


示例7: onSurfaceCreated

import android.media.effect.EffectContext; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void onSurfaceCreated(GL10 glUnused, EGLConfig config) {
    if (DEBUG) Log.d(TAG, "onSurfaceCreated [" + mInstance + "]");

    mWidth = -1;
    mHeight = -1;
    mMeasuredHeight = -1;
    mStatusBarHeight = 0;

    mLastTransition = System.currentTimeMillis();

    // We have a 2d (fake) scenario, disable all unnecessary tests. Deep are
    // necessary for some 3d effects
    GLES20.glDisable(GL10.GL_DITHER);
    GLESUtil.glesCheckError("glDisable");
    GLES20.glDisable(GL10.GL_CULL_FACE);
    GLESUtil.glesCheckError("glDisable");
    GLES20.glEnable(GL10.GL_DEPTH_TEST);
    GLESUtil.glesCheckError("glEnable");
    GLES20.glDepthMask(false);
    GLESUtil.glesCheckError("glDepthMask");
    GLES20.glDepthFunc(GLES20.GL_LEQUAL);
    GLESUtil.glesCheckError("glDepthFunc");

    // Create an effect context
    if (mEffectContext != null) {
        mEffectContext.release();
    }
    mEffectContext = EffectContext.createWithCurrentGlContext();

    // Create the texture manager and recycle the old one
    if (mTextureManager == null) {
        // Precalculate the window size for the PhotoPhaseTextureManager. In onSurfaceChanged
        // the best fixed size will be set. The disposition size is simple for a better
        // performance of the internal arrays
        final Configuration conf = mContext.getResources().getConfiguration();
        int orientation = mContext.getResources().getConfiguration().orientation;
        int w = (int) AndroidHelper.convertDpToPixel(mContext, conf.screenWidthDp);
        int h = (int) AndroidHelper.convertDpToPixel(mContext, conf.screenHeightDp);
        Rect dimensions = new Rect(0, 0, w, h);
        int cc = (orientation == Configuration.ORIENTATION_PORTRAIT)
                    ? Preferences.Layout.getPortraitDisposition(mContext).size()
                    : Preferences.Layout.getLandscapeDisposition(mContext).size();

        // Recycle the current texture manager and create a new one
        recycle();
        mTextureManager = new PhotoPhaseTextureManager(
                mContext, mHandler, mEffectContext, mDispatcher, cc, dimensions);
    } else {
        mTextureManager.updateEffectContext(mEffectContext);
    }

    // Schedule dispositions random recreation (if need it)
    scheduleDispositionRecreation();
}
 
开发者ID:jruesga,项目名称:PhotoPhase,代码行数:59,代码来源:PhotoPhaseRenderer.java



注:本文中的android.media.effect.EffectContext.createWithCurrentGlContext方法示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。