Skip to content

Commit

Permalink
内側ベベル以外で少し高速化
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Ojii committed Mar 8, 2024
1 parent aa506d1 commit cdffdf8
Showing 1 changed file with 9 additions and 18 deletions.
27 changes: 9 additions & 18 deletions dll_src/Bevel_And_Emboss_M.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,32 +167,23 @@ int bevel_and_emboss(lua_State *L) {

//4近傍を取得する時にOutOfIndexにしないためのマージン&ぼかし時に輪郭が端で途切れるのを回避
lua_getglobal(L, "obj");

double initblur = preblur + 1;
if (style % 4 != 1)
initblur += std::ceil(bev_w);

lua_getfield(L, -1, "effect");
lua_pushstring(L, "領域拡張");
lua_pushstring(L, "上");
lua_pushnumber(L, preblur + 1);
lua_pushnumber(L, initblur);
lua_pushstring(L, "下");
lua_pushnumber(L, preblur + 1);
lua_pushnumber(L, initblur);
lua_pushstring(L, "左");
lua_pushnumber(L, preblur + 1);
lua_pushnumber(L, initblur);
lua_pushstring(L, "右");
lua_pushnumber(L, preblur + 1);
lua_pushnumber(L, initblur);
lua_call(L, 9, 0);

if(style % 4 != 1) {
lua_getfield(L, -1, "effect");
lua_pushstring(L, "領域拡張");
lua_pushstring(L, "上");
lua_pushnumber(L, std::ceil(bev_w));
lua_pushstring(L, "下");
lua_pushnumber(L, std::ceil(bev_w));
lua_pushstring(L, "左");
lua_pushnumber(L, std::ceil(bev_w));
lua_pushstring(L, "右");
lua_pushnumber(L, std::ceil(bev_w));
lua_call(L, 9, 0);
}

//"getpixeldata"でw,hとれるじゃん!
//と思ったが、exedit.auf側で例外が発生する例があるので、getpixelを呼ぶ
lua_getfield(L, -1, "getpixel");
Expand Down

0 comments on commit cdffdf8

Please sign in to comment.