IOFormat 1.12.0
Loading...
Searching...
No Matches
IOFormat.h
Go to the documentation of this file.
1// Add following header comment to force Doxygen to generate documentation
2// for methods which are directly in ioformat namespace without belonging to a
3// class. Doxygen limitation.
6#pragma once
7
8#include <memory>
9#include <string>
10
11#include <iolink/Uri.h>
12#include <iolink/storage/RandomAccess.h>
13#include <iolink/storage/StreamAccess.h>
14#include <iolink/view/ImageView.h>
15#include <iolink/view/View.h>
16#include <iolink/writer/Writer.h>
17
18#include <ioformat/GeneralOptions.h>
19#include <ioformat/IOFormatAPI.h>
20
26namespace ioformat
27{
28
36IOFORMAT_API bool init();
37
44IOFORMAT_API std::shared_ptr<iolink::View> openView(const std::string& pathFile);
45
54IOFORMAT_API std::shared_ptr<iolink::View> openView(const std::string& path, const std::string& format);
55
64[[deprecated(
65 "Deprecated. Use openViewFromUri(const std::string & uri) instead.")]] IOFORMAT_API std::shared_ptr<iolink::View>
66openView(const iolink::Uri& uri);
67
83IOFORMAT_API std::shared_ptr<iolink::View> openViewFromUri(const std::string& uri, const GeneralOptions& options = {});
84
93[[deprecated(
94 "Deprecated. Use openViewFromUri(const std::string & uri, const std::string& format) instead.")]] IOFORMAT_API
95 std::shared_ptr<iolink::View>
96 openView(const iolink::Uri& uri, const std::string& format);
97
113IOFORMAT_API std::shared_ptr<iolink::View> openViewFromUri(const std::string& uri,
114 const std::string& format,
115 const GeneralOptions& options = {});
116
131IOFORMAT_API std::shared_ptr<iolink::ImageView> readImageFromUri(const std::string& uri,
132 const GeneralOptions& options = {});
133
142IOFORMAT_API std::shared_ptr<iolink::View> openView(std::shared_ptr<iolink::DataAccess> storage,
143 const std::string& format);
144
153IOFORMAT_API std::shared_ptr<iolink::Writer> openWriter(std::shared_ptr<iolink::View> view,
154 const std::string& pathFile);
155
165IOFORMAT_API std::shared_ptr<iolink::Writer> openWriter(std::shared_ptr<iolink::View> view,
166 std::shared_ptr<iolink::DataAccess> dst,
167 const std::string& format);
168
179IOFORMAT_API std::shared_ptr<iolink::Writer> openWriter(std::shared_ptr<iolink::View> view,
180 std::shared_ptr<iolink::DataAccess> dst,
181 const std::string& format,
182 const std::string& plugin);
183
192IOFORMAT_API void writeView(std::shared_ptr<iolink::View> view, const std::string& pathFile);
193
203IOFORMAT_API void writeView(std::shared_ptr<iolink::View> view,
204 std::shared_ptr<iolink::DataAccess> dst,
205 const std::string& format);
206
216IOFORMAT_API std::string formatFromExtension(const std::string& extension);
217
218// ======== //
219// openView //
220// ======== //
221
232IOFORMAT_API std::shared_ptr<iolink::View> openView(const std::string& src,
233 const std::string& format,
234 const GeneralOptions& options);
235
247IOFORMAT_API std::shared_ptr<iolink::View> openView(const std::string& src, const GeneralOptions& options);
248
259IOFORMAT_API std::shared_ptr<iolink::View> openView(std::shared_ptr<iolink::StreamAccess> src,
260 const std::string& format,
261 const GeneralOptions& options);
262
273IOFORMAT_API std::shared_ptr<iolink::View> openView(std::shared_ptr<iolink::RandomAccess> src,
274 const std::string& format,
275 const GeneralOptions& options);
276
277// ========== //
278// readImage //
279// ========== //
280
291IOFORMAT_API std::shared_ptr<iolink::ImageView> readImage(const std::string& src, const GeneralOptions& options);
292
304IOFORMAT_API std::shared_ptr<iolink::ImageView> readImage(const std::string& pathFile);
305
306// ========== //
307// openWriter //
308// ========== //
309
321IOFORMAT_API std::shared_ptr<iolink::Writer> openWriter(std::shared_ptr<iolink::View> src,
322 const std::string& dst,
323 const std::string& format,
324 const GeneralOptions& options);
325
338IOFORMAT_API std::shared_ptr<iolink::Writer> openWriter(std::shared_ptr<iolink::View> src,
339 const std::string& dst,
340 const GeneralOptions& options);
341
353IOFORMAT_API std::shared_ptr<iolink::Writer> openWriter(std::shared_ptr<iolink::View> src,
354 std::shared_ptr<iolink::StreamAccess> dst,
355 const std::string& format,
356 const GeneralOptions& options);
357
358// ========= //
359// writeView //
360// ========= //
361
372IOFORMAT_API void writeView(std::shared_ptr<iolink::View> src,
373 const std::string& dst,
374 const std::string& format,
375 const GeneralOptions& options);
376
388IOFORMAT_API void writeView(std::shared_ptr<iolink::View> src, const std::string& dst, const GeneralOptions& options);
389
399IOFORMAT_API void writeView(std::shared_ptr<iolink::View> src, const std::string& dst, const std::string& format);
400
415IOFORMAT_API void writeViewToUri(std::shared_ptr<iolink::View> src,
416 const std::string& dst,
417 const GeneralOptions& options = {});
418
433IOFORMAT_API void writeViewToUri(std::shared_ptr<iolink::View> src,
434 const std::string& dst,
435 const std::string& format,
436 const GeneralOptions& options = {});
437
448IOFORMAT_API void writeView(std::shared_ptr<iolink::View> src,
449 std::shared_ptr<iolink::StreamAccess> dst,
450 const std::string& format,
451 const GeneralOptions& options);
452
462IOFORMAT_API void writeView(std::shared_ptr<iolink::View> src,
463 std::shared_ptr<iolink::StreamAccess> dst,
464 const std::string& format);
465
478IOFORMAT_API void addCredentials(const std::string& host, const std::string& user, const std::string& password);
479
480} // namespace ioformat
A collection of general options.
Definition GeneralOptions.h:32
Global namespace which contains all methods to encode/decode data from/into different resources (file...
Definition Error.h:6
IOFORMAT_API std::shared_ptr< iolink::View > openViewFromUri(const std::string &uri, const GeneralOptions &options={})
IOFORMAT_API std::string formatFromExtension(const std::string &extension)
IOFORMAT_API void writeViewToUri(std::shared_ptr< iolink::View > src, const std::string &dst, const GeneralOptions &options={})
Write a view into a destination URI. Scheme is used to determine the protocol to use.
IOFORMAT_API std::shared_ptr< iolink::Writer > openWriter(std::shared_ptr< iolink::View > view, const std::string &pathFile)
IOFORMAT_API std::shared_ptr< iolink::ImageView > readImage(const std::string &src, const GeneralOptions &options)
Read an image from a source path and store it in CPU memory.
IOFORMAT_API bool init()
IOFORMAT_API void writeView(std::shared_ptr< iolink::View > view, const std::string &pathFile)
IOFORMAT_API std::shared_ptr< iolink::View > openView(const std::string &pathFile)
IOFORMAT_API void addCredentials(const std::string &host, const std::string &user, const std::string &password)
Add credentials for a given host.
IOFORMAT_API std::shared_ptr< iolink::ImageView > readImageFromUri(const std::string &uri, const GeneralOptions &options={})