Files
crosslang-gfx/src/webcam.cpp
2025-11-02 18:11:55 -06:00

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";
}
}