xref: /webtrees/app/Report/ReportBaseImage.php (revision ed53a9c0a479c5871db36fde10b575b33b9a209b)
1<?php
2/**
3 * webtrees: online genealogy
4 * Copyright (C) 2017 webtrees development team
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16namespace Fisharebest\Webtrees\Report;
17
18/**
19 * Class ReportBaseImage
20 */
21class ReportBaseImage extends ReportBaseElement {
22	/**
23	 * Filename of the image
24	 *
25	 * @var string
26	 */
27	public $file;
28	/**
29	 * Height of the image
30	 *
31	 * @var float
32	 */
33	public $height;
34	/**
35	 * Width of the image
36	 *
37	 * @var float
38	 */
39	public $width;
40	/**
41	 * X-position (left) of the image
42	 *
43	 * @var float
44	 */
45	public $x;
46	/**
47	 * Y-position (top) of the image
48	 *
49	 * @var float
50	 */
51	public $y;
52	/**
53	 * Placement fo the image. L: left, C:center, R:right
54	 *
55	 * @var string
56	 */
57	public $align = '';
58	/**
59	 * T:same line, N:next line
60	 *
61	 * @var string
62	 */
63	public $line = '';
64
65	/**
66	 * Image class function - Base
67	 *
68	 * @param string $file  Filename of the image
69	 * @param float  $x     X-position (left) of the image
70	 * @param float  $y     Y-position (top) of the image
71	 * @param float  $w     Width of the image
72	 * @param float  $h     Height of the image
73	 * @param string $align Placement of the image. L: left, C:center, R:right
74	 * @param string $ln    T:same line, N:next line
75	 */
76	public function __construct($file, $x, $y, $w, $h, $align, $ln) {
77		$this->file   = $file;
78		$this->width  = $w;
79		$this->height = $h;
80		$this->x      = $x;
81		$this->y      = $y;
82		$this->align  = $align;
83		$this->line   = $ln;
84
85		return 0;
86	}
87
88	/**
89	 * Get the height.
90	 *
91	 * @param $renderer
92	 *
93	 * @return float
94	 */
95	public function getHeight($renderer) {
96		return $this->height;
97	}
98
99	/**
100	 * Get the width.
101	 *
102	 * @param $renderer
103	 *
104	 * @return float
105	 */
106	public function getWidth($renderer) {
107		return $this->width;
108	}
109}
110