frame_handler.cpp
Go to the documentation of this file.
1 /*
2  * BSD 3-Clause License
3  *
4  * Copyright (c) 2019, Analog Devices, Inc.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions are met:
9  *
10  * 1. Redistributions of source code must retain the above copyright notice, this
11  * list of conditions and the following disclaimer.
12  *
13  * 2. Redistributions in binary form must reproduce the above copyright notice,
14  * this list of conditions and the following disclaimer in the documentation
15  * and/or other materials provided with the distribution.
16  *
17  * 3. Neither the name of the copyright holder nor the names of its
18  * contributors may be used to endorse or promote products derived from
19  * this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
25  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 
33 #include "frame_handler_impl.h"
34 #include <aditof/frame_handler.h>
35 #include <memory>
36 #ifdef USE_GLOG
37 #include <glog/logging.h>
38 #else
39 #include <aditof/log.h>
40 #endif
41 using namespace aditof;
42 
43 FrameHandler::FrameHandler() : m_impl(std::make_unique<FrameHandlerImpl>()) {}
44 
45 FrameHandler::~FrameHandler() = default;
46 
48 
49 FrameHandler &FrameHandler::operator=(FrameHandler &&) noexcept = default;
50 
51 Status FrameHandler::setOutputFilePath(const std::string &filePath) {
52  return m_impl->setOutputFilePath(filePath);
53 }
54 
56  return m_impl->setInputFileName(fullFileName);
57 }
58 
60  const std::string &fileName) {
61  return m_impl->saveFrameToFile(frame, fileName);
62 }
63 
65  const std::string &fileName) {
66 
67  return m_impl->saveFrameToFileMultithread(frame, fileName);
68 }
69 
71  const std::string &fullFileName) {
72  return m_impl->readNextFrame(frame, fullFileName);
73 }
74 
76  return m_impl->setCustomFormat(format);
77 }
78 
80  return m_impl->storeFramesToSingleFile(enable);
81 }
82 
84  return m_impl->setFrameContent(frameContent);
85 }
aditof::FrameHandler::saveFrameToFile
SDK_API aditof::Status saveFrameToFile(aditof::Frame &frame, const std::string &fileName="")
Store frame to file.
Definition: frame_handler.cpp:59
benchmarks.python.py_benchmark.const
const
Definition: py_benchmark.py:14
frame_handler.h
aditof::FrameHandler::readNextFrame
SDK_API aditof::Status readNextFrame(aditof::Frame &frame, const std::string &fullFileName="")
Reads frame from a file. If same file is provided it will continue to read from the last position.
Definition: frame_handler.cpp:70
log.h
string
GLsizei const GLchar *const * string
Definition: glcorearb.h:3083
aditof::FrameHandler::setFrameContent
SDK_API aditof::Status setFrameContent(const std::string &frameContent)
Set which frame element you want to store/read (depth/ab/conf)
Definition: frame_handler.cpp:83
aditof::FrameHandler::setCustomFormat
SDK_API aditof::Status setCustomFormat(const std::string &format)
A custom format in which the frames will be stored/read.
Definition: frame_handler.cpp:75
benchmarks.python.py_benchmark.default
default
Definition: py_benchmark.py:14
frame_handler_impl.h
aditof::FrameHandler::~FrameHandler
SDK_API ~FrameHandler()
aditof::FrameHandler::FrameHandler
SDK_API FrameHandler()
Definition: frame_handler.cpp:43
aditof
Namespace aditof.
Definition: adsd_errs.h:40
format
GLint GLint GLsizei GLint GLenum format
Definition: glcorearb.h:2773
aditof::FrameHandler::setOutputFilePath
SDK_API aditof::Status setOutputFilePath(const std::string &filePath)
Set the output path/output folder for the frames.
Definition: frame_handler.cpp:51
aditof::FrameHandler
Handles operations on a frame such as saving it to file and creating a new frame with content read fr...
Definition: frame_handler.h:57
aditof::Status
Status
Status of any operation that the TOF sdk performs.
Definition: status_definitions.h:48
std
aditof::FrameHandler::m_impl
std::unique_ptr< FrameHandlerImpl > m_impl
Definition: frame_handler.h:138
FrameHandlerImpl
Definition: frame_handler_impl.h:51
aditof::Frame
Frame of a camera.
Definition: frame.h:50
aditof::FrameHandler::saveFrameToFileMultithread
SDK_API aditof::Status saveFrameToFileMultithread(aditof::Frame &frame, const std::string &fileName="")
Store frame to file using a separate thread.
Definition: frame_handler.cpp:64
aditof::FrameHandler::setInputFileName
SDK_API aditof::Status setInputFileName(const std::string &fullFileName)
Set the input file for the frames.
Definition: frame_handler.cpp:55
aditof::FrameHandler::storeFramesToSingleFile
SDK_API aditof::Status storeFramesToSingleFile(bool enable)
Enable/disable if single file is intended to use for storing data.
Definition: frame_handler.cpp:79


libaditof
Author(s):
autogenerated on Wed May 21 2025 02:06:51