@@ -206,7 +206,7 @@ static HMODULE get_utl_module() {
206206
207207static void multi_thread (std::function<void (int , int )>&& f, bool single = false) {
208208 if (exec_multi_thread_func && !single) {
209- exec_multi_thread_func ([](int thread_id, int thread_num, void * param1, void * param2) {
209+ exec_multi_thread_func ([](int thread_id, int thread_num, void * param1, void * param2) {
210210 (*reinterpret_cast <std::function<void (int , int )>*>(param1))(thread_id, thread_num);
211211 }, &f, nullptr );
212212 } else {
@@ -313,13 +313,13 @@ int bevel_and_emboss(lua_State *L) {
313313 std::unique_ptr<Pixel_Info[]> pix_info = std::make_unique_for_overwrite<Pixel_Info[]>(size);
314314
315315 Pixel_BGRA* pixel = reinterpret_cast <Pixel_BGRA*>(utl_getpixeldata (L));
316-
316+
317317 std::unique_ptr<bool []> border_ans = std::make_unique_for_overwrite<bool []>(size);
318-
318+
319319 for (int j = 0 ; j < h; j++) {
320320 for (int i = 0 ; i < w; i++) {
321321 pix_info[j * w + i] = {pixel[j * w + i].a , HUGE_VAL, static_cast <double >(i), static_cast <double >(j), 1 , 0 };
322-
322+
323323 // rikky_module.borderingも一緒に
324324 // 端か、端ではなかった場合上下左右がth以下だった場合
325325 if (a_th < pixel[j * w + i].a && ((i == 0 || j == 0 || i == w-1 || j == h-1 ) || (pixel[j * w + i - 1 ].a <= a_th || pixel[j * w + i + 1 ].a <= a_th || pixel[j * w + i - w].a <= a_th || pixel[j * w + i + w].a <= a_th)))
@@ -348,7 +348,7 @@ int bevel_and_emboss(lua_State *L) {
348348
349349 // 外側判定
350350 bool ccw = (tmp_point.y == 0 || (pixel[static_cast <int >((tmp_point.y - 1 ) * w + tmp_point.x )].a <= a_th));
351-
351+
352352 while (true ) {
353353 pb.push_back (tmp_point);
354354 border_ans[tmp_point.y * w + tmp_point.x ] = false ;
@@ -394,7 +394,7 @@ int bevel_and_emboss(lua_State *L) {
394394
395395 if (next_point.x == -1 || next_point.y == -1 )
396396 break ;
397-
397+
398398 tmp_point = next_point;
399399 }
400400 p.push_back (std::move (pb));
@@ -416,7 +416,7 @@ int bevel_and_emboss(lua_State *L) {
416416 } else {
417417 double dx = std::clamp (a6 < a_th ? (a5 - a_th) / (a5 - a6) : a4 < a_th ? (a5 - a_th) / (a4 - a5) : 0.0 , -1.0 , 1.0 );
418418 double dy = std::clamp (a2 < a_th ? (a5 - a_th) / (a5 - a2) : a8 < a_th ? (a5 - a_th) / (a8 - a5) : 0.0 , -1.0 , 1.0 );
419- pi[j].x += dx / (1 + std::abs (dy / dx));
419+ pi[j].x += dx / (1 + std::abs (dy / dx));
420420 pi[j].y += dy / (1 + std::abs (dx / dy));
421421 }
422422 }
@@ -439,7 +439,7 @@ int bevel_and_emboss(lua_State *L) {
439439 bufy = y0;
440440 }
441441 }
442-
442+
443443 for (int i = 0 ; i < p.size (); i++) {
444444 auto & pi = p[i];
445445 size_t s[2 ] = {pi.size () - 2 , pi.size () - 1 };
@@ -546,7 +546,7 @@ int bevel_and_emboss(lua_State *L) {
546546 utl_drawtarget (L, " tempbuffer" );
547547
548548 pix = reinterpret_cast <Pixel_BGRA*>(utl_getpixeldata (L));
549-
549+
550550 multi_thread ([&](int thread_id, int thread_num) {
551551 size_t start = size * thread_id / thread_num;
552552 size_t end = size * (thread_id + 1 ) / thread_num;
@@ -580,7 +580,7 @@ int bevel_and_emboss(lua_State *L) {
580580 utl_copybuffer (L, " obj" , " tmp" );
581581
582582 pix = reinterpret_cast <Pixel_BGRA*>(utl_getpixeldata (L));
583-
583+
584584 multi_thread ([&](int thread_id, int thread_num) {
585585 size_t start = size * thread_id / thread_num;
586586 size_t end = size * (thread_id + 1 ) / thread_num;
@@ -664,7 +664,7 @@ int bevel_and_emboss(lua_State *L) {
664664 pix[i].a = bevel_buffer[i].a ;
665665 }
666666 });
667-
667+
668668 utl_putpixeldata (L, pix);
669669 break ;
670670 }
@@ -686,7 +686,7 @@ int bevel_and_emboss(lua_State *L) {
686686 utl_drawtarget (L, " tempbuffer" );
687687
688688 pix = reinterpret_cast <Pixel_BGRA*>(utl_getpixeldata (L));
689-
689+
690690 multi_thread ([&](int thread_id, int thread_num) {
691691 size_t start = size * thread_id / thread_num;
692692 size_t end = size * (thread_id + 1 ) / thread_num;
@@ -710,7 +710,7 @@ int bevel_and_emboss(lua_State *L) {
710710 utl_draw (L, alp1);
711711
712712 pix = reinterpret_cast <Pixel_BGRA*>(utl_getpixeldata (L));
713-
713+
714714 multi_thread ([&](int thread_id, int thread_num) {
715715 size_t start = size * thread_id / thread_num;
716716 size_t end = size * (thread_id + 1 ) / thread_num;
@@ -735,7 +735,7 @@ int bevel_and_emboss(lua_State *L) {
735735 utl_copybuffer (L, " obj" , " tmp" );
736736
737737 pix = reinterpret_cast <Pixel_BGRA*>(utl_getpixeldata (L));
738-
738+
739739 multi_thread ([&](int thread_id, int thread_num) {
740740 size_t start = size * thread_id / thread_num;
741741 size_t end = size * (thread_id + 1 ) / thread_num;
@@ -749,7 +749,7 @@ int bevel_and_emboss(lua_State *L) {
749749 case 3 : // ピローエンボス
750750 {
751751 Pixel_BGRA* pix = reinterpret_cast <Pixel_BGRA*>(utl_getpixeldata (L));
752-
752+
753753 multi_thread ([&](int thread_id, int thread_num) {
754754 size_t start = size * thread_id / thread_num;
755755 size_t end = size * (thread_id + 1 ) / thread_num;
@@ -765,7 +765,7 @@ int bevel_and_emboss(lua_State *L) {
765765 utl_drawtarget (L, " tempbuffer" );
766766
767767 pix = reinterpret_cast <Pixel_BGRA*>(utl_getpixeldata (L));
768-
768+
769769 multi_thread ([&](int thread_id, int thread_num) {
770770 size_t start = size * thread_id / thread_num;
771771 size_t end = size * (thread_id + 1 ) / thread_num;
@@ -789,7 +789,7 @@ int bevel_and_emboss(lua_State *L) {
789789 utl_draw (L, alp1);
790790
791791 pix = reinterpret_cast <Pixel_BGRA*>(utl_getpixeldata (L));
792-
792+
793793 multi_thread ([&](int thread_id, int thread_num) {
794794 size_t start = size * thread_id / thread_num;
795795 size_t end = size * (thread_id + 1 ) / thread_num;
@@ -814,7 +814,7 @@ int bevel_and_emboss(lua_State *L) {
814814 utl_copybuffer (L, " obj" , " tmp" );
815815
816816 pix = reinterpret_cast <Pixel_BGRA*>(utl_getpixeldata (L));
817-
817+
818818 multi_thread ([&](int thread_id, int thread_num) {
819819 size_t start = size * thread_id / thread_num;
820820 size_t end = size * (thread_id + 1 ) / thread_num;
@@ -845,7 +845,7 @@ int bevel_and_emboss(lua_State *L) {
845845 setObjField (L, obj);
846846
847847 Pixel_BGRA* pix = reinterpret_cast <Pixel_BGRA*>(utl_getpixeldata (L));
848-
848+
849849 multi_thread ([&](int thread_id, int thread_num) {
850850 size_t start = size * thread_id / thread_num;
851851 size_t end = size * (thread_id + 1 ) / thread_num;
@@ -878,7 +878,7 @@ int bevel_and_emboss(lua_State *L) {
878878 setObjField (L, obj);
879879
880880 pix = reinterpret_cast <Pixel_BGRA*>(utl_getpixeldata (L));
881-
881+
882882 multi_thread ([&](int thread_id, int thread_num) {
883883 size_t start = size * thread_id / thread_num;
884884 size_t end = size * (thread_id + 1 ) / thread_num;
@@ -923,7 +923,7 @@ int bevel_and_emboss(lua_State *L) {
923923 setObjField (L, obj);
924924
925925 Pixel_BGRA* pix = reinterpret_cast <Pixel_BGRA*>(utl_getpixeldata (L));
926-
926+
927927 multi_thread ([&](int thread_id, int thread_num) {
928928 size_t start = size * thread_id / thread_num;
929929 size_t end = size * (thread_id + 1 ) / thread_num;
@@ -956,7 +956,7 @@ int bevel_and_emboss(lua_State *L) {
956956 setObjField (L, obj);
957957
958958 pix = reinterpret_cast <Pixel_BGRA*>(utl_getpixeldata (L));
959-
959+
960960 multi_thread ([&](int thread_id, int thread_num) {
961961 size_t start = size * thread_id / thread_num;
962962 size_t end = size * (thread_id + 1 ) / thread_num;
@@ -980,7 +980,7 @@ int bevel_and_emboss(lua_State *L) {
980980
981981 lua_getfield (L, -1 , " effect" );
982982 lua_call (L, 0 , 0 );
983-
983+
984984 utl_draw (L, alp2);
985985 break ;
986986 }
@@ -1001,7 +1001,7 @@ int bevel_and_emboss(lua_State *L) {
10011001 setObjField (L, obj);
10021002
10031003 Pixel_BGRA* pix = reinterpret_cast <Pixel_BGRA*>(utl_getpixeldata (L));
1004-
1004+
10051005 multi_thread ([&](int thread_id, int thread_num) {
10061006 size_t start = size * thread_id / thread_num;
10071007 size_t end = size * (thread_id + 1 ) / thread_num;
@@ -1034,7 +1034,7 @@ int bevel_and_emboss(lua_State *L) {
10341034 setObjField (L, obj);
10351035
10361036 pix = reinterpret_cast <Pixel_BGRA*>(utl_getpixeldata (L));
1037-
1037+
10381038 multi_thread ([&](int thread_id, int thread_num) {
10391039 size_t start = size * thread_id / thread_num;
10401040 size_t end = size * (thread_id + 1 ) / thread_num;
@@ -1079,7 +1079,7 @@ int bevel_and_emboss(lua_State *L) {
10791079 setObjField (L, obj);
10801080
10811081 Pixel_BGRA* pix = reinterpret_cast <Pixel_BGRA*>(utl_getpixeldata (L));
1082-
1082+
10831083 multi_thread ([&](int thread_id, int thread_num) {
10841084 size_t start = size * thread_id / thread_num;
10851085 size_t end = size * (thread_id + 1 ) / thread_num;
@@ -1103,16 +1103,16 @@ int bevel_and_emboss(lua_State *L) {
11031103
11041104 lua_getfield (L, -1 , " effect" );
11051105 lua_call (L, 0 , 0 );
1106-
1106+
11071107 utl_draw (L, alp1);
11081108 utl_temptarget (L, w, h);
11091109 utl_copybuffer (L, " obj" , " tmp" );
11101110 utl_drawtarget (L, " framebuffer" );
1111-
1111+
11121112 setObjField (L, obj);
11131113
11141114 pix = reinterpret_cast <Pixel_BGRA*>(utl_getpixeldata (L));
1115-
1115+
11161116 multi_thread ([&](int thread_id, int thread_num) {
11171117 size_t start = size * thread_id / thread_num;
11181118 size_t end = size * (thread_id + 1 ) / thread_num;
@@ -1136,14 +1136,14 @@ int bevel_and_emboss(lua_State *L) {
11361136
11371137 lua_getfield (L, -1 , " effect" );
11381138 lua_call (L, 0 , 0 );
1139-
1139+
11401140 utl_draw (L, alp2);
11411141 break ;
11421142 }
11431143 case 8 : // ベベル(外側) ハイライトのみ
11441144 {
11451145 Pixel_BGRA* pix = reinterpret_cast <Pixel_BGRA*>(utl_getpixeldata (L));
1146-
1146+
11471147 multi_thread ([&](int thread_id, int thread_num) {
11481148 size_t start = size * thread_id / thread_num;
11491149 size_t end = size * (thread_id + 1 ) / thread_num;
@@ -1168,7 +1168,7 @@ int bevel_and_emboss(lua_State *L) {
11681168 case 9 : // ベベル(内側) ハイライトのみ
11691169 {
11701170 Pixel_BGRA* pix = reinterpret_cast <Pixel_BGRA*>(utl_getpixeldata (L));
1171-
1171+
11721172 multi_thread ([&](int thread_id, int thread_num) {
11731173 size_t start = size * thread_id / thread_num;
11741174 size_t end = size * (thread_id + 1 ) / thread_num;
@@ -1193,7 +1193,7 @@ int bevel_and_emboss(lua_State *L) {
11931193 case 10 : // エンボス ハイライトのみ
11941194 {
11951195 Pixel_BGRA* pix = reinterpret_cast <Pixel_BGRA*>(utl_getpixeldata (L));
1196-
1196+
11971197 multi_thread ([&](int thread_id, int thread_num) {
11981198 size_t start = size * thread_id / thread_num;
11991199 size_t end = size * (thread_id + 1 ) / thread_num;
@@ -1242,7 +1242,7 @@ int bevel_and_emboss(lua_State *L) {
12421242 case 12 : // ベベル(外側) シャドウのみ
12431243 {
12441244 Pixel_BGRA* pix = reinterpret_cast <Pixel_BGRA*>(utl_getpixeldata (L));
1245-
1245+
12461246 multi_thread ([&](int thread_id, int thread_num) {
12471247 size_t start = size * thread_id / thread_num;
12481248 size_t end = size * (thread_id + 1 ) / thread_num;
0 commit comments