First commit

This commit is contained in:
2025-11-02 18:11:55 -06:00
commit 0190f7223c
14 changed files with 919 additions and 0 deletions

35
src/webcam.cpp Normal file
View File

@@ -0,0 +1,35 @@
#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";
}
}