use of rahmatzulfikri.com.androidvideoedit.Effect.HueEffect 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;
}
}
Aggregations