glbarcode++
 
Loading...
Searching...
No Matches
RendererDebug.hpp
Go to the documentation of this file.
1// RendererDebug.hpp
2//
3// Copyright (C) 2013-2026 Jaye Evins <evins@snaught.com>
4//
5// This file is part of glbarcode++.
6//
7// glbarcode++ is free software: you can redistribute it and/or modify
8// it under the terms of the GNU Lesser General Public License as published by
9// the Free Software Foundation, either version 3 of the License, or
10// (at your option) any later version.
11//
12// glbarcode++ is distributed in the hope that it will be useful,
13// but WITHOUT ANY WARRANTY; without even the implied warranty of
14// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15// GNU Lesser General Public License for more details.
16//
17// You should have received a copy of the GNU Lesser General Public License
18// along with glbarcode++. If not, see <http://www.gnu.org/licenses/>.
19//
20
21#ifndef glbarcode_RendererDebug_hpp
22#define glbarcode_RendererDebug_hpp
23
24
25#include "Renderer.hpp"
26
27#include <cstdio>
28
29
30namespace glbarcode
31{
32
38 class RendererDebug : public Renderer
39 {
40
41 private:
42
43 void drawBegin( double w, double h ) override
44 {
45 printf( "DRAW_BEGIN( w = %f, h = %f )\n", w, h );
46 }
47
48
49 void drawEnd( void ) override
50 {
51 printf( "DRAW_END()\n\n" );
52 }
53
54
55 void drawLine( double x, double y, double w, double h ) override
56 {
57 printf( "\tDRAW_LINE( x = %f, y = %f, w = %f, h = %f )\n", x, y, w, h );
58 }
59
60
61 void drawBox( double x, double y, double w, double h ) override
62 {
63 printf( "\tDRAW_BOX( x = %f, y = %f, w = %f, h = %f )\n", x, y, w, h );
64 }
65
66
67 void drawText( double x, double y, double size, const std::string& text, HAlign halign = H_ALIGN_CENTER ) override
68 {
69 printf( "\tDRAW_TEXT( x = %f, y = %f, size = %f, text = \"%s\" )\n", x, y, size, text.c_str() );
70 }
71
72
73 void drawRing( double x, double y, double r, double w ) override
74 {
75 printf( "\tDRAW_RING( x = %f, y = %f, r = %f, w = %f )\n", x, y, r, w );
76 }
77
78
79 void drawHexagon( double x, double y, double h ) override
80 {
81 printf( "\tDRAW_HEXAGON( x = %f, y = %f, h = %f )\n", x, y, h );
82 }
83
84 };
85
86}
87
88#endif // glbarcode_RendererDebug_hpp
Definition RendererDebug.hpp:39
Definition Renderer.hpp:48
Definition Barcode.hpp:38
HAlign
Definition Enums.hpp:29
@ H_ALIGN_CENTER
Definition Enums.hpp:30