You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi. I'm trying to change brightness, contrast and saturation together to implement using sliders; the code works for me in some images, but in other images my app crashes. When I applied this part of the code:
Hi. I'm trying to change brightness, contrast and saturation together to implement using sliders; the code works for me in some images, but in other images my app crashes. When I applied this part of the code:
[filtroSaturacion useNextFrameForImageCapture];
[stillImageSource processImage];
I hope you can help me and thanks four your help. Here I leave my code:
(void) inicializarBasicos {
gpuViewImagen = [[GPUImageView alloc] initWithFrame:copiaViewImagen.frame];
stillImageSource = [[GPUImagePicture alloc] initWithImage:copiaViewImagen.image];
filtroBrillo = [[GPUImageBrightnessFilter alloc] init];
filtroContraste = [[GPUImageContrastFilter alloc] init];
filtroSaturacion = [[GPUImageSaturationFilter alloc] init];
[filtroBrillo forceProcessingAtSize:copiaViewImagen.image.size];
[filtroContraste forceProcessingAtSize:copiaViewImagen.image.size];
[filtroSaturacion forceProcessingAtSize:copiaViewImagen.image.size];
[stillImageSource addTarget:filtroBrillo];
[filtroBrillo addTarget:filtroContraste];
[filtroContraste addTarget:filtroSaturacion];
[filtroSaturacion addTarget:gpuViewImagen];
[_view_total addSubview:gpuViewImagen];
[_view_total sendSubviewToBack:gpuViewImagen];
}
(IBAction)sliderValueChangedBrillo:(id)sender {
[filtroSaturacion removeAllTargets];
[filtroBrillo setBrightness:_slider_brillo.value];
[filtroSaturacion useNextFrameForImageCapture];
[stillImageSource processImage];
UIImage *nearestNeighborImage = [filtroSaturacion imageFromCurrentFramebuffer];
viewImagenSeleccionada.image = nearestNeighborImage;
_boton_restaurar_foto.userInteractionEnabled = YES;
}
(IBAction)sliderValueChangedContraste:(id)sender {
[filtroContraste setContrast:_slider_contraste.value];
[filtroSaturacion useNextFrameForImageCapture];
[stillImageSource processImage];
UIImage *nearestNeighborImage = [filtroSaturacion imageFromCurrentFramebuffer];
viewImagenSeleccionada.image = nearestNeighborImage;
_boton_restaurar_foto.userInteractionEnabled = YES;
}
(IBAction)sliderValueChangedSaturacion:(id)sender {
[filtroSaturacion setSaturation:_slider_saturacion.value];
[filtroSaturacion useNextFrameForImageCapture];
[stillImageSource processImage];
UIImage *nearestNeighborImage = [filtroSaturacion imageFromCurrentFramebuffer];
viewImagenSeleccionada.image = nearestNeighborImage;
_boton_restaurar_foto.userInteractionEnabled = YES;
}
The text was updated successfully, but these errors were encountered: