TBTK
Need a break? Support the development by playing Polarity Puzzles
PNGCanvas2D.h
1 /* Copyright 2019 Kristofer Björnson
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
17 
24 #ifndef COM_DAFER45_TBTK_PNG_CANVAS_2D
25 #define COM_DAFER45_TBTK_PNG_CANVAS_2D
26 
27 #include "TBTK/Canvas2D.h"
28 #include "TBTK/TBTKMacros.h"
29 
30 #include <string>
31 #include <tuple>
32 
33 namespace TBTK{
34 
35 class PNGCanvas2D : public Canvas2D{
36 public:
38  PNGCanvas2D(const Canvas2D &canvas);
39 
41  virtual ~PNGCanvas2D();
42 
46  void flush(const std::string &filename);
47 private:
49  static std::string convertColorToHex(
50  const std::vector<unsigned char> &color
51  );
52 };
53 
54 }; //End namespace TBTK
55 
56 #endif
57 
Precompiler macros.
Definition: Boolean.h:32