Skip to content

Commit b1b4a56

Browse files
Documentation updated
1 parent 96fcda0 commit b1b4a56

14 files changed

+153
-153
lines changed

CMakeLists.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
cmake_minimum_required(VERSION 3.13)
22

3+
4+
35
################################################################################
46
## PROJECT
57
## name and version
68
################################################################################
79
project(plotOpenCV LANGUAGES CXX)
810

11+
12+
913
################################################################################
1014
## SETTINGS
1115
## basic project settings before use
@@ -25,16 +29,15 @@ endif()
2529
## CONFIGURATION
2630
## project configuration
2731
################################################################################
28-
SET(${PARENT}_PLOT_OPENCV ON CACHE BOOL "" ${REWRITE_FORCE})
29-
SET(${PARENT}_PLOT_OPENCV_TEST ON CACHE BOOL "" ${REWRITE_FORCE})
32+
SET(${PARENT}_PLOT_OPENCV ON CACHE BOOL "" ${REWRITE_FORCE})
33+
SET(${PARENT}_PLOT_OPENCV_TEST ON CACHE BOOL "" ${REWRITE_FORCE})
3034

3135

3236

3337
################################################################################
3438
## INCLUDING SUBDIRECTORIES
3539
## Adding subdirectories according to the project configuration
3640
################################################################################
37-
3841
if (${PARENT}_PLOT_OPENCV)
3942
add_subdirectory(src)
4043
endif()

LICENSE

Whitespace-only changes.

LICENSE.txt

Lines changed: 0 additions & 19 deletions
This file was deleted.

README.md

Lines changed: 77 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,35 @@
11

2-
![logo](_static/plot_opencv_logo.png)
2+
![plot_opencv_logo](_static/plot_opencv_logo.png)
3+
4+
35

46
# **plotOpenCv C++ library**
57

6-
**v1.0.1**
8+
**v1.0.2**
79

8-
------
910

1011

1112
# Table of contents
1213

