xref: /webtrees/app/Report/ReportBaseImage.php (revision c1010eda29c0909ed4d5d463f32d32bfefdd4dfe)
1<?php
2/**
3 * webtrees: online genealogy
4 * Copyright (C) 2018 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    /**
24     * Filename of the image
25     *
26     * @var string
27     */
28    public $file;
29    /**
30     * Height of the image
31     *
32     * @var float
33     */
34    public $height;
35    /**
36     * Width of the image
37     *
38     * @var float
39     */
40    public $width;
41    /**
42     * X-position (left) of the image
43     *
44     * @var float
45     */
46    public $x;
47    /**
48     * Y-position (top) of the image
49     *
50     * @var float
51     */
52    public $y;
53    /**
54     * Placement fo the image. L: left, C:center, R:right
55     *
56     * @var string
57     */
58    public $align = '';
59    /**
60     * T:same line, N:next line
61     *
62     * @var string
63     */
64    public $line = '';
65
66    /**
67     * Image class function - Base
68     *
69     * @param string $file  Filename of the image
70     * @param float  $x     X-position (left) of the image
71     * @param float  $y     Y-position (top) of the image
72     * @param float  $w     Width of the image
73     * @param float  $h     Height of the image
74     * @param string $align Placement of the image. L: left, C:center, R:right
75     * @param string $ln    T:same line, N:next line
76     */
77    public function __construct($file, $x, $y, $w, $h, $align, $ln)
78    {
79        $this->file   = $file;
80        $this->width  = $w;
81        $this->height = $h;
82        $this->x      = $x;
83        $this->y      = $y;
84        $this->align  = $align;
85        $this->line   = $ln;
86
87        return 0;
88    }
89
90    /**
91     * Get the height.
92     *
93     * @param $renderer
94     *
95     * @return float
96     */
97    public function getHeight($renderer)
98    {
99        return $this->height;
100    }
101
102    /**
103     * Get the width.
104     *
105     * @param $renderer
106     *
107     * @return float
108     */
109    public function getWidth($renderer)
110    {
111        return $this->width;
112    }
113}
114