AliceVision
Photogrammetric Computer Vision Framework
Rgb.hpp
1 // This file is part of the AliceVision project.
2 // Copyright (c) 2017 AliceVision contributors.
3 // This Source Code Form is subject to the terms of the Mozilla Public License,
4 // v. 2.0. If a copy of the MPL was not distributed with this file,
5 // You can obtain one at https://mozilla.org/MPL/2.0/.
6 
7 #pragma once
8 
9 namespace aliceVision {
10 
11 struct rgb
12 {
13  unsigned char r = 0;
14  unsigned char g = 0;
15  unsigned char b = 0;
16 
17  rgb() {}
18  rgb(unsigned char _r, unsigned char _g, unsigned char _b)
19  {
20  r = _r;
21  g = _g;
22  b = _b;
23  }
24 
25  inline rgb operator-(const rgb& _p) const { return rgb(r - _p.r, g - _p.g, b - _p.b); }
26 
27  inline rgb operator+(const rgb& _p) const { return rgb(r + _p.r, g + _p.g, b + _p.b); }
28 };
29 
30 } // namespace aliceVision
aliceVision
Definition: checkerDetector.cpp:32
aliceVision::rgb
Definition: Rgb.hpp:11