drawcanvas class added

This commit is contained in:
2025-06-03 09:36:08 -04:00
commit e515644432
43 changed files with 1707 additions and 0 deletions

View File

@ -0,0 +1,59 @@
#ifndef __AMSCPPSIMPLEDRAW_HPP__
#define __AMSCPPSIMPLEDRAW_HPP__
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <thread>
#include <amsmathutil25/amsmathutil25.hpp>
namespace ams
{
namespace simpledraw
{
static const int simpledraw_success = 1;
static const int simpledraw_failure = -1;
class drawcanvas
{
public:
int width;
int height;
double *data; //size [5,width,height] - {r,g,b,alpha,z}
drawcanvas();
~drawcanvas();
drawcanvas(const drawcanvas &other);
drawcanvas(drawcanvas &&other) noexcept;
drawcanvas& operator=(const drawcanvas &other);
drawcanvas& operator=(drawcanvas &&other) noexcept;
int resize(int _width, int _height);
double& operator[](int64_t ind);
const double& operator[](int64_t ind) const;
double& operator()(int channel, int ix, int iy);
const double& operator()(int channel, int ix, int iy) const;
double& at(int channel, int ix, int iy);
const double& at(int channel, int ix, int iy) const;
};
void test_drawcanvas1();
};
};
#include <amscppsimpledraw/amscppsimpledraw_util.hpp>
#endif

View File

@ -0,0 +1,15 @@
#ifndef __AMSCPPSIMPLEDRAW_UTIL_HPP__
#define __AMSCPPSIMPLEDRAW_UTIL_HPP__
namespace ams
{
namespace simpledraw
{
};
}; //end namespace ams
#include <amscppsimpledraw/amscppsimpledraw_utilimpl.hpp>
#endif

View File

@ -0,0 +1,15 @@
#ifndef __AMSCPPSIMPLEDRAW_UTILIMPL_HPP__
#define __AMSCPPSIMPLEDRAW_UTILIMPL_HPP__
namespace ams
{
namespace simpledraw
{
};
}; //end namespace ams
#endif