mirror of
https://onedev.site.tesses.net/crosslang/crosslang-gfx
synced 2026-02-08 17:45:45 +00:00
35 lines
726 B
C++
35 lines
726 B
C++
#include "gfx.hpp"
|
|
|
|
namespace Tesses::CrossLang::GFX
|
|
{
|
|
TWebcam::TWebcam(uint8_t id, const Size& sz, uint8_t fps) : webcam(id,sz, fps)
|
|
{
|
|
|
|
}
|
|
TObject TWebcam::CallMethod(GCList& ls, std::string key, std::vector<TObject> args)
|
|
{
|
|
if(key == "Open")
|
|
{
|
|
this->webcam.Open();
|
|
}
|
|
if(key == "ReadFrame")
|
|
{
|
|
TImage* img;
|
|
if(GetArgumentHeap(args,0,img))
|
|
{
|
|
this->webcam.ReadFrame(&img->img);
|
|
}
|
|
}
|
|
|
|
if(key == "Close")
|
|
{
|
|
this->webcam.Close();
|
|
}
|
|
|
|
return Undefined();
|
|
}
|
|
std::string TWebcam::TypeName()
|
|
{
|
|
return "GFX.Webcam";
|
|
}
|
|
} |