|
1 |
| - |
| 1 | + |
2 | 2 |
|
3 | 3 |
|
4 | 4 |
|
5 | 5 | # **Lens interface C++ library**
|
6 | 6 |
|
7 |
| -**v4.4.2** |
| 7 | +**v4.4.3** |
8 | 8 |
|
9 | 9 |
|
10 | 10 |
|
|
45 | 45 |
|
46 | 46 | # Overview
|
47 | 47 |
|
48 |
| -**Lens** C++ library provides standard interface as well defines data structures and rules for different lens controllers. **Lens** interface class doesn't do anything, just provides interface and provides methods to encode/decode commands and encode/decode params. Different lens controller classes inherit interface form **Lens** C++ class. **Lens.h** file contains list of data structures ([LensCommand](#lenscommand-enum) enum, [LensParam](#lensparam-enum) enum and [LensParams](#lensparams-class-description) class) and **Lens** class declaration. [LensCommand](#lenscommand-enum) enum contains IDs of commands supported by **Lens** class. [LensParam](#lensparam-enum) enum contains IDs of params supported by **Lens** class. [LensParams](#lensparam-enum) class contains fields for lens parameters values and provides methods to encode/decode and read/write lens parameters from JSON file. All lens controllers should include params and commands listed in **Lens.h** file. Lens interface class depends on [Frame](https://github.com/ConstantRobotics-Ltd/Frame) class (describes video frame and video frame data structures, necessary for autofocus functions, source code included, Apache 2.0 license) and [ConfigReader](https://github.com/ConstantRobotics-Ltd/ConfigReader) library (provides methods to read/write JSON config files, source code included, Apache 2.0 license). It uses C++17 standard. The library is licensed under the **Apache 2.0** license. |
| 48 | +**Lens** C++ library provides standard interface as well defines data structures and rules for different lens controllers. **Lens** interface class doesn't do anything, just provides interface and provides methods to encode / decode commands and encode / decode params. Different lens controller classes inherit interface form **Lens** C++ class. **Lens.h** file contains list of data structures ([LensCommand](#lenscommand-enum) enum, [LensParam](#lensparam-enum) enum and [LensParams](#lensparams-class-description) class) and [Lens](#lens-interface-class-description) class declaration. [LensCommand](#lenscommand-enum) enum contains IDs of commands supported by [Lens](#lens-interface-class-description) class. [LensParam](#lensparam-enum) enum contains IDs of params supported by **Lens** class. [LensParams](#lensparam-enum) class contains fields for lens parameters values and provides methods to encode/decode and read/write lens parameters from JSON file. All lens controllers should include params and commands listed in **Lens.h** file. Lens interface class depends on [Frame](https://rapidpixel.constantrobotics.com/docs/service-libraries/frame.html) class (describes video frame and video frame data structures, necessary for autofocus functions, source code included, Apache 2.0 license) and [ConfigReader](https://rapidpixel.constantrobotics.com/docs/service-libraries/config-reader.html) library (provides methods to read / write JSON config files, source code included, Apache 2.0 license). It uses C++17 standard. The library is licensed under the **Apache 2.0** license. |
49 | 49 |
|
50 | 50 |
|
51 | 51 |
|
|
70 | 70 | | 4.3.1 | 13.11.2023 | - Frame class updated. |
|
71 | 71 | | 4.4.1 | 13.12.2023 | - Virtual destructor added.<br />- Frame class updated. |
|
72 | 72 | | 4.4.2 | 25.03.2024 | - Frame class updated.<br />- ConfigReader class updated.<br />- Documentation updated. |
|
| 73 | +| 4.4.3 | 21.05.2024 | - Frame class updated.<br />- ConfigReader class updated.<br />- Documentation updated. | |
73 | 74 |
|
74 | 75 |
|
75 | 76 |
|
|
78 | 79 | The library supplied by source code only. The user would be given a set of files in the form of a CMake project (repository). The repository structure is shown below:
|
79 | 80 |
|
80 | 81 | ```xml
|
81 |
| -CMakeLists.txt --------------- Main CMake file of the library. |
82 |
| -3rdparty --------------------- Folder with third-party libraries. |
83 |
| - CMakeLists.txt ----------- CMake file to include third-party libraries. |
84 |
| - ConfigReader ------------- Source code of the ConfigReader library. |
85 |
| - Frame -------------------- Source code of the Frame library. |
86 |
| -example ---------------------- Folder with an example lens controller. |
87 |
| - CMakeLists.txt ----------- CMake file for example of lens controller. |
88 |
| - CustomLens.cpp ----------- C++ implementation file. |
89 |
| - CustomLens.h ------------- Header with class declaration. |
90 |
| - CustomLensVersion.h ------ Header file which includes class version. |
91 |
| - CustomLensVersion.h.in --- CMake service file to generate version file. |
92 |
| -test ------------------------- Folder with test application. |
93 |
| - CMakeLists.txt ----------- CMake file for test application. |
94 |
| - main.cpp ----------------- Source code file of test application. |
95 |
| -src -------------------------- Folder with source code of the library. |
96 |
| - CMakeLists.txt ----------- CMake file of the library. |
97 |
| - Lens.cpp ----------------- C++ implementation file. |
98 |
| - Lens.h ------------------- Header file which includes Lens class declaration. |
99 |
| - LensVersion.h ------------ Header file which includes version of the library. |
100 |
| - LensVersion.h.in --------- CMake service file to generate version file. |
| 82 | +CMakeLists.txt -------------- Main CMake file of the library. |
| 83 | +3rdparty -------------------- Folder with third-party libraries. |
| 84 | + CMakeLists.txt ---------- CMake file to include third-party libraries. |
| 85 | + ConfigReader ------------ Folder with ConfigReader library source code. |
| 86 | + Frame ------------------- Folder with Frame library source code. |
| 87 | +example --------------------- Folder with an example lens controller. |
| 88 | + CMakeLists.txt ---------- CMake file for example of lens controller. |
| 89 | + CustomLens.cpp ---------- C++ implementation file. |
| 90 | + CustomLens.h ------------ Header with class declaration. |
| 91 | + CustomLensVersion.h ----- Header file which includes class version. |
| 92 | + CustomLensVersion.h.in -- CMake service file to generate version file. |
| 93 | +test ------------------------ Folder with test application. |
| 94 | + CMakeLists.txt ---------- CMake file for test application. |
| 95 | + main.cpp ---------------- Source code file of test application. |
| 96 | +src ------------------------- Folder with source code of the library. |
| 97 | + CMakeLists.txt ---------- CMake file of the library. |
| 98 | + Lens.cpp ---------------- C++ implementation file. |
| 99 | + Lens.h ------------------ Header file which includes Lens class declaration. |
| 100 | + LensVersion.h ----------- Header file which includes version of the library. |
| 101 | + LensVersion.h.in -------- CMake service file to generate version file. |
101 | 102 | ```
|
102 | 103 |
|
103 | 104 |
|
@@ -190,7 +191,7 @@ std::cout << "Lens class version: " << Lens::getVersion() << std::endl;
|
190 | 191 | Console output:
|
191 | 192 |
|
192 | 193 | ```bash
|
193 |
| -Lens class version: 4.4.2 |
| 194 | +Lens class version: 4.4.3 |
194 | 195 | ```
|
195 | 196 |
|
196 | 197 |
|
@@ -221,7 +222,7 @@ virtual bool initLens(LensParams& params) = 0;
|
221 | 222 |
|
222 | 223 | | Parameter | Value |
|
223 | 224 | | --------- | ------------------------------------------------------------ |
|
224 |
| -| params | Parameters ([LensParams class](#lensparams-class-description)). LensParams class includes initString which used in **openLens(...)** method. See description of [LensParams](#lensparams-class-description) class. | |
| 225 | +| params | Parameters ([LensParams](#lensparams-class-description) class). LensParams class includes initString which used in **openLens(...)** method. See description of [LensParams](#lensparams-class-description) class. | |
225 | 226 |
|
226 | 227 | **Returns:** TRUE if the lens controller initialized or FALSE if not.
|
227 | 228 |
|
@@ -272,7 +273,7 @@ virtual bool setParam(LensParam id, float value) = 0;
|
272 | 273 | | Parameter | Description |
|
273 | 274 | | --------- | ------------------------------------------------------------ |
|
274 | 275 | | id | Lens parameter ID (see description of [LensParam](#lensparam-enum) enum). |
|
275 |
| -| value | Lens parameter value. Value depends on parameter ID (see description of [**LensParam enum**](#LensParam-enum)). | |
| 276 | +| value | Lens parameter value. Value depends on parameter ID (see description of [LensParam enum](#lensparam-enum) enum). | |
276 | 277 |
|
277 | 278 | **Returns:** TRUE if the parameter was set or FALSE if not.
|
278 | 279 |
|
@@ -335,7 +336,7 @@ virtual void addVideoFrame(cr::video::Frame& frame) = 0;
|
335 | 336 |
|
336 | 337 | | Parameter | Description |
|
337 | 338 | | --------- | ------------------------------------------------------------ |
|
338 |
| -| frame | Video frame object (see [Frame](https://github.com/ConstantRobotics-Ltd/Frame) class description). | |
| 339 | +| frame | Video frame object (see [Frame](https://rapidpixel.constantrobotics.com/docs/service-libraries/frame.html) class description). | |
339 | 340 |
|
340 | 341 | **Returns:** TRUE is the video frame accepted or FALSE if not. **Note:** if particular lens controller doesn't support this function it should return **TRUE** (recommended).
|
341 | 342 |
|
|
0 commit comments