IT. Expert System.

Android Reference

Effect


android.media.effect

Class Effect

  • Direct Known Subclasses:
    FilterEffect


    public abstract class Effect
    extends Object

    Effects are high-performance transformations that can be applied to image frames. These are passed in the form of OpenGL ES 2.0 texture names. Typical frames could be images loaded from disk, or frames from the camera or other video streams.

    To create an Effect you must first create an EffectContext. You can obtain an instance of the context's EffectFactory by calling getFactory(). The EffectFactory allows you to instantiate specific Effects.

    The application is responsible for creating an EGL context, and making it current before applying an effect. An effect is bound to a single EffectContext, which in turn is bound to a single EGL context. If your EGL context is destroyed, the EffectContext becomes invalid and any effects bound to this context can no longer be used.

    • Constructor Detail

      • Effect

        public Effect()
    • Method Detail

      • getName

        public abstract String getName()
        Get the effect name. Returns the unique name of the effect, which matches the name used for instantiating this effect by the EffectFactory.
        Returns:
        The name of the effect.
      • apply

        public abstract void apply(int inputTexId,
                 int width,
                 int height,
                 int outputTexId)
        Apply an effect to GL textures.

        Apply the Effect on the specified input GL texture, and write the result into the output GL texture. The texture names passed must be valid in the current GL context.

        The input texture must be a valid texture name with the given width and height and must be bound to a GL_TEXTURE_2D texture image (usually done by calling the glTexImage2D() function). Multiple mipmap levels may be provided.

        If the output texture has not been bound to a texture image, it will be automatically bound by the effect as a GL_TEXTURE_2D. It will contain one mipmap level (0), which will have the same size as the input. No other mipmap levels are defined. If the output texture was bound already, and its size does not match the input texture size, the result may be clipped or only partially fill the texture.

        Note, that regardless of whether a texture image was originally provided or not, both the input and output textures are owned by the caller. That is, the caller is responsible for calling glDeleteTextures() to deallocate the input and output textures.

        Parameters:
        inputTexId - The GL texture name of a valid and bound input texture.
        width - The width of the input texture in pixels.
        height - The height of the input texture in pixels.
        outputTexId - The GL texture name of the output texture.
      • setParameter

        public abstract void setParameter(String parameterKey,
                        Object value)
        Set a filter parameter. Consult the effect documentation for a list of supported parameter keys for each effect.
        Parameters:
        parameterKey - The name of the parameter to adjust.
        value - The new value to set the parameter to.
        Throws:
        InvalidArgumentException - if parameterName is not a recognized name, or the value is not a valid value for this parameter.
      • setUpdateListener

        public void setUpdateListener(EffectUpdateListener listener)
        Set an effect listener. Some effects may report state changes back to the host, if a listener is set. Consult the individual effect documentation for more details.
        Parameters:
        listener - The listener to receive update callbacks on.
      • release

        public abstract void release()
        Release an effect.

        Releases the effect and any resources associated with it. You may call this if you need to make sure acquired resources are no longer held by the effect. Releasing an effect makes it invalid for reuse.

        Note that this method must be called with the EffectContext and EGL context current, as the effect may release internal GL resources.



Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 82 / 158668769. Delta: 0.04172 с