Yo, just noticed that page was copied from my blog that i wrote it 3 ~ 4 years ago. I don't know who translated then moved it. ?
http://blog.naver.com/hermet/176155333 http://blog.naver.com/hermet/176353797 The example was intended just for a demo. Algorithm and performance was not important. :) -----Original Message----- From: "Carsten Haitzler"<ras...@rasterman.com> To: "Enlightenment developer list"<enlightenment-devel@lists.sourceforge.net>; Cc: "Jiwon Kim"<jwkim0...@gmail.com>; Sent: 2016-08-02 (화) 15:42:14 Subject: Re: [E-devel] Fixed Programming guide for image_blur example On Tue, 2 Aug 2016 00:49:30 +0900 Jiwon Kim <jwkim0...@gmail.com> said: technically that blur still is wrong. especially at the boundaries. you need to do for a simple 3x3 box blur which is what it's trying, to do pixel x -1, x, x +1 and same for y and handle the boundary cases AND write to the current pixel. you can do a marching box to be more efficient, but this could would be best off splitting into a simple 3x1 horizontal and then 1x3 vertical blur and blur to a new temporary buffer as destination for the horizon blur then copy back to primary image from tmp buffer for vertical. faster and more correct. but the purpose here is just to demo access to pixels not to get the algorithms fast or correct. though it's bad to have a not-fast and not-correct algorithm in docs. :) the page is a wiki and anyone can edit btw... :) just fyi. i'd fix it myself (toe doc) but ...have a lot of things to do and my priority list has this... not at the top :( > Hi All. > > I found some doubtful example code on EFL Programming guide. > (https://www.enlightenment.org/program_guide/evas/image_objects) > > We can notify that result(blur) image is too much spread only horizontally, > when if set higher value to "blur_size". > Because, calculation about average color is used recursively. > (calc result is re-used for calc in 6th and 7th for loop) > > So, I fixed the example code. > If I fixed by incorrect way, please fix again. > > Regards. > Jiwon Kim. > > ======================================================== > void image_blur(Evas_Object *img) > { > unsigned char *img_src = evas_object_image_data_get(img, EINA_TRUE); > > int w, h; > evas_object_image_size_get(img, &w, &h); > int blur_size = 4; > int x, y, xx, yy; > > for (y = 0; y < h; y++) > { > for (x = 0; x < w; x++) > { > int avg_color[3] = {0, 0, 0}; > int blur_pixel_cnt = 0; > > for (xx = x; (xx < x + blur_size) && (xx < w); xx++) > { > for (yy = y; (yy < y + blur_size) && (yy < h); yy++) > { > int idx = (yy * w * 4) + (xx * 4); > avg_color[0] += img_src[idx + 0]; > avg_color[1] += img_src[idx + 1]; > avg_color[2] += img_src[idx + 2]; > ++blur_pixel_cnt; > } > } > avg_color[0] /= blur_pixel_cnt; > avg_color[1] /= blur_pixel_cnt; > avg_color[2] /= blur_pixel_cnt; > > * // Fixed newly* > int idx = (y * w * 4) + (x * 4); > img_src[idx + 0] = avg_color[0]; > img_src[idx + 1] = avg_color[1]; > img_src[idx + 2] = avg_color[2]; > > * // Removed* > * for (xx = x; (xx < x + blur_size) && (xx < w); xx++)* > * {* > * for (yy = y; (yy < y + blur_size) && (yy < h); yy++)* > * {* > * int idx = (yy * w * 4) + (xx * 4);* > * img_src[idx + 0] = avg_color[0];* > * img_src[idx + 1] = avg_color[1];* > * img_src[idx + 2] = avg_color[2];* > * }* > * }* > } > } > evas_object_image_data_update_add(img, 0, 0, w, h); > } > > ======================================================== > ------------------------------------------------------------------------------ > _______________________________________________ > enlightenment-devel mailing list > enlightenment-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/enlightenment-devel > -- ------------- Codito, ergo sum - "I code, therefore I am" -------------- The Rasterman (Carsten Haitzler) ras...@rasterman.com ------------------------------------------------------------------------------ _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel ------------------------------------------------------------------------------ What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic patterns at an interface-level. Reveals which users, apps, and protocols are consuming the most bandwidth. Provides multi-vendor support for NetFlow, J-Flow, sFlow and other flows. Make informed decisions using capacity planning reports. http://sdm.link/zohodev2dev _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel