1 // Copyright (C) 2018-2019 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
6 * \brief Format reader abstract class implementation
7 * \file format_reader.h
17 # ifdef IMPLEMENT_FORMAT_READER
18 # define FORMAT_READER_API(type) extern "C" __declspec(dllexport) type
20 # define FORMAT_READER_API(type) extern "C" type
23 # ifdef IMPLEMENT_FORMAT_READER
24 # define FORMAT_READER_API(type) extern "C" __attribute__((visibility("default"))) type
26 # define FORMAT_READER_API(type) extern "C" type
29 # define FORMAT_READER_API(TYPE) extern "C" TYPE
33 namespace FormatReader {
36 * \brief This is an abstract class for reading input data
45 std::shared_ptr<unsigned char> _data;
52 size_t width() const { return _width; }
58 size_t height() const { return _height; }
61 * \brief Get input data ptr
62 * @return shared pointer with input data
63 * @In case of using OpenCV, parameters width and height will be used for image resizing
65 virtual std::shared_ptr<unsigned char> getData(size_t width = 0, size_t height = 0) = 0;
71 virtual size_t size() const = 0;
73 virtual void Release() noexcept = 0;
75 } // namespace FormatReader
78 * \brief Function for create reader
79 * @return FormatReader pointer
81 FORMAT_READER_API(FormatReader::Reader*) CreateFormatReader(const char *filename);