FuncSketch
Loading...
Searching...
No Matches
func_sketch::plotter::Plotter Class Reference

Class for plotting. More...

#include <func_sketch/plotter/plotter.h>

Collaboration diagram for func_sketch::plotter::Plotter:

Public Member Functions

 Plotter (const PlotRange &range, const PlotConfig &config)
 Constructor.
Plotterrange (const PlotRange &value)
 Set the range of plots.
Plotterconfig (const PlotConfig &value)
 Set the configuration of plots.
void write_background (Image &image)
 Write background of plots.
void write_curve (const std::vector< Point > &samples, const RGBColor &color, Image &image)
 Write a curve on plots.

Private Member Functions

void write_grid_lines (Image &image)
 Write grid lines of plots.
void write_x_axis (Image &image)
 Write x axis.
void write_y_axis (Image &image)
 Write y axis.

Private Attributes

PlotRange range_
 Range of plots.
PlotConfig config_
 Configuration of plots.
int left_margin_ {}
 Left margin of plots in pixels. (This value is used over the value in config because tuning of the left margin is needed.).
AxisTicks x_axis_ticks_
 Ticks of the x-axis.
AxisTicks y_axis_ticks_
 Ticks of the y-axis.

Detailed Description

Class for plotting.

Note
This class assumes that the image is in RGB format, not BGR format as in default of OpenCV.

Definition at line 36 of file plotter.h.

Constructor & Destructor Documentation

◆ Plotter()

func_sketch::plotter::Plotter::Plotter ( const PlotRange & range,
const PlotConfig & config )

Constructor.

Parameters
[in]rangeRange of plots.
[in]configConfiguration of plots.

Definition at line 114 of file plotter.cpp.

Member Function Documentation

◆ range()

Plotter & func_sketch::plotter::Plotter::range ( const PlotRange & value)

Set the range of plots.

Parameters
[in]valueRange of plots.
Returns
Reference to this object.

Definition at line 117 of file plotter.cpp.

◆ config()

Plotter & func_sketch::plotter::Plotter::config ( const PlotConfig & value)

Set the configuration of plots.

Parameters
[in]valueConfiguration of plots.
Returns
Reference to this object.

Definition at line 122 of file plotter.cpp.

◆ write_background()

void func_sketch::plotter::Plotter::write_background ( Image & image)

Write background of plots.

Parameters
[in]imageImage to write.
Note
This changes the internal states holding some parameters used in write_curve function.

Definition at line 127 of file plotter.cpp.

◆ write_curve()

void func_sketch::plotter::Plotter::write_curve ( const std::vector< Point > & samples,
const RGBColor & color,
Image & image )

Write a curve on plots.

Parameters
[in]samplesSamples points of the curve.
[in]colorColor of the curve.
[in]imageImage to write.
Note
This function must be called after write_background function because this function uses some parameters computed in write_background function.

Definition at line 146 of file plotter.cpp.

◆ write_grid_lines()

void func_sketch::plotter::Plotter::write_grid_lines ( Image & image)
private

Write grid lines of plots.

Parameters
[in]imageImage to write.

Definition at line 194 of file plotter.cpp.

◆ write_x_axis()

void func_sketch::plotter::Plotter::write_x_axis ( Image & image)
private

Write x axis.

Parameters
[in]imageImage to write.

Definition at line 217 of file plotter.cpp.

◆ write_y_axis()

void func_sketch::plotter::Plotter::write_y_axis ( Image & image)
private

Write y axis.

Parameters
[in]imageImage to write.

Definition at line 256 of file plotter.cpp.

Member Data Documentation

◆ range_

PlotRange func_sketch::plotter::Plotter::range_
private

Range of plots.

Definition at line 109 of file plotter.h.

◆ config_

PlotConfig func_sketch::plotter::Plotter::config_
private

Configuration of plots.

Definition at line 112 of file plotter.h.

◆ left_margin_

int func_sketch::plotter::Plotter::left_margin_ {}
private

Left margin of plots in pixels. (This value is used over the value in config because tuning of the left margin is needed.).

Definition at line 118 of file plotter.h.

◆ x_axis_ticks_

AxisTicks func_sketch::plotter::Plotter::x_axis_ticks_
private

Ticks of the x-axis.

Definition at line 121 of file plotter.h.

◆ y_axis_ticks_

AxisTicks func_sketch::plotter::Plotter::y_axis_ticks_
private

Ticks of the y-axis.

Definition at line 124 of file plotter.h.


The documentation for this class was generated from the following files: