limited-rose-72431
05/17/2022, 2:41 PMbest-agent-85158
05/17/2022, 2:42 PMbest-agent-85158
05/17/2022, 2:42 PMlimited-rose-72431
05/17/2022, 2:49 PMlimited-rose-72431
05/17/2022, 2:49 PMbest-agent-85158
05/17/2022, 5:03 PMbest-agent-85158
05/17/2022, 5:03 PMmost-caravan-45834
05/17/2022, 5:08 PMbest-agent-85158
05/17/2022, 5:23 PMbright-gpu-74537
05/17/2022, 6:01 PMbest-agent-85158
05/17/2022, 6:05 PMbright-gpu-74537
05/17/2022, 6:05 PMbest-agent-85158
05/17/2022, 6:33 PMbest-agent-85158
05/17/2022, 6:37 PMEitherType<Dynamic, Item>, Item being a typedef with all of the accepted values for the viewsbest-agent-85158
05/17/2022, 6:38 PMbright-gpu-74537
05/17/2022, 6:38 PMArrayDataSource<Item>?best-agent-85158
05/17/2022, 6:39 PMbright-gpu-74537
05/17/2022, 6:40 PMbest-agent-85158
05/17/2022, 6:41 PMhaxe
function add(item:Dynamic) {}
to
haxe
function add(item:haxe.#if haxe4 ds #else extern #endEitherType<Item, Dynamic>)best-agent-85158
05/17/2022, 6:41 PMbest-agent-85158
05/17/2022, 6:41 PMbright-gpu-74537
05/17/2022, 6:42 PMpublic function add(item:T):Tbest-agent-85158
05/17/2022, 6:42 PMbest-agent-85158
05/17/2022, 6:42 PMlimited-rose-72431
05/17/2022, 7:03 PMcpp
Array<hx::Anon> hx_hough_lines(Array<uint8_t> in_image)
{
auto base = in_image->base();
auto input = std::vector<uint8_t>(base, base + in_image->length);
auto output = std::vector<Vec2f>();
HoughLines(input, output, 1, CV_PI/180, 150, 0, 0 );
auto anons = Array<hx::Anon>(0, 0);
for (auto&& vec : output)
{
auto anon = hx::Anon_obj::Create();
anon->Add(HX_CSTRING("x"), vec.x);
anon->Add(HX_CSTRING("y"), vec.y);
anons->Add(anon);
}
return anons;
}
(thrown together from the opencv hough lines example and past use of opencv, may not work as is, will probably need changing to fit your needs, etc, etc)
and on the haxe side the extern would look like function hx_hough_lines(input : BytesData) : Array<{x : Float, y : Float}>;best-agent-85158
05/17/2022, 7:04 PMlimited-rose-72431
05/17/2022, 7:05 PMmost-caravan-45834
05/17/2022, 8:08 PMmost-caravan-45834
05/17/2022, 8:09 PMbright-gpu-74537
05/17/2022, 8:19 PM