BmpIO.h
Go to the documentation of this file.
1 /********************************************************************
2 *
3 * Project Artec 3D Scanning SDK
4 *
5 * Purpose: BMP file format support
6 *
7 * Copyright: Artec Group
8 *
9 ********************************************************************/
10 
11 #ifndef _BMPIO_H_
12 #define _BMPIO_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 BMP file/blob
23 /// @param path - file path to save image to
24 /// @param data - blob pointer to save image to
25 /// @param image - image to be saved (not empty, 1 or 3 channels)
27  saveBmpImageToFile(const wchar_t* path, const IImage* image);
29  saveBmpImageToBlob(IBlob** data, const IImage* image);
30 ///@}
31 
32 ///@{
33 /// Load image from BMP 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  loadBmpImageFromFile(IImage** image, const wchar_t* path);
40  loadBmpImageFromBlob(IImage** image, const IBlob* data);
41 ///@}
42 }
43 
44 class Bmp
45 {
46 public:
47 
48  ///@{
49  /// Save image to BMP file/blob
50  /// @param path - file path to save image to
51  /// @param data - blob pointer to save image to
52  /// @param image - image to be saved (not empty, 1 or 3 channels)
53  static ErrorCode save(const wchar_t* path, const IImage* image)
54  {
55  return saveBmpImageToFile(path, image);
56  }
57  static ErrorCode save(IBlob** data, const IImage* image)
58  {
59  return saveBmpImageToBlob(data, image);
60  }
61  ///@}
62 
63  ///@{
64  /// Load image from BMP file/blob
65  /// @param image - loaded image
66  /// @param path - file path to load image from
67  /// @param data - blob to load image from
68  static ErrorCode load(IImage** image, const wchar_t* path)
69  {
70  return loadBmpImageFromFile(image, path);
71  }
72  static ErrorCode load(IImage** image, const IBlob* data)
73  {
74  return loadBmpImageFromBlob(image, data);
75  }
76  ///@}
77 };
78 
79 } } } } // namespace artec::sdk::base::io
80 
81 #endif //_BMPIO_H_
ErrorCode ABASESDK_LINK_SPEC saveBmpImageToBlob(IBlob **data, const IImage *image)
static ErrorCode load(IImage **image, const wchar_t *path)
Definition: BmpIO.h:68
static ErrorCode save(const wchar_t *path, const IImage *image)
Definition: BmpIO.h:53
ErrorCode ABASESDK_LINK_SPEC loadBmpImageFromBlob(IImage **image, const IBlob *data)
static ErrorCode save(IBlob **data, const IImage *image)
Definition: BmpIO.h:57
ErrorCode ABASESDK_LINK_SPEC loadBmpImageFromFile(IImage **image, const wchar_t *path)
static ErrorCode load(IImage **image, const IBlob *data)
Definition: BmpIO.h:72
#define ABASESDK_LINK_SPEC
Definition: BaseSdkDefines.h:7
ErrorCode ABASESDK_LINK_SPEC saveBmpImageToFile(const wchar_t *path, const IImage *image)