Update ImageProcessor.java
This commit is contained in:
		
							parent
							
								
									fa158b126c
								
							
						
					
					
						commit
						d37436289a
					
				
					 1 changed files with 15 additions and 10 deletions
				
			
		| 
						 | 
					@ -38,18 +38,23 @@ public class ImageProcessor {
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public static void applyInvert(ImageView imageView) {
 | 
					    public static void applyVignette(ImageView imageView) {
 | 
				
			||||||
        if (imageView.getImage() != null) {
 | 
					        if (imageView.getImage() != null) {
 | 
				
			||||||
            ColorAdjust colorAdjust = new ColorAdjust();
 | 
					            // Create radial gradient for vignette effect
 | 
				
			||||||
            colorAdjust.setBrightness(-1.0);
 | 
					            double width = imageView.getImage().getWidth();
 | 
				
			||||||
            colorAdjust.setContrast(0);
 | 
					            double height = imageView.getImage().getHeight();
 | 
				
			||||||
            colorAdjust.setHue(1.0);
 | 
					            double radius = Math.max(width, height) * 0.7; // Adjust this value to control vignette size
 | 
				
			||||||
            colorAdjust.setSaturation(-1.0);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            InnerShadow innerShadow = new InnerShadow();
 | 
					            InnerShadow innerShadow = new InnerShadow();
 | 
				
			||||||
            innerShadow.setRadius(5.0);
 | 
					            innerShadow.setRadius(radius * 0.3);
 | 
				
			||||||
            innerShadow.setColor(Color.rgb(255, 255, 255, 0.3));
 | 
					            innerShadow.setChoke(0.2);
 | 
				
			||||||
            innerShadow.setInput(colorAdjust);
 | 
					            innerShadow.setColor(Color.rgb(0, 0, 0, 0.7));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            DropShadow dropShadow = new DropShadow();
 | 
				
			||||||
 | 
					            dropShadow.setRadius(radius * 0.2);
 | 
				
			||||||
 | 
					            dropShadow.setSpread(0.4);
 | 
				
			||||||
 | 
					            dropShadow.setColor(Color.rgb(0, 0, 0, 0.6));
 | 
				
			||||||
 | 
					            dropShadow.setInput(innerShadow);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            FadeTransition ft = new FadeTransition(
 | 
					            FadeTransition ft = new FadeTransition(
 | 
				
			||||||
                Duration.millis(300),
 | 
					                Duration.millis(300),
 | 
				
			||||||
| 
						 | 
					@ -58,7 +63,7 @@ public class ImageProcessor {
 | 
				
			||||||
            ft.setFromValue(0.7);
 | 
					            ft.setFromValue(0.7);
 | 
				
			||||||
            ft.setToValue(1.0);
 | 
					            ft.setToValue(1.0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            imageView.setEffect(innerShadow);
 | 
					            imageView.setEffect(dropShadow);
 | 
				
			||||||
            ft.play();
 | 
					            ft.play();
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue