canvas_ity
canvas_ity copied to clipboard
Using canvas_ity in a class based cpp library
Hi!
We're trying to submodule your library in ngscopeclient/scopehal, as a replacement for cairo, but I am running into issues using it as part of a class with multiple functions. Could you be so kind as to provide an example in the repo? Or at least some basic code here where you show how/what we should keep a reference for the class property or to pass between methods? For performance reasons we can't stuff everything in one method, we've tried :')
Would appreciate any response, and hopefully you can help us out and your library can be added to ngscopeclient. We'd love to finally get rid of cairo.....
Trying to keep a class property like:
`cpp /** @brief A mask used for checking eye patterns */ class EyeMask { public: EyeMask(); virtual ~EyeMask();
.....
canvas_ity::canvas canvas;
};`
We're running into stuff like:
cpp [build] /home/johnsimons/scopehal-apps_working_copy/lib/scopehal/EyeMask.cpp: In constructor ‘EyeMask::EyeMask()’: [build] /home/johnsimons/scopehal-apps_working_copy/lib/scopehal/EyeMask.cpp:55:37: error: no matching function for call to ‘canvas_ity::canvas::canvas()’ [build] 55 | , m_timebaseIsRelative(false) [build] | ^ [build] In file included from /home/johnsimons/scopehal-apps_working_copy/lib/scopehal/EyeMask.h:39, [build] from /home/johnsimons/scopehal-apps_working_copy/lib/scopehal/BERTInputChannel.h:34, [build] from /home/johnsimons/scopehal-apps_working_copy/lib/scopehal/BERT.h:423, [build] from /home/johnsimons/scopehal-apps_working_copy/lib/scopehal/scopehal.h:132, [build] from /home/johnsimons/scopehal-apps_working_copy/lib/scopehal/EyeMask.cpp:36: [build] /home/johnsimons/scopehal-apps_working_copy/lib/scopehal/../canvas_ity/src/canvas_ity.hpp:1173:5: note: candidate: ‘canvas_ity::canvas::canvas(const canvas_ity::canvas&)’ [build] 1173 | canvas( canvas const & ); [build] | ^~~~~~ [build] /home/johnsimons/scopehal-apps_working_copy/lib/scopehal/../canvas_ity/src/canvas_ity.hpp:1173:5: note: candidate expects 1 argument, 0 provided [build] In file included from /home/johnsimons/scopehal-apps_working_copy/lib/scopehal/EyeMask.cpp:42: [build] /home/johnsimons/scopehal-apps_working_copy/lib/scopehal/../canvas_ity/src/canvas_ity.hpp:2607:1: note: candidate: ‘canvas_ity::canvas::canvas(int, int)’ [build] 2607 | canvas::canvas(
cpp [build] from /home/johnsimons/scopehal-apps_working_copy/lib/scopehal/EyeMask.cpp:36: [build] /home/johnsimons/scopehal-apps_working_copy/lib/scopehal/../canvas_ity/src/canvas_ity.hpp:1174:13: note: declared private here [build] 1174 | canvas &operator=( canvas const & ); [build] | ^~~~~~~~ [build] /home/johnsimons/scopehal-apps_working_copy/lib/scopehal/EyeMask.cpp:187:55: error: passing ‘const canvas_ity::canvas’ as ‘this’ argument discards qualifiers [-fpermissive] [build] 187 | this->canvas = canvas_ity::canvas(width,height);
and