Skip to content

Commit

Permalink
不要部分の削除
Browse files Browse the repository at this point in the history
  • Loading branch information
5PB-3-4 authored Mar 7, 2024
1 parent ba41e80 commit bf6a6a6
Showing 1 changed file with 0 additions and 102 deletions.
102 changes: 0 additions & 102 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1357,108 +1357,6 @@ int moebius(lua_State* L)
Mat out;
cv::resize(tmp, out, Size(width, height), 0, 0, INTER_LANCZOS4);
PutPixelData(L, out.data);

/*
Mat out;
bool wh_flag = (ow < oh);
bool w_flag = ((ow - 8) < new_buf.cols);
bool h_flag = (oh < new_buf.rows);
bool b_flag = (new_buf.rows < new_buf.cols);
double cn = 0.0;
if (w_flag || h_flag)
{
if (!h_flag)
{
cn = double(ow - 8) / new_w;
}
else if (!w_flag)
{
cn = (double)oh / new_h;
}
else
{
if (b_flag)
{
cn = (double)oh / new_h;
}
else
{
cn = double(ow - 8) / new_w;
}
}
std::cout << cn << std::endl;
cv::resize(new_buf, out, Size(), cn, cn, INTER_LANCZOS4);
}
assert((out.cols <= (ow - 8)) && (out.rows <= oh));
cv::namedWindow("result", WINDOW_NORMAL);
cv::imshow("result", out);
*/

/*
parallel_for(0, out.rows, 1, [&](int y)
{
auto pOUT = out.ptr<Vec4b>(y);
for (auto x = 0; x < out.cols; ++x)
{
int idx = x + y * out.cols;
int r = static_cast<int>(pOUT[idx][2]);
int g = static_cast<int>(pOUT[idx][1]);
int b = static_cast<int>(pOUT[idx][0]);
int a = static_cast<int>(pOUT[idx][3]);
int r_ = (r << 6) + 18;
int g_ = (g << 6) + 18;
int b_ = (b << 6) + 18;
int a_ = (a << 6) + 1;
(*dt + idx)->y = static_cast<int16_t>(((r_ * 4918) >> 16) + ((g_ * 9655) >> 16) + ((b_ * 1875) >> 16) - 3);
(*dt + idx)->cb = static_cast<int16_t>(((r_ * -2775) >> 16) + ((g_ * -5449) >> 16) + ((b_ * 8224) >> 16) + 1);
(*dt + idx)->cr = static_cast<int16_t>(((r_ * 8224) >> 16) + ((g_ * -6887) >> 16) + ((b_ * -1337) >> 16) + 1);
(*dt + idx)->a = static_cast<int16_t>((a_ * 16448) >> 16);
}
}
);
*/

/*
parallel_for(0, ht, 1, [&](int y)
{
for (auto x = 0; x < wt; ++x)
{
int cdi = x + y * wt;
double xrange = (xmax == xmin) ? 1 : (xmax - xmin);
double yrange = (ymax == ymin) ? 1 : (ymax - ymin);
int new_x = int((wt - 1) * (coodX[cdi] - xmin) / xrange);
int new_y = int((ht - 1) * (coodY[cdi] - ymin) / yrange);
new_x = constrain(new_x, 0, wt - 1);
new_y = constrain(new_y, 0, ht - 1);
auto pOUT = buf_bgra.ptr<Vec4b>(new_y);
int idx = x + y * ow;
int r = static_cast<int>(pOUT[new_x][2]);
int g = static_cast<int>(pOUT[new_x][1]);
int b = static_cast<int>(pOUT[new_x][0]);
int a = static_cast<int>(pOUT[new_x][3]);
int r_ = (r << 6) + 18;
int g_ = (g << 6) + 18;
int b_ = (b << 6) + 18;
int a_ = (a << 6) + 1;
(*dt + idx)->y = static_cast<int16_t>(((r_ * 4918) >> 16) + ((g_ * 9655) >> 16) + ((b_ * 1875) >> 16) - 3);
(*dt + idx)->cb = static_cast<int16_t>(((r_ * -2775) >> 16) + ((g_ * -5449) >> 16) + ((b_ * 8224) >> 16) + 1);
(*dt + idx)->cr = static_cast<int16_t>(((r_ * 8224) >> 16) + ((g_ * -6887) >> 16) + ((b_ * -1337) >> 16) + 1);
(*dt + idx)->a = static_cast<int16_t>((a_ * 16448) >> 16);
}
}
);
*/
}
catch (const std::exception& ex)
{
Expand Down

0 comments on commit bf6a6a6

Please sign in to comment.