Rumba C++ SDK
Image.h
Go to the documentation of this file.
1 /*
2 
3  *
4  ***
5  *****
6  ********************* Mercenaries Engineering SARL
7  ***************** Copyright (C) 2018
8  *************
9  ********* http://www.mercenaries-engineering.com
10  ***********
11  **** ****
12  ** **
13 
14 */
15 #pragma once
16 
17 #include "Value.h"
18 
19  namespace maquina
20  {
22  class MAQUINA_EXPORT Image : public Value
23  {
24  public:
25  Image();
26 
28 
29  Image(const Value &v);
30  Image(int width, int height, int channels, bool clear=true);
31 
32 
34  int width() const;
36  int height() const;
38  int channels() const;
39 
41  void* pixels() const;
43  void pixel(int x, int y, float* pixel, int channels) const;
45  void set_pixel(int x, int y, const Imath::Color4f &color);
46 
48  void to_UINT8();
50  void to_RGBA();
51 
52  bool read(const std::wstring& path);
53  bool write(const char* path) const;
54 
56  void flip();
57 
59  void rotate(int rotation);
60 
62  void resize(int width, int height);
63 
65  static const Image default_value;
66 
68  Image(std::shared_ptr<Impl> impl) { _impl=impl; }
69  };
70  }
Definition: ImathColor.h:120
An Image.
Definition: Image.h:22
This version of the SDK is unstable, i-e, it may change with no warning.
Definition: AddCurveAction.h:20
#define MAQUINA_EXPORT
Definition: Export.h:31
static const Image default_value
The default value.
Definition: Image.h:65
Base class of all Rumba values.
Definition: Value.h:34