Search in sources :

Example 1 with BrightnessEffect

use of rahmatzulfikri.com.androidvideoedit.Effect.BrightnessEffect in project react-native-android-video-editor by RZulfikri.

the class ImageTextureRenderer method setImage.

//    public void setImage(){
public void setImage(String path, int position, int filterCode) {
    //         Log.e("DEBUG", "MASUK IMAGE");
    MediaMetadataRetriever mediaMetadataRetriever = new MediaMetadataRetriever();
    mediaMetadataRetriever.setDataSource(path);
    photo = mediaMetadataRetriever.getFrameAtTime(position * 1000, MediaMetadataRetriever.OPTION_CLOSEST_SYNC);
    photoWidth = photo.getWidth();
    photoHeight = photo.getHeight();
    mediaMetadataRetriever.release();
    mediaMetadataRetriever = null;
    switch(filterCode) {
        case 0:
            fragmentShaderCode = new NoEffect();
            break;
        case 1:
            fragmentShaderCode = new BlackAndWhiteEffect();
            break;
        case 2:
            fragmentShaderCode = new BrightnessEffect(0.5f);
            break;
        case 3:
            fragmentShaderCode = new ContrastEffect(0.5f);
            break;
        case 4:
            fragmentShaderCode = new CrossProcessEffect();
            break;
        case 5:
            fragmentShaderCode = new DocumentaryEffect(photoWidth, photoHeight);
            break;
        case 6:
            fragmentShaderCode = new DuotoneEffect(Color.CYAN, Color.BLUE);
            break;
        case 7:
            fragmentShaderCode = new FillLightEffect(0.5f);
            break;
        case 8:
            fragmentShaderCode = new GammaEffect(1.0f);
            break;
        case 9:
            fragmentShaderCode = new GreyScaleEffect();
            break;
        case 10:
            fragmentShaderCode = new HueEffect(90f);
            break;
        case 11:
            fragmentShaderCode = new InvertColorsEffect();
            break;
        case 12:
            fragmentShaderCode = new LamoishEffect(photoWidth, photoHeight);
            break;
        case 13:
            fragmentShaderCode = new PosterizeEffect();
            break;
        case 14:
            fragmentShaderCode = new SaturationEffect(0.1f);
            break;
        case 15:
            fragmentShaderCode = new SepiaEffect();
            break;
        case 16:
            fragmentShaderCode = new SharpnessEffect(0.5f, photoWidth, photoHeight);
            break;
        case 17:
            fragmentShaderCode = new TemperatureEffect(0.5f);
            break;
        case 18:
            fragmentShaderCode = new TintEffect(Color.BLUE);
            break;
        case 19:
            fragmentShaderCode = new VignetteEffect(0.5f, photoWidth, photoHeight);
            break;
        default:
            fragmentShaderCode = new NoEffect();
            break;
    }
}
Also used : HueEffect(rahmatzulfikri.com.androidvideoedit.Effect.HueEffect) CrossProcessEffect(rahmatzulfikri.com.androidvideoedit.Effect.CrossProcessEffect) LamoishEffect(rahmatzulfikri.com.androidvideoedit.Effect.LamoishEffect) TemperatureEffect(rahmatzulfikri.com.androidvideoedit.Effect.TemperatureEffect) InvertColorsEffect(rahmatzulfikri.com.androidvideoedit.Effect.InvertColorsEffect) SaturationEffect(rahmatzulfikri.com.androidvideoedit.Effect.SaturationEffect) TintEffect(rahmatzulfikri.com.androidvideoedit.Effect.TintEffect) SharpnessEffect(rahmatzulfikri.com.androidvideoedit.Effect.SharpnessEffect) VignetteEffect(rahmatzulfikri.com.androidvideoedit.Effect.VignetteEffect) NoEffect(rahmatzulfikri.com.androidvideoedit.Effect.NoEffect) ContrastEffect(rahmatzulfikri.com.androidvideoedit.Effect.ContrastEffect) DocumentaryEffect(rahmatzulfikri.com.androidvideoedit.Effect.DocumentaryEffect) FillLightEffect(rahmatzulfikri.com.androidvideoedit.Effect.FillLightEffect) GammaEffect(rahmatzulfikri.com.androidvideoedit.Effect.GammaEffect) SepiaEffect(rahmatzulfikri.com.androidvideoedit.Effect.SepiaEffect) MediaMetadataRetriever(android.media.MediaMetadataRetriever) BrightnessEffect(rahmatzulfikri.com.androidvideoedit.Effect.BrightnessEffect) DuotoneEffect(rahmatzulfikri.com.androidvideoedit.Effect.DuotoneEffect) BlackAndWhiteEffect(rahmatzulfikri.com.androidvideoedit.Effect.BlackAndWhiteEffect) GreyScaleEffect(rahmatzulfikri.com.androidvideoedit.Effect.GreyScaleEffect) PosterizeEffect(rahmatzulfikri.com.androidvideoedit.Effect.PosterizeEffect)

Aggregations

MediaMetadataRetriever (android.media.MediaMetadataRetriever)1 BlackAndWhiteEffect (rahmatzulfikri.com.androidvideoedit.Effect.BlackAndWhiteEffect)1 BrightnessEffect (rahmatzulfikri.com.androidvideoedit.Effect.BrightnessEffect)1 ContrastEffect (rahmatzulfikri.com.androidvideoedit.Effect.ContrastEffect)1 CrossProcessEffect (rahmatzulfikri.com.androidvideoedit.Effect.CrossProcessEffect)1 DocumentaryEffect (rahmatzulfikri.com.androidvideoedit.Effect.DocumentaryEffect)1 DuotoneEffect (rahmatzulfikri.com.androidvideoedit.Effect.DuotoneEffect)1 FillLightEffect (rahmatzulfikri.com.androidvideoedit.Effect.FillLightEffect)1 GammaEffect (rahmatzulfikri.com.androidvideoedit.Effect.GammaEffect)1 GreyScaleEffect (rahmatzulfikri.com.androidvideoedit.Effect.GreyScaleEffect)1 HueEffect (rahmatzulfikri.com.androidvideoedit.Effect.HueEffect)1 InvertColorsEffect (rahmatzulfikri.com.androidvideoedit.Effect.InvertColorsEffect)1 LamoishEffect (rahmatzulfikri.com.androidvideoedit.Effect.LamoishEffect)1 NoEffect (rahmatzulfikri.com.androidvideoedit.Effect.NoEffect)1 PosterizeEffect (rahmatzulfikri.com.androidvideoedit.Effect.PosterizeEffect)1 SaturationEffect (rahmatzulfikri.com.androidvideoedit.Effect.SaturationEffect)1 SepiaEffect (rahmatzulfikri.com.androidvideoedit.Effect.SepiaEffect)1 SharpnessEffect (rahmatzulfikri.com.androidvideoedit.Effect.SharpnessEffect)1 TemperatureEffect (rahmatzulfikri.com.androidvideoedit.Effect.TemperatureEffect)1 TintEffect (rahmatzulfikri.com.androidvideoedit.Effect.TintEffect)1