40 fs::directory_iterator endIter;
41 if (fs::is_directory(folder))
43 for (fs::directory_iterator dirIter(folder); dirIter != endIter; ++dirIter)
45 if (fs::is_regular_file(dirIter->status()))
47 const auto filename = dirIter->path().c_str();
49 files.push_back(filename);
52 const auto& fileExtension = dirIter->path().extension();
53 const auto found = std::find(filters.begin(), filters.end(), fileExtension);
54 if (found != filters.end())
55 files.push_back(filename);
60 std::sort(files.begin(), files.end());
66 auto extension = fs::path(filename).extension().string();
67 if (!extension.empty())
68 extension = extension.erase(0, 1);
75 if (t < 0.f || t > 1.f)
76 CORE_THROW(
"Invalid value with t=" + std::to_string(t) +
". Must be between 0 and 1");
78 const size_t n = controlPoints.size();
81 for (uint64_t k = 1; k < n; ++k)
83 for (uint64_t i = 0; i < n - k; ++i)
85 tempPoints[i].x = (1 - t) * tempPoints[i].x + t * tempPoints[i + 1].x;
86 tempPoints[i].y = (1 - t) * tempPoints[i].y + t * tempPoints[i + 1].y;
87 tempPoints[i].z = (1 - t) * tempPoints[i].z + t * tempPoints[i + 1].z;
88 tempPoints[i].w = (1 - t) * tempPoints[i].w + t * tempPoints[i + 1].w;
103 float p = v * (1 - s);
104 float q = v * (1 - f * s);
105 float t = v * (1 - (1 - f) * s);
129 for (uint32_t i = 0; i < colormapSize; ++i)
131 const float hue =
static_cast<float>(i) / colormapSize;
132 colormap.push_back(
hsvToRgb(hue, 1.0f, 1.0f));
138 template <
typename To,
typename From>
142 std::from_chars(from.data(), from.data() + from.size(), to);
Vector3f hsvToRgb(float h, float s, float v)
strings parseFolder(const std::string &folder, const strings &filters)
To lexical_cast(const From &from)
Function template taking two template parameters (To and From) representing the source and target typ...
Vector3fs getRainbowColormap(const uint32_t colormapSize)
Get the Rainbow Colormap.
std::vector< Vector4f > Vector4fs
std::vector< Vector3f > Vector3fs
Vector4f getBezierPoint(const Vector4fs &controlPoints, const float t)
Get the Bezier Point from a curve defined by the provided control points.
std::string extractExtension(const std::string &filename)