diff --git a/SDK/C++/private/observer_impl.cpp b/SDK/C++/private/observer_impl.cpp index abdd38f8f03ae81c4703ae8aa227dad5a1b6000e..8315df3d229a86b3b0024d1e739d79c2e9c04592 100644 --- a/SDK/C++/private/observer_impl.cpp +++ b/SDK/C++/private/observer_impl.cpp @@ -166,7 +166,7 @@ voltu::FramePtr ObserverImpl::getFrame() voltu::PropertyPtr ObserverImpl::property(voltu::ObserverProperty) { - throw voltu::exceptions::InvalidProperty(); + throw voltu::exceptions::NotImplemented(); } std::shared_ptr<ftl::data::FrameSet> ObserverImpl::_makeFrameSet() diff --git a/SDK/C++/public/LICENSE b/SDK/C++/public/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..2e5d48af4dd87df06b5a99c9605b19f9d3303324 --- /dev/null +++ b/SDK/C++/public/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2020 Nicolas Pope + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/SDK/C++/public/README.md b/SDK/C++/public/README.md new file mode 100644 index 0000000000000000000000000000000000000000..980ab1abd49a40b37cdb51b146be1421706564d1 --- /dev/null +++ b/SDK/C++/public/README.md @@ -0,0 +1 @@ +# VolTu - Volumetric Capture SDK \ No newline at end of file diff --git a/SDK/C++/public/include/voltu/defines.hpp b/SDK/C++/public/include/voltu/defines.hpp index 4f5ded24e0c89cfdbb5b002d1e2d830c1f90aeb2..19f2416f2812cc41b69b6c2f73a7a7f3bd4f7588 100644 --- a/SDK/C++/public/include/voltu/defines.hpp +++ b/SDK/C++/public/include/voltu/defines.hpp @@ -1,3 +1,9 @@ +/** + * @file system.hpp + * @copyright Copyright (c) 2020 Sebastian Hahta, MIT License + * @author Sebastian Hahta + */ + #pragma once #ifndef PY_API diff --git a/SDK/C++/public/include/voltu/feed.hpp b/SDK/C++/public/include/voltu/feed.hpp index 0a19d30174be9c09ad5461d2c071073741ed33f9..d863cf8940cf70cde9c41e3b4576877e9fe2ee7f 100644 --- a/SDK/C++/public/include/voltu/feed.hpp +++ b/SDK/C++/public/include/voltu/feed.hpp @@ -1,3 +1,9 @@ +/** + * @file feed.hpp + * @copyright Copyright (c) 2020 Nicolas Pope, MIT License + * @author Nicolas Pope + */ + #pragma once #include "defines.hpp" diff --git a/SDK/C++/public/include/voltu/initialise.hpp b/SDK/C++/public/include/voltu/initialise.hpp index e44799a67837ad543664b6c81316c82c98f9747e..aeae10f6c31dd11db0d8242c73b1e2a1ec49a719 100644 --- a/SDK/C++/public/include/voltu/initialise.hpp +++ b/SDK/C++/public/include/voltu/initialise.hpp @@ -1,3 +1,9 @@ +/** + * @file initialise.hpp + * @copyright Copyright (c) 2020 Nicolas Pope, MIT License + * @author Nicolas Pope + */ + #pragma once #include <memory> #include <voltu/system.hpp> diff --git a/SDK/C++/public/include/voltu/observer.hpp b/SDK/C++/public/include/voltu/observer.hpp index f42ffaf9a8173b737831a978704ac5810a61620a..e5d99325f01df39a58e1f8eb0ba4c7572e53f044 100644 --- a/SDK/C++/public/include/voltu/observer.hpp +++ b/SDK/C++/public/include/voltu/observer.hpp @@ -1,3 +1,9 @@ +/** + * @file observer.hpp + * @copyright Copyright (c) 2020 Nicolas Pope, MIT License + * @author Nicolas Pope + */ + #pragma once #include "defines.hpp" diff --git a/SDK/C++/public/include/voltu/opencv.hpp b/SDK/C++/public/include/voltu/opencv.hpp index 467a793e8ecff579444b8afede9a1dd740aac05c..7119cbc87097ce1609a7e93696059db38b7097e3 100644 --- a/SDK/C++/public/include/voltu/opencv.hpp +++ b/SDK/C++/public/include/voltu/opencv.hpp @@ -1,3 +1,9 @@ +/** + * @file opencv.hpp + * @copyright Copyright (c) 2020 Nicolas Pope, MIT License + * @author Nicolas Pope + */ + #pragma once #include <opencv2/core/mat.hpp> diff --git a/SDK/C++/public/include/voltu/operator.hpp b/SDK/C++/public/include/voltu/operator.hpp index a7f4ce9961567912cdb9b73d95731d0e1867d6a5..5231efd178e7e008e3df549c970ccec3d1c204fa 100644 --- a/SDK/C++/public/include/voltu/operator.hpp +++ b/SDK/C++/public/include/voltu/operator.hpp @@ -1,3 +1,9 @@ +/** + * @file operator.hpp + * @copyright Copyright (c) 2020 Nicolas Pope, MIT License + * @author Nicolas Pope + */ + #pragma once #include <voltu/types/property.hpp> diff --git a/SDK/C++/public/include/voltu/pipeline.hpp b/SDK/C++/public/include/voltu/pipeline.hpp index c9894f06366b3a7577ddb01ba322e4784d218aa7..c7531f1dcbfbd84412c09b3eabb92072db461628 100644 --- a/SDK/C++/public/include/voltu/pipeline.hpp +++ b/SDK/C++/public/include/voltu/pipeline.hpp @@ -1,3 +1,9 @@ +/** + * @file pipeline.hpp + * @copyright Copyright (c) 2020 Nicolas Pope, MIT License + * @author Nicolas Pope + */ + #pragma once #include <voltu/defines.hpp> diff --git a/SDK/C++/public/include/voltu/room.hpp b/SDK/C++/public/include/voltu/room.hpp index 4971439b869b514fb9aaca54c826fb4ec2ef8c41..28fd3ba62f879c67bc7676346bceca53fff6b474 100644 --- a/SDK/C++/public/include/voltu/room.hpp +++ b/SDK/C++/public/include/voltu/room.hpp @@ -1,3 +1,9 @@ +/** + * @file room.hpp + * @copyright Copyright (c) 2020 Nicolas Pope, MIT License + * @author Nicolas Pope + */ + #pragma once #include "defines.hpp" diff --git a/SDK/C++/public/include/voltu/system.hpp b/SDK/C++/public/include/voltu/system.hpp index 0f35bc88caa89f9e9e6fd09807421b147487780b..72e933bf338506784494a870afe05899b4b636ba 100644 --- a/SDK/C++/public/include/voltu/system.hpp +++ b/SDK/C++/public/include/voltu/system.hpp @@ -1,3 +1,9 @@ +/** + * @file system.hpp + * @copyright Copyright (c) 2020 Nicolas Pope, MIT License + * @author Nicolas Pope + */ + #pragma once #include "defines.hpp" @@ -6,47 +12,127 @@ #include <voltu/feed.hpp> #include <voltu/pipeline.hpp> #include <list> +#include <string> namespace voltu { +/** + * @brief Voltu semantic versioning information. + */ struct Version { - int major; // API Incompatible change - int minor; // Possible binary incompatible, extensions - int patch; // Internal only fixes. + int major; ///< API Incompatible change + int minor; ///< Possible binary incompatible, extensions + int patch; ///< Internal only fixes. }; /** - * Singleton Voltu system instance. Provides access to the key components such - * as opening streams or files and creating virtual cameras. + * @brief Singleton Voltu system instance. + * + * Provides access to the key components such as opening streams or files and + * creating virtual cameras. Use `voltu::instance()` to obtain the object. All + * object instances in VolTu are managed by shared smart pointers. */ class System { public: virtual ~System() = default; - /** Get the semantic version information. */ + /** + * @brief Get the semantic version information. + * + * @return Always returns semantic versioning structure. + */ virtual voltu::Version getVersion() const = 0; - /** Make a virtual room or composite room. */ + /** + * @brief Make a virtual room or composite room. + * + * @return A new virtual room instance. + */ PY_API virtual voltu::RoomPtr createRoom() = 0; - /** Create a virtual observer. This renderers virtual camera views. */ + /** + * @brief Create a virtual observer. + * + * An observer renderers virtual camera views, audio and other data from + * submitted framesets. It is possible and recommended that a single + * observer instance be used to renderer multiple different views, rather + * than creating lots of observers. This saves memory resources. + * + * @return A new observer instance. + */ PY_API virtual voltu::ObserverPtr createObserver() = 0; - /** Open a file, device or network stream using a URI. */ + /** + * @brief Open a file, device or network stream using a URI. + * + * All data sources in VolTu are represented by Universal Resource + * Identifiers (URIs), with some non-standard additions. A few examples + * are: + * * `file:///home/user/file.ftl` + * * `tcp://localhost:9001/*` + * * `ftl://my.stream.name/room1` + * * `ws://ftlab.utu.fi/lab/` + * * `./file.ftl` + * * `device:camera` + * * `device:screen` + * + * Note that returning from this call does not guarantee that the source + * is fully open and operational, this depends on network handshakes or + * file processing that occurs asynchronously. + * + * @throw voltu::exceptions::BadSourceURI If an unrecognised URI is given. + * @return A feed management object for the data source. + */ PY_API virtual voltu::FeedPtr open(const std::string &uri) = 0; + /** + * @brief Get a list of all available rooms. + * + * A room is a 3D captured physical space, or a combination of such spaces, + * and is represented by a unique identifier within the local system. This + * method obtains a list of all available rooms from all sources. To obtain + * rooms, either use `open` or `createRoom`. + * + * @return A list of room ids, which can be empty. + * + * @see getRoom + * @see open + */ PY_API virtual std::list<voltu::RoomId> listRooms() = 0; + /** + * @brief Get a room instance from identifier. + * + * A room instance enables access to all data frames associated with that + * room, including image data. Calling `getRoom` with the same ID + * multiple times will return different smart pointers to room instances + * but provides access to the same data regardless and is valid. An invalid + * room ID will throw an exception. + * + * @throw voltu::exceptions::InvalidRoomId If the ID does not exist. + * @return Room instance or accessing room data. + */ PY_API virtual voltu::RoomPtr getRoom(voltu::RoomId room) = 0; /** Make a file or streaming feed, to which you can send frames. */ PY_API virtual voltu::FeedPtr createFeed(const std::string &uri) = 0; - /** Make an empty operator pipeline for frame processing. */ + /** + * @brief Make an empty operator pipeline for frame processing. + * + * A pipeline allows a sequence of processing operations to be applied to + * a data frame. These operations include stereo correspondence, fusion, + * data evaluation and various image processing operations. Only some + * of these operators are exposed in the SDK. Once a pipeline instance + * is obtained, you can add specific operators to it, configure them and + * then submit frames from processing. + * + * @return A unique pipeline instance. + */ PY_API virtual voltu::PipelinePtr createPipeline() = 0; }; -} +} // namespace voltu diff --git a/SDK/C++/public/include/voltu/types/channel.hpp b/SDK/C++/public/include/voltu/types/channel.hpp index 07b7c9abadf3caaa36e1fcd8d01f08d496d1a5b0..e9e86324e565c22b65f31e41753c5c80113d70aa 100644 --- a/SDK/C++/public/include/voltu/types/channel.hpp +++ b/SDK/C++/public/include/voltu/types/channel.hpp @@ -1,3 +1,9 @@ +/** + * @file channel.hpp + * @copyright Copyright (c) 2020 Nicolas Pope, MIT License + * @author Nicolas Pope + */ + #pragma once namespace voltu { diff --git a/SDK/C++/public/include/voltu/types/errors.hpp b/SDK/C++/public/include/voltu/types/errors.hpp index bbb8be620813c4d4fc94e5a7d868c05f3cff30aa..a69e976305e34ff79ffcbb77ac12078c433d0f03 100644 --- a/SDK/C++/public/include/voltu/types/errors.hpp +++ b/SDK/C++/public/include/voltu/types/errors.hpp @@ -1,3 +1,9 @@ +/** + * @file errors.hpp + * @copyright Copyright (c) 2020 Nicolas Pope, MIT License + * @author Nicolas Pope + */ + #pragma once #include <exception> @@ -30,7 +36,7 @@ VOLTU_EXCEPTION(LibraryVersionMismatch, Exception, "Wrong version of library fou VOLTU_EXCEPTION(BadSourceURI, Exception, "Bad source URI"); VOLTU_EXCEPTION(InvalidFrameObject, Exception, "Invalid Frame object"); VOLTU_EXCEPTION(InternalRenderError, Exception, "Internal renderer error"); -VOLTU_EXCEPTION(InvalidProperty, Exception, "Unknown property enum"); +VOLTU_EXCEPTION(InvalidRoomId, Exception, "Room identifier does not exist"); VOLTU_EXCEPTION(PropertyUnavailable, Exception, "Property currently not available"); VOLTU_EXCEPTION(BadPropertyName, Exception, "Not a valid property name"); VOLTU_EXCEPTION(BadPropertyType, Exception, "Incorrect property data type"); diff --git a/SDK/C++/public/include/voltu/types/frame.hpp b/SDK/C++/public/include/voltu/types/frame.hpp index eebc557eae0c2f12c5b8fcaad66e72914c0d2968..4209cc80c2d1af4e46c4c1d7227ad0e3a9918c79 100644 --- a/SDK/C++/public/include/voltu/types/frame.hpp +++ b/SDK/C++/public/include/voltu/types/frame.hpp @@ -1,3 +1,9 @@ +/** + * @file frame.hpp + * @copyright Copyright (c) 2020 Nicolas Pope, MIT License + * @author Nicolas Pope + */ + #pragma once #include "../defines.hpp" diff --git a/SDK/C++/public/include/voltu/types/image.hpp b/SDK/C++/public/include/voltu/types/image.hpp index 406c81df8b2f4ba9e2a396b5df56097c50828e0c..c9c342f27c13cbc595bcd56f89ca18676dba0689 100644 --- a/SDK/C++/public/include/voltu/types/image.hpp +++ b/SDK/C++/public/include/voltu/types/image.hpp @@ -1,3 +1,9 @@ +/** + * @file image.hpp + * @copyright Copyright (c) 2020 Nicolas Pope, MIT License + * @author Nicolas Pope + */ + #pragma once #include "../defines.hpp" diff --git a/SDK/C++/public/include/voltu/types/intrinsics.hpp b/SDK/C++/public/include/voltu/types/intrinsics.hpp index 70d1dfe2c2f3ba6f8138e9c4dbb1ac618ae25187..cc4ee4caa188064a72ae0aad8a631ebfd4227890 100644 --- a/SDK/C++/public/include/voltu/types/intrinsics.hpp +++ b/SDK/C++/public/include/voltu/types/intrinsics.hpp @@ -1,3 +1,9 @@ +/** + * @file intrinsics.hpp + * @copyright Copyright (c) 2020 Nicolas Pope, MIT License + * @author Nicolas Pope + */ + #pragma once namespace voltu diff --git a/SDK/C++/public/include/voltu/types/pointcloud.hpp b/SDK/C++/public/include/voltu/types/pointcloud.hpp index c602a4f6a007b2b2b123bc263f766665e35b8af7..8ea53712af2771ccffcf9d608d74b9e97a25c27e 100644 --- a/SDK/C++/public/include/voltu/types/pointcloud.hpp +++ b/SDK/C++/public/include/voltu/types/pointcloud.hpp @@ -1,3 +1,9 @@ +/** + * @file pointcloud.hpp + * @copyright Copyright (c) 2020 Nicolas Pope, MIT License + * @author Nicolas Pope + */ + #pragma once #include <memory> diff --git a/SDK/C++/public/include/voltu/types/property.hpp b/SDK/C++/public/include/voltu/types/property.hpp index 2a5fbe53c0e53a4fecd40d79d60916c05d0fdf06..f2f781b9486092cf7d602850155bbb1602f022d4 100644 --- a/SDK/C++/public/include/voltu/types/property.hpp +++ b/SDK/C++/public/include/voltu/types/property.hpp @@ -1,3 +1,9 @@ +/** + * @file property.hpp + * @copyright Copyright (c) 2020 Nicolas Pope, MIT License + * @author Nicolas Pope + */ + #pragma once #include "../defines.hpp" diff --git a/SDK/C++/public/include/voltu/voltu.hpp b/SDK/C++/public/include/voltu/voltu.hpp index 17f251ed56989dd2058198297c8ac380b74bc963..a2c4c0a142341a9c145999bc1cadd530271c25b7 100644 --- a/SDK/C++/public/include/voltu/voltu.hpp +++ b/SDK/C++/public/include/voltu/voltu.hpp @@ -1,3 +1,9 @@ +/** + * @file voltu.hpp + * @copyright Copyright (c) 2020 Nicolas Pope, MIT License + * @author Nicolas Pope + */ + #pragma once // Bump these for each release diff --git a/SDK/C++/public/voltu.cpp b/SDK/C++/public/voltu.cpp index 25b0f4019ccd8c5df7c3090b7c7ea3198162baef..4aef0ba97f9828901d0c2d1f980cb7400f51ae97 100644 --- a/SDK/C++/public/voltu.cpp +++ b/SDK/C++/public/voltu.cpp @@ -1,3 +1,9 @@ +/** + * @file voltu.cpp + * @copyright Copyright (c) 2020 Nicolas Pope, MIT License + * @author Nicolas Pope + */ + #include <voltu/initialise.hpp> #include <voltu/types/errors.hpp> #include <voltu/voltu.hpp> diff --git a/SDK/C++/public/voltu_cv.cpp b/SDK/C++/public/voltu_cv.cpp index 0fae307111f1311bb73c675560bea18ecd00f539..31cd29aa6f85a77ee3baf23541d918ea5046b01a 100644 --- a/SDK/C++/public/voltu_cv.cpp +++ b/SDK/C++/public/voltu_cv.cpp @@ -1,3 +1,9 @@ +/** + * @file voltu_cv.cpp + * @copyright Copyright (c) 2020 Nicolas Pope, MIT License + * @author Nicolas Pope + */ + #include <voltu/opencv.hpp> #include <voltu/types/errors.hpp>