mirror of
https://github.com/CHN-beta/nixos.git
synced 2026-01-12 04:39:23 +08:00
packages.ufo: use gnuplot backend
This commit is contained in:
@@ -14,12 +14,9 @@ find_package(Matplot++ REQUIRED)
|
||||
find_package(biu REQUIRED)
|
||||
find_package(Threads REQUIRED)
|
||||
|
||||
# matplot++ requires glad but does not find it
|
||||
find_package(glad REQUIRED)
|
||||
|
||||
add_executable(ufo src/fold.cpp src/unfold.cpp src/plot.cpp src/main.cpp)
|
||||
target_include_directories(ufo PRIVATE ${PROJECT_SOURCE_DIR}/include)
|
||||
target_link_libraries(ufo PRIVATE TBB::tbb Matplot++::matplot Matplot++::matplot_opengl biu::biu)
|
||||
target_link_libraries(ufo PRIVATE TBB::tbb Matplot++::matplot biu::biu)
|
||||
target_compile_features(ufo PRIVATE cxx_std_23)
|
||||
target_compile_options(ufo PRIVATE -fexperimental-library)
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
# include <ufo.hpp>
|
||||
# include <matplot/matplot.h>
|
||||
# include <matplot/backend/opengl.h>
|
||||
# include <boost/container/flat_map.hpp>
|
||||
|
||||
void ufo::plot(std::string config_file)
|
||||
@@ -185,7 +184,7 @@ void ufo::plot(std::string config_file)
|
||||
if (g[i][j] < 0) g[i][j] = 0;
|
||||
b[i][j] = 255;
|
||||
}
|
||||
auto f = matplot::figure<matplot::backend::opengl>(true);
|
||||
auto f = matplot::figure(true);
|
||||
auto ax = f->current_axes();
|
||||
auto image = ax->image(std::tie(r, g, b));
|
||||
image->matrix_a(a);
|
||||
|
||||
Reference in New Issue
Block a user