marlam / gencolormap Goto Github PK
View Code? Open in Web Editor NEWcolor map generator for scientific visualization
Home Page: https://marlam.de/gencolormap
License: Other
color map generator for scientific visualization
Home Page: https://marlam.de/gencolormap
License: Other
Hi
I have compiled command line tool ,
cmake .
-- The CXX compiler identification is GNU 11.4.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
CMake Warning (dev) in CMakeLists.txt:
AUTOGEN: No valid Qt version found for target gencolormap. AUTOMOC
disabled. Consider adding:
find_package(Qt<QTVERSION> COMPONENTS Core)
to your CMakeLists.txt file.
This warning is for project developers. Use -Wno-dev to suppress it.
-- Generating done
-- Build files have been written to: /home/a/gencolormap-mirror
a@zalman:~/gencolormap-mirror$ make
[ 25%] Building CXX object CMakeFiles/gencolormap.dir/cmdline.cpp.o
[ 50%] Building CXX object CMakeFiles/gencolormap.dir/colormap.cpp.o
[ 75%] Building CXX object CMakeFiles/gencolormap.dir/export.cpp.o
[100%] Linking CXX executable gencolormap
[100%] Built target gencolormap
but gui have an errror
make all
g++ -c -pipe -O2 -Wall -Wextra -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -I. -I. -I/usr/include/x86_64-linux-gnu/qt5 -I/usr/include/x86_64-linux-gnu/qt5/QtGui -I/usr/include/x86_64-linux-gnu/qt5/QtCore -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -o colormapwidgets.o colormapwidgets.cpp
In file included from colormapwidgets.cpp:25:
gui.hpp:28:10: fatal error: QMainWindow: No such file or directory
28 | #include <QMainWindow>
| ^~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:415: colormapwidgets.o] Error 1
Any tips ?
I'm on Ubuntu 22.043
qmake --version
QMake version 3.1
Using Qt version 5.15.3 in /usr/lib/x86_64-linux-gnu
Hi
I try to add test image by Peter Kovesi
/* Apply color map to test image. See http://peterkovesi.com/projects/colourmaps/colourmaptestimage.html */
std::string ToPPM_Test(int n, const unsigned char* srgb_colormap)
{
static const float twopi = 2.0 * M_PI;
int jMax = 128; // height
int iMax = 512; // width
int colormap_size = jMax * iMax;
std::string s = "P3\n"; // magic number for plain (ASCII txt) PPM
s += std::to_string(n) + " " + std::to_string(jMax) + "\n"; // save n=width and jMax=height to s string
s += "255\n"; // max val
for (int j = 0; j < jMax; j++){ // y , jMax = height
float v = 1.0f - (j / (jMax - 1.0f));
for (int i = 0; i < iMax; i++) // x , so here n = width. outside n = number of colors in the map
{
float u = i / (iMax - 1.0f);
// Test image formula
float ramp = u;
float modulation = 0.05f * std::sin(iMax / 8 * twopi * u);
float value = ramp + v * v * modulation;
// Applying colormap
int k = std::round(value * (colormap_size / 3 - 1));
if (k < 0)
{k = 0;}
else if (k >= colormap_size / 3) k = colormap_size / 3 - 1;
// add RGB string to s string
s += std::to_string(srgb_colormap[3 * k + 0]) + ' '
+ std::to_string(srgb_colormap[3 * k + 1]) + ' '
+ std::to_string(srgb_colormap[3 * k + 2]) + '\n';
}}
return s;
}
It gives Segmentation fault
What should I change ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.