Commit d940e28e authored by Laurent Belcour's avatar Laurent Belcour

Adding some documentation about the file format

parent 36636f2e
/*!
\page format Format
\todo Describe here the file format
<h2>Rational function file format (.rational)</h2>
We advise to output all rational function into .rational file for consistency.
ALTA library assumes that all rational polynomials are exported using the
following convention:
<ul>
<li>The .rational file is outputed in plain text and not in binary.</li>
<li>The .rational file starts with a header. Each line of the header
starts with the character '#'.</li>
<li>If there are multiple color channels to the rational function, they
are enumerated in the file, one color channel by one.</li>
</ul>
Example of a .rational file:
\verbatim
#DIM N P
#NP (nombre de coeffs ou degré max au numerateur )
#NQ (nombre de coeffs ou degré min au denominateur )
#BASIS "chaine_caract_decrivant_le_type_de_fonction_de_base"
Coeff_numerateur deg_1_fct_base deg_2_fct_base ... coeff_associe
Coeff denominateur
#NP
#NQ
\endverbatim
\todo Right now the different color channels have the same length !
*/
......@@ -364,8 +364,7 @@ void rational_function::save(const std::string& filename, const arguments& args)
}
}
// Will save a header only function file
// TODO it should handle parametrization
//! \todo it should handle parametrization
void rational_function::save_cpp(const std::string& filename, const arguments& args) const
{
std::ofstream file(filename.c_str(), std::ios_base::trunc);
......
......@@ -50,9 +50,12 @@ class rational_function : public QObject, public function
// STL stream ouput
friend std::ostream& operator<< (std::ostream& out, const rational_function& r) ;
// Save the rational function to a given format
//! \brief Save the rational function to the rational format (see \ref formating).
void save_rational_function(const std::string& filename) const ;
//! \brief Output the rational function as a gnuplot file. It requires
//! the data object to output the function at the input location only.
void save_gnuplot(const std::string& filename, const data* d, const arguments& args) const ;
//! \brief Output the rational function using a C++ function formating.
void save_cpp(const std::string& filename, const arguments& args) const ;
protected: // functions
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment