e_comp: add simple comment for e_comp_image_filter_edge_detection_param_set 79/323979/1
authorhojoon-ryou <hojoon.ryou@samsung.com>
Mon, 28 Apr 2025 11:19:39 +0000 (20:19 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Mon, 12 May 2025 04:04:50 +0000 (13:04 +0900)
add simple comment for e_comp_image_filter_edge_detection_param_set function
add code for checking for out of range exception of parameters of edge_detection

Change-Id: I8adf9e5a261512e93fad2721baed7ad1b586a02d

src/bin/compmgr/e_comp.c
src/include/e_comp.h

index f72c638bd8ea468a8c4221f1c24b1b784dedefc0..f5a038f386f312bbf77b5e10ef7dcab63a984c02 100644 (file)
@@ -1315,6 +1315,18 @@ e_comp_image_filter_edge_detection_param_set(double thickness, unsigned int colo
    E_View_Client *view_client;
    Eina_List *l;
 
+   if (thickness <= 0.0 || thickness >= 5.0)
+     {
+        ERR("Invalid edge detection thickness value: %f", thickness);
+        return;
+     }
+
+   if (color_id < 1 || color_id > 4)
+     {
+        ERR("Invalid edge detection color_id value: %u", color_id);
+        return;
+     }
+
    e_comp->edge_detection_thickness = thickness;
    e_comp->edge_detection_color_id = color_id;
 
index dfbb0deeeb6d0577cdf355ab182cdf1abc86c49e..9cf3e7cd62267e38ee35d4c3d683484c55425426 100644 (file)
@@ -198,6 +198,8 @@ E_API int             e_comp_norender_get(void);
 E_API int             e_comp_nocomp_override_get(void);
 
 E_API Eina_Bool           e_comp_image_filter_set(E_Comp_Image_Filter filter);
+// 0.0 < thickness < 5.0 (default = 1.0)
+// color_id = 1: Optimized(black or white), 2: Black, 3: White, 4: Green (default = 1)
 E_API void                e_comp_image_filter_edge_detection_param_set(double thickness, unsigned int color_id);
 E_API E_Comp_Image_Filter e_comp_image_filter_get(void);