1<?php 2namespace Fisharebest\Webtrees; 3 4/** 5 * webtrees: online genealogy 6 * Copyright (C) 2015 webtrees development team 7 * This program is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU 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 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * You should have received a copy of the GNU General Public License 16 * along with this program. If not, see <http://www.gnu.org/licenses/>. 17 */ 18 19/** 20 * Class ReportBaseImage 21 */ 22class ReportBaseImage extends ReportBaseElement { 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 function __construct($file, $x, $y, $w, $h, $align, $ln) { 78 $this->file = $file; 79 $this->width = $w; 80 $this->height = $h; 81 $this->x = $x; 82 $this->y = $y; 83 $this->align = $align; 84 $this->line = $ln; 85 86 return 0; 87 } 88 89 /** 90 * @param $renderer 91 * 92 * @return float 93 */ 94 function getHeight($renderer) { 95 return $this->height; 96 } 97 98 /** 99 * @param $renderer 100 * 101 * @return float 102 */ 103 function getWidth($renderer) { 104 return $this->width; 105 } 106} 107