Artec 3D Scanning SDK  2.0
PngIO.h
Go to the documentation of this file.
1 /********************************************************************
2 *
3 * Project Artec 3D Scanning SDK
4 *
5 * Purpose: PNG file format support
6 *
7 * Copyright: Artec Group
8 *
9 ********************************************************************/
10 
11 #ifndef _PNGIO_H_
12 #define _PNGIO_H_
13 
15 #include <artec/sdk/base/IImage.h>
16 
17 namespace artec { namespace sdk { namespace base { namespace io {
18 
19 extern "C" {
20 
21 ///@{
22 /// Save image to PNG file/blob
23 /// @param path - file path where to save image
24 /// @param data - blob pointer where to save image
25 /// @param image - image to save (not empty, 1,3,4 channels)
27  savePngImageToFile(const wchar_t* path, const IImage* image);
29  savePngImageToBlob(IBlob** data, const IImage* image);
30 ///@}
31 
32 ///@{
33 /// Load image from PNG file/blob
34 /// @param image - loaded image
35 /// @param path - file path to load image from
36 /// @param data - blob to load image from
38  loadPngImageFromFile(IImage** image, const wchar_t* path);
40  loadPngImageFromBlob(IImage** image, const IBlob* data);
41 ///@}
42 }
43 /// Class to save/load PNG files
44 class Png
45 {
46 public:
47 
48  ///@{
49  /// Save image to PNG file/blob
50  /// @param path - file path where to save image
51  /// @param data - blob pointer where to save image
52  /// @param image - image to save (not empty, 1,3,4 channels)
53  static ErrorCode save(const wchar_t* path, const IImage* image)
54  {
55  return savePngImageToFile(path, image);
56  }
57 
58  static ErrorCode save(IBlob** data, const IImage* image)
59  {
60  return savePngImageToBlob(data, image);
61  }
62  ///@}
63 
64  ///@{
65  /// Load image from PNG file/blob
66  /// @param image - loaded image
67  /// @param path - file path to load image from
68  /// @param data - blob to load image from
69  static ErrorCode load(IImage** image, const wchar_t* path)
70  {
71  return loadPngImageFromFile(image, path);
72  }
73 
74  static ErrorCode load(IImage** image, const IBlob* data)
75  {
76  return loadPngImageFromBlob(image, data);
77  }
78  ///@}
79 };
80 
81 } } } } // namespace artec::sdk::base::io
82 
83 #endif //_PNGIO_H_
ErrorCode ABASESDK_LINK_SPEC loadPngImageFromBlob(IImage **image, const IBlob *data)
Interface for common raster image objects.
Definition: IImage.h:126
Class to save/load PNG files.
Definition: PngIO.h:44
static ErrorCode load(IImage **image, const wchar_t *path)
Definition: PngIO.h:69
static ErrorCode load(IImage **image, const IBlob *data)
Definition: PngIO.h:74
static ErrorCode save(IBlob **data, const IImage *image)
Definition: PngIO.h:58
Interface for Binary Large Object (memory chunk) with smart reference counting.
Definition: IBlob.h:35
ErrorCode ABASESDK_LINK_SPEC savePngImageToFile(const wchar_t *path, const IImage *image)
ErrorCode ABASESDK_LINK_SPEC savePngImageToBlob(IBlob **data, const IImage *image)
ErrorCode ABASESDK_LINK_SPEC loadPngImageFromFile(IImage **image, const wchar_t *path)
#define ABASESDK_LINK_SPEC
static ErrorCode save(const wchar_t *path, const IImage *image)
Definition: PngIO.h:53