@@ -10,7 +10,7 @@ use graphene_core::raster_types::{CPU, Raster};
1010use graphene_core:: table:: Table ;
1111use graphene_core_shaders:: color:: Color ;
1212use graphene_core_shaders:: context:: Ctx ;
13- use graphene_core_shaders:: registry:: types:: { Angle , Percentage , SignedPercentage } ;
13+ use graphene_core_shaders:: registry:: types:: { AngleF32 , PercentageF32 , SignedPercentageF32 } ;
1414#[ cfg( not( feature = "std" ) ) ]
1515use num_traits:: float:: Float ;
1616
@@ -148,8 +148,8 @@ fn brightness_contrast<T: Adjust<Color>>(
148148 ) ]
149149 #[ gpu_image]
150150 mut input : T ,
151- brightness : SignedPercentage ,
152- contrast : SignedPercentage ,
151+ brightness : SignedPercentageF32 ,
152+ contrast : SignedPercentageF32 ,
153153 use_classic : bool ,
154154) -> T {
155155 if use_classic {
@@ -238,11 +238,11 @@ fn levels<T: Adjust<Color>>(
238238 ) ]
239239 #[ gpu_image]
240240 mut image : T ,
241- #[ default( 0. ) ] shadows : Percentage ,
242- #[ default( 50. ) ] midtones : Percentage ,
243- #[ default( 100. ) ] highlights : Percentage ,
244- #[ default( 0. ) ] output_minimums : Percentage ,
245- #[ default( 100. ) ] output_maximums : Percentage ,
241+ #[ default( 0. ) ] shadows : PercentageF32 ,
242+ #[ default( 50. ) ] midtones : PercentageF32 ,
243+ #[ default( 100. ) ] highlights : PercentageF32 ,
244+ #[ default( 0. ) ] output_minimums : PercentageF32 ,
245+ #[ default( 100. ) ] output_maximums : PercentageF32 ,
246246) -> T {
247247 image. adjust ( |color| {
248248 let color = color. to_gamma_srgb ( ) ;
@@ -309,22 +309,22 @@ fn black_and_white<T: Adjust<Color>>(
309309 #[ default( Color :: BLACK ) ] tint : Color ,
310310 #[ default( 40. ) ]
311311 #[ range( ( -200. , 300. ) ) ]
312- reds : Percentage ,
312+ reds : PercentageF32 ,
313313 #[ default( 60. ) ]
314314 #[ range( ( -200. , 300. ) ) ]
315- yellows : Percentage ,
315+ yellows : PercentageF32 ,
316316 #[ default( 40. ) ]
317317 #[ range( ( -200. , 300. ) ) ]
318- greens : Percentage ,
318+ greens : PercentageF32 ,
319319 #[ default( 60. ) ]
320320 #[ range( ( -200. , 300. ) ) ]
321- cyans : Percentage ,
321+ cyans : PercentageF32 ,
322322 #[ default( 20. ) ]
323323 #[ range( ( -200. , 300. ) ) ]
324- blues : Percentage ,
324+ blues : PercentageF32 ,
325325 #[ default( 80. ) ]
326326 #[ range( ( -200. , 300. ) ) ]
327- magentas : Percentage ,
327+ magentas : PercentageF32 ,
328328) -> T {
329329 image. adjust ( |color| {
330330 let color = color. to_gamma_srgb ( ) ;
@@ -379,9 +379,9 @@ fn hue_saturation<T: Adjust<Color>>(
379379 ) ]
380380 #[ gpu_image]
381381 mut input : T ,
382- hue_shift : Angle ,
383- saturation_shift : SignedPercentage ,
384- lightness_shift : SignedPercentage ,
382+ hue_shift : AngleF32 ,
383+ saturation_shift : SignedPercentageF32 ,
384+ lightness_shift : SignedPercentageF32 ,
385385) -> T {
386386 input. adjust ( |color| {
387387 let color = color. to_gamma_srgb ( ) ;
@@ -437,8 +437,8 @@ fn threshold<T: Adjust<Color>>(
437437 ) ]
438438 #[ gpu_image]
439439 mut image : T ,
440- #[ default( 50. ) ] min_luminance : Percentage ,
441- #[ default( 100. ) ] max_luminance : Percentage ,
440+ #[ default( 50. ) ] min_luminance : PercentageF32 ,
441+ #[ default( 100. ) ] max_luminance : PercentageF32 ,
442442 luminance_calc : LuminanceCalculation ,
443443) -> T {
444444 image. adjust ( |color| {
@@ -483,7 +483,7 @@ fn vibrance<T: Adjust<Color>>(
483483 ) ]
484484 #[ gpu_image]
485485 mut image : T ,
486- vibrance : SignedPercentage ,
486+ vibrance : SignedPercentageF32 ,
487487) -> T {
488488 image. adjust ( |color| {
489489 let vibrance = vibrance as f32 / 100. ;
@@ -955,21 +955,21 @@ fn exposure<T: Adjust<Color>>(
955955 ) ]
956956 #[ gpu_image]
957957 mut input : T ,
958- exposure : f64 ,
959- offset : f64 ,
958+ exposure : f32 ,
959+ offset : f32 ,
960960 #[ default( 1. ) ]
961961 #[ range( ( 0.01 , 10. ) ) ]
962962 #[ hard_min( 0.0001 ) ]
963- gamma_correction : f64 ,
963+ gamma_correction : f32 ,
964964) -> T {
965965 input. adjust ( |color| {
966966 let adjusted = color
967967 // Exposure
968- . map_rgb ( |c : f32 | c * 2_f32 . powf ( exposure as f32 ) )
968+ . map_rgb ( |c : f32 | c * 2_f32 . powf ( exposure) )
969969 // Offset
970- . map_rgb ( |c : f32 | c + offset as f32 )
970+ . map_rgb ( |c : f32 | c + offset)
971971 // Gamma correction
972- . gamma ( gamma_correction as f32 ) ;
972+ . gamma ( gamma_correction) ;
973973
974974 adjusted. map_rgb ( |c : f32 | c. clamp ( 0. , 1. ) )
975975 } ) ;
0 commit comments