tmp update

This commit is contained in:
2024-09-19 11:24:17 +08:00
parent f1cc876972
commit 2901590f00
9 changed files with 68 additions and 33 deletions

View File

@@ -140,6 +140,7 @@ void HandyMan::SR_CalPlaneCoeff()
void HandyMan::SR_RGB2CPT()
{
gctl::text_content tc;
std::string rgb_file, cpt_file;
std::cout << "Name of the RGB series file (Each line of file contains a R G B group).\n>> ";
std::cin >> rgb_file;
@@ -147,8 +148,12 @@ void HandyMan::SR_RGB2CPT()
std::cout << "Name of the output .cpt file.\n>> ";
std::cin >> cpt_file;
std::vector<double> R, G, B;
gctl::read_text2vectors(rgb_file, "0,1,2", ' ', '#', 0, R, G, B);
tc.load_text(rgb_file);
std::vector<double> R(tc.contents_.size()), G(tc.contents_.size()), B(tc.contents_.size());
for (size_t i = 0; i < tc.contents_.size(); i++)
{
gctl::parse_string_to_value(tc.contents_[i], ' ', true, R[i], G[i], B[i]);
}
int c_size = R.size();
int i_type;
@@ -196,14 +201,16 @@ void HandyMan::SR_RGB2CPT()
}
else if (i_type == 2)
{
std::string in_str, f_name, d_name;
std::cout << "Name of the .txt input file appended by the index of the data column (<name>+<col>).\n>> ";
std::string in_str, f_name;
std::cout << "Name of the .txt input file.\n>> ";
std::cin >> in_str;
gctl::parse_string_to_value(in_str, '+', true, f_name, d_name);
gctl::parse_string_to_value(in_str, '+', true, f_name);
tc.clear();
tc.load_text(f_name);
std::vector<double> D, D_ori;
gctl::read_text2vectors(f_name, d_name, ' ', '#', 0, D_ori);
gctl::str2type_vector(tc.contents_, D_ori);
D.reserve(D_ori.size());
for (size_t i = 0; i < D_ori.size(); i++)