1314
- [Overview](#overview)
1415
- [Versions](#versions)
16+
- [Library files](#library-files)
1517
- [plot class description](#plot-class-description)
1618
- [Class declaration](#class-declaration)
1719
- [addPlot (1D) method](#addplot-for-1d-dataset-method)
1820
- [addPlot (2D) method](#addplot-for-2d-dataset-method)
1921
- [clean method](#show-method)
2022
- [show method](#clean-method)
21-
2223
- [Example](#example)
2324
- [Build and connect to your project](#build-and-connect-to-your-project)
2425

2526

27+
2628
# Overview
2729

28-
**plotOpenCv** is a C++ library developed to facilitate the visualization of 2-dimensional line charts. This library is built upon the OpenCV, providing users with a convenient and efficient tool for visualizing data through line charts. With plotOpenCv, users can effortlessly create multiple line charts within a single window and tune various chart parameters, such as line width, color, and more.
30+
**plotOpenCv** is a C++ library developed to facilitate the visualization of 2-dimensional line charts. This library is built upon the OpenCV, providing users with a convenient and efficient tool for visualizing data through line charts. With plotOpenCv, users can effortlessly create multiple line charts within a single window and tune various chart parameters, such as line width, color, and more. It uses C++17 standard. The library is licensed under the Apache 2.0 license.
31+
32+
2933

3034
# Versions
3135

@@ -34,90 +38,77 @@
3438
| Version | Release date | What's new |
3539
| ------- | ------------ | ------------------------------------------------------------ |
3640
| 1.0.0 | 08.09.2023 | First version. |
37-
| 1.0.1 | 18.09.2023 | Update used container for plots. |
41+
| 1.0.1 | 18.09.2023 | - Update used container for plots. |
42+
| 1.0.2 | 16.04.2024 | - Antialiased line drawing implemented.<br/>- Window size issue fixed.<br/>- Documentation updated. |
43+
44+
45+
46+
# Library files
47+
48+
The library is supplied only by source code. The user is given a set of files in the form of a CMake project (repository). The repository structure is shown below:
49+
50+
```xml
51+
CMakeLists.txt -------------- Main CMake file of the library.
52+
src ------------------------- Library source code folder.
53+
CMakeLists.txt ---------- CMake file of the library.
54+
plotOpenCv.h ------------ Main library header file.
55+
plotOpenCvVersion.h ----- Header file with library version.
56+
plotOpenCvVersion.h.in -- File for CMake to generate version header.
57+
plotOpenCv.cpp ---------- C++ implementation file.
58+
test ------------------------ Folder for test application.
59+
CMakeLists.txt ---------- CMake file of test application.
60+
main.cpp ---------------- Source code of test application.
61+
```
62+
63+
64+
65+
# Plot class description
3866

3967

40-
# plot class description
4168

4269
## Class declaration
4370

44-
**plot** class declared in **plotOpenCv.h** file. Class declaration:
71+
**Plot** class declared in **plotOpenCv.h** file. Class declaration:
4572

4673
```cpp
47-
namespace cr
74+
class Plot
4875
{
49-
namespace utils
50-
{
51-
/**
52-
* @brief Plot class.
53-
*/
54-
class Plot {
5576
public:
56-
/**
57-
* @brief Method to get string of current library version.
58-
* @return String of current library version.
59-
*/
77+
78+
/// Get string of current library version.
6079
static std::string getVersion();
61-
/**
62-
* @brief Class constructor.
63-
* @param name window name.
64-
* @param width width of window.
65-
* @param height height of window.
66-
* @param backgroundColor color of background.
67-
* @param scaleLineColor color of horizontal scale line.
68-
*/
80+
81+
/// Class constructor.
6982
Plot(std::string name, int width = 1280, int height = 720,
7083
cv::Scalar backgroundColor = cv::Scalar(255, 255, 255),
7184
cv::Scalar scaleLineColor = cv::Scalar(0, 128, 128));
72-
/**
73-
* @brief Class destructor.
74-
*/
85+
86+
/// Class destructor.
7587
~Plot();
76-
/**
77-
* @brief Method to render plots on window.
78-
* @param points vector of points for plot.
79-
* @param id ploting id for a line chart, can be used to update existing plot
80-
or add new one.
81-
* @param start beginning index for plotting in given vector.
82-
* @param end ending index for plotting in given vector.
83-
* @param color printing color of plot.
84-
* @param thickness line tickness for plot.
85-
*/
88+
89+
/// Render plots on window.
8690
template <typename T>
8791
void addPlot(std::vector<T>& points, int id, int start = 0, int end = 0,
8892
cv::Scalar color = cv::Scalar(255, 255, 255), int thickness = 1);
89-
/**
90-
* @brief Method to render plots on window.
91-
* @param points 2D vector of points for plot.
92-
* @param id ploting id for a line chart, can be used to update existing plot
93-
or add new one.
94-
* @param start beginning index for plotting in given vector.
95-
* @param end ending index for plotting in given vector.
96-
* @param color printing color of plot.
97-
* @param thickness line tickness for plot
98-
*/
93+
/// Method to render plots on window.
9994
template <typename T>
10095
void addPlot(std::vector<std::vector<T>>& points, int id,
10196
int start = 0, int end = 0,
10297
cv::Scalar color = cv::Scalar(255, 255, 255), int thickness = 1);
103-
/**
104-
* @brief Method to clean window.
105-
*/
98+
99+
/// Method to clean window.
106100
void clean();
107-
/**
108-
* @brief Method to show window.
109-
*/
101+
102+
/// Method to show window.
110103
void show();
111104
};
112-
}
113-
}
114105
```
115106
116107
117108
118109
## getVersion method
119110
120-
**getVersion()** method returns string of current version of **plotOpenCv**. Method declaration:
111+
The **getVersion()** method returns string of current version of **plotOpenCv**. Method declaration:
121112
122113
```cpp
123114
static std::string getVersion();
@@ -132,12 +123,14 @@ std::cout << "plotOpenCv class version: " << plotOpenCv::getVersion() << std::en
132123
Console output:
133124

134125
```bash
135-
plotOpenCv class version: 1.0.1
126+
plotOpenCv class version: 1.0.2
136127
```
137128

129+
130+
138131
## addPlot (for 1D dataset) method
139132

140-
**addPlot(...)** method serves the purpose of incorporating a new line chart into the existing window. It either introduces a new plot if the provided id is not yet present, or updates an existing plot associated with the given identifier. Method declaration:
133+
The **addPlot(...)** method serves the purpose of incorporating a new line chart into the existing window. It either introduces a new plot if the provided id is not yet present, or updates an existing plot associated with the given identifier. Method declaration:
141134

142135
```cpp
143136
void addPlot(std::vector<T> &points, int id, int start = 0, int end = 0,
@@ -153,9 +146,11 @@ void addPlot(std::vector<T> &points, int id, int start = 0, int end = 0,
153146
| color | Color of chart line. |
154147
| thickness | Thickness of chart line.|
155148
149+
150+
156151
## addPlot (for 2D dataset) method
157152
158-
**addPlot(...)** method serves the purpose of incorporating a new line chart into the existing window. It either introduces a new plot if the provided id is not yet present, or updates an existing plot associated with the given identifier. Method declaration:
153+
The **addPlot(...)** method serves the purpose of incorporating a new line chart into the existing window. It either introduces a new plot if the provided id is not yet present, or updates an existing plot associated with the given identifier. Method declaration:
159154
160155
```cpp
161156
void addPlot(std::vector<std::vector<T>> &points, int id, int start = 0, int end = 0,
@@ -172,7 +167,6 @@ void addPlot(std::vector<std::vector<T>> &points, int id, int start = 0, int end
172167
| tickness | Tickness of chart line.|
173168

174169

175-
176170
**Table 2** - Supported data types.
177171

178172
| Supported data types |
@@ -185,22 +179,29 @@ void addPlot(std::vector<std::vector<T>> &points, int id, int start = 0, int end
185179
| int |
186180
| float |
187181
| double |
182+
183+
184+
188185
## show method
189186

190-
**show()** method is responsible for displaying a window containing all the plotted line charts. Method declaration:
187+
The **show()** method is responsible for displaying a window containing all the plotted line charts. Method declaration:
191188

192189
```cpp
193190
void show();
194191
```
195192

193+
194+
196195
## clean method
197196

198-
**clean()** method is responsible for cleaning a window containing all the plotted line charts. Method declaration:
197+
The **clean()** method is responsible for cleaning a window containing all the plotted line charts. Method declaration:
199198

200199
```cpp
201200
void clean();
202201
```
203202

203+
204+
204205
# Example
205206

206207
```cpp
@@ -216,12 +217,15 @@ void clean();
216217
cv::waitKey(0);
217218
```
218219
220+
221+
219222
# Example Charts
220223
221-
![example_1](_static/example_1.png)
222-
![example_2](_static/example_2.png)
223-
![example_3](_static/example_3.png)
224-
![example_combined](_static/example_combined.png)
224+
![plot_opencv_example_1](_static/plot_opencv_example_1.png)
225+
![plot_opencv_example_2](_static/plot_opencv_example_2.png)
226+
![plot_opencv_example_3](_static/plot_opencv_example_3.png)
227+
![plot_opencv_example_combined](_static/plot_opencv_example_combined.png)
228+
225229
226230
227231
# Build and connect to your project
@@ -290,9 +294,10 @@ SET(${PARENT}_SUBMODULE_CACHE_OVERWRITE OFF CACHE BOOL "" FORCE)
290294
## CONFIGURATION
291295
## 3rd-party submodules configuration
292296
################################################################################
293-
SET(${PARENT}_SUBMODULE_PLOT_OPENCV ON CACHE BOOL "" FORCE)
297+
SET(${PARENT}_SUBMODULE_PLOT_OPENCV ON CACHE BOOL "" FORCE)
294298
if (${PARENT}_SUBMODULE_PLOT_OPENCV)
295-
SET(${PARENT}_PLOT_OPENCV ON CACHE BOOL "" FORCE)
299+
SET(${PARENT}_PLOT_OPENCV ON CACHE BOOL "" FORCE)
300+
SET(${PARENT}_PLOT_OPENCV_TEST OFF CACHE BOOL "" FORCE)
296301
endif()
297302
298303
################################################################################
@@ -329,5 +334,4 @@ Next you have to include plotOpenCv library in your **src/CMakeLists.txt** file:
329334
target_link_libraries(${PROJECT_NAME} plotOpenCv)
330335
```
331336

332-
Done!
333-
337+
Done!
File renamed without changes.
File renamed without changes.
File renamed without changes.

plotOpenCv_C++_library_v1.0.2.pdf

686 KB
Binary file not shown.

src/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ cmake_minimum_required(VERSION 3.13)
66
## LIBRARY-PROJECT
77
## name and version
88
###############################################################################
9-
project(plotOpenCv VERSION 1.0.1 LANGUAGES CXX)
9+
project(plotOpenCv VERSION 1.0.2 LANGUAGES CXX)
10+
11+
1012

1113
###############################################################################
1214
## SETTINGS
@@ -25,6 +27,8 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${BINARY_DIR}/lib")
2527
file (GLOB_RECURSE IN_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.h.in)
2628
configure_file(${IN_FILES} ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}Version.h)
2729

30+
31+
2832
###############################################################################
2933
## TARGET
3034
## create target and add include path
@@ -42,6 +46,7 @@ endif()
4246
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
4347

4448

49+
4550
###############################################################################
4651
## LINK LIBRARIES
4752
## linking all dependencies

0 commit comments

Comments
 (0)