libkipr  1.0.0
image.hpp
Go to the documentation of this file.
1 #ifndef _KIPR_CAMERA_IMAGE_HPP_
2 #define _KIPR_CAMERA_IMAGE_HPP_
3 
4 #include <algorithm>
5 
6 namespace kipr
7 {
8  namespace camera
9  {
10  class Image
11  {
12  public:
13  enum class Type
14  {
15  Grey8,
16  Rgb888,
17  Bgr888,
18  };
19 
20  Image();
21 
23  const Type type,
24  const unsigned width,
25  const unsigned height,
26  const unsigned stride,
27  unsigned char *const data,
28  const bool owned = true
29  );
30 
31  Image(const Image &);
32  Image(Image &&);
33 
35 
36  ~Image();
37 
38  bool isEmpty() const;
39 
40  Type getType() const;
41  const unsigned char *const getData() const;
42 
43  unsigned getWidth() const;
44  unsigned getHeight() const;
45  unsigned getStride() const;
46  bool isOwned() const;
47 
48  friend void swap(Image &first, Image &second)
49  {
50  using std::swap;
51  swap(first.type_, second.type_);
52  swap(first.data_, second.data_);
53  swap(first.owned_, second.owned_);
54  swap(first.width_, second.width_);
55  swap(first.height_, second.height_);
56  swap(first.stride_, second.stride_);
57  }
58 
59  private:
60  Type type_;
61  unsigned char *data_;
62  bool owned_;
63 
64  unsigned width_;
65  unsigned height_;
66  unsigned stride_;
67  };
68  }
69 }
70 
71 #endif
Definition: image.hpp:11
bool isEmpty() const
unsigned getHeight() const
friend void swap(Image &first, Image &second)
Definition: image.hpp:48
const unsigned char *const getData() const
Image & operator=(Image)
bool isOwned() const
unsigned getWidth() const
Image(const Image &)
unsigned getStride() const
Type getType() const
Image(const Type type, const unsigned width, const unsigned height, const unsigned stride, unsigned char *const data, const bool owned=true)
Type
Definition: image.hpp:14
Definition: accel.hpp:7