c2822771f1c6484ec96981ca7125febaf2c508f7
[yaffs-website] / vendor / lsolesen / pel / src / PelJpegContent.php
1 <?php
2
3 /**
4  * PEL: PHP Exif Library.
5  * A library with support for reading and
6  * writing all Exif headers in JPEG and TIFF images using PHP.
7  *
8  * Copyright (C) 2004, 2005 Martin Geisler.
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program in the file COPYING; if not, write to the
22  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
23  * Boston, MA 02110-1301 USA
24  */
25 namespace lsolesen\pel;
26
27 use \lsolesen\pel\PelDataWindow;
28
29 /**
30  * Class representing content in a JPEG file.
31  *
32  * @author Martin Geisler <mgeisler@users.sourceforge.net>
33  * @license http://www.gnu.org/licenses/gpl.html GNU General Public
34  *          License (GPL)
35  * @package PEL
36  */
37
38 /**
39  * Class representing content in a JPEG file.
40  *
41  * A JPEG file consists of a sequence of each of which has an
42  * associated {@link PelJpegMarker marker} and some content. This
43  * class represents the content, and this basic type is just a simple
44  * holder of such content, represented by a {@link PelDataWindow}
45  * object. The {@link PelExif} class is an example of more
46  * specialized JPEG content.
47  *
48  * @author Martin Geisler <mgeisler@users.sourceforge.net>
49  * @package PEL
50  */
51 class PelJpegContent
52 {
53
54     private $data = null;
55
56     /**
57      * Make a new piece of JPEG content.
58      *
59      * @param PelDataWindow $data
60      *            the content.
61      */
62     public function __construct(PelDataWindow $data)
63     {
64         $this->data = $data;
65     }
66
67     /**
68      * Return the bytes of the content.
69      *
70      * @return string bytes representing this JPEG content. These bytes
71      *         will match the bytes given to {@link __construct the
72      *         constructor}.
73      */
74     public function getBytes()
75     {
76         return $this->data->getBytes();
77     }
78 }