--- /srv/reproducible-results/rbuild-debian/r-b-build.7IYeSCWe/b1/silly_0.1.0-8.1_armhf.changes +++ /srv/reproducible-results/rbuild-debian/r-b-build.7IYeSCWe/b2/silly_0.1.0-8.1_armhf.changes ├── Files │ @@ -1,5 +1,5 @@ │ │ 7a39c1cc33ed0ad76b1a1d93dd399df0 62900 debug optional libsilly-dbgsym_0.1.0-8.1_armhf.deb │ 393aec52cfb14949135f84a6e0df95c2 21144 libdevel extra libsilly-dev_0.1.0-8.1_armhf.deb │ - 09353fb9bf220c22fff2b909274b724e 181436 doc extra libsilly-doc_0.1.0-8.1_all.deb │ + 5b1d20bde0a50994dbb0b0f9cbba927f 181288 doc extra libsilly-doc_0.1.0-8.1_all.deb │ ee84754f857986962a622d031f16a4ab 13528 libs extra libsilly_0.1.0-8.1_armhf.deb ├── libsilly-doc_0.1.0-8.1_all.deb │ ├── file list │ │ @@ -1,3 +1,3 @@ │ │ -rw-r--r-- 0 0 0 4 2021-01-03 15:26:07.000000 debian-binary │ │ -rw-r--r-- 0 0 0 3784 2021-01-03 15:26:07.000000 control.tar.xz │ │ --rw-r--r-- 0 0 0 177460 2021-01-03 15:26:07.000000 data.tar.xz │ │ +-rw-r--r-- 0 0 0 177312 2021-01-03 15:26:07.000000 data.tar.xz │ ├── control.tar.xz │ │ ├── control.tar │ │ │ ├── ./md5sums │ │ │ │ ├── ./md5sums │ │ │ │ │┄ Files differ │ ├── data.tar.xz │ │ ├── data.tar │ │ │ ├── file list │ │ │ │ @@ -3,56 +3,56 @@ │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2021-01-03 15:26:07.000000 ./usr/share/ │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2021-01-03 15:26:07.000000 ./usr/share/doc/ │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/ │ │ │ │ -rw-r--r-- 0 root (0) root (0) 643 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/changelog.Debian.gz │ │ │ │ -rw-r--r-- 0 root (0) root (0) 387 2006-08-11 08:21:50.000000 ./usr/share/doc/libsilly-doc/changelog.gz │ │ │ │ -rw-r--r-- 0 root (0) root (0) 3404 2012-04-10 11:20:35.000000 ./usr/share/doc/libsilly-doc/copyright │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 12316 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00002_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 12053 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00005_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 15811 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00008_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 53959 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00011_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 28390 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00014_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 10691 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00017_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 21186 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00020_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 35541 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00023_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 15570 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00026_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 23008 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00029_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 17157 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00032_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 10528 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00035_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 22457 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00038_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 12721 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00041_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 18660 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00044_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 18236 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00047_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8701 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00050_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 17143 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00053_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 14015 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00056_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 10525 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00059_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 15219 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00062_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8592 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00065_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8597 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00068_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 23209 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00071_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8998 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00074_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8505 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00077_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 14670 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00080_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 17157 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00002_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 21186 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00005_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 28390 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00008_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 15570 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00011_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 10691 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00014_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 35541 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00017_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 53959 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00020_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 23008 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00023_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 15811 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00026_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 22457 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00029_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 12053 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00032_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 12316 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00035_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 10528 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00038_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 18660 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00041_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8998 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00044_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8701 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00047_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 12721 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00050_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 9011 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00053_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 15428 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00056_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8505 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00059_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 13542 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00062_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 14670 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00065_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 16111 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00068_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7626 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00071_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7621 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00074_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7626 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00077_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7622 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00080_source.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 7631 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00083_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 15428 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00086_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7626 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00089_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 13542 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00092_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 15585 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00095_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 16111 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00098_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 15713 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00101_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7621 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00104_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7626 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00107_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7622 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00110_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 10562 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00113_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 17896 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00116_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 9011 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00119_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 13435 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00122_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 14655 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00125_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 15713 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00086_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 15585 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00089_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 17896 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00092_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 10562 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00095_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 14015 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00098_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 15219 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00101_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 14655 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00104_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 23209 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00107_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 18236 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00110_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 17143 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00113_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 10525 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00116_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 13435 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00119_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8592 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00122_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8597 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00125_source.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 32596 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00129.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 6963 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00942.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 17147 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00943.png │ │ │ │ -rw-r--r-- 0 root (0) root (0) 4253 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00944.png │ │ │ │ -rw-r--r-- 0 root (0) root (0) 18861 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00945.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 4475 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00946.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 3277 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00947.png │ │ │ ├── ./usr/share/doc/libsilly-doc/html/a00002_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/src/SILLYImageLoader.cpp Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/src/SILLYFileDataSource.cpp Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -39,23 +39,23 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYImageLoader.cpp
│ │ │ │ +
SILLYFileDataSource.cpp
│ │ │ │
│ │ │ │
│ │ │ │
1/***********************************************************************
│ │ │ │ -
2 filename: ImageLoader.cpp
│ │ │ │ -
3 created: 10 Jun 2006
│ │ │ │ +
2 filename: SILLYFileDataSource.cpp
│ │ │ │ +
3 created: 20 Jul 2006
│ │ │ │
4 author: Olivier Delannoy
│ │ │ │
5
│ │ │ │ -
6 purpose: Implementation of the ImageLoader
│ │ │ │ +
6 purpose: Implementation of the FileDataSource methods
│ │ │ │
7*************************************************************************/
│ │ │ │
8/***************************************************************************
│ │ │ │
9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
│ │ │ │
10 *
│ │ │ │
11 * Permission is hereby granted, free of charge, to any person obtaining
│ │ │ │
12 * a copy of this software and associated documentation files (the
│ │ │ │
13 * "Software"), to deal in the Software without restriction, including
│ │ │ │ @@ -75,41 +75,76 @@ │ │ │ │
27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
│ │ │ │
28 * OTHER DEALINGS IN THE SOFTWARE.
│ │ │ │
29 ***************************************************************************/
│ │ │ │
30#ifdef HAVE_CONFIG_H
│ │ │ │
31#include <config.h>
│ │ │ │
32#endif
│ │ │ │
33
│ │ │ │ -
34#include "SILLYImageLoader.h"
│ │ │ │ -
35#ifndef SILLY_OPT_INLINE
│ │ │ │ -
36#define inline
│ │ │ │ -
37#include "SILLYImageLoader.icpp"
│ │ │ │ -
38#undef inline
│ │ │ │ -
39#endif
│ │ │ │ -
40#include "SILLYImageContext.h"
│ │ │ │ -
41
│ │ │ │ -
42// Start of SILLY namespace section
│ │ │ │ +
34#include "SILLYFileDataSource.h"
│ │ │ │ +
35
│ │ │ │ +
36#ifndef SILLY_OPT_INLINE
│ │ │ │ +
37#define inline
│ │ │ │ +
38#include "SILLYFileDataSource.icpp"
│ │ │ │ +
39#undef inline
│ │ │ │ +
40#endif
│ │ │ │ +
41#include <stdio.h>
│ │ │ │ +
42// Start section of namespace SILLY
│ │ │ │
43namespace SILLY
│ │ │ │
44{
│ │ │ │
45
│ │ │ │ -
46
│ │ │ │ - │ │ │ │ +
46FileDataSource::FileDataSource(const char* filename)
│ │ │ │ +
47 : d_error(true), d_bytes(0), d_size(0)
│ │ │ │
48{
│ │ │ │ -
49 delete context;
│ │ │ │ -
50}
│ │ │ │ -
51
│ │ │ │ -
52
│ │ │ │ -
53} // end of SILLY namespace section
│ │ │ │ -
54
│ │ │ │ -
55
│ │ │ │ -
56
│ │ │ │ -
57
│ │ │ │ -
Simple Image Loading LibrarY namespace.
│ │ │ │ -
Store the data needed by an ImageLoader object during the parsing of an image.
│ │ │ │ -
void destroyContext(ImageContext *context)
Destroy the image context.
│ │ │ │ +
49 FILE* data = fopen(filename, "rb");
│ │ │ │ +
50 if (data)
│ │ │ │ +
51 {
│ │ │ │ +
52 long status = fseek(data, 0, SEEK_END);
│ │ │ │ +
53 if (status == -1)
│ │ │ │ +
54 {
│ │ │ │ +
55 fclose(data);
│ │ │ │ +
56 return;
│ │ │ │ +
57 }
│ │ │ │ +
58 status = ftell(data);
│ │ │ │ +
59 if (status == -1)
│ │ │ │ +
60 {
│ │ │ │ +
61 fclose(data);
│ │ │ │ +
62 return;
│ │ │ │ +
63 }
│ │ │ │ +
64 d_size = status;
│ │ │ │ +
65 if (d_size)
│ │ │ │ +
66 d_bytes = new byte[d_size];
│ │ │ │ +
67 if (! d_bytes)
│ │ │ │ +
68 {
│ │ │ │ +
69 fclose(data);
│ │ │ │ +
70 return;
│ │ │ │ +
71 }
│ │ │ │ +
72 rewind(data);
│ │ │ │ +
73 status = fread(reinterpret_cast<void*>(d_bytes), 1, d_size, data);
│ │ │ │ +
74 if (status != d_size)
│ │ │ │ +
75 {
│ │ │ │ +
76 delete [] d_bytes;
│ │ │ │ +
77 d_bytes = 0;
│ │ │ │ +
78 fclose(data);
│ │ │ │ +
79 }
│ │ │ │ +
80 fclose(data);
│ │ │ │ +
81 d_error = false;
│ │ │ │ +
82 }
│ │ │ │ +
83}
│ │ │ │ +
84
│ │ │ │ +
85
│ │ │ │ + │ │ │ │ +
87{
│ │ │ │ +
88 delete [] d_bytes;
│ │ │ │ +
89}
│ │ │ │ +
90
│ │ │ │ +
91
│ │ │ │ +
92} // End section of namespace SILLY
│ │ │ │ +
Simple Image Loading LibrarY namespace.
│ │ │ │ +
FileDataSource(const char *filename)
Create a data source from an existing file.
│ │ │ │ + │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,21 +4,21 @@ │ │ │ │ │ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ │ │ │ │ │ * build │ │ │ │ │ * reproducible-path │ │ │ │ │ * silly-0.1.0 │ │ │ │ │ * src │ │ │ │ │ -SILLYImageLoader.cpp │ │ │ │ │ +SILLYFileDataSource.cpp │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ - 2 filename: ImageLoader.cpp │ │ │ │ │ - 3 created: 10 Jun 2006 │ │ │ │ │ + 2 filename: SILLYFileDataSource.cpp │ │ │ │ │ + 3 created: 20 Jul 2006 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ - 6 purpose: Implementation of the ImageLoader │ │ │ │ │ + 6 purpose: Implementation of the FileDataSource methods │ │ │ │ │ 7*************************************************************************/ │ │ │ │ │ 8/*************************************************************************** │ │ │ │ │ 9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team │ │ │ │ │ 10 * │ │ │ │ │ 11 * Permission is hereby granted, free of charge, to any person obtaining │ │ │ │ │ 12 * a copy of this software and associated documentation files (the │ │ │ │ │ 13 * "Software"), to deal in the Software without restriction, including │ │ │ │ │ @@ -39,44 +39,80 @@ │ │ │ │ │ 28 * OTHER DEALINGS IN THE SOFTWARE. │ │ │ │ │ 29 │ │ │ │ │ ***************************************************************************/ │ │ │ │ │ 30#ifdef HAVE_CONFIG_H │ │ │ │ │ 31#include │ │ │ │ │ 32#endif │ │ │ │ │ 33 │ │ │ │ │ - 34#include "SILLYImageLoader.h" │ │ │ │ │ - 35#ifndef SILLY_OPT_INLINE │ │ │ │ │ - 36#define inline │ │ │ │ │ - 37#include "SILLYImageLoader.icpp" │ │ │ │ │ - 38#undef inline │ │ │ │ │ - 39#endif │ │ │ │ │ - 40#include "SILLYImageContext.h" │ │ │ │ │ - 41 │ │ │ │ │ - 42// Start of SILLY namespace section │ │ │ │ │ + 34#include "SILLYFileDataSource.h" │ │ │ │ │ + 35 │ │ │ │ │ + 36#ifndef SILLY_OPT_INLINE │ │ │ │ │ + 37#define inline │ │ │ │ │ + 38#include "SILLYFileDataSource.icpp" │ │ │ │ │ + 39#undef inline │ │ │ │ │ + 40#endif │ │ │ │ │ + 41#include │ │ │ │ │ + 42// Start section of namespace SILLY │ │ │ │ │ 43namespace SILLY │ │ │ │ │ 44{ │ │ │ │ │ 45 │ │ │ │ │ - 46 │ │ │ │ │ -47void ImageLoader::destroyContext(ImageContext* context) │ │ │ │ │ +46FileDataSource::FileDataSource(const char* filename) │ │ │ │ │ + 47 : d_error(true), d_bytes(0), d_size(0) │ │ │ │ │ 48{ │ │ │ │ │ - 49 delete context; │ │ │ │ │ - 50} │ │ │ │ │ - 51 │ │ │ │ │ - 52 │ │ │ │ │ - 53} // end of SILLY namespace section │ │ │ │ │ - 54 │ │ │ │ │ - 55 │ │ │ │ │ - 56 │ │ │ │ │ - 57 │ │ │ │ │ + 49 FILE* data = fopen(filename, "rb"); │ │ │ │ │ + 50 if (data) │ │ │ │ │ + 51 { │ │ │ │ │ + 52 long status = fseek(data, 0, SEEK_END); │ │ │ │ │ + 53 if (status == -1) │ │ │ │ │ + 54 { │ │ │ │ │ + 55 fclose(data); │ │ │ │ │ + 56 return; │ │ │ │ │ + 57 } │ │ │ │ │ + 58 status = ftell(data); │ │ │ │ │ + 59 if (status == -1) │ │ │ │ │ + 60 { │ │ │ │ │ + 61 fclose(data); │ │ │ │ │ + 62 return; │ │ │ │ │ + 63 } │ │ │ │ │ + 64 d_size = status; │ │ │ │ │ + 65 if (d_size) │ │ │ │ │ + 66 d_bytes = new byte[d_size]; │ │ │ │ │ + 67 if (! d_bytes) │ │ │ │ │ + 68 { │ │ │ │ │ + 69 fclose(data); │ │ │ │ │ + 70 return; │ │ │ │ │ + 71 } │ │ │ │ │ + 72 rewind(data); │ │ │ │ │ + 73 status = fread(reinterpret_cast(d_bytes), 1, d_size, data); │ │ │ │ │ + 74 if (status != d_size) │ │ │ │ │ + 75 { │ │ │ │ │ + 76 delete [] d_bytes; │ │ │ │ │ + 77 d_bytes = 0; │ │ │ │ │ + 78 fclose(data); │ │ │ │ │ + 79 } │ │ │ │ │ + 80 fclose(data); │ │ │ │ │ + 81 d_error = false; │ │ │ │ │ + 82 } │ │ │ │ │ + 83} │ │ │ │ │ + 84 │ │ │ │ │ + 85 │ │ │ │ │ +86FileDataSource::~FileDataSource() │ │ │ │ │ + 87{ │ │ │ │ │ + 88 delete [] d_bytes; │ │ │ │ │ + 89} │ │ │ │ │ + 90 │ │ │ │ │ + 91 │ │ │ │ │ + 92} // End section of namespace SILLY │ │ │ │ │ SILLY │ │ │ │ │ Simple Image Loading LibrarY namespace. │ │ │ │ │ Definition: SILLYJPGImageContext.cpp:46 │ │ │ │ │ -SILLY::ImageContext │ │ │ │ │ -Store the data needed by an ImageLoader object during the parsing of an image. │ │ │ │ │ -Definition: SILLYImageContext.h:44 │ │ │ │ │ -SILLY::ImageLoader::destroyContext │ │ │ │ │ -void destroyContext(ImageContext *context) │ │ │ │ │ -Destroy the image context. │ │ │ │ │ -Definition: SILLYImageLoader.cpp:47 │ │ │ │ │ +SILLY::FileDataSource::FileDataSource │ │ │ │ │ +FileDataSource(const char *filename) │ │ │ │ │ +Create a data source from an existing file. │ │ │ │ │ +Definition: SILLYFileDataSource.cpp:46 │ │ │ │ │ +SILLY::FileDataSource::~FileDataSource │ │ │ │ │ +~FileDataSource() │ │ │ │ │ +destructor │ │ │ │ │ +Definition: SILLYFileDataSource.cpp:86 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libsilly-doc/html/a00005_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/src/SILLYMemoryDataSource.cpp Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/src/loaders/SILLYJPGImageContext.cpp Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -35,27 +35,27 @@ │ │ │ │ initMenu('',false,false,'search.php','Search'); │ │ │ │ }); │ │ │ │ /* @license-end */ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYMemoryDataSource.cpp
│ │ │ │ +
SILLYJPGImageContext.cpp
│ │ │ │
│ │ │ │
│ │ │ │
1/***********************************************************************
│ │ │ │ -
2 filename: SILLYMemoryDataSource.cpp
│ │ │ │ -
3 created: 10 Jun 2006
│ │ │ │ +
2 filename: SILLYJPGImageContext.cpp
│ │ │ │ +
3 created: 11 Jun 2006
│ │ │ │
4 author: Olivier Delannoy
│ │ │ │
5
│ │ │ │ -
6 purpose: SILLYMemoryDataSource definition for the SILLY library
│ │ │ │ +
6 purpose: Definition of the JPGImageContext class methods
│ │ │ │
7*************************************************************************/
│ │ │ │
8/***************************************************************************
│ │ │ │
9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
│ │ │ │
10 *
│ │ │ │
11 * Permission is hereby granted, free of charge, to any person obtaining
│ │ │ │
12 * a copy of this software and associated documentation files (the
│ │ │ │
13 * "Software"), to deal in the Software without restriction, including
│ │ │ │ @@ -75,38 +75,107 @@ │ │ │ │
27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
│ │ │ │
28 * OTHER DEALINGS IN THE SOFTWARE.
│ │ │ │
29 ***************************************************************************/
│ │ │ │
30#ifdef HAVE_CONFIG_H
│ │ │ │
31#include <config.h>
│ │ │ │
32#endif
│ │ │ │
33
│ │ │ │ -
34#include "SILLYMemoryDataSource.h"
│ │ │ │ +
34#include "loaders/SILLYJPGImageContext.h"
│ │ │ │
35
│ │ │ │
36#ifndef SILLY_OPT_INLINE
│ │ │ │
37#define inline
│ │ │ │ -
38#include "SILLYMemoryDataSource.icpp"
│ │ │ │ +
38#include "loaders/SILLYJPGImageContext.icpp"
│ │ │ │
39#undef inline
│ │ │ │ -
40#endif
│ │ │ │ +
40#endif
│ │ │ │
41
│ │ │ │ -
42// Start of SILLY namespace section
│ │ │ │ -
43namespace SILLY
│ │ │ │ -
44{
│ │ │ │ -
45
│ │ │ │ -
46MemoryDataSource::MemoryDataSource(const byte* data, size_t size)
│ │ │ │ -
47 : d_bytes(data), d_size(size)
│ │ │ │ -
48{
│ │ │ │ -
49 assert(data && "ASSERT: data point to an invalid memory");
│ │ │ │ -
50 assert(size && "ASSERT: size is equal to 0");
│ │ │ │ -
51}
│ │ │ │ -
52
│ │ │ │ -
53} // End of SILLY namespace section
│ │ │ │ -
54
│ │ │ │ -
55
│ │ │ │ -
Simple Image Loading LibrarY namespace.
│ │ │ │ -
MemoryDataSource(const byte *data, size_t size)
Create a data source from an existing memory area.
│ │ │ │ +
42#include <jpeglib.h>
│ │ │ │ +
43
│ │ │ │ +
44// Start section of namespace SILLY
│ │ │ │ +
45namespace SILLY
│ │ │ │ +
46{
│ │ │ │ +
47
│ │ │ │ +
48
│ │ │ │ +
49void JPG_init_source(j_decompress_ptr cinfo)
│ │ │ │ +
50{
│ │ │ │ +
51 // Nothing to do
│ │ │ │ +
52}
│ │ │ │ +
53
│ │ │ │ +
54boolean JPG_fill_input_buffer(j_decompress_ptr cinfo)
│ │ │ │ +
55{
│ │ │ │ +
56 JPGImageContext* jpg = reinterpret_cast<JPGImageContext*>(cinfo->client_data);
│ │ │ │ +
57 cinfo->src->next_input_byte = jpg->d_source->getDataPtr();
│ │ │ │ +
58 cinfo->src->bytes_in_buffer = jpg->d_source->getSize();
│ │ │ │ +
59 return TRUE;
│ │ │ │ +
60}
│ │ │ │ +
61
│ │ │ │ +
62void JPG_skip_input_data(j_decompress_ptr cinfo, long num_bytes)
│ │ │ │ +
63{
│ │ │ │ +
64 if (num_bytes > 0)
│ │ │ │ +
65 {
│ │ │ │ +
66 cinfo->src->next_input_byte += (size_t)num_bytes;
│ │ │ │ +
67 cinfo->src->bytes_in_buffer -= (size_t)num_bytes;
│ │ │ │ +
68 }
│ │ │ │ +
69}
│ │ │ │ +
70
│ │ │ │ +
71void JPG_term_source(j_decompress_ptr cinfo)
│ │ │ │ +
72{
│ │ │ │ +
73 // Nothing to do
│ │ │ │ +
74}
│ │ │ │ +
75
│ │ │ │ +
76void JPG_error_exit(j_common_ptr cinfo)
│ │ │ │ +
77{
│ │ │ │ +
78 JPGImageContext* jpg = reinterpret_cast<JPGImageContext*>(cinfo->client_data);
│ │ │ │ +
79 // TODO
│ │ │ │ +
80 longjmp(jpg->setjmp_buffer, 1);
│ │ │ │ +
81
│ │ │ │ +
82}
│ │ │ │ +
83
│ │ │ │ +
84void JPG_emit_message(j_common_ptr cinfo, int msg_level)
│ │ │ │ +
85{
│ │ │ │ +
86 // Ignore
│ │ │ │ +
87}
│ │ │ │ +
88
│ │ │ │ +
89
│ │ │ │ +
90JPGImageContext::JPGImageContext()
│ │ │ │ +
91 : ImageContext(0, 0)
│ │ │ │ +
92{
│ │ │ │ +
93 src_mgr.bytes_in_buffer = 0;
│ │ │ │ +
94 src_mgr.next_input_byte = 0;
│ │ │ │ +
95 src_mgr.init_source = JPG_init_source;
│ │ │ │ +
96 src_mgr.fill_input_buffer = JPG_fill_input_buffer;
│ │ │ │ +
97 src_mgr.skip_input_data = JPG_skip_input_data;
│ │ │ │ +
98 src_mgr.resync_to_restart = jpeg_resync_to_restart;
│ │ │ │ +
99 src_mgr.term_source = JPG_term_source;
│ │ │ │ +
100 jpeg_create_decompress(&cinfo);
│ │ │ │ +
101 cinfo.src = &src_mgr;
│ │ │ │ +
102 cinfo.client_data = this;
│ │ │ │ +
103 cinfo.err = jpeg_std_error(&d_error_mgr);
│ │ │ │ +
104 d_error_mgr.error_exit = JPG_error_exit;
│ │ │ │ +
105
│ │ │ │ +
106}
│ │ │ │ +
107
│ │ │ │ +
108
│ │ │ │ +
109JPGImageContext::~JPGImageContext()
│ │ │ │ +
110{
│ │ │ │ +
111 jpeg_destroy_decompress(&cinfo);
│ │ │ │ +
112}
│ │ │ │ +
113
│ │ │ │ +
114
│ │ │ │ +
115void JPGImageContext::setImageSize()
│ │ │ │ +
116{
│ │ │ │ +
117 setWidth(cinfo.output_width);
│ │ │ │ +
118 setHeight(cinfo.output_height);
│ │ │ │ +
119}
│ │ │ │ +
120
│ │ │ │ +
121} // End section of namespace SILLY
│ │ │ │ +
Simple Image Loading LibrarY namespace.
│ │ │ │ +
Image Context for JPG image loader.
│ │ │ │ +
virtual size_t getSize() const =0
Return the size of the data.
│ │ │ │ +
virtual const byte * getDataPtr() const =0
Get raw access to the image data.
│ │ │ │ +
Store the data needed by an ImageLoader object during the parsing of an image.
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,21 +4,22 @@ │ │ │ │ │ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ │ │ │ │ │ * build │ │ │ │ │ * reproducible-path │ │ │ │ │ * silly-0.1.0 │ │ │ │ │ * src │ │ │ │ │ -SILLYMemoryDataSource.cpp │ │ │ │ │ + * loaders │ │ │ │ │ +SILLYJPGImageContext.cpp │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ - 2 filename: SILLYMemoryDataSource.cpp │ │ │ │ │ - 3 created: 10 Jun 2006 │ │ │ │ │ + 2 filename: SILLYJPGImageContext.cpp │ │ │ │ │ + 3 created: 11 Jun 2006 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ - 6 purpose: SILLYMemoryDataSource definition for the SILLY library │ │ │ │ │ + 6 purpose: Definition of the JPGImageContext class methods │ │ │ │ │ 7*************************************************************************/ │ │ │ │ │ 8/*************************************************************************** │ │ │ │ │ 9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team │ │ │ │ │ 10 * │ │ │ │ │ 11 * Permission is hereby granted, free of charge, to any person obtaining │ │ │ │ │ 12 * a copy of this software and associated documentation files (the │ │ │ │ │ 13 * "Software"), to deal in the Software without restriction, including │ │ │ │ │ @@ -39,39 +40,115 @@ │ │ │ │ │ 28 * OTHER DEALINGS IN THE SOFTWARE. │ │ │ │ │ 29 │ │ │ │ │ ***************************************************************************/ │ │ │ │ │ 30#ifdef HAVE_CONFIG_H │ │ │ │ │ 31#include │ │ │ │ │ 32#endif │ │ │ │ │ 33 │ │ │ │ │ - 34#include "SILLYMemoryDataSource.h" │ │ │ │ │ + 34#include "loaders/SILLYJPGImageContext.h" │ │ │ │ │ 35 │ │ │ │ │ 36#ifndef SILLY_OPT_INLINE │ │ │ │ │ 37#define inline │ │ │ │ │ - 38#include "SILLYMemoryDataSource.icpp" │ │ │ │ │ + 38#include "loaders/SILLYJPGImageContext.icpp" │ │ │ │ │ 39#undef inline │ │ │ │ │ 40#endif │ │ │ │ │ 41 │ │ │ │ │ - 42// Start of SILLY namespace section │ │ │ │ │ - 43namespace SILLY │ │ │ │ │ - 44{ │ │ │ │ │ - 45 │ │ │ │ │ -46MemoryDataSource::MemoryDataSource(const byte* data, size_t size) │ │ │ │ │ - 47 : d_bytes(data), d_size(size) │ │ │ │ │ - 48{ │ │ │ │ │ - 49 assert(data && "ASSERT: data point to an invalid memory"); │ │ │ │ │ - 50 assert(size && "ASSERT: size is equal to 0"); │ │ │ │ │ - 51} │ │ │ │ │ - 52 │ │ │ │ │ - 53} // End of SILLY namespace section │ │ │ │ │ - 54 │ │ │ │ │ - 55 │ │ │ │ │ + 42#include │ │ │ │ │ + 43 │ │ │ │ │ + 44// Start section of namespace SILLY │ │ │ │ │ +45namespace SILLY │ │ │ │ │ + 46{ │ │ │ │ │ + 47 │ │ │ │ │ + 48 │ │ │ │ │ + 49void JPG_init_source(j_decompress_ptr cinfo) │ │ │ │ │ + 50{ │ │ │ │ │ + 51 // Nothing to do │ │ │ │ │ + 52} │ │ │ │ │ + 53 │ │ │ │ │ + 54boolean JPG_fill_input_buffer(j_decompress_ptr cinfo) │ │ │ │ │ + 55{ │ │ │ │ │ + 56 JPGImageContext* jpg = reinterpret_cast(cinfo- │ │ │ │ │ +>client_data); │ │ │ │ │ + 57 cinfo->src->next_input_byte = jpg->d_source->getDataPtr(); │ │ │ │ │ + 58 cinfo->src->bytes_in_buffer = jpg->d_source->getSize(); │ │ │ │ │ + 59 return TRUE; │ │ │ │ │ + 60} │ │ │ │ │ + 61 │ │ │ │ │ + 62void JPG_skip_input_data(j_decompress_ptr cinfo, long num_bytes) │ │ │ │ │ + 63{ │ │ │ │ │ + 64 if (num_bytes > 0) │ │ │ │ │ + 65 { │ │ │ │ │ + 66 cinfo->src->next_input_byte += (size_t)num_bytes; │ │ │ │ │ + 67 cinfo->src->bytes_in_buffer -= (size_t)num_bytes; │ │ │ │ │ + 68 } │ │ │ │ │ + 69} │ │ │ │ │ + 70 │ │ │ │ │ + 71void JPG_term_source(j_decompress_ptr cinfo) │ │ │ │ │ + 72{ │ │ │ │ │ + 73 // Nothing to do │ │ │ │ │ + 74} │ │ │ │ │ + 75 │ │ │ │ │ + 76void JPG_error_exit(j_common_ptr cinfo) │ │ │ │ │ + 77{ │ │ │ │ │ + 78 JPGImageContext* jpg = reinterpret_cast(cinfo- │ │ │ │ │ +>client_data); │ │ │ │ │ + 79 // TODO │ │ │ │ │ + 80 longjmp(jpg->setjmp_buffer, 1); │ │ │ │ │ + 81 │ │ │ │ │ + 82} │ │ │ │ │ + 83 │ │ │ │ │ + 84void JPG_emit_message(j_common_ptr cinfo, int msg_level) │ │ │ │ │ + 85{ │ │ │ │ │ + 86 // Ignore │ │ │ │ │ + 87} │ │ │ │ │ + 88 │ │ │ │ │ + 89 │ │ │ │ │ + 90JPGImageContext::JPGImageContext() │ │ │ │ │ + 91 : ImageContext(0, 0) │ │ │ │ │ + 92{ │ │ │ │ │ + 93 src_mgr.bytes_in_buffer = 0; │ │ │ │ │ + 94 src_mgr.next_input_byte = 0; │ │ │ │ │ + 95 src_mgr.init_source = JPG_init_source; │ │ │ │ │ + 96 src_mgr.fill_input_buffer = JPG_fill_input_buffer; │ │ │ │ │ + 97 src_mgr.skip_input_data = JPG_skip_input_data; │ │ │ │ │ + 98 src_mgr.resync_to_restart = jpeg_resync_to_restart; │ │ │ │ │ + 99 src_mgr.term_source = JPG_term_source; │ │ │ │ │ + 100 jpeg_create_decompress(&cinfo); │ │ │ │ │ + 101 cinfo.src = &src_mgr; │ │ │ │ │ + 102 cinfo.client_data = this; │ │ │ │ │ + 103 cinfo.err = jpeg_std_error(&d_error_mgr); │ │ │ │ │ + 104 d_error_mgr.error_exit = JPG_error_exit; │ │ │ │ │ + 105 │ │ │ │ │ + 106} │ │ │ │ │ + 107 │ │ │ │ │ + 108 │ │ │ │ │ + 109JPGImageContext::~JPGImageContext() │ │ │ │ │ + 110{ │ │ │ │ │ + 111 jpeg_destroy_decompress(&cinfo); │ │ │ │ │ + 112} │ │ │ │ │ + 113 │ │ │ │ │ + 114 │ │ │ │ │ + 115void JPGImageContext::setImageSize() │ │ │ │ │ + 116{ │ │ │ │ │ + 117 setWidth(cinfo.output_width); │ │ │ │ │ + 118 setHeight(cinfo.output_height); │ │ │ │ │ + 119} │ │ │ │ │ + 120 │ │ │ │ │ + 121} // End section of namespace SILLY │ │ │ │ │ SILLY │ │ │ │ │ Simple Image Loading LibrarY namespace. │ │ │ │ │ Definition: SILLYJPGImageContext.cpp:46 │ │ │ │ │ -SILLY::MemoryDataSource::MemoryDataSource │ │ │ │ │ -MemoryDataSource(const byte *data, size_t size) │ │ │ │ │ -Create a data source from an existing memory area. │ │ │ │ │ -Definition: SILLYMemoryDataSource.cpp:46 │ │ │ │ │ +SILLY::JPGImageContext │ │ │ │ │ +Image Context for JPG image loader. │ │ │ │ │ +Definition: SILLYJPGImageContext.h:57 │ │ │ │ │ +SILLY::DataSource::getSize │ │ │ │ │ +virtual size_t getSize() const =0 │ │ │ │ │ +Return the size of the data. │ │ │ │ │ +SILLY::DataSource::getDataPtr │ │ │ │ │ +virtual const byte * getDataPtr() const =0 │ │ │ │ │ +Get raw access to the image data. │ │ │ │ │ +SILLY::ImageContext │ │ │ │ │ +Store the data needed by an ImageLoader object during the parsing of an image. │ │ │ │ │ +Definition: SILLYImageContext.h:44 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libsilly-doc/html/a00008_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/src/SILLYImageContext.cpp Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/src/loaders/SILLYJPGImageLoader.cpp Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -35,27 +35,27 @@ │ │ │ │ initMenu('',false,false,'search.php','Search'); │ │ │ │ }); │ │ │ │ /* @license-end */ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYImageContext.cpp
│ │ │ │ +
SILLYJPGImageLoader.cpp
│ │ │ │
│ │ │ │
│ │ │ │
1/***********************************************************************
│ │ │ │ -
2 filename: SILLYImageContext.cpp
│ │ │ │ -
3 created: 10 Jun 2006
│ │ │ │ +
2 filename: SILLYJPGImageLoader.cpp
│ │ │ │ +
3 created: 11 Jun 2006
│ │ │ │
4 author: Olivier Delannoy
│ │ │ │
5
│ │ │ │ -
6 purpose: Implementation file for ImageContext class
│ │ │ │ +
6 purpose: Definition of JPGImageLoader methods
│ │ │ │
7*************************************************************************/
│ │ │ │
8/***************************************************************************
│ │ │ │
9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
│ │ │ │
10 *
│ │ │ │
11 * Permission is hereby granted, free of charge, to any person obtaining
│ │ │ │
12 * a copy of this software and associated documentation files (the
│ │ │ │
13 * "Software"), to deal in the Software without restriction, including
│ │ │ │ @@ -75,67 +75,146 @@ │ │ │ │
27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
│ │ │ │
28 * OTHER DEALINGS IN THE SOFTWARE.
│ │ │ │
29 ***************************************************************************/
│ │ │ │
30#ifdef HAVE_CONFIG_H
│ │ │ │
31#include <config.h>
│ │ │ │
32#endif
│ │ │ │
33
│ │ │ │ -
34#include "SILLYImageContext.h"
│ │ │ │ -
35#ifndef SILLY_OPT_INLINE
│ │ │ │ -
36#define inline
│ │ │ │ -
37#include "SILLYImageContext.icpp"
│ │ │ │ -
38#undef inline
│ │ │ │ -
39#endif
│ │ │ │ -
40#include <cstring>
│ │ │ │ -
41// Start section of namespace SILLY
│ │ │ │ -
42namespace SILLY
│ │ │ │ -
43{
│ │ │ │ -
44
│ │ │ │ - │ │ │ │ -
46{
│ │ │ │ -
47 size_t depth;
│ │ │ │ -
48 switch(d_format)
│ │ │ │ -
49 {
│ │ │ │ -
50 case PF_A1B5G5R5:
│ │ │ │ -
51 depth = 2;
│ │ │ │ -
52 break;
│ │ │ │ -
53 case PF_RGB:
│ │ │ │ -
54 depth = 3;
│ │ │ │ -
55 break;
│ │ │ │ -
56 case PF_RGBA:
│ │ │ │ -
57 depth = 4;
│ │ │ │ -
58 break;
│ │ │ │ -
59 }
│ │ │ │ -
60
│ │ │ │ -
61 // Do the flipping
│ │ │ │ -
62 byte *p1,*p2,*tmp; // tmp pointers
│ │ │ │ -
63 size_t len = d_width * depth; // length of horizontal line in bytes
│ │ │ │ -
64 tmp = new byte[len]; // Allocate a temporary line
│ │ │ │ -
65 if ( !tmp )
│ │ │ │ -
66 return false;
│ │ │ │ -
67
│ │ │ │ -
68 size_t y , y2;
│ │ │ │ -
69 y2 = d_height - 1;
│ │ │ │ -
70 for ( y = 0; y < d_height >> 1; y++ )
│ │ │ │ -
71 {
│ │ │ │ -
72 p1 = (d_pixels) + len * y;
│ │ │ │ -
73 p2 = (d_pixels) + len * y2;
│ │ │ │ -
74 memcpy( tmp, p1, len );
│ │ │ │ -
75 memcpy( p1, p2, len );
│ │ │ │ -
76 memcpy( p2, tmp, len );
│ │ │ │ -
77 y2--;
│ │ │ │ -
78 }
│ │ │ │ -
79 delete [] tmp;
│ │ │ │ -
80 return true;
│ │ │ │ -
81}
│ │ │ │ -
82
│ │ │ │ -
83
│ │ │ │ -
84} // End section of namespace SILLY
│ │ │ │ -
Simple Image Loading LibrarY namespace.
│ │ │ │ -
bool flipVertically()
Flip pixel ordering.
│ │ │ │ +
34#include "loaders/SILLYJPGImageLoader.h"
│ │ │ │ +
35
│ │ │ │ +
36#ifndef SILLY_OPT_INLINE
│ │ │ │ +
37#define inline
│ │ │ │ +
38#include "loaders/SILLYJPGImageLoader.icpp"
│ │ │ │ +
39#undef inline
│ │ │ │ +
40#endif
│ │ │ │ +
41#include "loaders/SILLYJPGImageContext.h"
│ │ │ │ +
42
│ │ │ │ +
43// Start section of namespace SILLY
│ │ │ │ +
44namespace SILLY
│ │ │ │ +
45{
│ │ │ │ +
46JPGImageLoader::JPGImageLoader()
│ │ │ │ +
47 : ImageLoader("JPG Image Loader based on jpeg-6b")
│ │ │ │ +
48{
│ │ │ │ +
49}
│ │ │ │ +
50
│ │ │ │ +
51JPGImageLoader::~JPGImageLoader()
│ │ │ │ +
52{
│ │ │ │ +
53}
│ │ │ │ +
54
│ │ │ │ +
55
│ │ │ │ +
56ImageContext* JPGImageLoader::loadHeader(PixelFormat& formatSource, DataSource* data)
│ │ │ │ +
57{
│ │ │ │ + │ │ │ │ +
59 jpg->d_source = data;
│ │ │ │ +
60
│ │ │ │ +
61 if (! jpg)
│ │ │ │ +
62 return 0;
│ │ │ │ +
63 if (setjmp(jpg->setjmp_buffer))
│ │ │ │ +
64 {
│ │ │ │ +
65 delete jpg;
│ │ │ │ +
66 return 0;
│ │ │ │ +
67 }
│ │ │ │ +
68 jpeg_read_header(&(jpg->cinfo), TRUE);
│ │ │ │ +
69 if (! jpeg_start_decompress(&(jpg->cinfo)))
│ │ │ │ +
70 {
│ │ │ │ +
71 delete jpg;
│ │ │ │ +
72 return 0;
│ │ │ │ +
73 }
│ │ │ │ +
74
│ │ │ │ +
75
│ │ │ │ +
76 if (jpg->cinfo.output_components != 1 && jpg->cinfo.output_components != 3)
│ │ │ │ +
77 {
│ │ │ │ +
78 printf("JPG unsupported bpp: %d\n", jpg->cinfo.output_components );
│ │ │ │ +
79 jpeg_finish_decompress(& jpg->cinfo);
│ │ │ │ +
80 delete jpg;
│ │ │ │ +
81 return 0;
│ │ │ │ +
82 }
│ │ │ │ +
83 formatSource = PF_RGB; // It's not true but we handle both the same way
│ │ │ │ +
84 //printf("Image info: size: %dx%d - bpp: %d\n", jpg->cinfo.output_width, jpg->cinfo.output_height, jpg->cinfo.output_components);
│ │ │ │ +
85
│ │ │ │ +
86 jpg->setImageSize();
│ │ │ │ +
87 return jpg;
│ │ │ │ +
88}
│ │ │ │ +
89
│ │ │ │ +
90bool JPGImageLoader::loadImageData(PixelOrigin origin,
│ │ │ │ +
91 DataSource* data,
│ │ │ │ +
92 ImageContext* context)
│ │ │ │ +
93{
│ │ │ │ +
94 JPGImageContext* jpg = static_cast<JPGImageContext*>(context);
│ │ │ │ +
95
│ │ │ │ +
96 // Allocate a buffer
│ │ │ │ +
97 int row_stride = jpg->getWidth() * jpg->cinfo.output_components;
│ │ │ │ +
98 JSAMPARRAY buffer = (* jpg->cinfo.mem->alloc_sarray)(
│ │ │ │ +
99 (j_common_ptr)(& jpg->cinfo),
│ │ │ │ +
100 JPOOL_IMAGE,
│ │ │ │ +
101 row_stride,
│ │ │ │ +
102 1);
│ │ │ │ +
103 bool finished = true;
│ │ │ │ +
104 size_t height = jpg->getHeight();
│ │ │ │ +
105 size_t width = jpg->getWidth();
│ │ │ │ +
106
│ │ │ │ +
107
│ │ │ │ +
108 while(jpg->cinfo.output_scanline < height)
│ │ │ │ +
109 {
│ │ │ │ +
110 int num_rows = jpeg_read_scanlines(& jpg->cinfo, buffer, 1);
│ │ │ │ +
111 if (num_rows != 1)
│ │ │ │ +
112 {
│ │ │ │ +
113 jpeg_finish_decompress(& jpg->cinfo);
│ │ │ │ +
114 return false;
│ │ │ │ +
115 }
│ │ │ │ +
116 byte red;
│ │ │ │ +
117 byte green;
│ │ │ │ +
118 byte blue;
│ │ │ │ +
119 const byte alpha = 0xff;
│ │ │ │ +
120 byte* in = (byte*)(*buffer);
│ │ │ │ +
121 // Grayscale image
│ │ │ │ +
122 if (jpg->cinfo.output_components == 1)
│ │ │ │ +
123 {
│ │ │ │ +
124 for(size_t i = 0 ; i < width * num_rows ; ++i)
│ │ │ │ +
125 {
│ │ │ │ +
126 red = *in;
│ │ │ │ +
127 green = *in;
│ │ │ │ +
128 blue = *in;
│ │ │ │ +
129 jpg->setNextPixel(red, green, blue, alpha);
│ │ │ │ +
130 in += 1;
│ │ │ │ +
131 }
│ │ │ │ +
132 }
│ │ │ │ +
133 // RGB image
│ │ │ │ +
134 else
│ │ │ │ +
135 {
│ │ │ │ +
136 for(size_t i = 0 ; i < width * num_rows ; ++i)
│ │ │ │ +
137 {
│ │ │ │ +
138 red = *(in++);
│ │ │ │ +
139 green = *(in++);
│ │ │ │ +
140 blue = *(in++);
│ │ │ │ +
141 jpg->setNextPixel(red, green, blue, alpha);
│ │ │ │ +
142 }
│ │ │ │ +
143 }
│ │ │ │ +
144 }
│ │ │ │ +
145 jpeg_finish_decompress(& jpg->cinfo);
│ │ │ │ +
146
│ │ │ │ +
147 if (origin == PO_BOTTOM_LEFT)
│ │ │ │ +
148 return jpg->flipVertically();
│ │ │ │ +
149 return true;
│ │ │ │ +
150}
│ │ │ │ +
151
│ │ │ │ +
152
│ │ │ │ +
153
│ │ │ │ +
154
│ │ │ │ +
155
│ │ │ │ +
156
│ │ │ │ +
157} // End section of namespace SILLY
│ │ │ │ +
Simple Image Loading LibrarY namespace.
│ │ │ │ +
PixelFormat
List all pixel format supported.
Definition: SILLYBase.h:60
│ │ │ │ +
PixelOrigin
List all pixel origin supported.
Definition: SILLYBase.h:71
│ │ │ │ +
Image Context for JPG image loader.
│ │ │ │ +
This is an abstract class used to provide data to the loader.
│ │ │ │ +
Store the data needed by an ImageLoader object during the parsing of an image.
│ │ │ │ +
void setNextPixel(byte red, byte green, byte bleu, byte alpha)
Set the next pixel of the image.
│ │ │ │ +
bool flipVertically()
Flip pixel ordering.
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,21 +4,22 @@ │ │ │ │ │ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ │ │ │ │ │ * build │ │ │ │ │ * reproducible-path │ │ │ │ │ * silly-0.1.0 │ │ │ │ │ * src │ │ │ │ │ -SILLYImageContext.cpp │ │ │ │ │ + * loaders │ │ │ │ │ +SILLYJPGImageLoader.cpp │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ - 2 filename: SILLYImageContext.cpp │ │ │ │ │ - 3 created: 10 Jun 2006 │ │ │ │ │ + 2 filename: SILLYJPGImageLoader.cpp │ │ │ │ │ + 3 created: 11 Jun 2006 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ - 6 purpose: Implementation file for ImageContext class │ │ │ │ │ + 6 purpose: Definition of JPGImageLoader methods │ │ │ │ │ 7*************************************************************************/ │ │ │ │ │ 8/*************************************************************************** │ │ │ │ │ 9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team │ │ │ │ │ 10 * │ │ │ │ │ 11 * Permission is hereby granted, free of charge, to any person obtaining │ │ │ │ │ 12 * a copy of this software and associated documentation files (the │ │ │ │ │ 13 * "Software"), to deal in the Software without restriction, including │ │ │ │ │ @@ -39,68 +40,163 @@ │ │ │ │ │ 28 * OTHER DEALINGS IN THE SOFTWARE. │ │ │ │ │ 29 │ │ │ │ │ ***************************************************************************/ │ │ │ │ │ 30#ifdef HAVE_CONFIG_H │ │ │ │ │ 31#include │ │ │ │ │ 32#endif │ │ │ │ │ 33 │ │ │ │ │ - 34#include "SILLYImageContext.h" │ │ │ │ │ - 35#ifndef SILLY_OPT_INLINE │ │ │ │ │ - 36#define inline │ │ │ │ │ - 37#include "SILLYImageContext.icpp" │ │ │ │ │ - 38#undef inline │ │ │ │ │ - 39#endif │ │ │ │ │ - 40#include │ │ │ │ │ - 41// Start section of namespace SILLY │ │ │ │ │ - 42namespace SILLY │ │ │ │ │ - 43{ │ │ │ │ │ - 44 │ │ │ │ │ -45bool ImageContext::flipVertically() │ │ │ │ │ - 46{ │ │ │ │ │ - 47 size_t depth; │ │ │ │ │ - 48 switch(d_format) │ │ │ │ │ - 49 { │ │ │ │ │ - 50 case PF_A1B5G5R5: │ │ │ │ │ - 51 depth = 2; │ │ │ │ │ - 52 break; │ │ │ │ │ - 53 case PF_RGB: │ │ │ │ │ - 54 depth = 3; │ │ │ │ │ - 55 break; │ │ │ │ │ - 56 case PF_RGBA: │ │ │ │ │ - 57 depth = 4; │ │ │ │ │ - 58 break; │ │ │ │ │ - 59 } │ │ │ │ │ + 34#include "loaders/SILLYJPGImageLoader.h" │ │ │ │ │ + 35 │ │ │ │ │ + 36#ifndef SILLY_OPT_INLINE │ │ │ │ │ + 37#define inline │ │ │ │ │ + 38#include "loaders/SILLYJPGImageLoader.icpp" │ │ │ │ │ + 39#undef inline │ │ │ │ │ + 40#endif │ │ │ │ │ + 41#include "loaders/SILLYJPGImageContext.h" │ │ │ │ │ + 42 │ │ │ │ │ + 43// Start section of namespace SILLY │ │ │ │ │ + 44namespace SILLY │ │ │ │ │ + 45{ │ │ │ │ │ + 46JPGImageLoader::JPGImageLoader() │ │ │ │ │ + 47 : ImageLoader("JPG Image Loader based on jpeg-6b") │ │ │ │ │ + 48{ │ │ │ │ │ + 49} │ │ │ │ │ + 50 │ │ │ │ │ + 51JPGImageLoader::~JPGImageLoader() │ │ │ │ │ + 52{ │ │ │ │ │ + 53} │ │ │ │ │ + 54 │ │ │ │ │ + 55 │ │ │ │ │ +56ImageContext* JPGImageLoader::loadHeader(PixelFormat& formatSource, │ │ │ │ │ +DataSource* data) │ │ │ │ │ + 57{ │ │ │ │ │ + 58 JPGImageContext* jpg = new JPGImageContext; │ │ │ │ │ + 59 jpg->d_source = data; │ │ │ │ │ 60 │ │ │ │ │ - 61 // Do the flipping │ │ │ │ │ - 62 byte *p1,*p2,*tmp; // tmp pointers │ │ │ │ │ - 63 size_t len = d_width * depth; // length of horizontal line in bytes │ │ │ │ │ - 64 tmp = new byte[len]; // Allocate a temporary line │ │ │ │ │ - 65 if ( !tmp ) │ │ │ │ │ - 66 return false; │ │ │ │ │ - 67 │ │ │ │ │ - 68 size_t y , y2; │ │ │ │ │ - 69 y2 = d_height - 1; │ │ │ │ │ - 70 for ( y = 0; y < d_height >> 1; y++ ) │ │ │ │ │ - 71 { │ │ │ │ │ - 72 p1 = (d_pixels) + len * y; │ │ │ │ │ - 73 p2 = (d_pixels) + len * y2; │ │ │ │ │ - 74 memcpy( tmp, p1, len ); │ │ │ │ │ - 75 memcpy( p1, p2, len ); │ │ │ │ │ - 76 memcpy( p2, tmp, len ); │ │ │ │ │ - 77 y2--; │ │ │ │ │ - 78 } │ │ │ │ │ - 79 delete [] tmp; │ │ │ │ │ - 80 return true; │ │ │ │ │ - 81} │ │ │ │ │ - 82 │ │ │ │ │ - 83 │ │ │ │ │ - 84} // End section of namespace SILLY │ │ │ │ │ + 61 if (! jpg) │ │ │ │ │ + 62 return 0; │ │ │ │ │ + 63 if (setjmp(jpg->setjmp_buffer)) │ │ │ │ │ + 64 { │ │ │ │ │ + 65 delete jpg; │ │ │ │ │ + 66 return 0; │ │ │ │ │ + 67 } │ │ │ │ │ + 68 jpeg_read_header(&(jpg->cinfo), TRUE); │ │ │ │ │ + 69 if (! jpeg_start_decompress(&(jpg->cinfo))) │ │ │ │ │ + 70 { │ │ │ │ │ + 71 delete jpg; │ │ │ │ │ + 72 return 0; │ │ │ │ │ + 73 } │ │ │ │ │ + 74 │ │ │ │ │ + 75 │ │ │ │ │ + 76 if (jpg->cinfo.output_components != 1 && jpg->cinfo.output_components != 3) │ │ │ │ │ + 77 { │ │ │ │ │ + 78 printf("JPG unsupported bpp: %d\n", jpg->cinfo.output_components ); │ │ │ │ │ + 79 jpeg_finish_decompress(& jpg->cinfo); │ │ │ │ │ + 80 delete jpg; │ │ │ │ │ + 81 return 0; │ │ │ │ │ + 82 } │ │ │ │ │ + 83 formatSource = PF_RGB; // It's not true but we handle both the same way │ │ │ │ │ + 84 //printf("Image info: size: %dx%d - bpp: %d\n", jpg->cinfo.output_width, │ │ │ │ │ +jpg->cinfo.output_height, jpg->cinfo.output_components); │ │ │ │ │ + 85 │ │ │ │ │ + 86 jpg->setImageSize(); │ │ │ │ │ + 87 return jpg; │ │ │ │ │ + 88} │ │ │ │ │ + 89 │ │ │ │ │ +90bool JPGImageLoader::loadImageData(PixelOrigin origin, │ │ │ │ │ + 91 DataSource* data, │ │ │ │ │ + 92 ImageContext* context) │ │ │ │ │ + 93{ │ │ │ │ │ + 94 JPGImageContext* jpg = static_cast(context); │ │ │ │ │ + 95 │ │ │ │ │ + 96 // Allocate a buffer │ │ │ │ │ + 97 int row_stride = jpg->getWidth() * jpg->cinfo.output_components; │ │ │ │ │ + 98 JSAMPARRAY buffer = (* jpg->cinfo.mem->alloc_sarray)( │ │ │ │ │ + 99 (j_common_ptr)(& jpg->cinfo), │ │ │ │ │ + 100 JPOOL_IMAGE, │ │ │ │ │ + 101 row_stride, │ │ │ │ │ + 102 1); │ │ │ │ │ + 103 bool finished = true; │ │ │ │ │ + 104 size_t height = jpg->getHeight(); │ │ │ │ │ + 105 size_t width = jpg->getWidth(); │ │ │ │ │ + 106 │ │ │ │ │ + 107 │ │ │ │ │ + 108 while(jpg->cinfo.output_scanline < height) │ │ │ │ │ + 109 { │ │ │ │ │ + 110 int num_rows = jpeg_read_scanlines(& jpg->cinfo, buffer, 1); │ │ │ │ │ + 111 if (num_rows != 1) │ │ │ │ │ + 112 { │ │ │ │ │ + 113 jpeg_finish_decompress(& jpg->cinfo); │ │ │ │ │ + 114 return false; │ │ │ │ │ + 115 } │ │ │ │ │ + 116 byte red; │ │ │ │ │ + 117 byte green; │ │ │ │ │ + 118 byte blue; │ │ │ │ │ + 119 const byte alpha = 0xff; │ │ │ │ │ + 120 byte* in = (byte*)(*buffer); │ │ │ │ │ + 121 // Grayscale image │ │ │ │ │ + 122 if (jpg->cinfo.output_components == 1) │ │ │ │ │ + 123 { │ │ │ │ │ + 124 for(size_t i = 0 ; i < width * num_rows ; ++i) │ │ │ │ │ + 125 { │ │ │ │ │ + 126 red = *in; │ │ │ │ │ + 127 green = *in; │ │ │ │ │ + 128 blue = *in; │ │ │ │ │ + 129 jpg->setNextPixel(red, green, blue, alpha); │ │ │ │ │ + 130 in += 1; │ │ │ │ │ + 131 } │ │ │ │ │ + 132 } │ │ │ │ │ + 133 // RGB image │ │ │ │ │ + 134 else │ │ │ │ │ + 135 { │ │ │ │ │ + 136 for(size_t i = 0 ; i < width * num_rows ; ++i) │ │ │ │ │ + 137 { │ │ │ │ │ + 138 red = *(in++); │ │ │ │ │ + 139 green = *(in++); │ │ │ │ │ + 140 blue = *(in++); │ │ │ │ │ + 141 jpg->setNextPixel(red, green, blue, alpha); │ │ │ │ │ + 142 } │ │ │ │ │ + 143 } │ │ │ │ │ + 144 } │ │ │ │ │ + 145 jpeg_finish_decompress(& jpg->cinfo); │ │ │ │ │ + 146 │ │ │ │ │ + 147 if (origin == PO_BOTTOM_LEFT) │ │ │ │ │ + 148 return jpg->flipVertically(); │ │ │ │ │ + 149 return true; │ │ │ │ │ + 150} │ │ │ │ │ + 151 │ │ │ │ │ + 152 │ │ │ │ │ + 153 │ │ │ │ │ + 154 │ │ │ │ │ + 155 │ │ │ │ │ + 156 │ │ │ │ │ + 157} // End section of namespace SILLY │ │ │ │ │ SILLY │ │ │ │ │ Simple Image Loading LibrarY namespace. │ │ │ │ │ Definition: SILLYJPGImageContext.cpp:46 │ │ │ │ │ +SILLY::PixelFormat │ │ │ │ │ +PixelFormat │ │ │ │ │ +List all pixel format supported. │ │ │ │ │ +Definition: SILLYBase.h:60 │ │ │ │ │ +SILLY::PixelOrigin │ │ │ │ │ +PixelOrigin │ │ │ │ │ +List all pixel origin supported. │ │ │ │ │ +Definition: SILLYBase.h:71 │ │ │ │ │ +SILLY::JPGImageContext │ │ │ │ │ +Image Context for JPG image loader. │ │ │ │ │ +Definition: SILLYJPGImageContext.h:57 │ │ │ │ │ +SILLY::DataSource │ │ │ │ │ +This is an abstract class used to provide data to the loader. │ │ │ │ │ +Definition: SILLYDataSource.h:47 │ │ │ │ │ +SILLY::ImageContext │ │ │ │ │ +Store the data needed by an ImageLoader object during the parsing of an image. │ │ │ │ │ +Definition: SILLYImageContext.h:44 │ │ │ │ │ +SILLY::ImageContext::setNextPixel │ │ │ │ │ +void setNextPixel(byte red, byte green, byte bleu, byte alpha) │ │ │ │ │ +Set the next pixel of the image. │ │ │ │ │ SILLY::ImageContext::flipVertically │ │ │ │ │ bool flipVertically() │ │ │ │ │ Flip pixel ordering. │ │ │ │ │ Definition: SILLYImageContext.cpp:45 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libsilly-doc/html/a00011_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/src/loaders/SILLYTGAImageLoader.cpp Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/src/loaders/SILLYPNGImageContext.cpp Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -39,23 +39,23 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYTGAImageLoader.cpp
│ │ │ │ +
SILLYPNGImageContext.cpp
│ │ │ │
│ │ │ │
│ │ │ │
1/***********************************************************************
│ │ │ │ -
2 filename: SILLYTGAImageLoader.cpp
│ │ │ │ +
2 filename: SILLYPNGImageContext.cpp
│ │ │ │
3 created: 11 Jun 2006
│ │ │ │
4 author: Olivier Delannoy
│ │ │ │
5
│ │ │ │ -
6 purpose: Load TGA Image
│ │ │ │ +
6 purpose: Definition of PNGImageContext methods
│ │ │ │
7*************************************************************************/
│ │ │ │
8/***************************************************************************
│ │ │ │
9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
│ │ │ │
10 *
│ │ │ │
11 * Permission is hereby granted, free of charge, to any person obtaining
│ │ │ │
12 * a copy of this software and associated documentation files (the
│ │ │ │
13 * "Software"), to deal in the Software without restriction, including
│ │ │ │ @@ -75,309 +75,66 @@ │ │ │ │
27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
│ │ │ │
28 * OTHER DEALINGS IN THE SOFTWARE.
│ │ │ │
29 ***************************************************************************/
│ │ │ │
30#ifdef HAVE_CONFIG_H
│ │ │ │
31#include <config.h>
│ │ │ │
32#endif
│ │ │ │
33
│ │ │ │ -
34#include "loaders/SILLYTGAImageLoader.h"
│ │ │ │ +
34#include "loaders/SILLYPNGImageContext.h"
│ │ │ │
35
│ │ │ │
36#ifndef SILLY_OPT_INLINE
│ │ │ │
37#define inline
│ │ │ │ -
38#include "loaders/SILLYTGAImageLoader.icpp"
│ │ │ │ +
38#include "loaders/SILLYPNGImageContext.icpp"
│ │ │ │
39#undef inline
│ │ │ │ -
40#endif
│ │ │ │ -
41#include "SILLYDataSource.h"
│ │ │ │ -
42#include "loaders/SILLYTGAImageContext.h"
│ │ │ │ -
43
│ │ │ │ -
44#include <cstring>
│ │ │ │ -
45#include <cstdio>
│ │ │ │ -
46
│ │ │ │ -
47// Start section of namespace SILLY
│ │ │ │ -
48namespace SILLY
│ │ │ │ -
49{
│ │ │ │ -
50
│ │ │ │ -
51TGAImageLoader::TGAImageLoader()
│ │ │ │ -
52 : ImageLoader("TGA Image loader (builtin)")
│ │ │ │ -
53{
│ │ │ │ -
54}
│ │ │ │ -
55
│ │ │ │ -
56TGAImageLoader::~TGAImageLoader()
│ │ │ │ -
57{
│ │ │ │ -
58}
│ │ │ │ -
59
│ │ │ │ -
60#ifdef SILLY_BE
│ │ │ │ -
61#define READ_WORD(res, start) \
│ │ │ │ -
62 (res) = 0; \
│ │ │ │ -
63 (res) = data->getDataPtr()[(start) + 1]; \
│ │ │ │ -
64 (res) = (res) << 8; \
│ │ │ │ -
65 (res) |= data->getDataPtr()[(start)];
│ │ │ │ -
66#else
│ │ │ │ -
67#define READ_WORD(res, start) \
│ │ │ │ -
68 (res) = 0; \
│ │ │ │ -
69 (res) = data->getDataPtr()[(start)]; \
│ │ │ │ -
70 (res) = (res) << 8; \
│ │ │ │ -
71 (res) |= data->getDataPtr()[(start) + 1];
│ │ │ │ -
72#endif
│ │ │ │ +
40#endif
│ │ │ │ +
41#include <string.h>
│ │ │ │ +
42
│ │ │ │ +
43// Start section of namespace SILLY
│ │ │ │ +
44namespace SILLY
│ │ │ │ +
45{
│ │ │ │ +
46int PNGImageContext::read(png_bytep data, png_size_t length)
│ │ │ │ +
47{
│ │ │ │ +
48 //printf("PNG Read: %d bytes offset: %d, size %d\n",
│ │ │ │ +
49 // length, d_offset, d_data->getSize());
│ │ │ │ +
50
│ │ │ │ +
51 if (d_offset + length > d_data->getSize())
│ │ │ │ +
52 return -1;
│ │ │ │ +
53 memcpy(data, d_data->getDataPtr() + d_offset, length);
│ │ │ │ +
54 d_offset += length;
│ │ │ │ +
55 return length;
│ │ │ │ +
56}
│ │ │ │ +
57
│ │ │ │ +
58
│ │ │ │ +
59PNGImageContext::PNGImageContext(DataSource* data)
│ │ │ │ +
60 : ImageContext(0,0), d_offset(0), d_data(data), d_png_ptr(0), d_info_ptr(0)
│ │ │ │ +
61{
│ │ │ │ +
62
│ │ │ │ +
63}
│ │ │ │ +
64
│ │ │ │ +
65PNGImageContext::~PNGImageContext()
│ │ │ │ +
66{
│ │ │ │ +
67 if (d_info_ptr)
│ │ │ │ +
68 png_destroy_read_struct(&d_png_ptr, &d_info_ptr, 0);
│ │ │ │ +
69 if (d_png_ptr)
│ │ │ │ +
70 png_destroy_read_struct(&d_png_ptr, 0, 0);
│ │ │ │ +
71}
│ │ │ │ +
72
│ │ │ │
73
│ │ │ │ -
74ImageContext* TGAImageLoader::loadHeader(PixelFormat& formatSource, DataSource* data)
│ │ │ │ +
74void PNGImageContext::setImageSize()
│ │ │ │
75{
│ │ │ │ -
76 byte idLength = data->getDataPtr()[0];
│ │ │ │ -
77 byte colorMapType = data->getDataPtr()[1];
│ │ │ │ -
78 byte imageType = data->getDataPtr()[2];
│ │ │ │ -
79 size_t width;
│ │ │ │ -
80 size_t height;
│ │ │ │ -
81 byte depth;
│ │ │ │ -
82 byte description;
│ │ │ │ -
83 if ((imageType != 2 && imageType != 10) || colorMapType)
│ │ │ │ -
84 {
│ │ │ │ -
85 // Unsupported image format
│ │ │ │ -
86 return 0;
│ │ │ │ -
87 }
│ │ │ │ -
88 // offset: 3 Skip color map + 5 bytes
│ │ │ │ -
89 // offset: 8 Skip xorg / yorg + 4 bytes
│ │ │ │ -
90#ifdef SILLY_BE
│ │ │ │ -
91 width = data->getDataPtr()[12];
│ │ │ │ -
92 width = width << 8;
│ │ │ │ -
93 width |= data->getDataPtr()[13];
│ │ │ │ -
94 height = data->getDataPtr()[14];
│ │ │ │ -
95 height = height << 8;
│ │ │ │ -
96 height |= data->getDataPtr()[15];
│ │ │ │ -
97#else
│ │ │ │ -
98 width = data->getDataPtr()[13];
│ │ │ │ -
99 width = width << 8;
│ │ │ │ -
100 width |= data->getDataPtr()[12];
│ │ │ │ -
101 height = data->getDataPtr()[15];
│ │ │ │ -
102 height = height << 8;
│ │ │ │ -
103 height |= data->getDataPtr()[14];
│ │ │ │ -
104#endif
│ │ │ │ -
105 depth = data->getDataPtr()[16] >> 3;
│ │ │ │ -
106 switch (depth)
│ │ │ │ -
107 {
│ │ │ │ -
108 case 2:
│ │ │ │ -
109 formatSource = PF_A1B5G5R5;
│ │ │ │ -
110 break;
│ │ │ │ -
111 case 3:
│ │ │ │ -
112 formatSource = PF_RGB;
│ │ │ │ -
113 break;
│ │ │ │ -
114 case 4:
│ │ │ │ -
115 formatSource = PF_RGBA;
│ │ │ │ -
116 break;
│ │ │ │ -
117 default:
│ │ │ │ -
118 return 0;
│ │ │ │ -
119 }
│ │ │ │ -
120 description = (*data)[17];
│ │ │ │ -
121
│ │ │ │ -
122
│ │ │ │ -
123 TGAImageContext* context = new TGAImageContext(width, height);
│ │ │ │ -
124 if (context)
│ │ │ │ -
125 {
│ │ │ │ -
126 context->d_idLength = idLength;
│ │ │ │ -
127 context->d_imageType = imageType;
│ │ │ │ -
128 context->d_depth = depth;
│ │ │ │ -
129 context->d_description = description;
│ │ │ │ -
130 }
│ │ │ │ -
131 return context;
│ │ │ │ -
132}
│ │ │ │ -
133
│ │ │ │ -
134bool TGAImageLoader::loadImageData(PixelOrigin origin, DataSource* data, ImageContext* context)
│ │ │ │ -
135{
│ │ │ │ -
136 TGAImageContext* tga = static_cast<TGAImageContext*>(context);
│ │ │ │ -
137 size_t bpp = tga->d_depth;
│ │ │ │ -
138 size_t w = tga->getWidth();
│ │ │ │ -
139 size_t h = tga->getHeight();
│ │ │ │ -
140 size_t imgSize = w * h * bpp;
│ │ │ │ -
141 size_t offset = 18 + tga->d_idLength;
│ │ │ │ -
142 size_t numPixels = w * h;
│ │ │ │ -
143 const byte* input = data->getDataPtr() + offset;
│ │ │ │ -
144 // Read image data
│ │ │ │ -
145 byte red;
│ │ │ │ -
146 byte green;
│ │ │ │ -
147 byte blue;
│ │ │ │ -
148 byte alpha;
│ │ │ │ -
149 // Uncompressed
│ │ │ │ -
150 if (tga->d_imageType == 2)
│ │ │ │ -
151 {
│ │ │ │ -
152
│ │ │ │ -
153 switch(bpp)
│ │ │ │ -
154 {
│ │ │ │ -
155 case 2: //A1B5G5R5
│ │ │ │ -
156 for(size_t i = 0 ; i < numPixels ; ++i)
│ │ │ │ -
157 {
│ │ │ │ -
158 unsigned short pixel;
│ │ │ │ -
159 pixel = *(input++);
│ │ │ │ -
160 pixel = pixel << 8;
│ │ │ │ -
161 pixel |= *(input++);
│ │ │ │ -
162
│ │ │ │ -
163 alpha = pixel & 0xf000 ? 0xff : 0x00;
│ │ │ │ -
164 blue = static_cast<byte>((pixel & 0x1f) << 3);
│ │ │ │ -
165 green = static_cast<byte>(((pixel >> 5) & 0x1f) << 3);
│ │ │ │ -
166 red = static_cast<byte>(((pixel >> 10) & 0x1f) << 3);
│ │ │ │ -
167 context->setNextPixel(red, green, blue, alpha);
│ │ │ │ -
168 }
│ │ │ │ -
169 break;
│ │ │ │ -
170
│ │ │ │ -
171 case 3: // BGR_24
│ │ │ │ -
172 alpha = 0xff;
│ │ │ │ -
173 for(size_t i = 0 ; i < numPixels ; ++i)
│ │ │ │ -
174 {
│ │ │ │ -
175 blue = *(input++);
│ │ │ │ -
176 green = *(input++);
│ │ │ │ -
177 red = *(input++);
│ │ │ │ -
178 context->setNextPixel(red, green, blue, alpha);
│ │ │ │ -
179 }
│ │ │ │ -
180 break;
│ │ │ │ -
181
│ │ │ │ -
182 case 4: // BGRA_32
│ │ │ │ -
183 alpha = 0xff;
│ │ │ │ -
184 for(size_t i = 0 ; i < numPixels ; ++i)
│ │ │ │ -
185 {
│ │ │ │ -
186 blue = *(input++);
│ │ │ │ -
187 green = *(input++);
│ │ │ │ -
188 red = *(input++);
│ │ │ │ -
189 alpha = *(input++);
│ │ │ │ -
190 context->setNextPixel(red, green, blue, alpha);
│ │ │ │ -
191 }
│ │ │ │ -
192 break;
│ │ │ │ -
193 }
│ │ │ │ -
194 }
│ │ │ │ -
195 else
│ │ │ │ -
196 {
│ │ │ │ -
197 size_t pixelsRead = 0;
│ │ │ │ -
198 size_t num, i;
│ │ │ │ -
199 byte header;
│ │ │ │ -
200
│ │ │ │ -
201 switch(bpp)
│ │ │ │ -
202 {
│ │ │ │ -
203 case 2: //A1B5G5R5
│ │ │ │ -
204 while(pixelsRead < numPixels)
│ │ │ │ -
205 {
│ │ │ │ -
206 header = *(input++);
│ │ │ │ -
207 num = 1 + (header & 0x7f);
│ │ │ │ -
208 if (header & 0x80)
│ │ │ │ -
209 {
│ │ │ │ -
210 unsigned short pixel;
│ │ │ │ -
211 pixel = *(input++);
│ │ │ │ -
212 pixel = pixel << 8;
│ │ │ │ -
213 pixel |= *(input++);
│ │ │ │ -
214
│ │ │ │ -
215 alpha = pixel & 0xf000 ? 0xff : 0x00;
│ │ │ │ -
216 blue = static_cast<byte>((pixel & 0x1f) << 3);
│ │ │ │ -
217 green = static_cast<byte>(((pixel >> 5) & 0x1f) << 3);
│ │ │ │ -
218 red = static_cast<byte>(((pixel >> 10) & 0x1f) << 3);
│ │ │ │ -
219 for(i = 0 ; i < num ; ++i)
│ │ │ │ -
220 {
│ │ │ │ -
221 context->setNextPixel(red, green, blue, alpha);
│ │ │ │ -
222 }
│ │ │ │ -
223 }
│ │ │ │ -
224 else
│ │ │ │ -
225 {
│ │ │ │ -
226 for (i = 0 ; i < num ; ++i)
│ │ │ │ -
227 {
│ │ │ │ -
228 unsigned short pixel;
│ │ │ │ -
229 pixel = *(input++);
│ │ │ │ -
230 pixel = pixel << 8;
│ │ │ │ -
231 pixel |= *(input++);
│ │ │ │ -
232 alpha = pixel & 0xf000 ? 0xff : 0x00;
│ │ │ │ -
233 blue = static_cast<byte>((pixel & 0x1f) << 3);
│ │ │ │ -
234 green = static_cast<byte>(((pixel >> 5) & 0x1f) << 3);
│ │ │ │ -
235 red = static_cast<byte>(((pixel >> 10) & 0x1f) << 3);
│ │ │ │ -
236 context->setNextPixel(red, green, blue, alpha);
│ │ │ │ -
237 }
│ │ │ │ -
238 }
│ │ │ │ -
239 pixelsRead += num;
│ │ │ │ -
240 }
│ │ │ │ -
241
│ │ │ │ -
242 break;
│ │ │ │ -
243 case 3:
│ │ │ │ -
244 alpha = 0xff;
│ │ │ │ -
245 while(pixelsRead < numPixels)
│ │ │ │ -
246 {
│ │ │ │ -
247 header = *(input++);
│ │ │ │ -
248 num = 1 + (header & 0x7f);
│ │ │ │ -
249 if (header & 0x80)
│ │ │ │ -
250 {
│ │ │ │ -
251 blue = *(input++);
│ │ │ │ -
252 green = *(input++);
│ │ │ │ -
253 red = *(input++);
│ │ │ │ -
254 for(i = 0 ; i < num ; ++i)
│ │ │ │ -
255 {
│ │ │ │ -
256 context->setNextPixel(red, green, blue, alpha);
│ │ │ │ -
257 }
│ │ │ │ -
258 }
│ │ │ │ -
259 else
│ │ │ │ -
260 {
│ │ │ │ -
261 for (i = 0 ; i < num ; ++i)
│ │ │ │ -
262 {
│ │ │ │ -
263 blue = *(input++);
│ │ │ │ -
264 green = *(input++);
│ │ │ │ -
265 red = *(input++);
│ │ │ │ -
266 context->setNextPixel(red, green, blue, alpha);
│ │ │ │ -
267 }
│ │ │ │ -
268 }
│ │ │ │ -
269 pixelsRead += num;
│ │ │ │ -
270 }
│ │ │ │ -
271 break;
│ │ │ │ -
272
│ │ │ │ -
273 case 4:
│ │ │ │ -
274 while(pixelsRead < numPixels)
│ │ │ │ -
275 {
│ │ │ │ -
276 header = *(input++);
│ │ │ │ -
277 num = 1 + (header & 0x7f);
│ │ │ │ -
278 if (header & 0x80)
│ │ │ │ -
279 {
│ │ │ │ -
280 blue = *(input++);
│ │ │ │ -
281 green = *(input++);
│ │ │ │ -
282 red = *(input++);
│ │ │ │ -
283 alpha = *(input++);
│ │ │ │ -
284 for(i = 0 ; i < num ; ++i)
│ │ │ │ -
285 {
│ │ │ │ -
286 context->setNextPixel(red, green, blue, alpha);
│ │ │ │ -
287 }
│ │ │ │ -
288 }
│ │ │ │ -
289 else
│ │ │ │ -
290 {
│ │ │ │ -
291 for (i = 0 ; i < num ; ++i)
│ │ │ │ -
292 {
│ │ │ │ -
293 blue = *(input++);
│ │ │ │ -
294 green = *(input++);
│ │ │ │ -
295 red = *(input++);
│ │ │ │ -
296 alpha = *(input++);
│ │ │ │ -
297 context->setNextPixel(red, green, blue, alpha);
│ │ │ │ -
298 }
│ │ │ │ -
299 }
│ │ │ │ -
300 pixelsRead += num;
│ │ │ │ -
301 }
│ │ │ │ -
302 break;
│ │ │ │ -
303 }
│ │ │ │ -
304 }
│ │ │ │ -
305 // Flip or not flip that is the question
│ │ │ │ -
306 if ((tga->d_description & 0x10) == 0x10) // Upper Left origin
│ │ │ │ -
307 {
│ │ │ │ -
308 if (origin == PO_BOTTOM_LEFT)
│ │ │ │ -
309 return tga->flipVertically();
│ │ │ │ -
310 }
│ │ │ │ -
311 else
│ │ │ │ -
312 {
│ │ │ │ -
313 if (origin == PO_TOP_LEFT)
│ │ │ │ -
314 return tga->flipVertically();
│ │ │ │ -
315 }
│ │ │ │ -
316 return true;
│ │ │ │ -
317}
│ │ │ │ -
318
│ │ │ │ -
319} // End section of namespace SILLY
│ │ │ │ -
Simple Image Loading LibrarY namespace.
│ │ │ │ -
PixelFormat
List all pixel format supported.
Definition: SILLYBase.h:60
│ │ │ │ -
PixelOrigin
List all pixel origin supported.
Definition: SILLYBase.h:71
│ │ │ │ -
Image Context for Targa image.
│ │ │ │ -
This is an abstract class used to provide data to the loader.
│ │ │ │ +
76 setWidth(png_get_image_width(d_png_ptr, d_info_ptr));
│ │ │ │ +
77 setHeight(png_get_image_height(d_png_ptr, d_info_ptr));
│ │ │ │ +
78
│ │ │ │ +
79}
│ │ │ │ +
80
│ │ │ │ +
81
│ │ │ │ +
82} // End section of namespace SILLY
│ │ │ │ +
Simple Image Loading LibrarY namespace.
│ │ │ │ +
virtual size_t getSize() const =0
Return the size of the data.
│ │ │ │
virtual const byte * getDataPtr() const =0
Get raw access to the image data.
│ │ │ │ -
Store the data needed by an ImageLoader object during the parsing of an image.
│ │ │ │ -
void setNextPixel(byte red, byte green, byte bleu, byte alpha)
Set the next pixel of the image.
│ │ │ │ -
bool flipVertically()
Flip pixel ordering.
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,21 +5,21 @@ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ │ │ │ │ │ * build │ │ │ │ │ * reproducible-path │ │ │ │ │ * silly-0.1.0 │ │ │ │ │ * src │ │ │ │ │ * loaders │ │ │ │ │ -SILLYTGAImageLoader.cpp │ │ │ │ │ +SILLYPNGImageContext.cpp │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ - 2 filename: SILLYTGAImageLoader.cpp │ │ │ │ │ + 2 filename: SILLYPNGImageContext.cpp │ │ │ │ │ 3 created: 11 Jun 2006 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ - 6 purpose: Load TGA Image │ │ │ │ │ + 6 purpose: Definition of PNGImageContext methods │ │ │ │ │ 7*************************************************************************/ │ │ │ │ │ 8/*************************************************************************** │ │ │ │ │ 9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team │ │ │ │ │ 10 * │ │ │ │ │ 11 * Permission is hereby granted, free of charge, to any person obtaining │ │ │ │ │ 12 * a copy of this software and associated documentation files (the │ │ │ │ │ 13 * "Software"), to deal in the Software without restriction, including │ │ │ │ │ @@ -40,328 +40,68 @@ │ │ │ │ │ 28 * OTHER DEALINGS IN THE SOFTWARE. │ │ │ │ │ 29 │ │ │ │ │ ***************************************************************************/ │ │ │ │ │ 30#ifdef HAVE_CONFIG_H │ │ │ │ │ 31#include │ │ │ │ │ 32#endif │ │ │ │ │ 33 │ │ │ │ │ - 34#include "loaders/SILLYTGAImageLoader.h" │ │ │ │ │ + 34#include "loaders/SILLYPNGImageContext.h" │ │ │ │ │ 35 │ │ │ │ │ 36#ifndef SILLY_OPT_INLINE │ │ │ │ │ 37#define inline │ │ │ │ │ - 38#include "loaders/SILLYTGAImageLoader.icpp" │ │ │ │ │ + 38#include "loaders/SILLYPNGImageContext.icpp" │ │ │ │ │ 39#undef inline │ │ │ │ │ 40#endif │ │ │ │ │ - 41#include "SILLYDataSource.h" │ │ │ │ │ - 42#include "loaders/SILLYTGAImageContext.h" │ │ │ │ │ - 43 │ │ │ │ │ - 44#include │ │ │ │ │ - 45#include │ │ │ │ │ - 46 │ │ │ │ │ - 47// Start section of namespace SILLY │ │ │ │ │ - 48namespace SILLY │ │ │ │ │ - 49{ │ │ │ │ │ + 41#include │ │ │ │ │ + 42 │ │ │ │ │ + 43// Start section of namespace SILLY │ │ │ │ │ + 44namespace SILLY │ │ │ │ │ + 45{ │ │ │ │ │ + 46int PNGImageContext::read(png_bytep data, png_size_t length) │ │ │ │ │ + 47{ │ │ │ │ │ + 48 //printf("PNG Read: %d bytes offset: %d, size %d\n", │ │ │ │ │ + 49 // length, d_offset, d_data->getSize()); │ │ │ │ │ 50 │ │ │ │ │ - 51TGAImageLoader::TGAImageLoader() │ │ │ │ │ - 52 : ImageLoader("TGA Image loader (builtin)") │ │ │ │ │ - 53{ │ │ │ │ │ - 54} │ │ │ │ │ - 55 │ │ │ │ │ - 56TGAImageLoader::~TGAImageLoader() │ │ │ │ │ - 57{ │ │ │ │ │ - 58} │ │ │ │ │ - 59 │ │ │ │ │ - 60#ifdef SILLY_BE │ │ │ │ │ - 61#define READ_WORD(res, start) \ │ │ │ │ │ - 62 (res) = 0; \ │ │ │ │ │ - 63 (res) = data->getDataPtr()[(start) + 1]; \ │ │ │ │ │ - 64 (res) = (res) << 8; \ │ │ │ │ │ - 65 (res) |= data->getDataPtr()[(start)]; │ │ │ │ │ - 66#else │ │ │ │ │ - 67#define READ_WORD(res, start) \ │ │ │ │ │ - 68 (res) = 0; \ │ │ │ │ │ - 69 (res) = data->getDataPtr()[(start)]; \ │ │ │ │ │ - 70 (res) = (res) << 8; \ │ │ │ │ │ - 71 (res) |= data->getDataPtr()[(start) + 1]; │ │ │ │ │ - 72#endif │ │ │ │ │ + 51 if (d_offset + length > d_data->getSize()) │ │ │ │ │ + 52 return -1; │ │ │ │ │ + 53 memcpy(data, d_data->getDataPtr() + d_offset, length); │ │ │ │ │ + 54 d_offset += length; │ │ │ │ │ + 55 return length; │ │ │ │ │ + 56} │ │ │ │ │ + 57 │ │ │ │ │ + 58 │ │ │ │ │ + 59PNGImageContext::PNGImageContext(DataSource* data) │ │ │ │ │ + 60 : ImageContext(0,0), d_offset(0), d_data(data), d_png_ptr(0), d_info_ptr(0) │ │ │ │ │ + 61{ │ │ │ │ │ + 62 │ │ │ │ │ + 63} │ │ │ │ │ + 64 │ │ │ │ │ + 65PNGImageContext::~PNGImageContext() │ │ │ │ │ + 66{ │ │ │ │ │ + 67 if (d_info_ptr) │ │ │ │ │ + 68 png_destroy_read_struct(&d_png_ptr, &d_info_ptr, 0); │ │ │ │ │ + 69 if (d_png_ptr) │ │ │ │ │ + 70 png_destroy_read_struct(&d_png_ptr, 0, 0); │ │ │ │ │ + 71} │ │ │ │ │ + 72 │ │ │ │ │ 73 │ │ │ │ │ -74ImageContext* TGAImageLoader::loadHeader(PixelFormat& formatSource, │ │ │ │ │ -DataSource* data) │ │ │ │ │ + 74void PNGImageContext::setImageSize() │ │ │ │ │ 75{ │ │ │ │ │ - 76 byte idLength = data->getDataPtr()[0]; │ │ │ │ │ - 77 byte colorMapType = data->getDataPtr()[1]; │ │ │ │ │ - 78 byte imageType = data->getDataPtr()[2]; │ │ │ │ │ - 79 size_t width; │ │ │ │ │ - 80 size_t height; │ │ │ │ │ - 81 byte depth; │ │ │ │ │ - 82 byte description; │ │ │ │ │ - 83 if ((imageType != 2 && imageType != 10) || colorMapType) │ │ │ │ │ - 84 { │ │ │ │ │ - 85 // Unsupported image format │ │ │ │ │ - 86 return 0; │ │ │ │ │ - 87 } │ │ │ │ │ - 88 // offset: 3 Skip color map + 5 bytes │ │ │ │ │ - 89 // offset: 8 Skip xorg / yorg + 4 bytes │ │ │ │ │ - 90#ifdef SILLY_BE │ │ │ │ │ - 91 width = data->getDataPtr()[12]; │ │ │ │ │ - 92 width = width << 8; │ │ │ │ │ - 93 width |= data->getDataPtr()[13]; │ │ │ │ │ - 94 height = data->getDataPtr()[14]; │ │ │ │ │ - 95 height = height << 8; │ │ │ │ │ - 96 height |= data->getDataPtr()[15]; │ │ │ │ │ - 97#else │ │ │ │ │ - 98 width = data->getDataPtr()[13]; │ │ │ │ │ - 99 width = width << 8; │ │ │ │ │ - 100 width |= data->getDataPtr()[12]; │ │ │ │ │ - 101 height = data->getDataPtr()[15]; │ │ │ │ │ - 102 height = height << 8; │ │ │ │ │ - 103 height |= data->getDataPtr()[14]; │ │ │ │ │ - 104#endif │ │ │ │ │ - 105 depth = data->getDataPtr()[16] >> 3; │ │ │ │ │ - 106 switch (depth) │ │ │ │ │ - 107 { │ │ │ │ │ - 108 case 2: │ │ │ │ │ - 109 formatSource = PF_A1B5G5R5; │ │ │ │ │ - 110 break; │ │ │ │ │ - 111 case 3: │ │ │ │ │ - 112 formatSource = PF_RGB; │ │ │ │ │ - 113 break; │ │ │ │ │ - 114 case 4: │ │ │ │ │ - 115 formatSource = PF_RGBA; │ │ │ │ │ - 116 break; │ │ │ │ │ - 117 default: │ │ │ │ │ - 118 return 0; │ │ │ │ │ - 119 } │ │ │ │ │ - 120 description = (*data)[17]; │ │ │ │ │ - 121 │ │ │ │ │ - 122 │ │ │ │ │ - 123 TGAImageContext* context = new TGAImageContext(width, height); │ │ │ │ │ - 124 if (context) │ │ │ │ │ - 125 { │ │ │ │ │ - 126 context->d_idLength = idLength; │ │ │ │ │ - 127 context->d_imageType = imageType; │ │ │ │ │ - 128 context->d_depth = depth; │ │ │ │ │ - 129 context->d_description = description; │ │ │ │ │ - 130 } │ │ │ │ │ - 131 return context; │ │ │ │ │ - 132} │ │ │ │ │ - 133 │ │ │ │ │ -134bool TGAImageLoader::loadImageData(PixelOrigin origin, DataSource* data, │ │ │ │ │ -ImageContext* context) │ │ │ │ │ - 135{ │ │ │ │ │ - 136 TGAImageContext* tga = static_cast(context); │ │ │ │ │ - 137 size_t bpp = tga->d_depth; │ │ │ │ │ - 138 size_t w = tga->getWidth(); │ │ │ │ │ - 139 size_t h = tga->getHeight(); │ │ │ │ │ - 140 size_t imgSize = w * h * bpp; │ │ │ │ │ - 141 size_t offset = 18 + tga->d_idLength; │ │ │ │ │ - 142 size_t numPixels = w * h; │ │ │ │ │ - 143 const byte* input = data->getDataPtr() + offset; │ │ │ │ │ - 144 // Read image data │ │ │ │ │ - 145 byte red; │ │ │ │ │ - 146 byte green; │ │ │ │ │ - 147 byte blue; │ │ │ │ │ - 148 byte alpha; │ │ │ │ │ - 149 // Uncompressed │ │ │ │ │ - 150 if (tga->d_imageType == 2) │ │ │ │ │ - 151 { │ │ │ │ │ - 152 │ │ │ │ │ - 153 switch(bpp) │ │ │ │ │ - 154 { │ │ │ │ │ - 155 case 2: //A1B5G5R5 │ │ │ │ │ - 156 for(size_t i = 0 ; i < numPixels ; ++i) │ │ │ │ │ - 157 { │ │ │ │ │ - 158 unsigned short pixel; │ │ │ │ │ - 159 pixel = *(input++); │ │ │ │ │ - 160 pixel = pixel << 8; │ │ │ │ │ - 161 pixel |= *(input++); │ │ │ │ │ - 162 │ │ │ │ │ - 163 alpha = pixel & 0xf000 ? 0xff : 0x00; │ │ │ │ │ - 164 blue = static_cast((pixel & 0x1f) << 3); │ │ │ │ │ - 165 green = static_cast(((pixel >> 5) & 0x1f) << 3); │ │ │ │ │ - 166 red = static_cast(((pixel >> 10) & 0x1f) << 3); │ │ │ │ │ - 167 context->setNextPixel(red, green, blue, alpha); │ │ │ │ │ - 168 } │ │ │ │ │ - 169 break; │ │ │ │ │ - 170 │ │ │ │ │ - 171 case 3: // BGR_24 │ │ │ │ │ - 172 alpha = 0xff; │ │ │ │ │ - 173 for(size_t i = 0 ; i < numPixels ; ++i) │ │ │ │ │ - 174 { │ │ │ │ │ - 175 blue = *(input++); │ │ │ │ │ - 176 green = *(input++); │ │ │ │ │ - 177 red = *(input++); │ │ │ │ │ - 178 context->setNextPixel(red, green, blue, alpha); │ │ │ │ │ - 179 } │ │ │ │ │ - 180 break; │ │ │ │ │ - 181 │ │ │ │ │ - 182 case 4: // BGRA_32 │ │ │ │ │ - 183 alpha = 0xff; │ │ │ │ │ - 184 for(size_t i = 0 ; i < numPixels ; ++i) │ │ │ │ │ - 185 { │ │ │ │ │ - 186 blue = *(input++); │ │ │ │ │ - 187 green = *(input++); │ │ │ │ │ - 188 red = *(input++); │ │ │ │ │ - 189 alpha = *(input++); │ │ │ │ │ - 190 context->setNextPixel(red, green, blue, alpha); │ │ │ │ │ - 191 } │ │ │ │ │ - 192 break; │ │ │ │ │ - 193 } │ │ │ │ │ - 194 } │ │ │ │ │ - 195 else │ │ │ │ │ - 196 { │ │ │ │ │ - 197 size_t pixelsRead = 0; │ │ │ │ │ - 198 size_t num, i; │ │ │ │ │ - 199 byte header; │ │ │ │ │ - 200 │ │ │ │ │ - 201 switch(bpp) │ │ │ │ │ - 202 { │ │ │ │ │ - 203 case 2: //A1B5G5R5 │ │ │ │ │ - 204 while(pixelsRead < numPixels) │ │ │ │ │ - 205 { │ │ │ │ │ - 206 header = *(input++); │ │ │ │ │ - 207 num = 1 + (header & 0x7f); │ │ │ │ │ - 208 if (header & 0x80) │ │ │ │ │ - 209 { │ │ │ │ │ - 210 unsigned short pixel; │ │ │ │ │ - 211 pixel = *(input++); │ │ │ │ │ - 212 pixel = pixel << 8; │ │ │ │ │ - 213 pixel |= *(input++); │ │ │ │ │ - 214 │ │ │ │ │ - 215 alpha = pixel & 0xf000 ? 0xff : 0x00; │ │ │ │ │ - 216 blue = static_cast((pixel & 0x1f) << 3); │ │ │ │ │ - 217 green = static_cast(((pixel >> 5) & 0x1f) << 3); │ │ │ │ │ - 218 red = static_cast(((pixel >> 10) & 0x1f) << 3); │ │ │ │ │ - 219 for(i = 0 ; i < num ; ++i) │ │ │ │ │ - 220 { │ │ │ │ │ - 221 context->setNextPixel(red, green, blue, alpha); │ │ │ │ │ - 222 } │ │ │ │ │ - 223 } │ │ │ │ │ - 224 else │ │ │ │ │ - 225 { │ │ │ │ │ - 226 for (i = 0 ; i < num ; ++i) │ │ │ │ │ - 227 { │ │ │ │ │ - 228 unsigned short pixel; │ │ │ │ │ - 229 pixel = *(input++); │ │ │ │ │ - 230 pixel = pixel << 8; │ │ │ │ │ - 231 pixel |= *(input++); │ │ │ │ │ - 232 alpha = pixel & 0xf000 ? 0xff : 0x00; │ │ │ │ │ - 233 blue = static_cast((pixel & 0x1f) << 3); │ │ │ │ │ - 234 green = static_cast(((pixel >> 5) & 0x1f) << 3); │ │ │ │ │ - 235 red = static_cast(((pixel >> 10) & 0x1f) << 3); │ │ │ │ │ - 236 context->setNextPixel(red, green, blue, alpha); │ │ │ │ │ - 237 } │ │ │ │ │ - 238 } │ │ │ │ │ - 239 pixelsRead += num; │ │ │ │ │ - 240 } │ │ │ │ │ - 241 │ │ │ │ │ - 242 break; │ │ │ │ │ - 243 case 3: │ │ │ │ │ - 244 alpha = 0xff; │ │ │ │ │ - 245 while(pixelsRead < numPixels) │ │ │ │ │ - 246 { │ │ │ │ │ - 247 header = *(input++); │ │ │ │ │ - 248 num = 1 + (header & 0x7f); │ │ │ │ │ - 249 if (header & 0x80) │ │ │ │ │ - 250 { │ │ │ │ │ - 251 blue = *(input++); │ │ │ │ │ - 252 green = *(input++); │ │ │ │ │ - 253 red = *(input++); │ │ │ │ │ - 254 for(i = 0 ; i < num ; ++i) │ │ │ │ │ - 255 { │ │ │ │ │ - 256 context->setNextPixel(red, green, blue, alpha); │ │ │ │ │ - 257 } │ │ │ │ │ - 258 } │ │ │ │ │ - 259 else │ │ │ │ │ - 260 { │ │ │ │ │ - 261 for (i = 0 ; i < num ; ++i) │ │ │ │ │ - 262 { │ │ │ │ │ - 263 blue = *(input++); │ │ │ │ │ - 264 green = *(input++); │ │ │ │ │ - 265 red = *(input++); │ │ │ │ │ - 266 context->setNextPixel(red, green, blue, alpha); │ │ │ │ │ - 267 } │ │ │ │ │ - 268 } │ │ │ │ │ - 269 pixelsRead += num; │ │ │ │ │ - 270 } │ │ │ │ │ - 271 break; │ │ │ │ │ - 272 │ │ │ │ │ - 273 case 4: │ │ │ │ │ - 274 while(pixelsRead < numPixels) │ │ │ │ │ - 275 { │ │ │ │ │ - 276 header = *(input++); │ │ │ │ │ - 277 num = 1 + (header & 0x7f); │ │ │ │ │ - 278 if (header & 0x80) │ │ │ │ │ - 279 { │ │ │ │ │ - 280 blue = *(input++); │ │ │ │ │ - 281 green = *(input++); │ │ │ │ │ - 282 red = *(input++); │ │ │ │ │ - 283 alpha = *(input++); │ │ │ │ │ - 284 for(i = 0 ; i < num ; ++i) │ │ │ │ │ - 285 { │ │ │ │ │ - 286 context->setNextPixel(red, green, blue, alpha); │ │ │ │ │ - 287 } │ │ │ │ │ - 288 } │ │ │ │ │ - 289 else │ │ │ │ │ - 290 { │ │ │ │ │ - 291 for (i = 0 ; i < num ; ++i) │ │ │ │ │ - 292 { │ │ │ │ │ - 293 blue = *(input++); │ │ │ │ │ - 294 green = *(input++); │ │ │ │ │ - 295 red = *(input++); │ │ │ │ │ - 296 alpha = *(input++); │ │ │ │ │ - 297 context->setNextPixel(red, green, blue, alpha); │ │ │ │ │ - 298 } │ │ │ │ │ - 299 } │ │ │ │ │ - 300 pixelsRead += num; │ │ │ │ │ - 301 } │ │ │ │ │ - 302 break; │ │ │ │ │ - 303 } │ │ │ │ │ - 304 } │ │ │ │ │ - 305 // Flip or not flip that is the question │ │ │ │ │ - 306 if ((tga->d_description & 0x10) == 0x10) // Upper Left origin │ │ │ │ │ - 307 { │ │ │ │ │ - 308 if (origin == PO_BOTTOM_LEFT) │ │ │ │ │ - 309 return tga->flipVertically(); │ │ │ │ │ - 310 } │ │ │ │ │ - 311 else │ │ │ │ │ - 312 { │ │ │ │ │ - 313 if (origin == PO_TOP_LEFT) │ │ │ │ │ - 314 return tga->flipVertically(); │ │ │ │ │ - 315 } │ │ │ │ │ - 316 return true; │ │ │ │ │ - 317} │ │ │ │ │ - 318 │ │ │ │ │ - 319} // End section of namespace SILLY │ │ │ │ │ + 76 setWidth(png_get_image_width(d_png_ptr, d_info_ptr)); │ │ │ │ │ + 77 setHeight(png_get_image_height(d_png_ptr, d_info_ptr)); │ │ │ │ │ + 78 │ │ │ │ │ + 79} │ │ │ │ │ + 80 │ │ │ │ │ + 81 │ │ │ │ │ + 82} // End section of namespace SILLY │ │ │ │ │ SILLY │ │ │ │ │ Simple Image Loading LibrarY namespace. │ │ │ │ │ Definition: SILLYJPGImageContext.cpp:46 │ │ │ │ │ -SILLY::PixelFormat │ │ │ │ │ -PixelFormat │ │ │ │ │ -List all pixel format supported. │ │ │ │ │ -Definition: SILLYBase.h:60 │ │ │ │ │ -SILLY::PixelOrigin │ │ │ │ │ -PixelOrigin │ │ │ │ │ -List all pixel origin supported. │ │ │ │ │ -Definition: SILLYBase.h:71 │ │ │ │ │ -SILLY::TGAImageContext │ │ │ │ │ -Image Context for Targa image. │ │ │ │ │ -Definition: SILLYTGAImageContext.h:43 │ │ │ │ │ -SILLY::DataSource │ │ │ │ │ -This is an abstract class used to provide data to the loader. │ │ │ │ │ -Definition: SILLYDataSource.h:47 │ │ │ │ │ +SILLY::DataSource::getSize │ │ │ │ │ +virtual size_t getSize() const =0 │ │ │ │ │ +Return the size of the data. │ │ │ │ │ SILLY::DataSource::getDataPtr │ │ │ │ │ virtual const byte * getDataPtr() const =0 │ │ │ │ │ Get raw access to the image data. │ │ │ │ │ -SILLY::ImageContext │ │ │ │ │ -Store the data needed by an ImageLoader object during the parsing of an image. │ │ │ │ │ -Definition: SILLYImageContext.h:44 │ │ │ │ │ -SILLY::ImageContext::setNextPixel │ │ │ │ │ -void setNextPixel(byte red, byte green, byte bleu, byte alpha) │ │ │ │ │ -Set the next pixel of the image. │ │ │ │ │ -SILLY::ImageContext::flipVertically │ │ │ │ │ -bool flipVertically() │ │ │ │ │ -Flip pixel ordering. │ │ │ │ │ -Definition: SILLYImageContext.cpp:45 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libsilly-doc/html/a00014_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/src/loaders/SILLYJPGImageLoader.cpp Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/src/loaders/SILLYTGAImageContext.cpp Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -39,23 +39,23 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYJPGImageLoader.cpp
│ │ │ │ +
SILLYTGAImageContext.cpp
│ │ │ │
│ │ │ │
│ │ │ │
1/***********************************************************************
│ │ │ │ -
2 filename: SILLYJPGImageLoader.cpp
│ │ │ │ +
2 filename: SILLYTGAImageContext.cpp
│ │ │ │
3 created: 11 Jun 2006
│ │ │ │
4 author: Olivier Delannoy
│ │ │ │
5
│ │ │ │ -
6 purpose: Definition of JPGImageLoader methods
│ │ │ │ +
6 purpose: Definition of the TGAImageContext methods
│ │ │ │
7*************************************************************************/
│ │ │ │
8/***************************************************************************
│ │ │ │
9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
│ │ │ │
10 *
│ │ │ │
11 * Permission is hereby granted, free of charge, to any person obtaining
│ │ │ │
12 * a copy of this software and associated documentation files (the
│ │ │ │
13 * "Software"), to deal in the Software without restriction, including
│ │ │ │ @@ -75,146 +75,31 @@ │ │ │ │
27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
│ │ │ │
28 * OTHER DEALINGS IN THE SOFTWARE.
│ │ │ │
29 ***************************************************************************/
│ │ │ │
30#ifdef HAVE_CONFIG_H
│ │ │ │
31#include <config.h>
│ │ │ │
32#endif
│ │ │ │
33
│ │ │ │ -
34#include "loaders/SILLYJPGImageLoader.h"
│ │ │ │ +
34#include "loaders/SILLYTGAImageContext.h"
│ │ │ │
35
│ │ │ │
36#ifndef SILLY_OPT_INLINE
│ │ │ │
37#define inline
│ │ │ │ -
38#include "loaders/SILLYJPGImageLoader.icpp"
│ │ │ │ +
38#include "loaders/SILLYTGAImageContext.icpp"
│ │ │ │
39#undef inline
│ │ │ │ -
40#endif
│ │ │ │ -
41#include "loaders/SILLYJPGImageContext.h"
│ │ │ │ -
42
│ │ │ │ +
40#endif
│ │ │ │ +
41#include <cstring>
│ │ │ │ +
42#include <cstdio>
│ │ │ │
43// Start section of namespace SILLY
│ │ │ │
44namespace SILLY
│ │ │ │
45{
│ │ │ │ -
46JPGImageLoader::JPGImageLoader()
│ │ │ │ -
47 : ImageLoader("JPG Image Loader based on jpeg-6b")
│ │ │ │ -
48{
│ │ │ │ -
49}
│ │ │ │ -
50
│ │ │ │ -
51JPGImageLoader::~JPGImageLoader()
│ │ │ │ -
52{
│ │ │ │ -
53}
│ │ │ │ -
54
│ │ │ │ -
55
│ │ │ │ -
56ImageContext* JPGImageLoader::loadHeader(PixelFormat& formatSource, DataSource* data)
│ │ │ │ -
57{
│ │ │ │ - │ │ │ │ -
59 jpg->d_source = data;
│ │ │ │ -
60
│ │ │ │ -
61 if (! jpg)
│ │ │ │ -
62 return 0;
│ │ │ │ -
63 if (setjmp(jpg->setjmp_buffer))
│ │ │ │ -
64 {
│ │ │ │ -
65 delete jpg;
│ │ │ │ -
66 return 0;
│ │ │ │ -
67 }
│ │ │ │ -
68 jpeg_read_header(&(jpg->cinfo), TRUE);
│ │ │ │ -
69 if (! jpeg_start_decompress(&(jpg->cinfo)))
│ │ │ │ -
70 {
│ │ │ │ -
71 delete jpg;
│ │ │ │ -
72 return 0;
│ │ │ │ -
73 }
│ │ │ │ -
74
│ │ │ │ -
75
│ │ │ │ -
76 if (jpg->cinfo.output_components != 1 && jpg->cinfo.output_components != 3)
│ │ │ │ -
77 {
│ │ │ │ -
78 printf("JPG unsupported bpp: %d\n", jpg->cinfo.output_components );
│ │ │ │ -
79 jpeg_finish_decompress(& jpg->cinfo);
│ │ │ │ -
80 delete jpg;
│ │ │ │ -
81 return 0;
│ │ │ │ -
82 }
│ │ │ │ -
83 formatSource = PF_RGB; // It's not true but we handle both the same way
│ │ │ │ -
84 //printf("Image info: size: %dx%d - bpp: %d\n", jpg->cinfo.output_width, jpg->cinfo.output_height, jpg->cinfo.output_components);
│ │ │ │ -
85
│ │ │ │ -
86 jpg->setImageSize();
│ │ │ │ -
87 return jpg;
│ │ │ │ -
88}
│ │ │ │ -
89
│ │ │ │ -
90bool JPGImageLoader::loadImageData(PixelOrigin origin,
│ │ │ │ -
91 DataSource* data,
│ │ │ │ -
92 ImageContext* context)
│ │ │ │ -
93{
│ │ │ │ -
94 JPGImageContext* jpg = static_cast<JPGImageContext*>(context);
│ │ │ │ -
95
│ │ │ │ -
96 // Allocate a buffer
│ │ │ │ -
97 int row_stride = jpg->getWidth() * jpg->cinfo.output_components;
│ │ │ │ -
98 JSAMPARRAY buffer = (* jpg->cinfo.mem->alloc_sarray)(
│ │ │ │ -
99 (j_common_ptr)(& jpg->cinfo),
│ │ │ │ -
100 JPOOL_IMAGE,
│ │ │ │ -
101 row_stride,
│ │ │ │ -
102 1);
│ │ │ │ -
103 bool finished = true;
│ │ │ │ -
104 size_t height = jpg->getHeight();
│ │ │ │ -
105 size_t width = jpg->getWidth();
│ │ │ │ -
106
│ │ │ │ -
107
│ │ │ │ -
108 while(jpg->cinfo.output_scanline < height)
│ │ │ │ -
109 {
│ │ │ │ -
110 int num_rows = jpeg_read_scanlines(& jpg->cinfo, buffer, 1);
│ │ │ │ -
111 if (num_rows != 1)
│ │ │ │ -
112 {
│ │ │ │ -
113 jpeg_finish_decompress(& jpg->cinfo);
│ │ │ │ -
114 return false;
│ │ │ │ -
115 }
│ │ │ │ -
116 byte red;
│ │ │ │ -
117 byte green;
│ │ │ │ -
118 byte blue;
│ │ │ │ -
119 const byte alpha = 0xff;
│ │ │ │ -
120 byte* in = (byte*)(*buffer);
│ │ │ │ -
121 // Grayscale image
│ │ │ │ -
122 if (jpg->cinfo.output_components == 1)
│ │ │ │ -
123 {
│ │ │ │ -
124 for(size_t i = 0 ; i < width * num_rows ; ++i)
│ │ │ │ -
125 {
│ │ │ │ -
126 red = *in;
│ │ │ │ -
127 green = *in;
│ │ │ │ -
128 blue = *in;
│ │ │ │ -
129 jpg->setNextPixel(red, green, blue, alpha);
│ │ │ │ -
130 in += 1;
│ │ │ │ -
131 }
│ │ │ │ -
132 }
│ │ │ │ -
133 // RGB image
│ │ │ │ -
134 else
│ │ │ │ -
135 {
│ │ │ │ -
136 for(size_t i = 0 ; i < width * num_rows ; ++i)
│ │ │ │ -
137 {
│ │ │ │ -
138 red = *(in++);
│ │ │ │ -
139 green = *(in++);
│ │ │ │ -
140 blue = *(in++);
│ │ │ │ -
141 jpg->setNextPixel(red, green, blue, alpha);
│ │ │ │ -
142 }
│ │ │ │ -
143 }
│ │ │ │ -
144 }
│ │ │ │ -
145 jpeg_finish_decompress(& jpg->cinfo);
│ │ │ │ -
146
│ │ │ │ -
147 if (origin == PO_BOTTOM_LEFT)
│ │ │ │ -
148 return jpg->flipVertically();
│ │ │ │ -
149 return true;
│ │ │ │ -
150}
│ │ │ │ -
151
│ │ │ │ -
152
│ │ │ │ -
153
│ │ │ │ -
154
│ │ │ │ -
155
│ │ │ │ -
156
│ │ │ │ -
157} // End section of namespace SILLY
│ │ │ │ -
Simple Image Loading LibrarY namespace.
│ │ │ │ -
PixelFormat
List all pixel format supported.
Definition: SILLYBase.h:60
│ │ │ │ -
PixelOrigin
List all pixel origin supported.
Definition: SILLYBase.h:71
│ │ │ │ -
Image Context for JPG image loader.
│ │ │ │ -
This is an abstract class used to provide data to the loader.
│ │ │ │ -
Store the data needed by an ImageLoader object during the parsing of an image.
│ │ │ │ -
void setNextPixel(byte red, byte green, byte bleu, byte alpha)
Set the next pixel of the image.
│ │ │ │ -
bool flipVertically()
Flip pixel ordering.
│ │ │ │ +
46
│ │ │ │ +
47
│ │ │ │ +
48
│ │ │ │ +
49} // End section of namespace SILLY
│ │ │ │ +
Simple Image Loading LibrarY namespace.
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,21 +5,21 @@ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ │ │ │ │ │ * build │ │ │ │ │ * reproducible-path │ │ │ │ │ * silly-0.1.0 │ │ │ │ │ * src │ │ │ │ │ * loaders │ │ │ │ │ -SILLYJPGImageLoader.cpp │ │ │ │ │ +SILLYTGAImageContext.cpp │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ - 2 filename: SILLYJPGImageLoader.cpp │ │ │ │ │ + 2 filename: SILLYTGAImageContext.cpp │ │ │ │ │ 3 created: 11 Jun 2006 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ - 6 purpose: Definition of JPGImageLoader methods │ │ │ │ │ + 6 purpose: Definition of the TGAImageContext methods │ │ │ │ │ 7*************************************************************************/ │ │ │ │ │ 8/*************************************************************************** │ │ │ │ │ 9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team │ │ │ │ │ 10 * │ │ │ │ │ 11 * Permission is hereby granted, free of charge, to any person obtaining │ │ │ │ │ 12 * a copy of this software and associated documentation files (the │ │ │ │ │ 13 * "Software"), to deal in the Software without restriction, including │ │ │ │ │ @@ -40,163 +40,29 @@ │ │ │ │ │ 28 * OTHER DEALINGS IN THE SOFTWARE. │ │ │ │ │ 29 │ │ │ │ │ ***************************************************************************/ │ │ │ │ │ 30#ifdef HAVE_CONFIG_H │ │ │ │ │ 31#include │ │ │ │ │ 32#endif │ │ │ │ │ 33 │ │ │ │ │ - 34#include "loaders/SILLYJPGImageLoader.h" │ │ │ │ │ + 34#include "loaders/SILLYTGAImageContext.h" │ │ │ │ │ 35 │ │ │ │ │ 36#ifndef SILLY_OPT_INLINE │ │ │ │ │ 37#define inline │ │ │ │ │ - 38#include "loaders/SILLYJPGImageLoader.icpp" │ │ │ │ │ + 38#include "loaders/SILLYTGAImageContext.icpp" │ │ │ │ │ 39#undef inline │ │ │ │ │ 40#endif │ │ │ │ │ - 41#include "loaders/SILLYJPGImageContext.h" │ │ │ │ │ - 42 │ │ │ │ │ + 41#include │ │ │ │ │ + 42#include │ │ │ │ │ 43// Start section of namespace SILLY │ │ │ │ │ 44namespace SILLY │ │ │ │ │ 45{ │ │ │ │ │ - 46JPGImageLoader::JPGImageLoader() │ │ │ │ │ - 47 : ImageLoader("JPG Image Loader based on jpeg-6b") │ │ │ │ │ - 48{ │ │ │ │ │ - 49} │ │ │ │ │ - 50 │ │ │ │ │ - 51JPGImageLoader::~JPGImageLoader() │ │ │ │ │ - 52{ │ │ │ │ │ - 53} │ │ │ │ │ - 54 │ │ │ │ │ - 55 │ │ │ │ │ -56ImageContext* JPGImageLoader::loadHeader(PixelFormat& formatSource, │ │ │ │ │ -DataSource* data) │ │ │ │ │ - 57{ │ │ │ │ │ - 58 JPGImageContext* jpg = new JPGImageContext; │ │ │ │ │ - 59 jpg->d_source = data; │ │ │ │ │ - 60 │ │ │ │ │ - 61 if (! jpg) │ │ │ │ │ - 62 return 0; │ │ │ │ │ - 63 if (setjmp(jpg->setjmp_buffer)) │ │ │ │ │ - 64 { │ │ │ │ │ - 65 delete jpg; │ │ │ │ │ - 66 return 0; │ │ │ │ │ - 67 } │ │ │ │ │ - 68 jpeg_read_header(&(jpg->cinfo), TRUE); │ │ │ │ │ - 69 if (! jpeg_start_decompress(&(jpg->cinfo))) │ │ │ │ │ - 70 { │ │ │ │ │ - 71 delete jpg; │ │ │ │ │ - 72 return 0; │ │ │ │ │ - 73 } │ │ │ │ │ - 74 │ │ │ │ │ - 75 │ │ │ │ │ - 76 if (jpg->cinfo.output_components != 1 && jpg->cinfo.output_components != 3) │ │ │ │ │ - 77 { │ │ │ │ │ - 78 printf("JPG unsupported bpp: %d\n", jpg->cinfo.output_components ); │ │ │ │ │ - 79 jpeg_finish_decompress(& jpg->cinfo); │ │ │ │ │ - 80 delete jpg; │ │ │ │ │ - 81 return 0; │ │ │ │ │ - 82 } │ │ │ │ │ - 83 formatSource = PF_RGB; // It's not true but we handle both the same way │ │ │ │ │ - 84 //printf("Image info: size: %dx%d - bpp: %d\n", jpg->cinfo.output_width, │ │ │ │ │ -jpg->cinfo.output_height, jpg->cinfo.output_components); │ │ │ │ │ - 85 │ │ │ │ │ - 86 jpg->setImageSize(); │ │ │ │ │ - 87 return jpg; │ │ │ │ │ - 88} │ │ │ │ │ - 89 │ │ │ │ │ -90bool JPGImageLoader::loadImageData(PixelOrigin origin, │ │ │ │ │ - 91 DataSource* data, │ │ │ │ │ - 92 ImageContext* context) │ │ │ │ │ - 93{ │ │ │ │ │ - 94 JPGImageContext* jpg = static_cast(context); │ │ │ │ │ - 95 │ │ │ │ │ - 96 // Allocate a buffer │ │ │ │ │ - 97 int row_stride = jpg->getWidth() * jpg->cinfo.output_components; │ │ │ │ │ - 98 JSAMPARRAY buffer = (* jpg->cinfo.mem->alloc_sarray)( │ │ │ │ │ - 99 (j_common_ptr)(& jpg->cinfo), │ │ │ │ │ - 100 JPOOL_IMAGE, │ │ │ │ │ - 101 row_stride, │ │ │ │ │ - 102 1); │ │ │ │ │ - 103 bool finished = true; │ │ │ │ │ - 104 size_t height = jpg->getHeight(); │ │ │ │ │ - 105 size_t width = jpg->getWidth(); │ │ │ │ │ - 106 │ │ │ │ │ - 107 │ │ │ │ │ - 108 while(jpg->cinfo.output_scanline < height) │ │ │ │ │ - 109 { │ │ │ │ │ - 110 int num_rows = jpeg_read_scanlines(& jpg->cinfo, buffer, 1); │ │ │ │ │ - 111 if (num_rows != 1) │ │ │ │ │ - 112 { │ │ │ │ │ - 113 jpeg_finish_decompress(& jpg->cinfo); │ │ │ │ │ - 114 return false; │ │ │ │ │ - 115 } │ │ │ │ │ - 116 byte red; │ │ │ │ │ - 117 byte green; │ │ │ │ │ - 118 byte blue; │ │ │ │ │ - 119 const byte alpha = 0xff; │ │ │ │ │ - 120 byte* in = (byte*)(*buffer); │ │ │ │ │ - 121 // Grayscale image │ │ │ │ │ - 122 if (jpg->cinfo.output_components == 1) │ │ │ │ │ - 123 { │ │ │ │ │ - 124 for(size_t i = 0 ; i < width * num_rows ; ++i) │ │ │ │ │ - 125 { │ │ │ │ │ - 126 red = *in; │ │ │ │ │ - 127 green = *in; │ │ │ │ │ - 128 blue = *in; │ │ │ │ │ - 129 jpg->setNextPixel(red, green, blue, alpha); │ │ │ │ │ - 130 in += 1; │ │ │ │ │ - 131 } │ │ │ │ │ - 132 } │ │ │ │ │ - 133 // RGB image │ │ │ │ │ - 134 else │ │ │ │ │ - 135 { │ │ │ │ │ - 136 for(size_t i = 0 ; i < width * num_rows ; ++i) │ │ │ │ │ - 137 { │ │ │ │ │ - 138 red = *(in++); │ │ │ │ │ - 139 green = *(in++); │ │ │ │ │ - 140 blue = *(in++); │ │ │ │ │ - 141 jpg->setNextPixel(red, green, blue, alpha); │ │ │ │ │ - 142 } │ │ │ │ │ - 143 } │ │ │ │ │ - 144 } │ │ │ │ │ - 145 jpeg_finish_decompress(& jpg->cinfo); │ │ │ │ │ - 146 │ │ │ │ │ - 147 if (origin == PO_BOTTOM_LEFT) │ │ │ │ │ - 148 return jpg->flipVertically(); │ │ │ │ │ - 149 return true; │ │ │ │ │ - 150} │ │ │ │ │ - 151 │ │ │ │ │ - 152 │ │ │ │ │ - 153 │ │ │ │ │ - 154 │ │ │ │ │ - 155 │ │ │ │ │ - 156 │ │ │ │ │ - 157} // End section of namespace SILLY │ │ │ │ │ + 46 │ │ │ │ │ + 47 │ │ │ │ │ + 48 │ │ │ │ │ + 49} // End section of namespace SILLY │ │ │ │ │ SILLY │ │ │ │ │ Simple Image Loading LibrarY namespace. │ │ │ │ │ Definition: SILLYJPGImageContext.cpp:46 │ │ │ │ │ -SILLY::PixelFormat │ │ │ │ │ -PixelFormat │ │ │ │ │ -List all pixel format supported. │ │ │ │ │ -Definition: SILLYBase.h:60 │ │ │ │ │ -SILLY::PixelOrigin │ │ │ │ │ -PixelOrigin │ │ │ │ │ -List all pixel origin supported. │ │ │ │ │ -Definition: SILLYBase.h:71 │ │ │ │ │ -SILLY::JPGImageContext │ │ │ │ │ -Image Context for JPG image loader. │ │ │ │ │ -Definition: SILLYJPGImageContext.h:57 │ │ │ │ │ -SILLY::DataSource │ │ │ │ │ -This is an abstract class used to provide data to the loader. │ │ │ │ │ -Definition: SILLYDataSource.h:47 │ │ │ │ │ -SILLY::ImageContext │ │ │ │ │ -Store the data needed by an ImageLoader object during the parsing of an image. │ │ │ │ │ -Definition: SILLYImageContext.h:44 │ │ │ │ │ -SILLY::ImageContext::setNextPixel │ │ │ │ │ -void setNextPixel(byte red, byte green, byte bleu, byte alpha) │ │ │ │ │ -Set the next pixel of the image. │ │ │ │ │ -SILLY::ImageContext::flipVertically │ │ │ │ │ -bool flipVertically() │ │ │ │ │ -Flip pixel ordering. │ │ │ │ │ -Definition: SILLYImageContext.cpp:45 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libsilly-doc/html/a00017_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/src/loaders/SILLYTGAImageContext.cpp Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/src/loaders/SILLYPNGImageLoader.cpp Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -39,23 +39,23 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYTGAImageContext.cpp
│ │ │ │ +
SILLYPNGImageLoader.cpp
│ │ │ │
│ │ │ │
│ │ │ │
1/***********************************************************************
│ │ │ │ -
2 filename: SILLYTGAImageContext.cpp
│ │ │ │ +
2 filename: SILLYPNGImageLoader.cpp
│ │ │ │
3 created: 11 Jun 2006
│ │ │ │ -
4 author: Olivier Delannoy
│ │ │ │ +
4 author: Olivier Delannoy
│ │ │ │
5
│ │ │ │ -
6 purpose: Definition of the TGAImageContext methods
│ │ │ │ +
6 purpose: Definition of the PNGImageLoader methods
│ │ │ │
7*************************************************************************/
│ │ │ │
8/***************************************************************************
│ │ │ │
9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
│ │ │ │
10 *
│ │ │ │
11 * Permission is hereby granted, free of charge, to any person obtaining
│ │ │ │
12 * a copy of this software and associated documentation files (the
│ │ │ │
13 * "Software"), to deal in the Software without restriction, including
│ │ │ │ @@ -73,33 +73,198 @@ │ │ │ │
25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
│ │ │ │
26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
│ │ │ │
27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
│ │ │ │
28 * OTHER DEALINGS IN THE SOFTWARE.
│ │ │ │
29 ***************************************************************************/
│ │ │ │
30#ifdef HAVE_CONFIG_H
│ │ │ │
31#include <config.h>
│ │ │ │ -
32#endif
│ │ │ │ -
33
│ │ │ │ -
34#include "loaders/SILLYTGAImageContext.h"
│ │ │ │ -
35
│ │ │ │ -
36#ifndef SILLY_OPT_INLINE
│ │ │ │ -
37#define inline
│ │ │ │ -
38#include "loaders/SILLYTGAImageContext.icpp"
│ │ │ │ -
39#undef inline
│ │ │ │ -
40#endif
│ │ │ │ -
41#include <cstring>
│ │ │ │ -
42#include <cstdio>
│ │ │ │ -
43// Start section of namespace SILLY
│ │ │ │ -
44namespace SILLY
│ │ │ │ -
45{
│ │ │ │ -
46
│ │ │ │ -
47
│ │ │ │ -
48
│ │ │ │ -
49} // End section of namespace SILLY
│ │ │ │ -
Simple Image Loading LibrarY namespace.
│ │ │ │ +
32#include <string.h>
│ │ │ │ +
33#endif
│ │ │ │ +
34
│ │ │ │ +
35#include "loaders/SILLYPNGImageLoader.h"
│ │ │ │ +
36
│ │ │ │ +
37#ifndef SILLY_OPT_INLINE
│ │ │ │ +
38#define inline
│ │ │ │ +
39#include "loaders/SILLYPNGImageLoader.icpp"
│ │ │ │ +
40#undef inline
│ │ │ │ +
41#endif
│ │ │ │ +
42
│ │ │ │ +
43#include "loaders/SILLYPNGImageContext.h"
│ │ │ │ +
44#include <png.h>
│ │ │ │ +
45// Start section of namespace SILLY
│ │ │ │ +
46namespace SILLY
│ │ │ │ +
47{
│ │ │ │ +
48void PNG_read_function(png_structp png_ptr, png_bytep data, png_size_t length)
│ │ │ │ +
49{
│ │ │ │ +
50 PNGImageContext* png = reinterpret_cast<PNGImageContext*>(png_get_io_ptr(png_ptr));
│ │ │ │ +
51 int readed = png->read(data, length);
│ │ │ │ +
52 if (readed != (int)length)
│ │ │ │ +
53 {
│ │ │ │ +
54 png_error(png_ptr, "PNG_read_function error");
│ │ │ │ +
55 }
│ │ │ │ +
56}
│ │ │ │ +
57
│ │ │ │ +
58void PNG_warning_function(png_structp png_ptr,
│ │ │ │ +
59 png_const_charp error)
│ │ │ │ +
60{
│ │ │ │ +
61// printf("PNG Warning: %s\n", error);
│ │ │ │ +
62}
│ │ │ │ +
63
│ │ │ │ +
64void PNG_error_function(png_structp png_ptr,
│ │ │ │ +
65 png_const_charp error)
│ │ │ │ +
66{
│ │ │ │ +
67 // printf("PNG Error: %s\n", error);
│ │ │ │ +
68 // copied from libpng's pngerror.cpp
│ │ │ │ +
69 jmp_buf buf;
│ │ │ │ +
70#if PNG_LIBPNG_VER_MAJOR >= 1 && PNG_LIBPNG_VER_MINOR >= 4
│ │ │ │ +
71 memcpy(buf, png_jmpbuf((png_ptr)), sizeof(jmp_buf));
│ │ │ │ +
72#else
│ │ │ │ +
73 memcpy(buf, png_ptr->jmpbuf, sizeof(jmp_buf));
│ │ │ │ +
74#endif
│ │ │ │ +
75 longjmp(buf, 1);
│ │ │ │ +
76}
│ │ │ │ +
77
│ │ │ │ +
78
│ │ │ │ +
79PNGImageLoader::PNGImageLoader()
│ │ │ │ +
80 : ImageLoader("PNG Image Loader based on libpng")
│ │ │ │ +
81{
│ │ │ │ +
82}
│ │ │ │ +
83PNGImageLoader::~PNGImageLoader()
│ │ │ │ +
84{
│ │ │ │ +
85}
│ │ │ │ +
86
│ │ │ │ +
87
│ │ │ │ +
88ImageContext* PNGImageLoader::loadHeader(PixelFormat& formatSource, DataSource* data)
│ │ │ │ +
89{
│ │ │ │ +
90 PNGImageContext* png = new PNGImageContext(data);
│ │ │ │ +
91 if (!png)
│ │ │ │ +
92 {
│ │ │ │ +
93 return 0;
│ │ │ │ +
94
│ │ │ │ +
95 }
│ │ │ │ +
96 // Prepare png loading
│ │ │ │ +
97 png->d_png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, 0, 0, 0);
│ │ │ │ +
98 if (png->d_png_ptr == 0)
│ │ │ │ +
99 {
│ │ │ │ +
100 delete png;
│ │ │ │ +
101 return 0;
│ │ │ │ +
102 }
│ │ │ │ +
103 png->d_info_ptr = png_create_info_struct(png->d_png_ptr);
│ │ │ │ +
104 if (png->d_info_ptr == 0)
│ │ │ │ +
105 {
│ │ │ │ +
106 delete png;
│ │ │ │ +
107 return 0;
│ │ │ │ +
108 }
│ │ │ │ +
109 if (setjmp(png_jmpbuf(png->d_png_ptr)))
│ │ │ │ +
110 {
│ │ │ │ +
111 delete png;
│ │ │ │ +
112 return 0;
│ │ │ │ +
113 }
│ │ │ │ +
114 png_set_error_fn(png->d_png_ptr, 0, PNG_error_function, PNG_warning_function);
│ │ │ │ +
115 png_set_read_fn(png->d_png_ptr, png, PNG_read_function);
│ │ │ │ +
116 //png_set_sig_bytes(png->d_png_ptr, 8);
│ │ │ │ +
117
│ │ │ │ +
118
│ │ │ │ +
119
│ │ │ │ +
120 // Read header Check whether PNG can depaletize transparently or not
│ │ │ │ +
121 int png_transform = PNG_TRANSFORM_STRIP_16 | PNG_TRANSFORM_EXPAND;
│ │ │ │ +
122 //printf("Start reading png\n");
│ │ │ │ +
123 png_read_png(png->d_png_ptr, png->d_info_ptr, png_transform, 0);
│ │ │ │ +
124 png->setImageSize();
│ │ │ │ +
125 png->d_bit_depth = png_get_bit_depth(png->d_png_ptr, png->d_info_ptr);
│ │ │ │ +
126 png->d_num_channels = png_get_channels(png->d_png_ptr, png->d_info_ptr);
│ │ │ │ +
127 //printf("PNG Info: width: %d height: %d bpp: %d channels: %d\n", png->getWidth(), png->getHeight(), png->d_bit_depth, png->d_num_channels);
│ │ │ │ +
128 if (png->d_bit_depth == 8)
│ │ │ │ +
129 {
│ │ │ │ +
130 if (png->d_num_channels == 4)
│ │ │ │ +
131 {
│ │ │ │ +
132 formatSource = PF_RGBA;
│ │ │ │ +
133 }
│ │ │ │ +
134 else if (png->d_num_channels == 3)
│ │ │ │ +
135 {
│ │ │ │ +
136 formatSource = PF_RGB;
│ │ │ │ +
137 }
│ │ │ │ +
138 else
│ │ │ │ +
139 {
│ │ │ │ +
140 delete png;
│ │ │ │ +
141 return 0;
│ │ │ │ +
142 }
│ │ │ │ +
143 }
│ │ │ │ +
144 // Paletized or grayscale not yet handled
│ │ │ │ +
145 else
│ │ │ │ +
146 {
│ │ │ │ +
147 delete png;
│ │ │ │ +
148 return 0;
│ │ │ │ +
149 }
│ │ │ │ +
150 return png;
│ │ │ │ +
151}
│ │ │ │ +
152
│ │ │ │ +
153
│ │ │ │ +
154bool PNGImageLoader::loadImageData(PixelOrigin origin,
│ │ │ │ +
155 DataSource* data,
│ │ │ │ +
156 ImageContext* context)
│ │ │ │ +
157{
│ │ │ │ +
158 PNGImageContext* png = static_cast<PNGImageContext*>(context);
│ │ │ │ +
159 byte red;
│ │ │ │ +
160 byte green;
│ │ │ │ +
161 byte blue;
│ │ │ │ +
162 byte alpha;
│ │ │ │ +
163 size_t width = png->getWidth();
│ │ │ │ +
164 size_t height = png->getHeight();
│ │ │ │ +
165 png_bytepp row_pointers = png_get_rows(png->d_png_ptr, png->d_info_ptr);
│ │ │ │ +
166 if (png->d_bit_depth == 8)
│ │ │ │ +
167 {
│ │ │ │ +
168 // Read RGBA
│ │ │ │ +
169 if (png->d_num_channels == 4)
│ │ │ │ +
170 {
│ │ │ │ +
171 for (size_t j = 0 ; j < height ; ++j)
│ │ │ │ +
172 {
│ │ │ │ +
173 for(size_t i = 0 ; i < width ; ++i)
│ │ │ │ +
174 {
│ │ │ │ +
175 size_t pixel_offset = 4 * i;
│ │ │ │ +
176 red = *(row_pointers[j] + pixel_offset);
│ │ │ │ +
177 green = *(row_pointers[j] + pixel_offset + 1);
│ │ │ │ +
178 blue = *(row_pointers[j] + pixel_offset + 2);
│ │ │ │ +
179 alpha = *(row_pointers[j] + pixel_offset + 3);
│ │ │ │ +
180 png->setNextPixel(red, green, blue, alpha);
│ │ │ │ +
181 }
│ │ │ │ +
182 }
│ │ │ │ +
183 }
│ │ │ │ +
184 else if (png->d_num_channels == 3)
│ │ │ │ +
185 {
│ │ │ │ +
186 alpha = 0xff;
│ │ │ │ +
187 for (size_t j = 0 ; j < height ; ++j)
│ │ │ │ +
188 {
│ │ │ │ +
189 for(size_t i = 0 ; i < width ; ++i)
│ │ │ │ +
190 {
│ │ │ │ +
191 size_t pixel_offset = 3 * i;
│ │ │ │ +
192 red = *(row_pointers[j] + pixel_offset);
│ │ │ │ +
193 green = *(row_pointers[j] + pixel_offset + 1);
│ │ │ │ +
194 blue = *(row_pointers[j] + pixel_offset + 2);
│ │ │ │ +
195 png->setNextPixel(red, green, blue, alpha);
│ │ │ │ +
196 }
│ │ │ │ +
197 }
│ │ │ │ +
198
│ │ │ │ +
199 }
│ │ │ │ +
200 }
│ │ │ │ +
201 if (origin == PO_BOTTOM_LEFT)
│ │ │ │ +
202 return png->flipVertically();
│ │ │ │ +
203
│ │ │ │ +
204 return true;
│ │ │ │ +
205}
│ │ │ │ +
206
│ │ │ │ +
207} // End section of namespace SILLY
│ │ │ │ +
Simple Image Loading LibrarY namespace.
│ │ │ │ +
PixelFormat
List all pixel format supported.
Definition: SILLYBase.h:60
│ │ │ │ +
PixelOrigin
List all pixel origin supported.
Definition: SILLYBase.h:71
│ │ │ │ +
Image Context for PNG Image Loader.
│ │ │ │ +
This is an abstract class used to provide data to the loader.
│ │ │ │ +
Store the data needed by an ImageLoader object during the parsing of an image.
│ │ │ │ +
void setNextPixel(byte red, byte green, byte bleu, byte alpha)
Set the next pixel of the image.
│ │ │ │ +
bool flipVertically()
Flip pixel ordering.
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,21 +5,21 @@ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ │ │ │ │ │ * build │ │ │ │ │ * reproducible-path │ │ │ │ │ * silly-0.1.0 │ │ │ │ │ * src │ │ │ │ │ * loaders │ │ │ │ │ -SILLYTGAImageContext.cpp │ │ │ │ │ +SILLYPNGImageLoader.cpp │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ - 2 filename: SILLYTGAImageContext.cpp │ │ │ │ │ + 2 filename: SILLYPNGImageLoader.cpp │ │ │ │ │ 3 created: 11 Jun 2006 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ - 6 purpose: Definition of the TGAImageContext methods │ │ │ │ │ + 6 purpose: Definition of the PNGImageLoader methods │ │ │ │ │ 7*************************************************************************/ │ │ │ │ │ 8/*************************************************************************** │ │ │ │ │ 9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team │ │ │ │ │ 10 * │ │ │ │ │ 11 * Permission is hereby granted, free of charge, to any person obtaining │ │ │ │ │ 12 * a copy of this software and associated documentation files (the │ │ │ │ │ 13 * "Software"), to deal in the Software without restriction, including │ │ │ │ │ @@ -38,31 +38,218 @@ │ │ │ │ │ 26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ │ │ │ │ 27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR │ │ │ │ │ 28 * OTHER DEALINGS IN THE SOFTWARE. │ │ │ │ │ 29 │ │ │ │ │ ***************************************************************************/ │ │ │ │ │ 30#ifdef HAVE_CONFIG_H │ │ │ │ │ 31#include │ │ │ │ │ - 32#endif │ │ │ │ │ - 33 │ │ │ │ │ - 34#include "loaders/SILLYTGAImageContext.h" │ │ │ │ │ - 35 │ │ │ │ │ - 36#ifndef SILLY_OPT_INLINE │ │ │ │ │ - 37#define inline │ │ │ │ │ - 38#include "loaders/SILLYTGAImageContext.icpp" │ │ │ │ │ - 39#undef inline │ │ │ │ │ - 40#endif │ │ │ │ │ - 41#include │ │ │ │ │ - 42#include │ │ │ │ │ - 43// Start section of namespace SILLY │ │ │ │ │ - 44namespace SILLY │ │ │ │ │ - 45{ │ │ │ │ │ - 46 │ │ │ │ │ - 47 │ │ │ │ │ - 48 │ │ │ │ │ - 49} // End section of namespace SILLY │ │ │ │ │ + 32#include │ │ │ │ │ + 33#endif │ │ │ │ │ + 34 │ │ │ │ │ + 35#include "loaders/SILLYPNGImageLoader.h" │ │ │ │ │ + 36 │ │ │ │ │ + 37#ifndef SILLY_OPT_INLINE │ │ │ │ │ + 38#define inline │ │ │ │ │ + 39#include "loaders/SILLYPNGImageLoader.icpp" │ │ │ │ │ + 40#undef inline │ │ │ │ │ + 41#endif │ │ │ │ │ + 42 │ │ │ │ │ + 43#include "loaders/SILLYPNGImageContext.h" │ │ │ │ │ + 44#include │ │ │ │ │ + 45// Start section of namespace SILLY │ │ │ │ │ + 46namespace SILLY │ │ │ │ │ + 47{ │ │ │ │ │ + 48void PNG_read_function(png_structp png_ptr, png_bytep data, png_size_t │ │ │ │ │ +length) │ │ │ │ │ + 49{ │ │ │ │ │ + 50 PNGImageContext* png = reinterpret_cast(png_get_io_ptr │ │ │ │ │ +(png_ptr)); │ │ │ │ │ + 51 int readed = png->read(data, length); │ │ │ │ │ + 52 if (readed != (int)length) │ │ │ │ │ + 53 { │ │ │ │ │ + 54 png_error(png_ptr, "PNG_read_function error"); │ │ │ │ │ + 55 } │ │ │ │ │ + 56} │ │ │ │ │ + 57 │ │ │ │ │ + 58void PNG_warning_function(png_structp png_ptr, │ │ │ │ │ + 59 png_const_charp error) │ │ │ │ │ + 60{ │ │ │ │ │ + 61// printf("PNG Warning: %s\n", error); │ │ │ │ │ + 62} │ │ │ │ │ + 63 │ │ │ │ │ + 64void PNG_error_function(png_structp png_ptr, │ │ │ │ │ + 65 png_const_charp error) │ │ │ │ │ + 66{ │ │ │ │ │ + 67 // printf("PNG Error: %s\n", error); │ │ │ │ │ + 68 // copied from libpng's pngerror.cpp │ │ │ │ │ + 69 jmp_buf buf; │ │ │ │ │ + 70#if PNG_LIBPNG_VER_MAJOR >= 1 && PNG_LIBPNG_VER_MINOR >= 4 │ │ │ │ │ + 71 memcpy(buf, png_jmpbuf((png_ptr)), sizeof(jmp_buf)); │ │ │ │ │ + 72#else │ │ │ │ │ + 73 memcpy(buf, png_ptr->jmpbuf, sizeof(jmp_buf)); │ │ │ │ │ + 74#endif │ │ │ │ │ + 75 longjmp(buf, 1); │ │ │ │ │ + 76} │ │ │ │ │ + 77 │ │ │ │ │ + 78 │ │ │ │ │ + 79PNGImageLoader::PNGImageLoader() │ │ │ │ │ + 80 : ImageLoader("PNG Image Loader based on libpng") │ │ │ │ │ + 81{ │ │ │ │ │ + 82} │ │ │ │ │ + 83PNGImageLoader::~PNGImageLoader() │ │ │ │ │ + 84{ │ │ │ │ │ + 85} │ │ │ │ │ + 86 │ │ │ │ │ + 87 │ │ │ │ │ +88ImageContext* PNGImageLoader::loadHeader(PixelFormat& formatSource, │ │ │ │ │ +DataSource* data) │ │ │ │ │ + 89{ │ │ │ │ │ + 90 PNGImageContext* png = new PNGImageContext(data); │ │ │ │ │ + 91 if (!png) │ │ │ │ │ + 92 { │ │ │ │ │ + 93 return 0; │ │ │ │ │ + 94 │ │ │ │ │ + 95 } │ │ │ │ │ + 96 // Prepare png loading │ │ │ │ │ + 97 png->d_png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, 0, 0, 0); │ │ │ │ │ + 98 if (png->d_png_ptr == 0) │ │ │ │ │ + 99 { │ │ │ │ │ + 100 delete png; │ │ │ │ │ + 101 return 0; │ │ │ │ │ + 102 } │ │ │ │ │ + 103 png->d_info_ptr = png_create_info_struct(png->d_png_ptr); │ │ │ │ │ + 104 if (png->d_info_ptr == 0) │ │ │ │ │ + 105 { │ │ │ │ │ + 106 delete png; │ │ │ │ │ + 107 return 0; │ │ │ │ │ + 108 } │ │ │ │ │ + 109 if (setjmp(png_jmpbuf(png->d_png_ptr))) │ │ │ │ │ + 110 { │ │ │ │ │ + 111 delete png; │ │ │ │ │ + 112 return 0; │ │ │ │ │ + 113 } │ │ │ │ │ + 114 png_set_error_fn(png->d_png_ptr, 0, PNG_error_function, │ │ │ │ │ +PNG_warning_function); │ │ │ │ │ + 115 png_set_read_fn(png->d_png_ptr, png, PNG_read_function); │ │ │ │ │ + 116 //png_set_sig_bytes(png->d_png_ptr, 8); │ │ │ │ │ + 117 │ │ │ │ │ + 118 │ │ │ │ │ + 119 │ │ │ │ │ + 120 // Read header Check whether PNG can depaletize transparently or not │ │ │ │ │ + 121 int png_transform = PNG_TRANSFORM_STRIP_16 | PNG_TRANSFORM_EXPAND; │ │ │ │ │ + 122 //printf("Start reading png\n"); │ │ │ │ │ + 123 png_read_png(png->d_png_ptr, png->d_info_ptr, png_transform, 0); │ │ │ │ │ + 124 png->setImageSize(); │ │ │ │ │ + 125 png->d_bit_depth = png_get_bit_depth(png->d_png_ptr, png->d_info_ptr); │ │ │ │ │ + 126 png->d_num_channels = png_get_channels(png->d_png_ptr, png->d_info_ptr); │ │ │ │ │ + 127 //printf("PNG Info: width: %d height: %d bpp: %d channels: %d\n", png- │ │ │ │ │ +>getWidth(), png->getHeight(), png->d_bit_depth, png->d_num_channels); │ │ │ │ │ + 128 if (png->d_bit_depth == 8) │ │ │ │ │ + 129 { │ │ │ │ │ + 130 if (png->d_num_channels == 4) │ │ │ │ │ + 131 { │ │ │ │ │ + 132 formatSource = PF_RGBA; │ │ │ │ │ + 133 } │ │ │ │ │ + 134 else if (png->d_num_channels == 3) │ │ │ │ │ + 135 { │ │ │ │ │ + 136 formatSource = PF_RGB; │ │ │ │ │ + 137 } │ │ │ │ │ + 138 else │ │ │ │ │ + 139 { │ │ │ │ │ + 140 delete png; │ │ │ │ │ + 141 return 0; │ │ │ │ │ + 142 } │ │ │ │ │ + 143 } │ │ │ │ │ + 144 // Paletized or grayscale not yet handled │ │ │ │ │ + 145 else │ │ │ │ │ + 146 { │ │ │ │ │ + 147 delete png; │ │ │ │ │ + 148 return 0; │ │ │ │ │ + 149 } │ │ │ │ │ + 150 return png; │ │ │ │ │ + 151} │ │ │ │ │ + 152 │ │ │ │ │ + 153 │ │ │ │ │ +154bool PNGImageLoader::loadImageData(PixelOrigin origin, │ │ │ │ │ + 155 DataSource* data, │ │ │ │ │ + 156 ImageContext* context) │ │ │ │ │ + 157{ │ │ │ │ │ + 158 PNGImageContext* png = static_cast(context); │ │ │ │ │ + 159 byte red; │ │ │ │ │ + 160 byte green; │ │ │ │ │ + 161 byte blue; │ │ │ │ │ + 162 byte alpha; │ │ │ │ │ + 163 size_t width = png->getWidth(); │ │ │ │ │ + 164 size_t height = png->getHeight(); │ │ │ │ │ + 165 png_bytepp row_pointers = png_get_rows(png->d_png_ptr, png->d_info_ptr); │ │ │ │ │ + 166 if (png->d_bit_depth == 8) │ │ │ │ │ + 167 { │ │ │ │ │ + 168 // Read RGBA │ │ │ │ │ + 169 if (png->d_num_channels == 4) │ │ │ │ │ + 170 { │ │ │ │ │ + 171 for (size_t j = 0 ; j < height ; ++j) │ │ │ │ │ + 172 { │ │ │ │ │ + 173 for(size_t i = 0 ; i < width ; ++i) │ │ │ │ │ + 174 { │ │ │ │ │ + 175 size_t pixel_offset = 4 * i; │ │ │ │ │ + 176 red = *(row_pointers[j] + pixel_offset); │ │ │ │ │ + 177 green = *(row_pointers[j] + pixel_offset + 1); │ │ │ │ │ + 178 blue = *(row_pointers[j] + pixel_offset + 2); │ │ │ │ │ + 179 alpha = *(row_pointers[j] + pixel_offset + 3); │ │ │ │ │ + 180 png->setNextPixel(red, green, blue, alpha); │ │ │ │ │ + 181 } │ │ │ │ │ + 182 } │ │ │ │ │ + 183 } │ │ │ │ │ + 184 else if (png->d_num_channels == 3) │ │ │ │ │ + 185 { │ │ │ │ │ + 186 alpha = 0xff; │ │ │ │ │ + 187 for (size_t j = 0 ; j < height ; ++j) │ │ │ │ │ + 188 { │ │ │ │ │ + 189 for(size_t i = 0 ; i < width ; ++i) │ │ │ │ │ + 190 { │ │ │ │ │ + 191 size_t pixel_offset = 3 * i; │ │ │ │ │ + 192 red = *(row_pointers[j] + pixel_offset); │ │ │ │ │ + 193 green = *(row_pointers[j] + pixel_offset + 1); │ │ │ │ │ + 194 blue = *(row_pointers[j] + pixel_offset + 2); │ │ │ │ │ + 195 png->setNextPixel(red, green, blue, alpha); │ │ │ │ │ + 196 } │ │ │ │ │ + 197 } │ │ │ │ │ + 198 │ │ │ │ │ + 199 } │ │ │ │ │ + 200 } │ │ │ │ │ + 201 if (origin == PO_BOTTOM_LEFT) │ │ │ │ │ + 202 return png->flipVertically(); │ │ │ │ │ + 203 │ │ │ │ │ + 204 return true; │ │ │ │ │ + 205} │ │ │ │ │ + 206 │ │ │ │ │ + 207} // End section of namespace SILLY │ │ │ │ │ SILLY │ │ │ │ │ Simple Image Loading LibrarY namespace. │ │ │ │ │ Definition: SILLYJPGImageContext.cpp:46 │ │ │ │ │ +SILLY::PixelFormat │ │ │ │ │ +PixelFormat │ │ │ │ │ +List all pixel format supported. │ │ │ │ │ +Definition: SILLYBase.h:60 │ │ │ │ │ +SILLY::PixelOrigin │ │ │ │ │ +PixelOrigin │ │ │ │ │ +List all pixel origin supported. │ │ │ │ │ +Definition: SILLYBase.h:71 │ │ │ │ │ +SILLY::PNGImageContext │ │ │ │ │ +Image Context for PNG Image Loader. │ │ │ │ │ +Definition: SILLYPNGImageContext.h:46 │ │ │ │ │ +SILLY::DataSource │ │ │ │ │ +This is an abstract class used to provide data to the loader. │ │ │ │ │ +Definition: SILLYDataSource.h:47 │ │ │ │ │ +SILLY::ImageContext │ │ │ │ │ +Store the data needed by an ImageLoader object during the parsing of an image. │ │ │ │ │ +Definition: SILLYImageContext.h:44 │ │ │ │ │ +SILLY::ImageContext::setNextPixel │ │ │ │ │ +void setNextPixel(byte red, byte green, byte bleu, byte alpha) │ │ │ │ │ +Set the next pixel of the image. │ │ │ │ │ +SILLY::ImageContext::flipVertically │ │ │ │ │ +bool flipVertically() │ │ │ │ │ +Flip pixel ordering. │ │ │ │ │ +Definition: SILLYImageContext.cpp:45 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libsilly-doc/html/a00020_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/src/loaders/SILLYJPGImageContext.cpp Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/src/loaders/SILLYTGAImageLoader.cpp Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -39,23 +39,23 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYJPGImageContext.cpp
│ │ │ │ +
SILLYTGAImageLoader.cpp
│ │ │ │
│ │ │ │
│ │ │ │
1/***********************************************************************
│ │ │ │ -
2 filename: SILLYJPGImageContext.cpp
│ │ │ │ +
2 filename: SILLYTGAImageLoader.cpp
│ │ │ │
3 created: 11 Jun 2006
│ │ │ │
4 author: Olivier Delannoy
│ │ │ │
5
│ │ │ │ -
6 purpose: Definition of the JPGImageContext class methods
│ │ │ │ +
6 purpose: Load TGA Image
│ │ │ │
7*************************************************************************/
│ │ │ │
8/***************************************************************************
│ │ │ │
9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
│ │ │ │
10 *
│ │ │ │
11 * Permission is hereby granted, free of charge, to any person obtaining
│ │ │ │
12 * a copy of this software and associated documentation files (the
│ │ │ │
13 * "Software"), to deal in the Software without restriction, including
│ │ │ │ @@ -75,107 +75,309 @@ │ │ │ │
27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
│ │ │ │
28 * OTHER DEALINGS IN THE SOFTWARE.
│ │ │ │
29 ***************************************************************************/
│ │ │ │
30#ifdef HAVE_CONFIG_H
│ │ │ │
31#include <config.h>
│ │ │ │
32#endif
│ │ │ │
33
│ │ │ │ -
34#include "loaders/SILLYJPGImageContext.h"
│ │ │ │ +
34#include "loaders/SILLYTGAImageLoader.h"
│ │ │ │
35
│ │ │ │
36#ifndef SILLY_OPT_INLINE
│ │ │ │
37#define inline
│ │ │ │ -
38#include "loaders/SILLYJPGImageContext.icpp"
│ │ │ │ +
38#include "loaders/SILLYTGAImageLoader.icpp"
│ │ │ │
39#undef inline
│ │ │ │ -
40#endif
│ │ │ │ -
41
│ │ │ │ -
42#include <jpeglib.h>
│ │ │ │ +
40#endif
│ │ │ │ +
41#include "SILLYDataSource.h"
│ │ │ │ +
42#include "loaders/SILLYTGAImageContext.h"
│ │ │ │
43
│ │ │ │ -
44// Start section of namespace SILLY
│ │ │ │ -
45namespace SILLY
│ │ │ │ -
46{
│ │ │ │ -
47
│ │ │ │ -
48
│ │ │ │ -
49void JPG_init_source(j_decompress_ptr cinfo)
│ │ │ │ -
50{
│ │ │ │ -
51 // Nothing to do
│ │ │ │ -
52}
│ │ │ │ -
53
│ │ │ │ -
54boolean JPG_fill_input_buffer(j_decompress_ptr cinfo)
│ │ │ │ -
55{
│ │ │ │ -
56 JPGImageContext* jpg = reinterpret_cast<JPGImageContext*>(cinfo->client_data);
│ │ │ │ -
57 cinfo->src->next_input_byte = jpg->d_source->getDataPtr();
│ │ │ │ -
58 cinfo->src->bytes_in_buffer = jpg->d_source->getSize();
│ │ │ │ -
59 return TRUE;
│ │ │ │ -
60}
│ │ │ │ -
61
│ │ │ │ -
62void JPG_skip_input_data(j_decompress_ptr cinfo, long num_bytes)
│ │ │ │ -
63{
│ │ │ │ -
64 if (num_bytes > 0)
│ │ │ │ -
65 {
│ │ │ │ -
66 cinfo->src->next_input_byte += (size_t)num_bytes;
│ │ │ │ -
67 cinfo->src->bytes_in_buffer -= (size_t)num_bytes;
│ │ │ │ -
68 }
│ │ │ │ -
69}
│ │ │ │ -
70
│ │ │ │ -
71void JPG_term_source(j_decompress_ptr cinfo)
│ │ │ │ -
72{
│ │ │ │ -
73 // Nothing to do
│ │ │ │ -
74}
│ │ │ │ -
75
│ │ │ │ -
76void JPG_error_exit(j_common_ptr cinfo)
│ │ │ │ -
77{
│ │ │ │ -
78 JPGImageContext* jpg = reinterpret_cast<JPGImageContext*>(cinfo->client_data);
│ │ │ │ -
79 // TODO
│ │ │ │ -
80 longjmp(jpg->setjmp_buffer, 1);
│ │ │ │ -
81
│ │ │ │ -
82}
│ │ │ │ -
83
│ │ │ │ -
84void JPG_emit_message(j_common_ptr cinfo, int msg_level)
│ │ │ │ -
85{
│ │ │ │ -
86 // Ignore
│ │ │ │ -
87}
│ │ │ │ -
88
│ │ │ │ -
89
│ │ │ │ -
90JPGImageContext::JPGImageContext()
│ │ │ │ -
91 : ImageContext(0, 0)
│ │ │ │ -
92{
│ │ │ │ -
93 src_mgr.bytes_in_buffer = 0;
│ │ │ │ -
94 src_mgr.next_input_byte = 0;
│ │ │ │ -
95 src_mgr.init_source = JPG_init_source;
│ │ │ │ -
96 src_mgr.fill_input_buffer = JPG_fill_input_buffer;
│ │ │ │ -
97 src_mgr.skip_input_data = JPG_skip_input_data;
│ │ │ │ -
98 src_mgr.resync_to_restart = jpeg_resync_to_restart;
│ │ │ │ -
99 src_mgr.term_source = JPG_term_source;
│ │ │ │ -
100 jpeg_create_decompress(&cinfo);
│ │ │ │ -
101 cinfo.src = &src_mgr;
│ │ │ │ -
102 cinfo.client_data = this;
│ │ │ │ -
103 cinfo.err = jpeg_std_error(&d_error_mgr);
│ │ │ │ -
104 d_error_mgr.error_exit = JPG_error_exit;
│ │ │ │ -
105
│ │ │ │ -
106}
│ │ │ │ -
107
│ │ │ │ -
108
│ │ │ │ -
109JPGImageContext::~JPGImageContext()
│ │ │ │ -
110{
│ │ │ │ -
111 jpeg_destroy_decompress(&cinfo);
│ │ │ │ -
112}
│ │ │ │ -
113
│ │ │ │ -
114
│ │ │ │ -
115void JPGImageContext::setImageSize()
│ │ │ │ -
116{
│ │ │ │ -
117 setWidth(cinfo.output_width);
│ │ │ │ -
118 setHeight(cinfo.output_height);
│ │ │ │ -
119}
│ │ │ │ -
120
│ │ │ │ -
121} // End section of namespace SILLY
│ │ │ │ -
Simple Image Loading LibrarY namespace.
│ │ │ │ -
Image Context for JPG image loader.
│ │ │ │ -
virtual size_t getSize() const =0
Return the size of the data.
│ │ │ │ +
44#include <cstring>
│ │ │ │ +
45#include <cstdio>
│ │ │ │ +
46
│ │ │ │ +
47// Start section of namespace SILLY
│ │ │ │ +
48namespace SILLY
│ │ │ │ +
49{
│ │ │ │ +
50
│ │ │ │ +
51TGAImageLoader::TGAImageLoader()
│ │ │ │ +
52 : ImageLoader("TGA Image loader (builtin)")
│ │ │ │ +
53{
│ │ │ │ +
54}
│ │ │ │ +
55
│ │ │ │ +
56TGAImageLoader::~TGAImageLoader()
│ │ │ │ +
57{
│ │ │ │ +
58}
│ │ │ │ +
59
│ │ │ │ +
60#ifdef SILLY_BE
│ │ │ │ +
61#define READ_WORD(res, start) \
│ │ │ │ +
62 (res) = 0; \
│ │ │ │ +
63 (res) = data->getDataPtr()[(start) + 1]; \
│ │ │ │ +
64 (res) = (res) << 8; \
│ │ │ │ +
65 (res) |= data->getDataPtr()[(start)];
│ │ │ │ +
66#else
│ │ │ │ +
67#define READ_WORD(res, start) \
│ │ │ │ +
68 (res) = 0; \
│ │ │ │ +
69 (res) = data->getDataPtr()[(start)]; \
│ │ │ │ +
70 (res) = (res) << 8; \
│ │ │ │ +
71 (res) |= data->getDataPtr()[(start) + 1];
│ │ │ │ +
72#endif
│ │ │ │ +
73
│ │ │ │ +
74ImageContext* TGAImageLoader::loadHeader(PixelFormat& formatSource, DataSource* data)
│ │ │ │ +
75{
│ │ │ │ +
76 byte idLength = data->getDataPtr()[0];
│ │ │ │ +
77 byte colorMapType = data->getDataPtr()[1];
│ │ │ │ +
78 byte imageType = data->getDataPtr()[2];
│ │ │ │ +
79 size_t width;
│ │ │ │ +
80 size_t height;
│ │ │ │ +
81 byte depth;
│ │ │ │ +
82 byte description;
│ │ │ │ +
83 if ((imageType != 2 && imageType != 10) || colorMapType)
│ │ │ │ +
84 {
│ │ │ │ +
85 // Unsupported image format
│ │ │ │ +
86 return 0;
│ │ │ │ +
87 }
│ │ │ │ +
88 // offset: 3 Skip color map + 5 bytes
│ │ │ │ +
89 // offset: 8 Skip xorg / yorg + 4 bytes
│ │ │ │ +
90#ifdef SILLY_BE
│ │ │ │ +
91 width = data->getDataPtr()[12];
│ │ │ │ +
92 width = width << 8;
│ │ │ │ +
93 width |= data->getDataPtr()[13];
│ │ │ │ +
94 height = data->getDataPtr()[14];
│ │ │ │ +
95 height = height << 8;
│ │ │ │ +
96 height |= data->getDataPtr()[15];
│ │ │ │ +
97#else
│ │ │ │ +
98 width = data->getDataPtr()[13];
│ │ │ │ +
99 width = width << 8;
│ │ │ │ +
100 width |= data->getDataPtr()[12];
│ │ │ │ +
101 height = data->getDataPtr()[15];
│ │ │ │ +
102 height = height << 8;
│ │ │ │ +
103 height |= data->getDataPtr()[14];
│ │ │ │ +
104#endif
│ │ │ │ +
105 depth = data->getDataPtr()[16] >> 3;
│ │ │ │ +
106 switch (depth)
│ │ │ │ +
107 {
│ │ │ │ +
108 case 2:
│ │ │ │ +
109 formatSource = PF_A1B5G5R5;
│ │ │ │ +
110 break;
│ │ │ │ +
111 case 3:
│ │ │ │ +
112 formatSource = PF_RGB;
│ │ │ │ +
113 break;
│ │ │ │ +
114 case 4:
│ │ │ │ +
115 formatSource = PF_RGBA;
│ │ │ │ +
116 break;
│ │ │ │ +
117 default:
│ │ │ │ +
118 return 0;
│ │ │ │ +
119 }
│ │ │ │ +
120 description = (*data)[17];
│ │ │ │ +
121
│ │ │ │ +
122
│ │ │ │ +
123 TGAImageContext* context = new TGAImageContext(width, height);
│ │ │ │ +
124 if (context)
│ │ │ │ +
125 {
│ │ │ │ +
126 context->d_idLength = idLength;
│ │ │ │ +
127 context->d_imageType = imageType;
│ │ │ │ +
128 context->d_depth = depth;
│ │ │ │ +
129 context->d_description = description;
│ │ │ │ +
130 }
│ │ │ │ +
131 return context;
│ │ │ │ +
132}
│ │ │ │ +
133
│ │ │ │ +
134bool TGAImageLoader::loadImageData(PixelOrigin origin, DataSource* data, ImageContext* context)
│ │ │ │ +
135{
│ │ │ │ +
136 TGAImageContext* tga = static_cast<TGAImageContext*>(context);
│ │ │ │ +
137 size_t bpp = tga->d_depth;
│ │ │ │ +
138 size_t w = tga->getWidth();
│ │ │ │ +
139 size_t h = tga->getHeight();
│ │ │ │ +
140 size_t imgSize = w * h * bpp;
│ │ │ │ +
141 size_t offset = 18 + tga->d_idLength;
│ │ │ │ +
142 size_t numPixels = w * h;
│ │ │ │ +
143 const byte* input = data->getDataPtr() + offset;
│ │ │ │ +
144 // Read image data
│ │ │ │ +
145 byte red;
│ │ │ │ +
146 byte green;
│ │ │ │ +
147 byte blue;
│ │ │ │ +
148 byte alpha;
│ │ │ │ +
149 // Uncompressed
│ │ │ │ +
150 if (tga->d_imageType == 2)
│ │ │ │ +
151 {
│ │ │ │ +
152
│ │ │ │ +
153 switch(bpp)
│ │ │ │ +
154 {
│ │ │ │ +
155 case 2: //A1B5G5R5
│ │ │ │ +
156 for(size_t i = 0 ; i < numPixels ; ++i)
│ │ │ │ +
157 {
│ │ │ │ +
158 unsigned short pixel;
│ │ │ │ +
159 pixel = *(input++);
│ │ │ │ +
160 pixel = pixel << 8;
│ │ │ │ +
161 pixel |= *(input++);
│ │ │ │ +
162
│ │ │ │ +
163 alpha = pixel & 0xf000 ? 0xff : 0x00;
│ │ │ │ +
164 blue = static_cast<byte>((pixel & 0x1f) << 3);
│ │ │ │ +
165 green = static_cast<byte>(((pixel >> 5) & 0x1f) << 3);
│ │ │ │ +
166 red = static_cast<byte>(((pixel >> 10) & 0x1f) << 3);
│ │ │ │ +
167 context->setNextPixel(red, green, blue, alpha);
│ │ │ │ +
168 }
│ │ │ │ +
169 break;
│ │ │ │ +
170
│ │ │ │ +
171 case 3: // BGR_24
│ │ │ │ +
172 alpha = 0xff;
│ │ │ │ +
173 for(size_t i = 0 ; i < numPixels ; ++i)
│ │ │ │ +
174 {
│ │ │ │ +
175 blue = *(input++);
│ │ │ │ +
176 green = *(input++);
│ │ │ │ +
177 red = *(input++);
│ │ │ │ +
178 context->setNextPixel(red, green, blue, alpha);
│ │ │ │ +
179 }
│ │ │ │ +
180 break;
│ │ │ │ +
181
│ │ │ │ +
182 case 4: // BGRA_32
│ │ │ │ +
183 alpha = 0xff;
│ │ │ │ +
184 for(size_t i = 0 ; i < numPixels ; ++i)
│ │ │ │ +
185 {
│ │ │ │ +
186 blue = *(input++);
│ │ │ │ +
187 green = *(input++);
│ │ │ │ +
188 red = *(input++);
│ │ │ │ +
189 alpha = *(input++);
│ │ │ │ +
190 context->setNextPixel(red, green, blue, alpha);
│ │ │ │ +
191 }
│ │ │ │ +
192 break;
│ │ │ │ +
193 }
│ │ │ │ +
194 }
│ │ │ │ +
195 else
│ │ │ │ +
196 {
│ │ │ │ +
197 size_t pixelsRead = 0;
│ │ │ │ +
198 size_t num, i;
│ │ │ │ +
199 byte header;
│ │ │ │ +
200
│ │ │ │ +
201 switch(bpp)
│ │ │ │ +
202 {
│ │ │ │ +
203 case 2: //A1B5G5R5
│ │ │ │ +
204 while(pixelsRead < numPixels)
│ │ │ │ +
205 {
│ │ │ │ +
206 header = *(input++);
│ │ │ │ +
207 num = 1 + (header & 0x7f);
│ │ │ │ +
208 if (header & 0x80)
│ │ │ │ +
209 {
│ │ │ │ +
210 unsigned short pixel;
│ │ │ │ +
211 pixel = *(input++);
│ │ │ │ +
212 pixel = pixel << 8;
│ │ │ │ +
213 pixel |= *(input++);
│ │ │ │ +
214
│ │ │ │ +
215 alpha = pixel & 0xf000 ? 0xff : 0x00;
│ │ │ │ +
216 blue = static_cast<byte>((pixel & 0x1f) << 3);
│ │ │ │ +
217 green = static_cast<byte>(((pixel >> 5) & 0x1f) << 3);
│ │ │ │ +
218 red = static_cast<byte>(((pixel >> 10) & 0x1f) << 3);
│ │ │ │ +
219 for(i = 0 ; i < num ; ++i)
│ │ │ │ +
220 {
│ │ │ │ +
221 context->setNextPixel(red, green, blue, alpha);
│ │ │ │ +
222 }
│ │ │ │ +
223 }
│ │ │ │ +
224 else
│ │ │ │ +
225 {
│ │ │ │ +
226 for (i = 0 ; i < num ; ++i)
│ │ │ │ +
227 {
│ │ │ │ +
228 unsigned short pixel;
│ │ │ │ +
229 pixel = *(input++);
│ │ │ │ +
230 pixel = pixel << 8;
│ │ │ │ +
231 pixel |= *(input++);
│ │ │ │ +
232 alpha = pixel & 0xf000 ? 0xff : 0x00;
│ │ │ │ +
233 blue = static_cast<byte>((pixel & 0x1f) << 3);
│ │ │ │ +
234 green = static_cast<byte>(((pixel >> 5) & 0x1f) << 3);
│ │ │ │ +
235 red = static_cast<byte>(((pixel >> 10) & 0x1f) << 3);
│ │ │ │ +
236 context->setNextPixel(red, green, blue, alpha);
│ │ │ │ +
237 }
│ │ │ │ +
238 }
│ │ │ │ +
239 pixelsRead += num;
│ │ │ │ +
240 }
│ │ │ │ +
241
│ │ │ │ +
242 break;
│ │ │ │ +
243 case 3:
│ │ │ │ +
244 alpha = 0xff;
│ │ │ │ +
245 while(pixelsRead < numPixels)
│ │ │ │ +
246 {
│ │ │ │ +
247 header = *(input++);
│ │ │ │ +
248 num = 1 + (header & 0x7f);
│ │ │ │ +
249 if (header & 0x80)
│ │ │ │ +
250 {
│ │ │ │ +
251 blue = *(input++);
│ │ │ │ +
252 green = *(input++);
│ │ │ │ +
253 red = *(input++);
│ │ │ │ +
254 for(i = 0 ; i < num ; ++i)
│ │ │ │ +
255 {
│ │ │ │ +
256 context->setNextPixel(red, green, blue, alpha);
│ │ │ │ +
257 }
│ │ │ │ +
258 }
│ │ │ │ +
259 else
│ │ │ │ +
260 {
│ │ │ │ +
261 for (i = 0 ; i < num ; ++i)
│ │ │ │ +
262 {
│ │ │ │ +
263 blue = *(input++);
│ │ │ │ +
264 green = *(input++);
│ │ │ │ +
265 red = *(input++);
│ │ │ │ +
266 context->setNextPixel(red, green, blue, alpha);
│ │ │ │ +
267 }
│ │ │ │ +
268 }
│ │ │ │ +
269 pixelsRead += num;
│ │ │ │ +
270 }
│ │ │ │ +
271 break;
│ │ │ │ +
272
│ │ │ │ +
273 case 4:
│ │ │ │ +
274 while(pixelsRead < numPixels)
│ │ │ │ +
275 {
│ │ │ │ +
276 header = *(input++);
│ │ │ │ +
277 num = 1 + (header & 0x7f);
│ │ │ │ +
278 if (header & 0x80)
│ │ │ │ +
279 {
│ │ │ │ +
280 blue = *(input++);
│ │ │ │ +
281 green = *(input++);
│ │ │ │ +
282 red = *(input++);
│ │ │ │ +
283 alpha = *(input++);
│ │ │ │ +
284 for(i = 0 ; i < num ; ++i)
│ │ │ │ +
285 {
│ │ │ │ +
286 context->setNextPixel(red, green, blue, alpha);
│ │ │ │ +
287 }
│ │ │ │ +
288 }
│ │ │ │ +
289 else
│ │ │ │ +
290 {
│ │ │ │ +
291 for (i = 0 ; i < num ; ++i)
│ │ │ │ +
292 {
│ │ │ │ +
293 blue = *(input++);
│ │ │ │ +
294 green = *(input++);
│ │ │ │ +
295 red = *(input++);
│ │ │ │ +
296 alpha = *(input++);
│ │ │ │ +
297 context->setNextPixel(red, green, blue, alpha);
│ │ │ │ +
298 }
│ │ │ │ +
299 }
│ │ │ │ +
300 pixelsRead += num;
│ │ │ │ +
301 }
│ │ │ │ +
302 break;
│ │ │ │ +
303 }
│ │ │ │ +
304 }
│ │ │ │ +
305 // Flip or not flip that is the question
│ │ │ │ +
306 if ((tga->d_description & 0x10) == 0x10) // Upper Left origin
│ │ │ │ +
307 {
│ │ │ │ +
308 if (origin == PO_BOTTOM_LEFT)
│ │ │ │ +
309 return tga->flipVertically();
│ │ │ │ +
310 }
│ │ │ │ +
311 else
│ │ │ │ +
312 {
│ │ │ │ +
313 if (origin == PO_TOP_LEFT)
│ │ │ │ +
314 return tga->flipVertically();
│ │ │ │ +
315 }
│ │ │ │ +
316 return true;
│ │ │ │ +
317}
│ │ │ │ +
318
│ │ │ │ +
319} // End section of namespace SILLY
│ │ │ │ +
Simple Image Loading LibrarY namespace.
│ │ │ │ +
PixelFormat
List all pixel format supported.
Definition: SILLYBase.h:60
│ │ │ │ +
PixelOrigin
List all pixel origin supported.
Definition: SILLYBase.h:71
│ │ │ │ +
Image Context for Targa image.
│ │ │ │ +
This is an abstract class used to provide data to the loader.
│ │ │ │
virtual const byte * getDataPtr() const =0
Get raw access to the image data.
│ │ │ │ -
Store the data needed by an ImageLoader object during the parsing of an image.
│ │ │ │ +
Store the data needed by an ImageLoader object during the parsing of an image.
│ │ │ │ +
void setNextPixel(byte red, byte green, byte bleu, byte alpha)
Set the next pixel of the image.
│ │ │ │ +
bool flipVertically()
Flip pixel ordering.
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,21 +5,21 @@ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ │ │ │ │ │ * build │ │ │ │ │ * reproducible-path │ │ │ │ │ * silly-0.1.0 │ │ │ │ │ * src │ │ │ │ │ * loaders │ │ │ │ │ -SILLYJPGImageContext.cpp │ │ │ │ │ +SILLYTGAImageLoader.cpp │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ - 2 filename: SILLYJPGImageContext.cpp │ │ │ │ │ + 2 filename: SILLYTGAImageLoader.cpp │ │ │ │ │ 3 created: 11 Jun 2006 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ - 6 purpose: Definition of the JPGImageContext class methods │ │ │ │ │ + 6 purpose: Load TGA Image │ │ │ │ │ 7*************************************************************************/ │ │ │ │ │ 8/*************************************************************************** │ │ │ │ │ 9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team │ │ │ │ │ 10 * │ │ │ │ │ 11 * Permission is hereby granted, free of charge, to any person obtaining │ │ │ │ │ 12 * a copy of this software and associated documentation files (the │ │ │ │ │ 13 * "Software"), to deal in the Software without restriction, including │ │ │ │ │ @@ -40,115 +40,328 @@ │ │ │ │ │ 28 * OTHER DEALINGS IN THE SOFTWARE. │ │ │ │ │ 29 │ │ │ │ │ ***************************************************************************/ │ │ │ │ │ 30#ifdef HAVE_CONFIG_H │ │ │ │ │ 31#include │ │ │ │ │ 32#endif │ │ │ │ │ 33 │ │ │ │ │ - 34#include "loaders/SILLYJPGImageContext.h" │ │ │ │ │ + 34#include "loaders/SILLYTGAImageLoader.h" │ │ │ │ │ 35 │ │ │ │ │ 36#ifndef SILLY_OPT_INLINE │ │ │ │ │ 37#define inline │ │ │ │ │ - 38#include "loaders/SILLYJPGImageContext.icpp" │ │ │ │ │ + 38#include "loaders/SILLYTGAImageLoader.icpp" │ │ │ │ │ 39#undef inline │ │ │ │ │ 40#endif │ │ │ │ │ - 41 │ │ │ │ │ - 42#include │ │ │ │ │ + 41#include "SILLYDataSource.h" │ │ │ │ │ + 42#include "loaders/SILLYTGAImageContext.h" │ │ │ │ │ 43 │ │ │ │ │ - 44// Start section of namespace SILLY │ │ │ │ │ -45namespace SILLY │ │ │ │ │ - 46{ │ │ │ │ │ - 47 │ │ │ │ │ - 48 │ │ │ │ │ - 49void JPG_init_source(j_decompress_ptr cinfo) │ │ │ │ │ - 50{ │ │ │ │ │ - 51 // Nothing to do │ │ │ │ │ - 52} │ │ │ │ │ - 53 │ │ │ │ │ - 54boolean JPG_fill_input_buffer(j_decompress_ptr cinfo) │ │ │ │ │ - 55{ │ │ │ │ │ - 56 JPGImageContext* jpg = reinterpret_cast(cinfo- │ │ │ │ │ ->client_data); │ │ │ │ │ - 57 cinfo->src->next_input_byte = jpg->d_source->getDataPtr(); │ │ │ │ │ - 58 cinfo->src->bytes_in_buffer = jpg->d_source->getSize(); │ │ │ │ │ - 59 return TRUE; │ │ │ │ │ - 60} │ │ │ │ │ - 61 │ │ │ │ │ - 62void JPG_skip_input_data(j_decompress_ptr cinfo, long num_bytes) │ │ │ │ │ - 63{ │ │ │ │ │ - 64 if (num_bytes > 0) │ │ │ │ │ - 65 { │ │ │ │ │ - 66 cinfo->src->next_input_byte += (size_t)num_bytes; │ │ │ │ │ - 67 cinfo->src->bytes_in_buffer -= (size_t)num_bytes; │ │ │ │ │ - 68 } │ │ │ │ │ - 69} │ │ │ │ │ - 70 │ │ │ │ │ - 71void JPG_term_source(j_decompress_ptr cinfo) │ │ │ │ │ - 72{ │ │ │ │ │ - 73 // Nothing to do │ │ │ │ │ - 74} │ │ │ │ │ - 75 │ │ │ │ │ - 76void JPG_error_exit(j_common_ptr cinfo) │ │ │ │ │ - 77{ │ │ │ │ │ - 78 JPGImageContext* jpg = reinterpret_cast(cinfo- │ │ │ │ │ ->client_data); │ │ │ │ │ - 79 // TODO │ │ │ │ │ - 80 longjmp(jpg->setjmp_buffer, 1); │ │ │ │ │ - 81 │ │ │ │ │ - 82} │ │ │ │ │ - 83 │ │ │ │ │ - 84void JPG_emit_message(j_common_ptr cinfo, int msg_level) │ │ │ │ │ - 85{ │ │ │ │ │ - 86 // Ignore │ │ │ │ │ - 87} │ │ │ │ │ - 88 │ │ │ │ │ - 89 │ │ │ │ │ - 90JPGImageContext::JPGImageContext() │ │ │ │ │ - 91 : ImageContext(0, 0) │ │ │ │ │ - 92{ │ │ │ │ │ - 93 src_mgr.bytes_in_buffer = 0; │ │ │ │ │ - 94 src_mgr.next_input_byte = 0; │ │ │ │ │ - 95 src_mgr.init_source = JPG_init_source; │ │ │ │ │ - 96 src_mgr.fill_input_buffer = JPG_fill_input_buffer; │ │ │ │ │ - 97 src_mgr.skip_input_data = JPG_skip_input_data; │ │ │ │ │ - 98 src_mgr.resync_to_restart = jpeg_resync_to_restart; │ │ │ │ │ - 99 src_mgr.term_source = JPG_term_source; │ │ │ │ │ - 100 jpeg_create_decompress(&cinfo); │ │ │ │ │ - 101 cinfo.src = &src_mgr; │ │ │ │ │ - 102 cinfo.client_data = this; │ │ │ │ │ - 103 cinfo.err = jpeg_std_error(&d_error_mgr); │ │ │ │ │ - 104 d_error_mgr.error_exit = JPG_error_exit; │ │ │ │ │ - 105 │ │ │ │ │ - 106} │ │ │ │ │ - 107 │ │ │ │ │ - 108 │ │ │ │ │ - 109JPGImageContext::~JPGImageContext() │ │ │ │ │ - 110{ │ │ │ │ │ - 111 jpeg_destroy_decompress(&cinfo); │ │ │ │ │ - 112} │ │ │ │ │ - 113 │ │ │ │ │ - 114 │ │ │ │ │ - 115void JPGImageContext::setImageSize() │ │ │ │ │ - 116{ │ │ │ │ │ - 117 setWidth(cinfo.output_width); │ │ │ │ │ - 118 setHeight(cinfo.output_height); │ │ │ │ │ - 119} │ │ │ │ │ - 120 │ │ │ │ │ - 121} // End section of namespace SILLY │ │ │ │ │ + 44#include │ │ │ │ │ + 45#include │ │ │ │ │ + 46 │ │ │ │ │ + 47// Start section of namespace SILLY │ │ │ │ │ + 48namespace SILLY │ │ │ │ │ + 49{ │ │ │ │ │ + 50 │ │ │ │ │ + 51TGAImageLoader::TGAImageLoader() │ │ │ │ │ + 52 : ImageLoader("TGA Image loader (builtin)") │ │ │ │ │ + 53{ │ │ │ │ │ + 54} │ │ │ │ │ + 55 │ │ │ │ │ + 56TGAImageLoader::~TGAImageLoader() │ │ │ │ │ + 57{ │ │ │ │ │ + 58} │ │ │ │ │ + 59 │ │ │ │ │ + 60#ifdef SILLY_BE │ │ │ │ │ + 61#define READ_WORD(res, start) \ │ │ │ │ │ + 62 (res) = 0; \ │ │ │ │ │ + 63 (res) = data->getDataPtr()[(start) + 1]; \ │ │ │ │ │ + 64 (res) = (res) << 8; \ │ │ │ │ │ + 65 (res) |= data->getDataPtr()[(start)]; │ │ │ │ │ + 66#else │ │ │ │ │ + 67#define READ_WORD(res, start) \ │ │ │ │ │ + 68 (res) = 0; \ │ │ │ │ │ + 69 (res) = data->getDataPtr()[(start)]; \ │ │ │ │ │ + 70 (res) = (res) << 8; \ │ │ │ │ │ + 71 (res) |= data->getDataPtr()[(start) + 1]; │ │ │ │ │ + 72#endif │ │ │ │ │ + 73 │ │ │ │ │ +74ImageContext* TGAImageLoader::loadHeader(PixelFormat& formatSource, │ │ │ │ │ +DataSource* data) │ │ │ │ │ + 75{ │ │ │ │ │ + 76 byte idLength = data->getDataPtr()[0]; │ │ │ │ │ + 77 byte colorMapType = data->getDataPtr()[1]; │ │ │ │ │ + 78 byte imageType = data->getDataPtr()[2]; │ │ │ │ │ + 79 size_t width; │ │ │ │ │ + 80 size_t height; │ │ │ │ │ + 81 byte depth; │ │ │ │ │ + 82 byte description; │ │ │ │ │ + 83 if ((imageType != 2 && imageType != 10) || colorMapType) │ │ │ │ │ + 84 { │ │ │ │ │ + 85 // Unsupported image format │ │ │ │ │ + 86 return 0; │ │ │ │ │ + 87 } │ │ │ │ │ + 88 // offset: 3 Skip color map + 5 bytes │ │ │ │ │ + 89 // offset: 8 Skip xorg / yorg + 4 bytes │ │ │ │ │ + 90#ifdef SILLY_BE │ │ │ │ │ + 91 width = data->getDataPtr()[12]; │ │ │ │ │ + 92 width = width << 8; │ │ │ │ │ + 93 width |= data->getDataPtr()[13]; │ │ │ │ │ + 94 height = data->getDataPtr()[14]; │ │ │ │ │ + 95 height = height << 8; │ │ │ │ │ + 96 height |= data->getDataPtr()[15]; │ │ │ │ │ + 97#else │ │ │ │ │ + 98 width = data->getDataPtr()[13]; │ │ │ │ │ + 99 width = width << 8; │ │ │ │ │ + 100 width |= data->getDataPtr()[12]; │ │ │ │ │ + 101 height = data->getDataPtr()[15]; │ │ │ │ │ + 102 height = height << 8; │ │ │ │ │ + 103 height |= data->getDataPtr()[14]; │ │ │ │ │ + 104#endif │ │ │ │ │ + 105 depth = data->getDataPtr()[16] >> 3; │ │ │ │ │ + 106 switch (depth) │ │ │ │ │ + 107 { │ │ │ │ │ + 108 case 2: │ │ │ │ │ + 109 formatSource = PF_A1B5G5R5; │ │ │ │ │ + 110 break; │ │ │ │ │ + 111 case 3: │ │ │ │ │ + 112 formatSource = PF_RGB; │ │ │ │ │ + 113 break; │ │ │ │ │ + 114 case 4: │ │ │ │ │ + 115 formatSource = PF_RGBA; │ │ │ │ │ + 116 break; │ │ │ │ │ + 117 default: │ │ │ │ │ + 118 return 0; │ │ │ │ │ + 119 } │ │ │ │ │ + 120 description = (*data)[17]; │ │ │ │ │ + 121 │ │ │ │ │ + 122 │ │ │ │ │ + 123 TGAImageContext* context = new TGAImageContext(width, height); │ │ │ │ │ + 124 if (context) │ │ │ │ │ + 125 { │ │ │ │ │ + 126 context->d_idLength = idLength; │ │ │ │ │ + 127 context->d_imageType = imageType; │ │ │ │ │ + 128 context->d_depth = depth; │ │ │ │ │ + 129 context->d_description = description; │ │ │ │ │ + 130 } │ │ │ │ │ + 131 return context; │ │ │ │ │ + 132} │ │ │ │ │ + 133 │ │ │ │ │ +134bool TGAImageLoader::loadImageData(PixelOrigin origin, DataSource* data, │ │ │ │ │ +ImageContext* context) │ │ │ │ │ + 135{ │ │ │ │ │ + 136 TGAImageContext* tga = static_cast(context); │ │ │ │ │ + 137 size_t bpp = tga->d_depth; │ │ │ │ │ + 138 size_t w = tga->getWidth(); │ │ │ │ │ + 139 size_t h = tga->getHeight(); │ │ │ │ │ + 140 size_t imgSize = w * h * bpp; │ │ │ │ │ + 141 size_t offset = 18 + tga->d_idLength; │ │ │ │ │ + 142 size_t numPixels = w * h; │ │ │ │ │ + 143 const byte* input = data->getDataPtr() + offset; │ │ │ │ │ + 144 // Read image data │ │ │ │ │ + 145 byte red; │ │ │ │ │ + 146 byte green; │ │ │ │ │ + 147 byte blue; │ │ │ │ │ + 148 byte alpha; │ │ │ │ │ + 149 // Uncompressed │ │ │ │ │ + 150 if (tga->d_imageType == 2) │ │ │ │ │ + 151 { │ │ │ │ │ + 152 │ │ │ │ │ + 153 switch(bpp) │ │ │ │ │ + 154 { │ │ │ │ │ + 155 case 2: //A1B5G5R5 │ │ │ │ │ + 156 for(size_t i = 0 ; i < numPixels ; ++i) │ │ │ │ │ + 157 { │ │ │ │ │ + 158 unsigned short pixel; │ │ │ │ │ + 159 pixel = *(input++); │ │ │ │ │ + 160 pixel = pixel << 8; │ │ │ │ │ + 161 pixel |= *(input++); │ │ │ │ │ + 162 │ │ │ │ │ + 163 alpha = pixel & 0xf000 ? 0xff : 0x00; │ │ │ │ │ + 164 blue = static_cast((pixel & 0x1f) << 3); │ │ │ │ │ + 165 green = static_cast(((pixel >> 5) & 0x1f) << 3); │ │ │ │ │ + 166 red = static_cast(((pixel >> 10) & 0x1f) << 3); │ │ │ │ │ + 167 context->setNextPixel(red, green, blue, alpha); │ │ │ │ │ + 168 } │ │ │ │ │ + 169 break; │ │ │ │ │ + 170 │ │ │ │ │ + 171 case 3: // BGR_24 │ │ │ │ │ + 172 alpha = 0xff; │ │ │ │ │ + 173 for(size_t i = 0 ; i < numPixels ; ++i) │ │ │ │ │ + 174 { │ │ │ │ │ + 175 blue = *(input++); │ │ │ │ │ + 176 green = *(input++); │ │ │ │ │ + 177 red = *(input++); │ │ │ │ │ + 178 context->setNextPixel(red, green, blue, alpha); │ │ │ │ │ + 179 } │ │ │ │ │ + 180 break; │ │ │ │ │ + 181 │ │ │ │ │ + 182 case 4: // BGRA_32 │ │ │ │ │ + 183 alpha = 0xff; │ │ │ │ │ + 184 for(size_t i = 0 ; i < numPixels ; ++i) │ │ │ │ │ + 185 { │ │ │ │ │ + 186 blue = *(input++); │ │ │ │ │ + 187 green = *(input++); │ │ │ │ │ + 188 red = *(input++); │ │ │ │ │ + 189 alpha = *(input++); │ │ │ │ │ + 190 context->setNextPixel(red, green, blue, alpha); │ │ │ │ │ + 191 } │ │ │ │ │ + 192 break; │ │ │ │ │ + 193 } │ │ │ │ │ + 194 } │ │ │ │ │ + 195 else │ │ │ │ │ + 196 { │ │ │ │ │ + 197 size_t pixelsRead = 0; │ │ │ │ │ + 198 size_t num, i; │ │ │ │ │ + 199 byte header; │ │ │ │ │ + 200 │ │ │ │ │ + 201 switch(bpp) │ │ │ │ │ + 202 { │ │ │ │ │ + 203 case 2: //A1B5G5R5 │ │ │ │ │ + 204 while(pixelsRead < numPixels) │ │ │ │ │ + 205 { │ │ │ │ │ + 206 header = *(input++); │ │ │ │ │ + 207 num = 1 + (header & 0x7f); │ │ │ │ │ + 208 if (header & 0x80) │ │ │ │ │ + 209 { │ │ │ │ │ + 210 unsigned short pixel; │ │ │ │ │ + 211 pixel = *(input++); │ │ │ │ │ + 212 pixel = pixel << 8; │ │ │ │ │ + 213 pixel |= *(input++); │ │ │ │ │ + 214 │ │ │ │ │ + 215 alpha = pixel & 0xf000 ? 0xff : 0x00; │ │ │ │ │ + 216 blue = static_cast((pixel & 0x1f) << 3); │ │ │ │ │ + 217 green = static_cast(((pixel >> 5) & 0x1f) << 3); │ │ │ │ │ + 218 red = static_cast(((pixel >> 10) & 0x1f) << 3); │ │ │ │ │ + 219 for(i = 0 ; i < num ; ++i) │ │ │ │ │ + 220 { │ │ │ │ │ + 221 context->setNextPixel(red, green, blue, alpha); │ │ │ │ │ + 222 } │ │ │ │ │ + 223 } │ │ │ │ │ + 224 else │ │ │ │ │ + 225 { │ │ │ │ │ + 226 for (i = 0 ; i < num ; ++i) │ │ │ │ │ + 227 { │ │ │ │ │ + 228 unsigned short pixel; │ │ │ │ │ + 229 pixel = *(input++); │ │ │ │ │ + 230 pixel = pixel << 8; │ │ │ │ │ + 231 pixel |= *(input++); │ │ │ │ │ + 232 alpha = pixel & 0xf000 ? 0xff : 0x00; │ │ │ │ │ + 233 blue = static_cast((pixel & 0x1f) << 3); │ │ │ │ │ + 234 green = static_cast(((pixel >> 5) & 0x1f) << 3); │ │ │ │ │ + 235 red = static_cast(((pixel >> 10) & 0x1f) << 3); │ │ │ │ │ + 236 context->setNextPixel(red, green, blue, alpha); │ │ │ │ │ + 237 } │ │ │ │ │ + 238 } │ │ │ │ │ + 239 pixelsRead += num; │ │ │ │ │ + 240 } │ │ │ │ │ + 241 │ │ │ │ │ + 242 break; │ │ │ │ │ + 243 case 3: │ │ │ │ │ + 244 alpha = 0xff; │ │ │ │ │ + 245 while(pixelsRead < numPixels) │ │ │ │ │ + 246 { │ │ │ │ │ + 247 header = *(input++); │ │ │ │ │ + 248 num = 1 + (header & 0x7f); │ │ │ │ │ + 249 if (header & 0x80) │ │ │ │ │ + 250 { │ │ │ │ │ + 251 blue = *(input++); │ │ │ │ │ + 252 green = *(input++); │ │ │ │ │ + 253 red = *(input++); │ │ │ │ │ + 254 for(i = 0 ; i < num ; ++i) │ │ │ │ │ + 255 { │ │ │ │ │ + 256 context->setNextPixel(red, green, blue, alpha); │ │ │ │ │ + 257 } │ │ │ │ │ + 258 } │ │ │ │ │ + 259 else │ │ │ │ │ + 260 { │ │ │ │ │ + 261 for (i = 0 ; i < num ; ++i) │ │ │ │ │ + 262 { │ │ │ │ │ + 263 blue = *(input++); │ │ │ │ │ + 264 green = *(input++); │ │ │ │ │ + 265 red = *(input++); │ │ │ │ │ + 266 context->setNextPixel(red, green, blue, alpha); │ │ │ │ │ + 267 } │ │ │ │ │ + 268 } │ │ │ │ │ + 269 pixelsRead += num; │ │ │ │ │ + 270 } │ │ │ │ │ + 271 break; │ │ │ │ │ + 272 │ │ │ │ │ + 273 case 4: │ │ │ │ │ + 274 while(pixelsRead < numPixels) │ │ │ │ │ + 275 { │ │ │ │ │ + 276 header = *(input++); │ │ │ │ │ + 277 num = 1 + (header & 0x7f); │ │ │ │ │ + 278 if (header & 0x80) │ │ │ │ │ + 279 { │ │ │ │ │ + 280 blue = *(input++); │ │ │ │ │ + 281 green = *(input++); │ │ │ │ │ + 282 red = *(input++); │ │ │ │ │ + 283 alpha = *(input++); │ │ │ │ │ + 284 for(i = 0 ; i < num ; ++i) │ │ │ │ │ + 285 { │ │ │ │ │ + 286 context->setNextPixel(red, green, blue, alpha); │ │ │ │ │ + 287 } │ │ │ │ │ + 288 } │ │ │ │ │ + 289 else │ │ │ │ │ + 290 { │ │ │ │ │ + 291 for (i = 0 ; i < num ; ++i) │ │ │ │ │ + 292 { │ │ │ │ │ + 293 blue = *(input++); │ │ │ │ │ + 294 green = *(input++); │ │ │ │ │ + 295 red = *(input++); │ │ │ │ │ + 296 alpha = *(input++); │ │ │ │ │ + 297 context->setNextPixel(red, green, blue, alpha); │ │ │ │ │ + 298 } │ │ │ │ │ + 299 } │ │ │ │ │ + 300 pixelsRead += num; │ │ │ │ │ + 301 } │ │ │ │ │ + 302 break; │ │ │ │ │ + 303 } │ │ │ │ │ + 304 } │ │ │ │ │ + 305 // Flip or not flip that is the question │ │ │ │ │ + 306 if ((tga->d_description & 0x10) == 0x10) // Upper Left origin │ │ │ │ │ + 307 { │ │ │ │ │ + 308 if (origin == PO_BOTTOM_LEFT) │ │ │ │ │ + 309 return tga->flipVertically(); │ │ │ │ │ + 310 } │ │ │ │ │ + 311 else │ │ │ │ │ + 312 { │ │ │ │ │ + 313 if (origin == PO_TOP_LEFT) │ │ │ │ │ + 314 return tga->flipVertically(); │ │ │ │ │ + 315 } │ │ │ │ │ + 316 return true; │ │ │ │ │ + 317} │ │ │ │ │ + 318 │ │ │ │ │ + 319} // End section of namespace SILLY │ │ │ │ │ SILLY │ │ │ │ │ Simple Image Loading LibrarY namespace. │ │ │ │ │ Definition: SILLYJPGImageContext.cpp:46 │ │ │ │ │ -SILLY::JPGImageContext │ │ │ │ │ -Image Context for JPG image loader. │ │ │ │ │ -Definition: SILLYJPGImageContext.h:57 │ │ │ │ │ -SILLY::DataSource::getSize │ │ │ │ │ -virtual size_t getSize() const =0 │ │ │ │ │ -Return the size of the data. │ │ │ │ │ +SILLY::PixelFormat │ │ │ │ │ +PixelFormat │ │ │ │ │ +List all pixel format supported. │ │ │ │ │ +Definition: SILLYBase.h:60 │ │ │ │ │ +SILLY::PixelOrigin │ │ │ │ │ +PixelOrigin │ │ │ │ │ +List all pixel origin supported. │ │ │ │ │ +Definition: SILLYBase.h:71 │ │ │ │ │ +SILLY::TGAImageContext │ │ │ │ │ +Image Context for Targa image. │ │ │ │ │ +Definition: SILLYTGAImageContext.h:43 │ │ │ │ │ +SILLY::DataSource │ │ │ │ │ +This is an abstract class used to provide data to the loader. │ │ │ │ │ +Definition: SILLYDataSource.h:47 │ │ │ │ │ SILLY::DataSource::getDataPtr │ │ │ │ │ virtual const byte * getDataPtr() const =0 │ │ │ │ │ Get raw access to the image data. │ │ │ │ │ SILLY::ImageContext │ │ │ │ │ Store the data needed by an ImageLoader object during the parsing of an image. │ │ │ │ │ Definition: SILLYImageContext.h:44 │ │ │ │ │ +SILLY::ImageContext::setNextPixel │ │ │ │ │ +void setNextPixel(byte red, byte green, byte bleu, byte alpha) │ │ │ │ │ +Set the next pixel of the image. │ │ │ │ │ +SILLY::ImageContext::flipVertically │ │ │ │ │ +bool flipVertically() │ │ │ │ │ +Flip pixel ordering. │ │ │ │ │ +Definition: SILLYImageContext.cpp:45 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libsilly-doc/html/a00023_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/src/loaders/SILLYPNGImageLoader.cpp Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/src/SILLYImage.cpp Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -35,27 +35,27 @@ │ │ │ │ initMenu('',false,false,'search.php','Search'); │ │ │ │ }); │ │ │ │ /* @license-end */ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYPNGImageLoader.cpp
│ │ │ │ +
SILLYImage.cpp
│ │ │ │
│ │ │ │
│ │ │ │
1/***********************************************************************
│ │ │ │ -
2 filename: SILLYPNGImageLoader.cpp
│ │ │ │ -
3 created: 11 Jun 2006
│ │ │ │ -
4 author: Olivier Delannoy
│ │ │ │ +
2 filename: SILLYImage.cpp
│ │ │ │ +
3 created: 10 Jun 2006
│ │ │ │ +
4 author: Olivier Delannoy
│ │ │ │
5
│ │ │ │ -
6 purpose: Definition of the PNGImageLoader methods
│ │ │ │ +
6 purpose: Implementation of the Image class
│ │ │ │
7*************************************************************************/
│ │ │ │
8/***************************************************************************
│ │ │ │
9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
│ │ │ │
10 *
│ │ │ │
11 * Permission is hereby granted, free of charge, to any person obtaining
│ │ │ │
12 * a copy of this software and associated documentation files (the
│ │ │ │
13 * "Software"), to deal in the Software without restriction, including
│ │ │ │ @@ -73,198 +73,102 @@ │ │ │ │
25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
│ │ │ │
26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
│ │ │ │
27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
│ │ │ │
28 * OTHER DEALINGS IN THE SOFTWARE.
│ │ │ │
29 ***************************************************************************/
│ │ │ │
30#ifdef HAVE_CONFIG_H
│ │ │ │
31#include <config.h>
│ │ │ │ -
32#include <string.h>
│ │ │ │ -
33#endif
│ │ │ │ -
34
│ │ │ │ -
35#include "loaders/SILLYPNGImageLoader.h"
│ │ │ │ -
36
│ │ │ │ -
37#ifndef SILLY_OPT_INLINE
│ │ │ │ -
38#define inline
│ │ │ │ -
39#include "loaders/SILLYPNGImageLoader.icpp"
│ │ │ │ -
40#undef inline
│ │ │ │ -
41#endif
│ │ │ │ +
32#endif
│ │ │ │ +
33
│ │ │ │ +
34#include "SILLYImage.h"
│ │ │ │ +
35
│ │ │ │ +
36#ifndef SILLY_OPT_INLINE
│ │ │ │ +
37#define inline
│ │ │ │ +
38#include "SILLYImage.icpp"
│ │ │ │ +
39#undef inline
│ │ │ │ +
40#endif
│ │ │ │ +
41#include "SILLYImageLoaderManager.h"
│ │ │ │
42
│ │ │ │ -
43#include "loaders/SILLYPNGImageContext.h"
│ │ │ │ -
44#include <png.h>
│ │ │ │ -
45// Start section of namespace SILLY
│ │ │ │ -
46namespace SILLY
│ │ │ │ -
47{
│ │ │ │ -
48void PNG_read_function(png_structp png_ptr, png_bytep data, png_size_t length)
│ │ │ │ -
49{
│ │ │ │ -
50 PNGImageContext* png = reinterpret_cast<PNGImageContext*>(png_get_io_ptr(png_ptr));
│ │ │ │ -
51 int readed = png->read(data, length);
│ │ │ │ -
52 if (readed != (int)length)
│ │ │ │ -
53 {
│ │ │ │ -
54 png_error(png_ptr, "PNG_read_function error");
│ │ │ │ -
55 }
│ │ │ │ -
56}
│ │ │ │ -
57
│ │ │ │ -
58void PNG_warning_function(png_structp png_ptr,
│ │ │ │ -
59 png_const_charp error)
│ │ │ │ -
60{
│ │ │ │ -
61// printf("PNG Warning: %s\n", error);
│ │ │ │ -
62}
│ │ │ │ -
63
│ │ │ │ -
64void PNG_error_function(png_structp png_ptr,
│ │ │ │ -
65 png_const_charp error)
│ │ │ │ -
66{
│ │ │ │ -
67 // printf("PNG Error: %s\n", error);
│ │ │ │ -
68 // copied from libpng's pngerror.cpp
│ │ │ │ -
69 jmp_buf buf;
│ │ │ │ -
70#if PNG_LIBPNG_VER_MAJOR >= 1 && PNG_LIBPNG_VER_MINOR >= 4
│ │ │ │ -
71 memcpy(buf, png_jmpbuf((png_ptr)), sizeof(jmp_buf));
│ │ │ │ -
72#else
│ │ │ │ -
73 memcpy(buf, png_ptr->jmpbuf, sizeof(jmp_buf));
│ │ │ │ -
74#endif
│ │ │ │ -
75 longjmp(buf, 1);
│ │ │ │ -
76}
│ │ │ │ -
77
│ │ │ │ +
43
│ │ │ │ +
44// Start section of namespace SILLY
│ │ │ │ +
45namespace SILLY
│ │ │ │ +
46{
│ │ │ │ +
47
│ │ │ │ + │ │ │ │ +
49 : d_bpp(0), d_pixels(0), d_data(&source), d_imageContext(0), d_imageLoader(0)
│ │ │ │ +
50{
│ │ │ │ +
51}
│ │ │ │ +
52
│ │ │ │ +
53
│ │ │ │ + │ │ │ │ +
55{
│ │ │ │ +
56 ImageLoaderList::iterator iter = ImageLoaderManager::getSingleton().begin();
│ │ │ │ +
57 for (; ! d_imageLoader && iter != ImageLoaderManager::getSingleton().end() ; ++iter)
│ │ │ │ +
58 {
│ │ │ │ +
59 d_imageContext = (*iter)->loadHeader(d_pfSource, d_data);
│ │ │ │ +
60 if (d_imageContext)
│ │ │ │ +
61 d_imageLoader = (*iter);
│ │ │ │ +
62 }
│ │ │ │ +
63 assert((! d_imageLoader || d_imageContext) && "ASSERT: Internal state of image invalid");
│ │ │ │ +
64 return d_imageLoader != 0;
│ │ │ │ +
65
│ │ │ │ +
66}
│ │ │ │ +
67
│ │ │ │ + │ │ │ │ +
69{
│ │ │ │ +
70 switch (resultFormat)
│ │ │ │ +
71 {
│ │ │ │ +
72 case PF_A1B5G5R5:
│ │ │ │ +
73 d_bpp = 2;
│ │ │ │ +
74 break;
│ │ │ │ +
75 case PF_RGB:
│ │ │ │ +
76 d_bpp = 3;
│ │ │ │ +
77 break;
│ │ │ │
78
│ │ │ │ -
79PNGImageLoader::PNGImageLoader()
│ │ │ │ -
80 : ImageLoader("PNG Image Loader based on libpng")
│ │ │ │ -
81{
│ │ │ │ -
82}
│ │ │ │ -
83PNGImageLoader::~PNGImageLoader()
│ │ │ │ -
84{
│ │ │ │ -
85}
│ │ │ │ -
86
│ │ │ │ -
87
│ │ │ │ -
88ImageContext* PNGImageLoader::loadHeader(PixelFormat& formatSource, DataSource* data)
│ │ │ │ -
89{
│ │ │ │ -
90 PNGImageContext* png = new PNGImageContext(data);
│ │ │ │ -
91 if (!png)
│ │ │ │ -
92 {
│ │ │ │ -
93 return 0;
│ │ │ │ -
94
│ │ │ │ -
95 }
│ │ │ │ -
96 // Prepare png loading
│ │ │ │ -
97 png->d_png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, 0, 0, 0);
│ │ │ │ -
98 if (png->d_png_ptr == 0)
│ │ │ │ -
99 {
│ │ │ │ -
100 delete png;
│ │ │ │ -
101 return 0;
│ │ │ │ -
102 }
│ │ │ │ -
103 png->d_info_ptr = png_create_info_struct(png->d_png_ptr);
│ │ │ │ -
104 if (png->d_info_ptr == 0)
│ │ │ │ -
105 {
│ │ │ │ -
106 delete png;
│ │ │ │ -
107 return 0;
│ │ │ │ -
108 }
│ │ │ │ -
109 if (setjmp(png_jmpbuf(png->d_png_ptr)))
│ │ │ │ -
110 {
│ │ │ │ -
111 delete png;
│ │ │ │ -
112 return 0;
│ │ │ │ -
113 }
│ │ │ │ -
114 png_set_error_fn(png->d_png_ptr, 0, PNG_error_function, PNG_warning_function);
│ │ │ │ -
115 png_set_read_fn(png->d_png_ptr, png, PNG_read_function);
│ │ │ │ -
116 //png_set_sig_bytes(png->d_png_ptr, 8);
│ │ │ │ -
117
│ │ │ │ -
118
│ │ │ │ -
119
│ │ │ │ -
120 // Read header Check whether PNG can depaletize transparently or not
│ │ │ │ -
121 int png_transform = PNG_TRANSFORM_STRIP_16 | PNG_TRANSFORM_EXPAND;
│ │ │ │ -
122 //printf("Start reading png\n");
│ │ │ │ -
123 png_read_png(png->d_png_ptr, png->d_info_ptr, png_transform, 0);
│ │ │ │ -
124 png->setImageSize();
│ │ │ │ -
125 png->d_bit_depth = png_get_bit_depth(png->d_png_ptr, png->d_info_ptr);
│ │ │ │ -
126 png->d_num_channels = png_get_channels(png->d_png_ptr, png->d_info_ptr);
│ │ │ │ -
127 //printf("PNG Info: width: %d height: %d bpp: %d channels: %d\n", png->getWidth(), png->getHeight(), png->d_bit_depth, png->d_num_channels);
│ │ │ │ -
128 if (png->d_bit_depth == 8)
│ │ │ │ -
129 {
│ │ │ │ -
130 if (png->d_num_channels == 4)
│ │ │ │ -
131 {
│ │ │ │ -
132 formatSource = PF_RGBA;
│ │ │ │ -
133 }
│ │ │ │ -
134 else if (png->d_num_channels == 3)
│ │ │ │ -
135 {
│ │ │ │ -
136 formatSource = PF_RGB;
│ │ │ │ -
137 }
│ │ │ │ -
138 else
│ │ │ │ -
139 {
│ │ │ │ -
140 delete png;
│ │ │ │ -
141 return 0;
│ │ │ │ -
142 }
│ │ │ │ -
143 }
│ │ │ │ -
144 // Paletized or grayscale not yet handled
│ │ │ │ -
145 else
│ │ │ │ -
146 {
│ │ │ │ -
147 delete png;
│ │ │ │ -
148 return 0;
│ │ │ │ -
149 }
│ │ │ │ -
150 return png;
│ │ │ │ -
151}
│ │ │ │ -
152
│ │ │ │ -
153
│ │ │ │ -
154bool PNGImageLoader::loadImageData(PixelOrigin origin,
│ │ │ │ -
155 DataSource* data,
│ │ │ │ -
156 ImageContext* context)
│ │ │ │ -
157{
│ │ │ │ -
158 PNGImageContext* png = static_cast<PNGImageContext*>(context);
│ │ │ │ -
159 byte red;
│ │ │ │ -
160 byte green;
│ │ │ │ -
161 byte blue;
│ │ │ │ -
162 byte alpha;
│ │ │ │ -
163 size_t width = png->getWidth();
│ │ │ │ -
164 size_t height = png->getHeight();
│ │ │ │ -
165 png_bytepp row_pointers = png_get_rows(png->d_png_ptr, png->d_info_ptr);
│ │ │ │ -
166 if (png->d_bit_depth == 8)
│ │ │ │ -
167 {
│ │ │ │ -
168 // Read RGBA
│ │ │ │ -
169 if (png->d_num_channels == 4)
│ │ │ │ -
170 {
│ │ │ │ -
171 for (size_t j = 0 ; j < height ; ++j)
│ │ │ │ -
172 {
│ │ │ │ -
173 for(size_t i = 0 ; i < width ; ++i)
│ │ │ │ -
174 {
│ │ │ │ -
175 size_t pixel_offset = 4 * i;
│ │ │ │ -
176 red = *(row_pointers[j] + pixel_offset);
│ │ │ │ -
177 green = *(row_pointers[j] + pixel_offset + 1);
│ │ │ │ -
178 blue = *(row_pointers[j] + pixel_offset + 2);
│ │ │ │ -
179 alpha = *(row_pointers[j] + pixel_offset + 3);
│ │ │ │ -
180 png->setNextPixel(red, green, blue, alpha);
│ │ │ │ -
181 }
│ │ │ │ -
182 }
│ │ │ │ -
183 }
│ │ │ │ -
184 else if (png->d_num_channels == 3)
│ │ │ │ -
185 {
│ │ │ │ -
186 alpha = 0xff;
│ │ │ │ -
187 for (size_t j = 0 ; j < height ; ++j)
│ │ │ │ -
188 {
│ │ │ │ -
189 for(size_t i = 0 ; i < width ; ++i)
│ │ │ │ -
190 {
│ │ │ │ -
191 size_t pixel_offset = 3 * i;
│ │ │ │ -
192 red = *(row_pointers[j] + pixel_offset);
│ │ │ │ -
193 green = *(row_pointers[j] + pixel_offset + 1);
│ │ │ │ -
194 blue = *(row_pointers[j] + pixel_offset + 2);
│ │ │ │ -
195 png->setNextPixel(red, green, blue, alpha);
│ │ │ │ -
196 }
│ │ │ │ -
197 }
│ │ │ │ -
198
│ │ │ │ -
199 }
│ │ │ │ -
200 }
│ │ │ │ -
201 if (origin == PO_BOTTOM_LEFT)
│ │ │ │ -
202 return png->flipVertically();
│ │ │ │ -
203
│ │ │ │ -
204 return true;
│ │ │ │ -
205}
│ │ │ │ -
206
│ │ │ │ -
207} // End section of namespace SILLY
│ │ │ │ -
Simple Image Loading LibrarY namespace.
│ │ │ │ -
PixelFormat
List all pixel format supported.
Definition: SILLYBase.h:60
│ │ │ │ -
PixelOrigin
List all pixel origin supported.
Definition: SILLYBase.h:71
│ │ │ │ -
Image Context for PNG Image Loader.
│ │ │ │ -
This is an abstract class used to provide data to the loader.
│ │ │ │ -
Store the data needed by an ImageLoader object during the parsing of an image.
│ │ │ │ -
void setNextPixel(byte red, byte green, byte bleu, byte alpha)
Set the next pixel of the image.
│ │ │ │ -
bool flipVertically()
Flip pixel ordering.
│ │ │ │ +
79 case PF_RGBA:
│ │ │ │ +
80 d_bpp = 4;
│ │ │ │ +
81 break;
│ │ │ │ +
82 //default:
│ │ │ │ +
83 // Unsupported format
│ │ │ │ +
84 };
│ │ │ │ +
85
│ │ │ │ +
86 if (! allocate())
│ │ │ │ +
87 {
│ │ │ │ +
88 return false;
│ │ │ │ +
89 }
│ │ │ │ +
90 d_imageContext->setDestination(d_pixels, getWidth() * getHeight() * d_bpp, resultFormat);
│ │ │ │ +
91
│ │ │ │ +
92 if (! d_imageLoader->loadImageData(order, d_data, d_imageContext))
│ │ │ │ +
93 {
│ │ │ │ +
94 delete [] d_pixels;
│ │ │ │ +
95 return false;
│ │ │ │ +
96 }
│ │ │ │ +
97 return true;
│ │ │ │ +
98}
│ │ │ │ +
99
│ │ │ │ +
100bool Image::allocate()
│ │ │ │ +
101{
│ │ │ │ +
102 delete [] d_pixels;
│ │ │ │ +
103 d_pixels = 0;
│ │ │ │ +
104 d_pixels = new byte[d_bpp * getWidth() * getHeight()];
│ │ │ │ +
105 return d_pixels != 0;
│ │ │ │ +
106}
│ │ │ │ +
107
│ │ │ │ +
108} // End section of namespace SILLY
│ │ │ │ +
Simple Image Loading LibrarY namespace.
│ │ │ │ +
PixelFormat
List all pixel format supported.
Definition: SILLYBase.h:60
│ │ │ │ +
PixelOrigin
List all pixel origin supported.
Definition: SILLYBase.h:71
│ │ │ │ +
This is an abstract class used to provide data to the loader.
│ │ │ │ +
Image(DataSource &data)
Constructor.
Definition: SILLYImage.cpp:48
│ │ │ │ +
bool loadImageHeader()
Retrieve the information concerning the image object.
Definition: SILLYImage.cpp:54
│ │ │ │ +
bool loadImageData(PixelFormat resultFormat=PF_RGBA, PixelOrigin origin=PO_TOP_LEFT)
Load the image pixels in memory and store them in resultFormat.
Definition: SILLYImage.cpp:68
│ │ │ │ +
size_t getWidth() const
Retrieve the width of the image.
│ │ │ │ +
size_t getHeight() const
Retrieve the height of the image.
│ │ │ │ +
void setDestination(byte *pixels, size_t length, PixelFormat format)
Set the destination of the loading.
│ │ │ │ +
virtual bool loadImageData(PixelOrigin origin, DataSource *data, ImageContext *context)=0
Parse the pixels data of the image and fill the header struct.
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,22 +4,21 @@ │ │ │ │ │ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ │ │ │ │ │ * build │ │ │ │ │ * reproducible-path │ │ │ │ │ * silly-0.1.0 │ │ │ │ │ * src │ │ │ │ │ - * loaders │ │ │ │ │ -SILLYPNGImageLoader.cpp │ │ │ │ │ +SILLYImage.cpp │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ - 2 filename: SILLYPNGImageLoader.cpp │ │ │ │ │ - 3 created: 11 Jun 2006 │ │ │ │ │ + 2 filename: SILLYImage.cpp │ │ │ │ │ + 3 created: 10 Jun 2006 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ - 6 purpose: Definition of the PNGImageLoader methods │ │ │ │ │ + 6 purpose: Implementation of the Image class │ │ │ │ │ 7*************************************************************************/ │ │ │ │ │ 8/*************************************************************************** │ │ │ │ │ 9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team │ │ │ │ │ 10 * │ │ │ │ │ 11 * Permission is hereby granted, free of charge, to any person obtaining │ │ │ │ │ 12 * a copy of this software and associated documentation files (the │ │ │ │ │ 13 * "Software"), to deal in the Software without restriction, including │ │ │ │ │ @@ -38,218 +37,132 @@ │ │ │ │ │ 26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ │ │ │ │ 27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR │ │ │ │ │ 28 * OTHER DEALINGS IN THE SOFTWARE. │ │ │ │ │ 29 │ │ │ │ │ ***************************************************************************/ │ │ │ │ │ 30#ifdef HAVE_CONFIG_H │ │ │ │ │ 31#include │ │ │ │ │ - 32#include │ │ │ │ │ - 33#endif │ │ │ │ │ - 34 │ │ │ │ │ - 35#include "loaders/SILLYPNGImageLoader.h" │ │ │ │ │ - 36 │ │ │ │ │ - 37#ifndef SILLY_OPT_INLINE │ │ │ │ │ - 38#define inline │ │ │ │ │ - 39#include "loaders/SILLYPNGImageLoader.icpp" │ │ │ │ │ - 40#undef inline │ │ │ │ │ - 41#endif │ │ │ │ │ + 32#endif │ │ │ │ │ + 33 │ │ │ │ │ + 34#include "SILLYImage.h" │ │ │ │ │ + 35 │ │ │ │ │ + 36#ifndef SILLY_OPT_INLINE │ │ │ │ │ + 37#define inline │ │ │ │ │ + 38#include "SILLYImage.icpp" │ │ │ │ │ + 39#undef inline │ │ │ │ │ + 40#endif │ │ │ │ │ + 41#include "SILLYImageLoaderManager.h" │ │ │ │ │ 42 │ │ │ │ │ - 43#include "loaders/SILLYPNGImageContext.h" │ │ │ │ │ - 44#include │ │ │ │ │ - 45// Start section of namespace SILLY │ │ │ │ │ - 46namespace SILLY │ │ │ │ │ - 47{ │ │ │ │ │ - 48void PNG_read_function(png_structp png_ptr, png_bytep data, png_size_t │ │ │ │ │ -length) │ │ │ │ │ - 49{ │ │ │ │ │ - 50 PNGImageContext* png = reinterpret_cast(png_get_io_ptr │ │ │ │ │ -(png_ptr)); │ │ │ │ │ - 51 int readed = png->read(data, length); │ │ │ │ │ - 52 if (readed != (int)length) │ │ │ │ │ - 53 { │ │ │ │ │ - 54 png_error(png_ptr, "PNG_read_function error"); │ │ │ │ │ - 55 } │ │ │ │ │ - 56} │ │ │ │ │ - 57 │ │ │ │ │ - 58void PNG_warning_function(png_structp png_ptr, │ │ │ │ │ - 59 png_const_charp error) │ │ │ │ │ - 60{ │ │ │ │ │ - 61// printf("PNG Warning: %s\n", error); │ │ │ │ │ - 62} │ │ │ │ │ - 63 │ │ │ │ │ - 64void PNG_error_function(png_structp png_ptr, │ │ │ │ │ - 65 png_const_charp error) │ │ │ │ │ - 66{ │ │ │ │ │ - 67 // printf("PNG Error: %s\n", error); │ │ │ │ │ - 68 // copied from libpng's pngerror.cpp │ │ │ │ │ - 69 jmp_buf buf; │ │ │ │ │ - 70#if PNG_LIBPNG_VER_MAJOR >= 1 && PNG_LIBPNG_VER_MINOR >= 4 │ │ │ │ │ - 71 memcpy(buf, png_jmpbuf((png_ptr)), sizeof(jmp_buf)); │ │ │ │ │ - 72#else │ │ │ │ │ - 73 memcpy(buf, png_ptr->jmpbuf, sizeof(jmp_buf)); │ │ │ │ │ - 74#endif │ │ │ │ │ - 75 longjmp(buf, 1); │ │ │ │ │ - 76} │ │ │ │ │ - 77 │ │ │ │ │ + 43 │ │ │ │ │ + 44// Start section of namespace SILLY │ │ │ │ │ + 45namespace SILLY │ │ │ │ │ + 46{ │ │ │ │ │ + 47 │ │ │ │ │ +48Image::Image(DataSource& source) │ │ │ │ │ + 49 : d_bpp(0), d_pixels(0), d_data(&source), d_imageContext(0), d_imageLoader │ │ │ │ │ +(0) │ │ │ │ │ + 50{ │ │ │ │ │ + 51} │ │ │ │ │ + 52 │ │ │ │ │ + 53 │ │ │ │ │ +54bool Image::loadImageHeader() │ │ │ │ │ + 55{ │ │ │ │ │ + 56 ImageLoaderList::iterator iter = ImageLoaderManager::getSingleton().begin │ │ │ │ │ +(); │ │ │ │ │ + 57 for (; ! d_imageLoader && iter != ImageLoaderManager::getSingleton().end() │ │ │ │ │ +; ++iter) │ │ │ │ │ + 58 { │ │ │ │ │ + 59 d_imageContext = (*iter)->loadHeader(d_pfSource, d_data); │ │ │ │ │ + 60 if (d_imageContext) │ │ │ │ │ + 61 d_imageLoader = (*iter); │ │ │ │ │ + 62 } │ │ │ │ │ + 63 assert((! d_imageLoader || d_imageContext) && "ASSERT: Internal state of │ │ │ │ │ +image invalid"); │ │ │ │ │ + 64 return d_imageLoader != 0; │ │ │ │ │ + 65 │ │ │ │ │ + 66} │ │ │ │ │ + 67 │ │ │ │ │ +68bool Image::loadImageData(PixelFormat resultFormat, PixelOrigin order) │ │ │ │ │ + 69{ │ │ │ │ │ + 70 switch (resultFormat) │ │ │ │ │ + 71 { │ │ │ │ │ + 72 case PF_A1B5G5R5: │ │ │ │ │ + 73 d_bpp = 2; │ │ │ │ │ + 74 break; │ │ │ │ │ + 75 case PF_RGB: │ │ │ │ │ + 76 d_bpp = 3; │ │ │ │ │ + 77 break; │ │ │ │ │ 78 │ │ │ │ │ - 79PNGImageLoader::PNGImageLoader() │ │ │ │ │ - 80 : ImageLoader("PNG Image Loader based on libpng") │ │ │ │ │ - 81{ │ │ │ │ │ - 82} │ │ │ │ │ - 83PNGImageLoader::~PNGImageLoader() │ │ │ │ │ - 84{ │ │ │ │ │ - 85} │ │ │ │ │ - 86 │ │ │ │ │ - 87 │ │ │ │ │ -88ImageContext* PNGImageLoader::loadHeader(PixelFormat& formatSource, │ │ │ │ │ -DataSource* data) │ │ │ │ │ - 89{ │ │ │ │ │ - 90 PNGImageContext* png = new PNGImageContext(data); │ │ │ │ │ - 91 if (!png) │ │ │ │ │ - 92 { │ │ │ │ │ - 93 return 0; │ │ │ │ │ - 94 │ │ │ │ │ - 95 } │ │ │ │ │ - 96 // Prepare png loading │ │ │ │ │ - 97 png->d_png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, 0, 0, 0); │ │ │ │ │ - 98 if (png->d_png_ptr == 0) │ │ │ │ │ - 99 { │ │ │ │ │ - 100 delete png; │ │ │ │ │ - 101 return 0; │ │ │ │ │ - 102 } │ │ │ │ │ - 103 png->d_info_ptr = png_create_info_struct(png->d_png_ptr); │ │ │ │ │ - 104 if (png->d_info_ptr == 0) │ │ │ │ │ - 105 { │ │ │ │ │ - 106 delete png; │ │ │ │ │ - 107 return 0; │ │ │ │ │ - 108 } │ │ │ │ │ - 109 if (setjmp(png_jmpbuf(png->d_png_ptr))) │ │ │ │ │ - 110 { │ │ │ │ │ - 111 delete png; │ │ │ │ │ - 112 return 0; │ │ │ │ │ - 113 } │ │ │ │ │ - 114 png_set_error_fn(png->d_png_ptr, 0, PNG_error_function, │ │ │ │ │ -PNG_warning_function); │ │ │ │ │ - 115 png_set_read_fn(png->d_png_ptr, png, PNG_read_function); │ │ │ │ │ - 116 //png_set_sig_bytes(png->d_png_ptr, 8); │ │ │ │ │ - 117 │ │ │ │ │ - 118 │ │ │ │ │ - 119 │ │ │ │ │ - 120 // Read header Check whether PNG can depaletize transparently or not │ │ │ │ │ - 121 int png_transform = PNG_TRANSFORM_STRIP_16 | PNG_TRANSFORM_EXPAND; │ │ │ │ │ - 122 //printf("Start reading png\n"); │ │ │ │ │ - 123 png_read_png(png->d_png_ptr, png->d_info_ptr, png_transform, 0); │ │ │ │ │ - 124 png->setImageSize(); │ │ │ │ │ - 125 png->d_bit_depth = png_get_bit_depth(png->d_png_ptr, png->d_info_ptr); │ │ │ │ │ - 126 png->d_num_channels = png_get_channels(png->d_png_ptr, png->d_info_ptr); │ │ │ │ │ - 127 //printf("PNG Info: width: %d height: %d bpp: %d channels: %d\n", png- │ │ │ │ │ ->getWidth(), png->getHeight(), png->d_bit_depth, png->d_num_channels); │ │ │ │ │ - 128 if (png->d_bit_depth == 8) │ │ │ │ │ - 129 { │ │ │ │ │ - 130 if (png->d_num_channels == 4) │ │ │ │ │ - 131 { │ │ │ │ │ - 132 formatSource = PF_RGBA; │ │ │ │ │ - 133 } │ │ │ │ │ - 134 else if (png->d_num_channels == 3) │ │ │ │ │ - 135 { │ │ │ │ │ - 136 formatSource = PF_RGB; │ │ │ │ │ - 137 } │ │ │ │ │ - 138 else │ │ │ │ │ - 139 { │ │ │ │ │ - 140 delete png; │ │ │ │ │ - 141 return 0; │ │ │ │ │ - 142 } │ │ │ │ │ - 143 } │ │ │ │ │ - 144 // Paletized or grayscale not yet handled │ │ │ │ │ - 145 else │ │ │ │ │ - 146 { │ │ │ │ │ - 147 delete png; │ │ │ │ │ - 148 return 0; │ │ │ │ │ - 149 } │ │ │ │ │ - 150 return png; │ │ │ │ │ - 151} │ │ │ │ │ - 152 │ │ │ │ │ - 153 │ │ │ │ │ -154bool PNGImageLoader::loadImageData(PixelOrigin origin, │ │ │ │ │ - 155 DataSource* data, │ │ │ │ │ - 156 ImageContext* context) │ │ │ │ │ - 157{ │ │ │ │ │ - 158 PNGImageContext* png = static_cast(context); │ │ │ │ │ - 159 byte red; │ │ │ │ │ - 160 byte green; │ │ │ │ │ - 161 byte blue; │ │ │ │ │ - 162 byte alpha; │ │ │ │ │ - 163 size_t width = png->getWidth(); │ │ │ │ │ - 164 size_t height = png->getHeight(); │ │ │ │ │ - 165 png_bytepp row_pointers = png_get_rows(png->d_png_ptr, png->d_info_ptr); │ │ │ │ │ - 166 if (png->d_bit_depth == 8) │ │ │ │ │ - 167 { │ │ │ │ │ - 168 // Read RGBA │ │ │ │ │ - 169 if (png->d_num_channels == 4) │ │ │ │ │ - 170 { │ │ │ │ │ - 171 for (size_t j = 0 ; j < height ; ++j) │ │ │ │ │ - 172 { │ │ │ │ │ - 173 for(size_t i = 0 ; i < width ; ++i) │ │ │ │ │ - 174 { │ │ │ │ │ - 175 size_t pixel_offset = 4 * i; │ │ │ │ │ - 176 red = *(row_pointers[j] + pixel_offset); │ │ │ │ │ - 177 green = *(row_pointers[j] + pixel_offset + 1); │ │ │ │ │ - 178 blue = *(row_pointers[j] + pixel_offset + 2); │ │ │ │ │ - 179 alpha = *(row_pointers[j] + pixel_offset + 3); │ │ │ │ │ - 180 png->setNextPixel(red, green, blue, alpha); │ │ │ │ │ - 181 } │ │ │ │ │ - 182 } │ │ │ │ │ - 183 } │ │ │ │ │ - 184 else if (png->d_num_channels == 3) │ │ │ │ │ - 185 { │ │ │ │ │ - 186 alpha = 0xff; │ │ │ │ │ - 187 for (size_t j = 0 ; j < height ; ++j) │ │ │ │ │ - 188 { │ │ │ │ │ - 189 for(size_t i = 0 ; i < width ; ++i) │ │ │ │ │ - 190 { │ │ │ │ │ - 191 size_t pixel_offset = 3 * i; │ │ │ │ │ - 192 red = *(row_pointers[j] + pixel_offset); │ │ │ │ │ - 193 green = *(row_pointers[j] + pixel_offset + 1); │ │ │ │ │ - 194 blue = *(row_pointers[j] + pixel_offset + 2); │ │ │ │ │ - 195 png->setNextPixel(red, green, blue, alpha); │ │ │ │ │ - 196 } │ │ │ │ │ - 197 } │ │ │ │ │ - 198 │ │ │ │ │ - 199 } │ │ │ │ │ - 200 } │ │ │ │ │ - 201 if (origin == PO_BOTTOM_LEFT) │ │ │ │ │ - 202 return png->flipVertically(); │ │ │ │ │ - 203 │ │ │ │ │ - 204 return true; │ │ │ │ │ - 205} │ │ │ │ │ - 206 │ │ │ │ │ - 207} // End section of namespace SILLY │ │ │ │ │ + 79 case PF_RGBA: │ │ │ │ │ + 80 d_bpp = 4; │ │ │ │ │ + 81 break; │ │ │ │ │ + 82 //default: │ │ │ │ │ + 83 // Unsupported format │ │ │ │ │ + 84 }; │ │ │ │ │ + 85 │ │ │ │ │ + 86 if (! allocate()) │ │ │ │ │ + 87 { │ │ │ │ │ + 88 return false; │ │ │ │ │ + 89 } │ │ │ │ │ + 90 d_imageContext->setDestination(d_pixels, getWidth() * getHeight() * d_bpp, │ │ │ │ │ +resultFormat); │ │ │ │ │ + 91 │ │ │ │ │ + 92 if (! d_imageLoader->loadImageData(order, d_data, d_imageContext)) │ │ │ │ │ + 93 { │ │ │ │ │ + 94 delete [] d_pixels; │ │ │ │ │ + 95 return false; │ │ │ │ │ + 96 } │ │ │ │ │ + 97 return true; │ │ │ │ │ + 98} │ │ │ │ │ + 99 │ │ │ │ │ + 100bool Image::allocate() │ │ │ │ │ + 101{ │ │ │ │ │ + 102 delete [] d_pixels; │ │ │ │ │ + 103 d_pixels = 0; │ │ │ │ │ + 104 d_pixels = new byte[d_bpp * getWidth() * getHeight()]; │ │ │ │ │ + 105 return d_pixels != 0; │ │ │ │ │ + 106} │ │ │ │ │ + 107 │ │ │ │ │ + 108} // End section of namespace SILLY │ │ │ │ │ SILLY │ │ │ │ │ Simple Image Loading LibrarY namespace. │ │ │ │ │ Definition: SILLYJPGImageContext.cpp:46 │ │ │ │ │ SILLY::PixelFormat │ │ │ │ │ PixelFormat │ │ │ │ │ List all pixel format supported. │ │ │ │ │ Definition: SILLYBase.h:60 │ │ │ │ │ SILLY::PixelOrigin │ │ │ │ │ PixelOrigin │ │ │ │ │ List all pixel origin supported. │ │ │ │ │ Definition: SILLYBase.h:71 │ │ │ │ │ -SILLY::PNGImageContext │ │ │ │ │ -Image Context for PNG Image Loader. │ │ │ │ │ -Definition: SILLYPNGImageContext.h:46 │ │ │ │ │ SILLY::DataSource │ │ │ │ │ This is an abstract class used to provide data to the loader. │ │ │ │ │ Definition: SILLYDataSource.h:47 │ │ │ │ │ -SILLY::ImageContext │ │ │ │ │ -Store the data needed by an ImageLoader object during the parsing of an image. │ │ │ │ │ -Definition: SILLYImageContext.h:44 │ │ │ │ │ -SILLY::ImageContext::setNextPixel │ │ │ │ │ -void setNextPixel(byte red, byte green, byte bleu, byte alpha) │ │ │ │ │ -Set the next pixel of the image. │ │ │ │ │ -SILLY::ImageContext::flipVertically │ │ │ │ │ -bool flipVertically() │ │ │ │ │ -Flip pixel ordering. │ │ │ │ │ -Definition: SILLYImageContext.cpp:45 │ │ │ │ │ +SILLY::Image::Image │ │ │ │ │ +Image(DataSource &data) │ │ │ │ │ +Constructor. │ │ │ │ │ +Definition: SILLYImage.cpp:48 │ │ │ │ │ +SILLY::Image::loadImageHeader │ │ │ │ │ +bool loadImageHeader() │ │ │ │ │ +Retrieve the information concerning the image object. │ │ │ │ │ +Definition: SILLYImage.cpp:54 │ │ │ │ │ +SILLY::Image::loadImageData │ │ │ │ │ +bool loadImageData(PixelFormat resultFormat=PF_RGBA, PixelOrigin │ │ │ │ │ +origin=PO_TOP_LEFT) │ │ │ │ │ +Load the image pixels in memory and store them in resultFormat. │ │ │ │ │ +Definition: SILLYImage.cpp:68 │ │ │ │ │ +SILLY::Image::getWidth │ │ │ │ │ +size_t getWidth() const │ │ │ │ │ +Retrieve the width of the image. │ │ │ │ │ +SILLY::Image::getHeight │ │ │ │ │ +size_t getHeight() const │ │ │ │ │ +Retrieve the height of the image. │ │ │ │ │ +SILLY::ImageContext::setDestination │ │ │ │ │ +void setDestination(byte *pixels, size_t length, PixelFormat format) │ │ │ │ │ +Set the destination of the loading. │ │ │ │ │ +SILLY::ImageLoader::loadImageData │ │ │ │ │ +virtual bool loadImageData(PixelOrigin origin, DataSource *data, ImageContext │ │ │ │ │ +*context)=0 │ │ │ │ │ +Parse the pixels data of the image and fill the header struct. │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libsilly-doc/html/a00026_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/src/loaders/SILLYPNGImageContext.cpp Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/src/SILLYImageContext.cpp Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -35,27 +35,27 @@ │ │ │ │ initMenu('',false,false,'search.php','Search'); │ │ │ │ }); │ │ │ │ /* @license-end */ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYPNGImageContext.cpp
│ │ │ │ +
SILLYImageContext.cpp
│ │ │ │
│ │ │ │
│ │ │ │
1/***********************************************************************
│ │ │ │ -
2 filename: SILLYPNGImageContext.cpp
│ │ │ │ -
3 created: 11 Jun 2006
│ │ │ │ +
2 filename: SILLYImageContext.cpp
│ │ │ │ +
3 created: 10 Jun 2006
│ │ │ │
4 author: Olivier Delannoy
│ │ │ │
5
│ │ │ │ -
6 purpose: Definition of PNGImageContext methods
│ │ │ │ +
6 purpose: Implementation file for ImageContext class
│ │ │ │
7*************************************************************************/
│ │ │ │
8/***************************************************************************
│ │ │ │
9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
│ │ │ │
10 *
│ │ │ │
11 * Permission is hereby granted, free of charge, to any person obtaining
│ │ │ │
12 * a copy of this software and associated documentation files (the
│ │ │ │
13 * "Software"), to deal in the Software without restriction, including
│ │ │ │ @@ -75,66 +75,67 @@ │ │ │ │
27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
│ │ │ │
28 * OTHER DEALINGS IN THE SOFTWARE.
│ │ │ │
29 ***************************************************************************/
│ │ │ │
30#ifdef HAVE_CONFIG_H
│ │ │ │
31#include <config.h>
│ │ │ │
32#endif
│ │ │ │
33
│ │ │ │ -
34#include "loaders/SILLYPNGImageContext.h"
│ │ │ │ -
35
│ │ │ │ -
36#ifndef SILLY_OPT_INLINE
│ │ │ │ -
37#define inline
│ │ │ │ -
38#include "loaders/SILLYPNGImageContext.icpp"
│ │ │ │ -
39#undef inline
│ │ │ │ -
40#endif
│ │ │ │ -
41#include <string.h>
│ │ │ │ -
42
│ │ │ │ -
43// Start section of namespace SILLY
│ │ │ │ -
44namespace SILLY
│ │ │ │ -
45{
│ │ │ │ -
46int PNGImageContext::read(png_bytep data, png_size_t length)
│ │ │ │ -
47{
│ │ │ │ -
48 //printf("PNG Read: %d bytes offset: %d, size %d\n",
│ │ │ │ -
49 // length, d_offset, d_data->getSize());
│ │ │ │ -
50
│ │ │ │ -
51 if (d_offset + length > d_data->getSize())
│ │ │ │ -
52 return -1;
│ │ │ │ -
53 memcpy(data, d_data->getDataPtr() + d_offset, length);
│ │ │ │ -
54 d_offset += length;
│ │ │ │ -
55 return length;
│ │ │ │ -
56}
│ │ │ │ -
57
│ │ │ │ -
58
│ │ │ │ -
59PNGImageContext::PNGImageContext(DataSource* data)
│ │ │ │ -
60 : ImageContext(0,0), d_offset(0), d_data(data), d_png_ptr(0), d_info_ptr(0)
│ │ │ │ -
61{
│ │ │ │ -
62
│ │ │ │ -
63}
│ │ │ │ -
64
│ │ │ │ -
65PNGImageContext::~PNGImageContext()
│ │ │ │ -
66{
│ │ │ │ -
67 if (d_info_ptr)
│ │ │ │ -
68 png_destroy_read_struct(&d_png_ptr, &d_info_ptr, 0);
│ │ │ │ -
69 if (d_png_ptr)
│ │ │ │ -
70 png_destroy_read_struct(&d_png_ptr, 0, 0);
│ │ │ │ -
71}
│ │ │ │ -
72
│ │ │ │ -
73
│ │ │ │ -
74void PNGImageContext::setImageSize()
│ │ │ │ -
75{
│ │ │ │ -
76 setWidth(png_get_image_width(d_png_ptr, d_info_ptr));
│ │ │ │ -
77 setHeight(png_get_image_height(d_png_ptr, d_info_ptr));
│ │ │ │ -
78
│ │ │ │ -
79}
│ │ │ │ -
80
│ │ │ │ -
81
│ │ │ │ -
82} // End section of namespace SILLY
│ │ │ │ -
Simple Image Loading LibrarY namespace.
│ │ │ │ -
virtual size_t getSize() const =0
Return the size of the data.
│ │ │ │ -
virtual const byte * getDataPtr() const =0
Get raw access to the image data.
│ │ │ │ +
34#include "SILLYImageContext.h"
│ │ │ │ +
35#ifndef SILLY_OPT_INLINE
│ │ │ │ +
36#define inline
│ │ │ │ +
37#include "SILLYImageContext.icpp"
│ │ │ │ +
38#undef inline
│ │ │ │ +
39#endif
│ │ │ │ +
40#include <cstring>
│ │ │ │ +
41// Start section of namespace SILLY
│ │ │ │ +
42namespace SILLY
│ │ │ │ +
43{
│ │ │ │ +
44
│ │ │ │ + │ │ │ │ +
46{
│ │ │ │ +
47 size_t depth;
│ │ │ │ +
48 switch(d_format)
│ │ │ │ +
49 {
│ │ │ │ +
50 case PF_A1B5G5R5:
│ │ │ │ +
51 depth = 2;
│ │ │ │ +
52 break;
│ │ │ │ +
53 case PF_RGB:
│ │ │ │ +
54 depth = 3;
│ │ │ │ +
55 break;
│ │ │ │ +
56 case PF_RGBA:
│ │ │ │ +
57 depth = 4;
│ │ │ │ +
58 break;
│ │ │ │ +
59 }
│ │ │ │ +
60
│ │ │ │ +
61 // Do the flipping
│ │ │ │ +
62 byte *p1,*p2,*tmp; // tmp pointers
│ │ │ │ +
63 size_t len = d_width * depth; // length of horizontal line in bytes
│ │ │ │ +
64 tmp = new byte[len]; // Allocate a temporary line
│ │ │ │ +
65 if ( !tmp )
│ │ │ │ +
66 return false;
│ │ │ │ +
67
│ │ │ │ +
68 size_t y , y2;
│ │ │ │ +
69 y2 = d_height - 1;
│ │ │ │ +
70 for ( y = 0; y < d_height >> 1; y++ )
│ │ │ │ +
71 {
│ │ │ │ +
72 p1 = (d_pixels) + len * y;
│ │ │ │ +
73 p2 = (d_pixels) + len * y2;
│ │ │ │ +
74 memcpy( tmp, p1, len );
│ │ │ │ +
75 memcpy( p1, p2, len );
│ │ │ │ +
76 memcpy( p2, tmp, len );
│ │ │ │ +
77 y2--;
│ │ │ │ +
78 }
│ │ │ │ +
79 delete [] tmp;
│ │ │ │ +
80 return true;
│ │ │ │ +
81}
│ │ │ │ +
82
│ │ │ │ +
83
│ │ │ │ +
84} // End section of namespace SILLY
│ │ │ │ +
Simple Image Loading LibrarY namespace.
│ │ │ │ +
bool flipVertically()
Flip pixel ordering.
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,22 +4,21 @@ │ │ │ │ │ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ │ │ │ │ │ * build │ │ │ │ │ * reproducible-path │ │ │ │ │ * silly-0.1.0 │ │ │ │ │ * src │ │ │ │ │ - * loaders │ │ │ │ │ -SILLYPNGImageContext.cpp │ │ │ │ │ +SILLYImageContext.cpp │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ - 2 filename: SILLYPNGImageContext.cpp │ │ │ │ │ - 3 created: 11 Jun 2006 │ │ │ │ │ + 2 filename: SILLYImageContext.cpp │ │ │ │ │ + 3 created: 10 Jun 2006 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ - 6 purpose: Definition of PNGImageContext methods │ │ │ │ │ + 6 purpose: Implementation file for ImageContext class │ │ │ │ │ 7*************************************************************************/ │ │ │ │ │ 8/*************************************************************************** │ │ │ │ │ 9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team │ │ │ │ │ 10 * │ │ │ │ │ 11 * Permission is hereby granted, free of charge, to any person obtaining │ │ │ │ │ 12 * a copy of this software and associated documentation files (the │ │ │ │ │ 13 * "Software"), to deal in the Software without restriction, including │ │ │ │ │ @@ -40,68 +39,68 @@ │ │ │ │ │ 28 * OTHER DEALINGS IN THE SOFTWARE. │ │ │ │ │ 29 │ │ │ │ │ ***************************************************************************/ │ │ │ │ │ 30#ifdef HAVE_CONFIG_H │ │ │ │ │ 31#include │ │ │ │ │ 32#endif │ │ │ │ │ 33 │ │ │ │ │ - 34#include "loaders/SILLYPNGImageContext.h" │ │ │ │ │ - 35 │ │ │ │ │ - 36#ifndef SILLY_OPT_INLINE │ │ │ │ │ - 37#define inline │ │ │ │ │ - 38#include "loaders/SILLYPNGImageContext.icpp" │ │ │ │ │ - 39#undef inline │ │ │ │ │ - 40#endif │ │ │ │ │ - 41#include │ │ │ │ │ - 42 │ │ │ │ │ - 43// Start section of namespace SILLY │ │ │ │ │ - 44namespace SILLY │ │ │ │ │ - 45{ │ │ │ │ │ - 46int PNGImageContext::read(png_bytep data, png_size_t length) │ │ │ │ │ - 47{ │ │ │ │ │ - 48 //printf("PNG Read: %d bytes offset: %d, size %d\n", │ │ │ │ │ - 49 // length, d_offset, d_data->getSize()); │ │ │ │ │ - 50 │ │ │ │ │ - 51 if (d_offset + length > d_data->getSize()) │ │ │ │ │ - 52 return -1; │ │ │ │ │ - 53 memcpy(data, d_data->getDataPtr() + d_offset, length); │ │ │ │ │ - 54 d_offset += length; │ │ │ │ │ - 55 return length; │ │ │ │ │ - 56} │ │ │ │ │ - 57 │ │ │ │ │ - 58 │ │ │ │ │ - 59PNGImageContext::PNGImageContext(DataSource* data) │ │ │ │ │ - 60 : ImageContext(0,0), d_offset(0), d_data(data), d_png_ptr(0), d_info_ptr(0) │ │ │ │ │ - 61{ │ │ │ │ │ - 62 │ │ │ │ │ - 63} │ │ │ │ │ - 64 │ │ │ │ │ - 65PNGImageContext::~PNGImageContext() │ │ │ │ │ - 66{ │ │ │ │ │ - 67 if (d_info_ptr) │ │ │ │ │ - 68 png_destroy_read_struct(&d_png_ptr, &d_info_ptr, 0); │ │ │ │ │ - 69 if (d_png_ptr) │ │ │ │ │ - 70 png_destroy_read_struct(&d_png_ptr, 0, 0); │ │ │ │ │ - 71} │ │ │ │ │ - 72 │ │ │ │ │ - 73 │ │ │ │ │ - 74void PNGImageContext::setImageSize() │ │ │ │ │ - 75{ │ │ │ │ │ - 76 setWidth(png_get_image_width(d_png_ptr, d_info_ptr)); │ │ │ │ │ - 77 setHeight(png_get_image_height(d_png_ptr, d_info_ptr)); │ │ │ │ │ - 78 │ │ │ │ │ - 79} │ │ │ │ │ - 80 │ │ │ │ │ - 81 │ │ │ │ │ - 82} // End section of namespace SILLY │ │ │ │ │ + 34#include "SILLYImageContext.h" │ │ │ │ │ + 35#ifndef SILLY_OPT_INLINE │ │ │ │ │ + 36#define inline │ │ │ │ │ + 37#include "SILLYImageContext.icpp" │ │ │ │ │ + 38#undef inline │ │ │ │ │ + 39#endif │ │ │ │ │ + 40#include │ │ │ │ │ + 41// Start section of namespace SILLY │ │ │ │ │ + 42namespace SILLY │ │ │ │ │ + 43{ │ │ │ │ │ + 44 │ │ │ │ │ +45bool ImageContext::flipVertically() │ │ │ │ │ + 46{ │ │ │ │ │ + 47 size_t depth; │ │ │ │ │ + 48 switch(d_format) │ │ │ │ │ + 49 { │ │ │ │ │ + 50 case PF_A1B5G5R5: │ │ │ │ │ + 51 depth = 2; │ │ │ │ │ + 52 break; │ │ │ │ │ + 53 case PF_RGB: │ │ │ │ │ + 54 depth = 3; │ │ │ │ │ + 55 break; │ │ │ │ │ + 56 case PF_RGBA: │ │ │ │ │ + 57 depth = 4; │ │ │ │ │ + 58 break; │ │ │ │ │ + 59 } │ │ │ │ │ + 60 │ │ │ │ │ + 61 // Do the flipping │ │ │ │ │ + 62 byte *p1,*p2,*tmp; // tmp pointers │ │ │ │ │ + 63 size_t len = d_width * depth; // length of horizontal line in bytes │ │ │ │ │ + 64 tmp = new byte[len]; // Allocate a temporary line │ │ │ │ │ + 65 if ( !tmp ) │ │ │ │ │ + 66 return false; │ │ │ │ │ + 67 │ │ │ │ │ + 68 size_t y , y2; │ │ │ │ │ + 69 y2 = d_height - 1; │ │ │ │ │ + 70 for ( y = 0; y < d_height >> 1; y++ ) │ │ │ │ │ + 71 { │ │ │ │ │ + 72 p1 = (d_pixels) + len * y; │ │ │ │ │ + 73 p2 = (d_pixels) + len * y2; │ │ │ │ │ + 74 memcpy( tmp, p1, len ); │ │ │ │ │ + 75 memcpy( p1, p2, len ); │ │ │ │ │ + 76 memcpy( p2, tmp, len ); │ │ │ │ │ + 77 y2--; │ │ │ │ │ + 78 } │ │ │ │ │ + 79 delete [] tmp; │ │ │ │ │ + 80 return true; │ │ │ │ │ + 81} │ │ │ │ │ + 82 │ │ │ │ │ + 83 │ │ │ │ │ + 84} // End section of namespace SILLY │ │ │ │ │ SILLY │ │ │ │ │ Simple Image Loading LibrarY namespace. │ │ │ │ │ Definition: SILLYJPGImageContext.cpp:46 │ │ │ │ │ -SILLY::DataSource::getSize │ │ │ │ │ -virtual size_t getSize() const =0 │ │ │ │ │ -Return the size of the data. │ │ │ │ │ -SILLY::DataSource::getDataPtr │ │ │ │ │ -virtual const byte * getDataPtr() const =0 │ │ │ │ │ -Get raw access to the image data. │ │ │ │ │ +SILLY::ImageContext::flipVertically │ │ │ │ │ +bool flipVertically() │ │ │ │ │ +Flip pixel ordering. │ │ │ │ │ +Definition: SILLYImageContext.cpp:45 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libsilly-doc/html/a00029_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/src/SILLYImage.cpp Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/src/SILLYImageLoaderManager.cpp Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -39,23 +39,23 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYImage.cpp
│ │ │ │ +
SILLYImageLoaderManager.cpp
│ │ │ │
│ │ │ │
│ │ │ │
1/***********************************************************************
│ │ │ │ -
2 filename: SILLYImage.cpp
│ │ │ │ +
2 filename: ImageLoaderManager.cpp
│ │ │ │
3 created: 10 Jun 2006
│ │ │ │
4 author: Olivier Delannoy
│ │ │ │
5
│ │ │ │ -
6 purpose: Implementation of the Image class
│ │ │ │ +
6 purpose: Manage the list of existing ImageLoader
│ │ │ │
7*************************************************************************/
│ │ │ │
8/***************************************************************************
│ │ │ │
9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
│ │ │ │
10 *
│ │ │ │
11 * Permission is hereby granted, free of charge, to any person obtaining
│ │ │ │
12 * a copy of this software and associated documentation files (the
│ │ │ │
13 * "Software"), to deal in the Software without restriction, including
│ │ │ │ @@ -75,100 +75,101 @@ │ │ │ │
27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
│ │ │ │
28 * OTHER DEALINGS IN THE SOFTWARE.
│ │ │ │
29 ***************************************************************************/
│ │ │ │
30#ifdef HAVE_CONFIG_H
│ │ │ │
31#include <config.h>
│ │ │ │
32#endif
│ │ │ │
33
│ │ │ │ -
34#include "SILLYImage.h"
│ │ │ │ +
34#include "SILLYImageLoaderManager.h"
│ │ │ │
35
│ │ │ │
36#ifndef SILLY_OPT_INLINE
│ │ │ │
37#define inline
│ │ │ │ -
38#include "SILLYImage.icpp"
│ │ │ │ +
38#include "SILLYImageLoaderManager.icpp"
│ │ │ │
39#undef inline
│ │ │ │
40#endif
│ │ │ │ -
41#include "SILLYImageLoaderManager.h"
│ │ │ │ -
42
│ │ │ │ +
41#include "SILLYImageLoader.h"
│ │ │ │ +
42#include "loaders/SILLYTGAImageLoader.h"
│ │ │ │
43
│ │ │ │ -
44// Start section of namespace SILLY
│ │ │ │ -
45namespace SILLY
│ │ │ │ -
46{
│ │ │ │ +
44#ifdef SILLY_HAVE_JPG
│ │ │ │ +
45#include "loaders/SILLYJPGImageLoader.h"
│ │ │ │ +
46#endif
│ │ │ │
47
│ │ │ │ - │ │ │ │ -
49 : d_bpp(0), d_pixels(0), d_data(&source), d_imageContext(0), d_imageLoader(0)
│ │ │ │ -
50{
│ │ │ │ -
51}
│ │ │ │ -
52
│ │ │ │ -
53
│ │ │ │ - │ │ │ │ -
55{
│ │ │ │ -
56 ImageLoaderList::iterator iter = ImageLoaderManager::getSingleton().begin();
│ │ │ │ -
57 for (; ! d_imageLoader && iter != ImageLoaderManager::getSingleton().end() ; ++iter)
│ │ │ │ -
58 {
│ │ │ │ -
59 d_imageContext = (*iter)->loadHeader(d_pfSource, d_data);
│ │ │ │ -
60 if (d_imageContext)
│ │ │ │ -
61 d_imageLoader = (*iter);
│ │ │ │ -
62 }
│ │ │ │ -
63 assert((! d_imageLoader || d_imageContext) && "ASSERT: Internal state of image invalid");
│ │ │ │ -
64 return d_imageLoader != 0;
│ │ │ │ -
65
│ │ │ │ -
66}
│ │ │ │ -
67
│ │ │ │ - │ │ │ │ -
69{
│ │ │ │ -
70 switch (resultFormat)
│ │ │ │ -
71 {
│ │ │ │ -
72 case PF_A1B5G5R5:
│ │ │ │ -
73 d_bpp = 2;
│ │ │ │ -
74 break;
│ │ │ │ -
75 case PF_RGB:
│ │ │ │ -
76 d_bpp = 3;
│ │ │ │ -
77 break;
│ │ │ │ -
78
│ │ │ │ -
79 case PF_RGBA:
│ │ │ │ -
80 d_bpp = 4;
│ │ │ │ -
81 break;
│ │ │ │ -
82 //default:
│ │ │ │ -
83 // Unsupported format
│ │ │ │ -
84 };
│ │ │ │ +
48#ifdef SILLY_HAVE_PNG
│ │ │ │ +
49#include "loaders/SILLYPNGImageLoader.h"
│ │ │ │ +
50#endif
│ │ │ │ +
51
│ │ │ │ +
52// Start of SILLY namespace section
│ │ │ │ +
53namespace SILLY
│ │ │ │ +
54{
│ │ │ │ +
55
│ │ │ │ +
56// we need to do "reference counting" for init/exit to allow silly to be used
│ │ │ │ +
57// from inside multiple independent libraries simultaneously.
│ │ │ │ +
58static size_t silly_init_counter = 0;
│ │ │ │ +
59
│ │ │ │ +
60ImageLoaderManager* ImageLoaderManager::d_instance = 0;
│ │ │ │ +
61
│ │ │ │ + │ │ │ │ +
63{
│ │ │ │ +
64 assert(d_instance == 0);
│ │ │ │ +
65 d_instance = this;
│ │ │ │ + │ │ │ │ +
67#ifdef SILLY_HAVE_JPG
│ │ │ │ + │ │ │ │ +
69#endif
│ │ │ │ +
70#ifdef SILLY_HAVE_PNG
│ │ │ │ + │ │ │ │ +
72#endif
│ │ │ │ +
73// Add other builtins loader here
│ │ │ │ +
74
│ │ │ │ +
75}
│ │ │ │ +
76
│ │ │ │ + │ │ │ │ +
78{
│ │ │ │ +
79 for(ImageLoaderList::iterator iter = d_loaders.begin() ; iter != d_loaders.end() ; ++iter)
│ │ │ │ +
80 {
│ │ │ │ +
81 delete (*iter);
│ │ │ │ +
82 }
│ │ │ │ +
83 d_instance = 0;
│ │ │ │ +
84}
│ │ │ │
85
│ │ │ │ -
86 if (! allocate())
│ │ │ │ -
87 {
│ │ │ │ -
88 return false;
│ │ │ │ -
89 }
│ │ │ │ -
90 d_imageContext->setDestination(d_pixels, getWidth() * getHeight() * d_bpp, resultFormat);
│ │ │ │ -
91
│ │ │ │ -
92 if (! d_imageLoader->loadImageData(order, d_data, d_imageContext))
│ │ │ │ -
93 {
│ │ │ │ -
94 delete [] d_pixels;
│ │ │ │ -
95 return false;
│ │ │ │ -
96 }
│ │ │ │ +
86
│ │ │ │ + │ │ │ │ +
88{
│ │ │ │ +
89 if (ImageLoaderManager::getSingletonPtr() == 0)
│ │ │ │ +
90 {
│ │ │ │ +
91 if (!new ImageLoaderManager)
│ │ │ │ +
92 {
│ │ │ │ +
93 return false;
│ │ │ │ +
94 }
│ │ │ │ +
95 }
│ │ │ │ +
96 ++silly_init_counter;
│ │ │ │
97 return true;
│ │ │ │
98}
│ │ │ │
99
│ │ │ │ -
100bool Image::allocate()
│ │ │ │ + │ │ │ │
101{
│ │ │ │ -
102 delete [] d_pixels;
│ │ │ │ -
103 d_pixels = 0;
│ │ │ │ -
104 d_pixels = new byte[d_bpp * getWidth() * getHeight()];
│ │ │ │ -
105 return d_pixels != 0;
│ │ │ │ +
102 if (--silly_init_counter == 0)
│ │ │ │ +
103 {
│ │ │ │ +
104 delete ImageLoaderManager::getSingletonPtr();
│ │ │ │ +
105 }
│ │ │ │
106}
│ │ │ │
107
│ │ │ │ -
108} // End section of namespace SILLY
│ │ │ │ -
Simple Image Loading LibrarY namespace.
│ │ │ │ -
PixelFormat
List all pixel format supported.
Definition: SILLYBase.h:60
│ │ │ │ -
PixelOrigin
List all pixel origin supported.
Definition: SILLYBase.h:71
│ │ │ │ -
This is an abstract class used to provide data to the loader.
│ │ │ │ -
Image(DataSource &data)
Constructor.
Definition: SILLYImage.cpp:48
│ │ │ │ -
bool loadImageHeader()
Retrieve the information concerning the image object.
Definition: SILLYImage.cpp:54
│ │ │ │ -
bool loadImageData(PixelFormat resultFormat=PF_RGBA, PixelOrigin origin=PO_TOP_LEFT)
Load the image pixels in memory and store them in resultFormat.
Definition: SILLYImage.cpp:68
│ │ │ │ -
size_t getWidth() const
Retrieve the width of the image.
│ │ │ │ -
size_t getHeight() const
Retrieve the height of the image.
│ │ │ │ -
void setDestination(byte *pixels, size_t length, PixelFormat format)
Set the destination of the loading.
│ │ │ │ -
virtual bool loadImageData(PixelOrigin origin, DataSource *data, ImageContext *context)=0
Parse the pixels data of the image and fill the header struct.
│ │ │ │ +
108} // End of SILLY namespace section
│ │ │ │ +
109
│ │ │ │ +
110
│ │ │ │ +
Simple Image Loading LibrarY namespace.
│ │ │ │ +
void SILLYCleanup()
Cleanup SILLY library internal.
│ │ │ │ +
bool SILLYInit()
Initialize the SILLY Library.
│ │ │ │ +
Loader class for JPG Image.
│ │ │ │ +
Loader for PNG Image.
│ │ │ │ +
Loader for Targa image.
│ │ │ │ +
Manage the list of all supported ImageLoader.
│ │ │ │ + │ │ │ │ +
void add(ImageLoader *loader)
Register an ImageLoader object.
│ │ │ │ + │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,21 +4,21 @@ │ │ │ │ │ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ │ │ │ │ │ * build │ │ │ │ │ * reproducible-path │ │ │ │ │ * silly-0.1.0 │ │ │ │ │ * src │ │ │ │ │ -SILLYImage.cpp │ │ │ │ │ +SILLYImageLoaderManager.cpp │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ - 2 filename: SILLYImage.cpp │ │ │ │ │ + 2 filename: ImageLoaderManager.cpp │ │ │ │ │ 3 created: 10 Jun 2006 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ - 6 purpose: Implementation of the Image class │ │ │ │ │ + 6 purpose: Manage the list of existing ImageLoader │ │ │ │ │ 7*************************************************************************/ │ │ │ │ │ 8/*************************************************************************** │ │ │ │ │ 9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team │ │ │ │ │ 10 * │ │ │ │ │ 11 * Permission is hereby granted, free of charge, to any person obtaining │ │ │ │ │ 12 * a copy of this software and associated documentation files (the │ │ │ │ │ 13 * "Software"), to deal in the Software without restriction, including │ │ │ │ │ @@ -39,130 +39,123 @@ │ │ │ │ │ 28 * OTHER DEALINGS IN THE SOFTWARE. │ │ │ │ │ 29 │ │ │ │ │ ***************************************************************************/ │ │ │ │ │ 30#ifdef HAVE_CONFIG_H │ │ │ │ │ 31#include │ │ │ │ │ 32#endif │ │ │ │ │ 33 │ │ │ │ │ - 34#include "SILLYImage.h" │ │ │ │ │ + 34#include "SILLYImageLoaderManager.h" │ │ │ │ │ 35 │ │ │ │ │ 36#ifndef SILLY_OPT_INLINE │ │ │ │ │ 37#define inline │ │ │ │ │ - 38#include "SILLYImage.icpp" │ │ │ │ │ + 38#include "SILLYImageLoaderManager.icpp" │ │ │ │ │ 39#undef inline │ │ │ │ │ 40#endif │ │ │ │ │ - 41#include "SILLYImageLoaderManager.h" │ │ │ │ │ - 42 │ │ │ │ │ + 41#include "SILLYImageLoader.h" │ │ │ │ │ + 42#include "loaders/SILLYTGAImageLoader.h" │ │ │ │ │ 43 │ │ │ │ │ - 44// Start section of namespace SILLY │ │ │ │ │ - 45namespace SILLY │ │ │ │ │ - 46{ │ │ │ │ │ + 44#ifdef SILLY_HAVE_JPG │ │ │ │ │ + 45#include "loaders/SILLYJPGImageLoader.h" │ │ │ │ │ + 46#endif │ │ │ │ │ 47 │ │ │ │ │ -48Image::Image(DataSource& source) │ │ │ │ │ - 49 : d_bpp(0), d_pixels(0), d_data(&source), d_imageContext(0), d_imageLoader │ │ │ │ │ -(0) │ │ │ │ │ - 50{ │ │ │ │ │ - 51} │ │ │ │ │ - 52 │ │ │ │ │ - 53 │ │ │ │ │ -54bool Image::loadImageHeader() │ │ │ │ │ - 55{ │ │ │ │ │ - 56 ImageLoaderList::iterator iter = ImageLoaderManager::getSingleton().begin │ │ │ │ │ -(); │ │ │ │ │ - 57 for (; ! d_imageLoader && iter != ImageLoaderManager::getSingleton().end() │ │ │ │ │ -; ++iter) │ │ │ │ │ - 58 { │ │ │ │ │ - 59 d_imageContext = (*iter)->loadHeader(d_pfSource, d_data); │ │ │ │ │ - 60 if (d_imageContext) │ │ │ │ │ - 61 d_imageLoader = (*iter); │ │ │ │ │ - 62 } │ │ │ │ │ - 63 assert((! d_imageLoader || d_imageContext) && "ASSERT: Internal state of │ │ │ │ │ -image invalid"); │ │ │ │ │ - 64 return d_imageLoader != 0; │ │ │ │ │ - 65 │ │ │ │ │ - 66} │ │ │ │ │ - 67 │ │ │ │ │ -68bool Image::loadImageData(PixelFormat resultFormat, PixelOrigin order) │ │ │ │ │ - 69{ │ │ │ │ │ - 70 switch (resultFormat) │ │ │ │ │ - 71 { │ │ │ │ │ - 72 case PF_A1B5G5R5: │ │ │ │ │ - 73 d_bpp = 2; │ │ │ │ │ - 74 break; │ │ │ │ │ - 75 case PF_RGB: │ │ │ │ │ - 76 d_bpp = 3; │ │ │ │ │ - 77 break; │ │ │ │ │ - 78 │ │ │ │ │ - 79 case PF_RGBA: │ │ │ │ │ - 80 d_bpp = 4; │ │ │ │ │ - 81 break; │ │ │ │ │ - 82 //default: │ │ │ │ │ - 83 // Unsupported format │ │ │ │ │ - 84 }; │ │ │ │ │ + 48#ifdef SILLY_HAVE_PNG │ │ │ │ │ + 49#include "loaders/SILLYPNGImageLoader.h" │ │ │ │ │ + 50#endif │ │ │ │ │ + 51 │ │ │ │ │ + 52// Start of SILLY namespace section │ │ │ │ │ + 53namespace SILLY │ │ │ │ │ + 54{ │ │ │ │ │ + 55 │ │ │ │ │ + 56// we need to do "reference counting" for init/exit to allow silly to be │ │ │ │ │ +used │ │ │ │ │ + 57// from inside multiple independent libraries simultaneously. │ │ │ │ │ + 58static size_t silly_init_counter = 0; │ │ │ │ │ + 59 │ │ │ │ │ + 60ImageLoaderManager* ImageLoaderManager::d_instance = 0; │ │ │ │ │ + 61 │ │ │ │ │ +62ImageLoaderManager::ImageLoaderManager() │ │ │ │ │ + 63{ │ │ │ │ │ + 64 assert(d_instance == 0); │ │ │ │ │ + 65 d_instance = this; │ │ │ │ │ + 66 add(new TGAImageLoader); │ │ │ │ │ + 67#ifdef SILLY_HAVE_JPG │ │ │ │ │ + 68 add(new JPGImageLoader); │ │ │ │ │ + 69#endif │ │ │ │ │ + 70#ifdef SILLY_HAVE_PNG │ │ │ │ │ + 71 add(new PNGImageLoader); │ │ │ │ │ + 72#endif │ │ │ │ │ + 73// Add other builtins loader here │ │ │ │ │ + 74 │ │ │ │ │ + 75} │ │ │ │ │ + 76 │ │ │ │ │ +77ImageLoaderManager::~ImageLoaderManager() │ │ │ │ │ + 78{ │ │ │ │ │ + 79 for(ImageLoaderList::iterator iter = d_loaders.begin() ; iter != │ │ │ │ │ +d_loaders.end() ; ++iter) │ │ │ │ │ + 80 { │ │ │ │ │ + 81 delete (*iter); │ │ │ │ │ + 82 } │ │ │ │ │ + 83 d_instance = 0; │ │ │ │ │ + 84} │ │ │ │ │ 85 │ │ │ │ │ - 86 if (! allocate()) │ │ │ │ │ - 87 { │ │ │ │ │ - 88 return false; │ │ │ │ │ - 89 } │ │ │ │ │ - 90 d_imageContext->setDestination(d_pixels, getWidth() * getHeight() * d_bpp, │ │ │ │ │ -resultFormat); │ │ │ │ │ - 91 │ │ │ │ │ - 92 if (! d_imageLoader->loadImageData(order, d_data, d_imageContext)) │ │ │ │ │ - 93 { │ │ │ │ │ - 94 delete [] d_pixels; │ │ │ │ │ - 95 return false; │ │ │ │ │ - 96 } │ │ │ │ │ + 86 │ │ │ │ │ +87bool SILLYInit() │ │ │ │ │ + 88{ │ │ │ │ │ + 89 if (ImageLoaderManager::getSingletonPtr() == 0) │ │ │ │ │ + 90 { │ │ │ │ │ + 91 if (!new ImageLoaderManager) │ │ │ │ │ + 92 { │ │ │ │ │ + 93 return false; │ │ │ │ │ + 94 } │ │ │ │ │ + 95 } │ │ │ │ │ + 96 ++silly_init_counter; │ │ │ │ │ 97 return true; │ │ │ │ │ 98} │ │ │ │ │ 99 │ │ │ │ │ - 100bool Image::allocate() │ │ │ │ │ +100void SILLYCleanup() │ │ │ │ │ 101{ │ │ │ │ │ - 102 delete [] d_pixels; │ │ │ │ │ - 103 d_pixels = 0; │ │ │ │ │ - 104 d_pixels = new byte[d_bpp * getWidth() * getHeight()]; │ │ │ │ │ - 105 return d_pixels != 0; │ │ │ │ │ + 102 if (--silly_init_counter == 0) │ │ │ │ │ + 103 { │ │ │ │ │ + 104 delete ImageLoaderManager::getSingletonPtr(); │ │ │ │ │ + 105 } │ │ │ │ │ 106} │ │ │ │ │ 107 │ │ │ │ │ - 108} // End section of namespace SILLY │ │ │ │ │ + 108} // End of SILLY namespace section │ │ │ │ │ + 109 │ │ │ │ │ + 110 │ │ │ │ │ SILLY │ │ │ │ │ Simple Image Loading LibrarY namespace. │ │ │ │ │ Definition: SILLYJPGImageContext.cpp:46 │ │ │ │ │ -SILLY::PixelFormat │ │ │ │ │ -PixelFormat │ │ │ │ │ -List all pixel format supported. │ │ │ │ │ -Definition: SILLYBase.h:60 │ │ │ │ │ -SILLY::PixelOrigin │ │ │ │ │ -PixelOrigin │ │ │ │ │ -List all pixel origin supported. │ │ │ │ │ -Definition: SILLYBase.h:71 │ │ │ │ │ -SILLY::DataSource │ │ │ │ │ -This is an abstract class used to provide data to the loader. │ │ │ │ │ -Definition: SILLYDataSource.h:47 │ │ │ │ │ -SILLY::Image::Image │ │ │ │ │ -Image(DataSource &data) │ │ │ │ │ +SILLY::SILLYCleanup │ │ │ │ │ +void SILLYCleanup() │ │ │ │ │ +Cleanup SILLY library internal. │ │ │ │ │ +Definition: SILLYImageLoaderManager.cpp:100 │ │ │ │ │ +SILLY::SILLYInit │ │ │ │ │ +bool SILLYInit() │ │ │ │ │ +Initialize the SILLY Library. │ │ │ │ │ +Definition: SILLYImageLoaderManager.cpp:87 │ │ │ │ │ +SILLY::JPGImageLoader │ │ │ │ │ +Loader class for JPG Image. │ │ │ │ │ +Definition: SILLYJPGImageLoader.h:43 │ │ │ │ │ +SILLY::PNGImageLoader │ │ │ │ │ +Loader for PNG Image. │ │ │ │ │ +Definition: SILLYPNGImageLoader.h:43 │ │ │ │ │ +SILLY::TGAImageLoader │ │ │ │ │ +Loader for Targa image. │ │ │ │ │ +Definition: SILLYTGAImageLoader.h:44 │ │ │ │ │ +SILLY::ImageLoaderManager │ │ │ │ │ +Manage the list of all supported ImageLoader. │ │ │ │ │ +Definition: SILLYImageLoaderManager.h:57 │ │ │ │ │ +SILLY::ImageLoaderManager::~ImageLoaderManager │ │ │ │ │ +~ImageLoaderManager() │ │ │ │ │ +Destructor. │ │ │ │ │ +Definition: SILLYImageLoaderManager.cpp:77 │ │ │ │ │ +SILLY::ImageLoaderManager::add │ │ │ │ │ +void add(ImageLoader *loader) │ │ │ │ │ +Register an ImageLoader object. │ │ │ │ │ +SILLY::ImageLoaderManager::ImageLoaderManager │ │ │ │ │ +ImageLoaderManager() │ │ │ │ │ Constructor. │ │ │ │ │ -Definition: SILLYImage.cpp:48 │ │ │ │ │ -SILLY::Image::loadImageHeader │ │ │ │ │ -bool loadImageHeader() │ │ │ │ │ -Retrieve the information concerning the image object. │ │ │ │ │ -Definition: SILLYImage.cpp:54 │ │ │ │ │ -SILLY::Image::loadImageData │ │ │ │ │ -bool loadImageData(PixelFormat resultFormat=PF_RGBA, PixelOrigin │ │ │ │ │ -origin=PO_TOP_LEFT) │ │ │ │ │ -Load the image pixels in memory and store them in resultFormat. │ │ │ │ │ -Definition: SILLYImage.cpp:68 │ │ │ │ │ -SILLY::Image::getWidth │ │ │ │ │ -size_t getWidth() const │ │ │ │ │ -Retrieve the width of the image. │ │ │ │ │ -SILLY::Image::getHeight │ │ │ │ │ -size_t getHeight() const │ │ │ │ │ -Retrieve the height of the image. │ │ │ │ │ -SILLY::ImageContext::setDestination │ │ │ │ │ -void setDestination(byte *pixels, size_t length, PixelFormat format) │ │ │ │ │ -Set the destination of the loading. │ │ │ │ │ -SILLY::ImageLoader::loadImageData │ │ │ │ │ -virtual bool loadImageData(PixelOrigin origin, DataSource *data, ImageContext │ │ │ │ │ -*context)=0 │ │ │ │ │ -Parse the pixels data of the image and fill the header struct. │ │ │ │ │ +Definition: SILLYImageLoaderManager.cpp:62 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libsilly-doc/html/a00032_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/src/SILLYFileDataSource.cpp Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/src/SILLYMemoryDataSource.cpp Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -39,23 +39,23 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYFileDataSource.cpp
│ │ │ │ +
SILLYMemoryDataSource.cpp
│ │ │ │
│ │ │ │
│ │ │ │
1/***********************************************************************
│ │ │ │ -
2 filename: SILLYFileDataSource.cpp
│ │ │ │ -
3 created: 20 Jul 2006
│ │ │ │ +
2 filename: SILLYMemoryDataSource.cpp
│ │ │ │ +
3 created: 10 Jun 2006
│ │ │ │
4 author: Olivier Delannoy
│ │ │ │
5
│ │ │ │ -
6 purpose: Implementation of the FileDataSource methods
│ │ │ │ +
6 purpose: SILLYMemoryDataSource definition for the SILLY library
│ │ │ │
7*************************************************************************/
│ │ │ │
8/***************************************************************************
│ │ │ │
9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
│ │ │ │
10 *
│ │ │ │
11 * Permission is hereby granted, free of charge, to any person obtaining
│ │ │ │
12 * a copy of this software and associated documentation files (the
│ │ │ │
13 * "Software"), to deal in the Software without restriction, including
│ │ │ │ @@ -75,76 +75,38 @@ │ │ │ │
27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
│ │ │ │
28 * OTHER DEALINGS IN THE SOFTWARE.
│ │ │ │
29 ***************************************************************************/
│ │ │ │
30#ifdef HAVE_CONFIG_H
│ │ │ │
31#include <config.h>
│ │ │ │
32#endif
│ │ │ │
33
│ │ │ │ -
34#include "SILLYFileDataSource.h"
│ │ │ │ +
34#include "SILLYMemoryDataSource.h"
│ │ │ │
35
│ │ │ │
36#ifndef SILLY_OPT_INLINE
│ │ │ │
37#define inline
│ │ │ │ -
38#include "SILLYFileDataSource.icpp"
│ │ │ │ +
38#include "SILLYMemoryDataSource.icpp"
│ │ │ │
39#undef inline
│ │ │ │
40#endif
│ │ │ │ -
41#include <stdio.h>
│ │ │ │ -
42// Start section of namespace SILLY
│ │ │ │ +
41
│ │ │ │ +
42// Start of SILLY namespace section
│ │ │ │
43namespace SILLY
│ │ │ │
44{
│ │ │ │ -
45
│ │ │ │ -
46FileDataSource::FileDataSource(const char* filename)
│ │ │ │ -
47 : d_error(true), d_bytes(0), d_size(0)
│ │ │ │ +
45
│ │ │ │ +
46MemoryDataSource::MemoryDataSource(const byte* data, size_t size)
│ │ │ │ +
47 : d_bytes(data), d_size(size)
│ │ │ │
48{
│ │ │ │ -
49 FILE* data = fopen(filename, "rb");
│ │ │ │ -
50 if (data)
│ │ │ │ -
51 {
│ │ │ │ -
52 long status = fseek(data, 0, SEEK_END);
│ │ │ │ -
53 if (status == -1)
│ │ │ │ -
54 {
│ │ │ │ -
55 fclose(data);
│ │ │ │ -
56 return;
│ │ │ │ -
57 }
│ │ │ │ -
58 status = ftell(data);
│ │ │ │ -
59 if (status == -1)
│ │ │ │ -
60 {
│ │ │ │ -
61 fclose(data);
│ │ │ │ -
62 return;
│ │ │ │ -
63 }
│ │ │ │ -
64 d_size = status;
│ │ │ │ -
65 if (d_size)
│ │ │ │ -
66 d_bytes = new byte[d_size];
│ │ │ │ -
67 if (! d_bytes)
│ │ │ │ -
68 {
│ │ │ │ -
69 fclose(data);
│ │ │ │ -
70 return;
│ │ │ │ -
71 }
│ │ │ │ -
72 rewind(data);
│ │ │ │ -
73 status = fread(reinterpret_cast<void*>(d_bytes), 1, d_size, data);
│ │ │ │ -
74 if (status != d_size)
│ │ │ │ -
75 {
│ │ │ │ -
76 delete [] d_bytes;
│ │ │ │ -
77 d_bytes = 0;
│ │ │ │ -
78 fclose(data);
│ │ │ │ -
79 }
│ │ │ │ -
80 fclose(data);
│ │ │ │ -
81 d_error = false;
│ │ │ │ -
82 }
│ │ │ │ -
83}
│ │ │ │ -
84
│ │ │ │ -
85
│ │ │ │ - │ │ │ │ -
87{
│ │ │ │ -
88 delete [] d_bytes;
│ │ │ │ -
89}
│ │ │ │ -
90
│ │ │ │ -
91
│ │ │ │ -
92} // End section of namespace SILLY
│ │ │ │ -
Simple Image Loading LibrarY namespace.
│ │ │ │ -
FileDataSource(const char *filename)
Create a data source from an existing file.
│ │ │ │ - │ │ │ │ +
49 assert(data && "ASSERT: data point to an invalid memory");
│ │ │ │ +
50 assert(size && "ASSERT: size is equal to 0");
│ │ │ │ +
51}
│ │ │ │ +
52
│ │ │ │ +
53} // End of SILLY namespace section
│ │ │ │ +
54
│ │ │ │ +
55
│ │ │ │ +
Simple Image Loading LibrarY namespace.
│ │ │ │ +
MemoryDataSource(const byte *data, size_t size)
Create a data source from an existing memory area.
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,21 +4,21 @@ │ │ │ │ │ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ │ │ │ │ │ * build │ │ │ │ │ * reproducible-path │ │ │ │ │ * silly-0.1.0 │ │ │ │ │ * src │ │ │ │ │ -SILLYFileDataSource.cpp │ │ │ │ │ +SILLYMemoryDataSource.cpp │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ - 2 filename: SILLYFileDataSource.cpp │ │ │ │ │ - 3 created: 20 Jul 2006 │ │ │ │ │ + 2 filename: SILLYMemoryDataSource.cpp │ │ │ │ │ + 3 created: 10 Jun 2006 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ - 6 purpose: Implementation of the FileDataSource methods │ │ │ │ │ + 6 purpose: SILLYMemoryDataSource definition for the SILLY library │ │ │ │ │ 7*************************************************************************/ │ │ │ │ │ 8/*************************************************************************** │ │ │ │ │ 9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team │ │ │ │ │ 10 * │ │ │ │ │ 11 * Permission is hereby granted, free of charge, to any person obtaining │ │ │ │ │ 12 * a copy of this software and associated documentation files (the │ │ │ │ │ 13 * "Software"), to deal in the Software without restriction, including │ │ │ │ │ @@ -39,80 +39,39 @@ │ │ │ │ │ 28 * OTHER DEALINGS IN THE SOFTWARE. │ │ │ │ │ 29 │ │ │ │ │ ***************************************************************************/ │ │ │ │ │ 30#ifdef HAVE_CONFIG_H │ │ │ │ │ 31#include │ │ │ │ │ 32#endif │ │ │ │ │ 33 │ │ │ │ │ - 34#include "SILLYFileDataSource.h" │ │ │ │ │ + 34#include "SILLYMemoryDataSource.h" │ │ │ │ │ 35 │ │ │ │ │ 36#ifndef SILLY_OPT_INLINE │ │ │ │ │ 37#define inline │ │ │ │ │ - 38#include "SILLYFileDataSource.icpp" │ │ │ │ │ + 38#include "SILLYMemoryDataSource.icpp" │ │ │ │ │ 39#undef inline │ │ │ │ │ 40#endif │ │ │ │ │ - 41#include │ │ │ │ │ - 42// Start section of namespace SILLY │ │ │ │ │ + 41 │ │ │ │ │ + 42// Start of SILLY namespace section │ │ │ │ │ 43namespace SILLY │ │ │ │ │ 44{ │ │ │ │ │ 45 │ │ │ │ │ -46FileDataSource::FileDataSource(const char* filename) │ │ │ │ │ - 47 : d_error(true), d_bytes(0), d_size(0) │ │ │ │ │ +46MemoryDataSource::MemoryDataSource(const byte* data, size_t size) │ │ │ │ │ + 47 : d_bytes(data), d_size(size) │ │ │ │ │ 48{ │ │ │ │ │ - 49 FILE* data = fopen(filename, "rb"); │ │ │ │ │ - 50 if (data) │ │ │ │ │ - 51 { │ │ │ │ │ - 52 long status = fseek(data, 0, SEEK_END); │ │ │ │ │ - 53 if (status == -1) │ │ │ │ │ - 54 { │ │ │ │ │ - 55 fclose(data); │ │ │ │ │ - 56 return; │ │ │ │ │ - 57 } │ │ │ │ │ - 58 status = ftell(data); │ │ │ │ │ - 59 if (status == -1) │ │ │ │ │ - 60 { │ │ │ │ │ - 61 fclose(data); │ │ │ │ │ - 62 return; │ │ │ │ │ - 63 } │ │ │ │ │ - 64 d_size = status; │ │ │ │ │ - 65 if (d_size) │ │ │ │ │ - 66 d_bytes = new byte[d_size]; │ │ │ │ │ - 67 if (! d_bytes) │ │ │ │ │ - 68 { │ │ │ │ │ - 69 fclose(data); │ │ │ │ │ - 70 return; │ │ │ │ │ - 71 } │ │ │ │ │ - 72 rewind(data); │ │ │ │ │ - 73 status = fread(reinterpret_cast(d_bytes), 1, d_size, data); │ │ │ │ │ - 74 if (status != d_size) │ │ │ │ │ - 75 { │ │ │ │ │ - 76 delete [] d_bytes; │ │ │ │ │ - 77 d_bytes = 0; │ │ │ │ │ - 78 fclose(data); │ │ │ │ │ - 79 } │ │ │ │ │ - 80 fclose(data); │ │ │ │ │ - 81 d_error = false; │ │ │ │ │ - 82 } │ │ │ │ │ - 83} │ │ │ │ │ - 84 │ │ │ │ │ - 85 │ │ │ │ │ -86FileDataSource::~FileDataSource() │ │ │ │ │ - 87{ │ │ │ │ │ - 88 delete [] d_bytes; │ │ │ │ │ - 89} │ │ │ │ │ - 90 │ │ │ │ │ - 91 │ │ │ │ │ - 92} // End section of namespace SILLY │ │ │ │ │ + 49 assert(data && "ASSERT: data point to an invalid memory"); │ │ │ │ │ + 50 assert(size && "ASSERT: size is equal to 0"); │ │ │ │ │ + 51} │ │ │ │ │ + 52 │ │ │ │ │ + 53} // End of SILLY namespace section │ │ │ │ │ + 54 │ │ │ │ │ + 55 │ │ │ │ │ SILLY │ │ │ │ │ Simple Image Loading LibrarY namespace. │ │ │ │ │ Definition: SILLYJPGImageContext.cpp:46 │ │ │ │ │ -SILLY::FileDataSource::FileDataSource │ │ │ │ │ -FileDataSource(const char *filename) │ │ │ │ │ -Create a data source from an existing file. │ │ │ │ │ -Definition: SILLYFileDataSource.cpp:46 │ │ │ │ │ -SILLY::FileDataSource::~FileDataSource │ │ │ │ │ -~FileDataSource() │ │ │ │ │ -destructor │ │ │ │ │ -Definition: SILLYFileDataSource.cpp:86 │ │ │ │ │ +SILLY::MemoryDataSource::MemoryDataSource │ │ │ │ │ +MemoryDataSource(const byte *data, size_t size) │ │ │ │ │ +Create a data source from an existing memory area. │ │ │ │ │ +Definition: SILLYMemoryDataSource.cpp:46 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libsilly-doc/html/a00035_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/src/SILLYDataSource.cpp Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/src/SILLYImageLoader.cpp Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -39,23 +39,23 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYDataSource.cpp
│ │ │ │ +
SILLYImageLoader.cpp
│ │ │ │
│ │ │ │
│ │ │ │
1/***********************************************************************
│ │ │ │ -
2 filename: SILLYDataSource.cpp
│ │ │ │ +
2 filename: ImageLoader.cpp
│ │ │ │
3 created: 10 Jun 2006
│ │ │ │ -
4 author: Olivier Delannoy
│ │ │ │ +
4 author: Olivier Delannoy
│ │ │ │
5
│ │ │ │ -
6 purpose: SILLYDataSource definition for the SILLY library
│ │ │ │ +
6 purpose: Implementation of the ImageLoader
│ │ │ │
7*************************************************************************/
│ │ │ │
8/***************************************************************************
│ │ │ │
9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
│ │ │ │
10 *
│ │ │ │
11 * Permission is hereby granted, free of charge, to any person obtaining
│ │ │ │
12 * a copy of this software and associated documentation files (the
│ │ │ │
13 * "Software"), to deal in the Software without restriction, including
│ │ │ │ @@ -75,32 +75,41 @@ │ │ │ │
27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
│ │ │ │
28 * OTHER DEALINGS IN THE SOFTWARE.
│ │ │ │
29 ***************************************************************************/
│ │ │ │
30#ifdef HAVE_CONFIG_H
│ │ │ │
31#include <config.h>
│ │ │ │
32#endif
│ │ │ │
33
│ │ │ │ -
34#include "SILLYDataSource.h"
│ │ │ │ -
35
│ │ │ │ -
36#ifndef SILLY_OPT_INLINE
│ │ │ │ -
37#define inline
│ │ │ │ -
38#include "SILLYDataSource.icpp"
│ │ │ │ -
39#undef inline
│ │ │ │ -
40#endif
│ │ │ │ +
34#include "SILLYImageLoader.h"
│ │ │ │ +
35#ifndef SILLY_OPT_INLINE
│ │ │ │ +
36#define inline
│ │ │ │ +
37#include "SILLYImageLoader.icpp"
│ │ │ │ +
38#undef inline
│ │ │ │ +
39#endif
│ │ │ │ +
40#include "SILLYImageContext.h"
│ │ │ │
41
│ │ │ │
42// Start of SILLY namespace section
│ │ │ │
43namespace SILLY
│ │ │ │
44{
│ │ │ │ -
45
│ │ │ │ -
46} // End of SILLY namespace section
│ │ │ │ -
47
│ │ │ │ -
48
│ │ │ │ -
49
│ │ │ │ -
50
│ │ │ │ -
Simple Image Loading LibrarY namespace.
│ │ │ │ +
45
│ │ │ │ +
46
│ │ │ │ + │ │ │ │ +
48{
│ │ │ │ +
49 delete context;
│ │ │ │ +
50}
│ │ │ │ +
51
│ │ │ │ +
52
│ │ │ │ +
53} // end of SILLY namespace section
│ │ │ │ +
54
│ │ │ │ +
55
│ │ │ │ +
56
│ │ │ │ +
57
│ │ │ │ +
Simple Image Loading LibrarY namespace.
│ │ │ │ +
Store the data needed by an ImageLoader object during the parsing of an image.
│ │ │ │ +
void destroyContext(ImageContext *context)
Destroy the image context.
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,21 +4,21 @@ │ │ │ │ │ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ │ │ │ │ │ * build │ │ │ │ │ * reproducible-path │ │ │ │ │ * silly-0.1.0 │ │ │ │ │ * src │ │ │ │ │ -SILLYDataSource.cpp │ │ │ │ │ +SILLYImageLoader.cpp │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ - 2 filename: SILLYDataSource.cpp │ │ │ │ │ + 2 filename: ImageLoader.cpp │ │ │ │ │ 3 created: 10 Jun 2006 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ - 6 purpose: SILLYDataSource definition for the SILLY library │ │ │ │ │ + 6 purpose: Implementation of the ImageLoader │ │ │ │ │ 7*************************************************************************/ │ │ │ │ │ 8/*************************************************************************** │ │ │ │ │ 9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team │ │ │ │ │ 10 * │ │ │ │ │ 11 * Permission is hereby granted, free of charge, to any person obtaining │ │ │ │ │ 12 * a copy of this software and associated documentation files (the │ │ │ │ │ 13 * "Software"), to deal in the Software without restriction, including │ │ │ │ │ @@ -39,30 +39,44 @@ │ │ │ │ │ 28 * OTHER DEALINGS IN THE SOFTWARE. │ │ │ │ │ 29 │ │ │ │ │ ***************************************************************************/ │ │ │ │ │ 30#ifdef HAVE_CONFIG_H │ │ │ │ │ 31#include │ │ │ │ │ 32#endif │ │ │ │ │ 33 │ │ │ │ │ - 34#include "SILLYDataSource.h" │ │ │ │ │ - 35 │ │ │ │ │ - 36#ifndef SILLY_OPT_INLINE │ │ │ │ │ - 37#define inline │ │ │ │ │ - 38#include "SILLYDataSource.icpp" │ │ │ │ │ - 39#undef inline │ │ │ │ │ - 40#endif │ │ │ │ │ + 34#include "SILLYImageLoader.h" │ │ │ │ │ + 35#ifndef SILLY_OPT_INLINE │ │ │ │ │ + 36#define inline │ │ │ │ │ + 37#include "SILLYImageLoader.icpp" │ │ │ │ │ + 38#undef inline │ │ │ │ │ + 39#endif │ │ │ │ │ + 40#include "SILLYImageContext.h" │ │ │ │ │ 41 │ │ │ │ │ 42// Start of SILLY namespace section │ │ │ │ │ 43namespace SILLY │ │ │ │ │ 44{ │ │ │ │ │ 45 │ │ │ │ │ - 46} // End of SILLY namespace section │ │ │ │ │ - 47 │ │ │ │ │ - 48 │ │ │ │ │ - 49 │ │ │ │ │ - 50 │ │ │ │ │ + 46 │ │ │ │ │ +47void ImageLoader::destroyContext(ImageContext* context) │ │ │ │ │ + 48{ │ │ │ │ │ + 49 delete context; │ │ │ │ │ + 50} │ │ │ │ │ + 51 │ │ │ │ │ + 52 │ │ │ │ │ + 53} // end of SILLY namespace section │ │ │ │ │ + 54 │ │ │ │ │ + 55 │ │ │ │ │ + 56 │ │ │ │ │ + 57 │ │ │ │ │ SILLY │ │ │ │ │ Simple Image Loading LibrarY namespace. │ │ │ │ │ Definition: SILLYJPGImageContext.cpp:46 │ │ │ │ │ +SILLY::ImageContext │ │ │ │ │ +Store the data needed by an ImageLoader object during the parsing of an image. │ │ │ │ │ +Definition: SILLYImageContext.h:44 │ │ │ │ │ +SILLY::ImageLoader::destroyContext │ │ │ │ │ +void destroyContext(ImageContext *context) │ │ │ │ │ +Destroy the image context. │ │ │ │ │ +Definition: SILLYImageLoader.cpp:47 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libsilly-doc/html/a00038_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/src/SILLYImageLoaderManager.cpp Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/src/SILLYDataSource.cpp Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -39,23 +39,23 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYImageLoaderManager.cpp
│ │ │ │ +
SILLYDataSource.cpp
│ │ │ │
│ │ │ │
│ │ │ │
1/***********************************************************************
│ │ │ │ -
2 filename: ImageLoaderManager.cpp
│ │ │ │ +
2 filename: SILLYDataSource.cpp
│ │ │ │
3 created: 10 Jun 2006
│ │ │ │ -
4 author: Olivier Delannoy
│ │ │ │ +
4 author: Olivier Delannoy
│ │ │ │
5
│ │ │ │ -
6 purpose: Manage the list of existing ImageLoader
│ │ │ │ +
6 purpose: SILLYDataSource definition for the SILLY library
│ │ │ │
7*************************************************************************/
│ │ │ │
8/***************************************************************************
│ │ │ │
9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
│ │ │ │
10 *
│ │ │ │
11 * Permission is hereby granted, free of charge, to any person obtaining
│ │ │ │
12 * a copy of this software and associated documentation files (the
│ │ │ │
13 * "Software"), to deal in the Software without restriction, including
│ │ │ │ @@ -75,101 +75,32 @@ │ │ │ │
27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
│ │ │ │
28 * OTHER DEALINGS IN THE SOFTWARE.
│ │ │ │
29 ***************************************************************************/
│ │ │ │
30#ifdef HAVE_CONFIG_H
│ │ │ │
31#include <config.h>
│ │ │ │
32#endif
│ │ │ │
33
│ │ │ │ -
34#include "SILLYImageLoaderManager.h"
│ │ │ │ +
34#include "SILLYDataSource.h"
│ │ │ │
35
│ │ │ │
36#ifndef SILLY_OPT_INLINE
│ │ │ │
37#define inline
│ │ │ │ -
38#include "SILLYImageLoaderManager.icpp"
│ │ │ │ +
38#include "SILLYDataSource.icpp"
│ │ │ │
39#undef inline
│ │ │ │
40#endif
│ │ │ │ -
41#include "SILLYImageLoader.h"
│ │ │ │ -
42#include "loaders/SILLYTGAImageLoader.h"
│ │ │ │ -
43
│ │ │ │ -
44#ifdef SILLY_HAVE_JPG
│ │ │ │ -
45#include "loaders/SILLYJPGImageLoader.h"
│ │ │ │ -
46#endif
│ │ │ │ +
41
│ │ │ │ +
42// Start of SILLY namespace section
│ │ │ │ +
43namespace SILLY
│ │ │ │ +
44{
│ │ │ │ +
45
│ │ │ │ +
46} // End of SILLY namespace section
│ │ │ │
47
│ │ │ │ -
48#ifdef SILLY_HAVE_PNG
│ │ │ │ -
49#include "loaders/SILLYPNGImageLoader.h"
│ │ │ │ -
50#endif
│ │ │ │ -
51
│ │ │ │ -
52// Start of SILLY namespace section
│ │ │ │ -
53namespace SILLY
│ │ │ │ -
54{
│ │ │ │ -
55
│ │ │ │ -
56// we need to do "reference counting" for init/exit to allow silly to be used
│ │ │ │ -
57// from inside multiple independent libraries simultaneously.
│ │ │ │ -
58static size_t silly_init_counter = 0;
│ │ │ │ -
59
│ │ │ │ -
60ImageLoaderManager* ImageLoaderManager::d_instance = 0;
│ │ │ │ -
61
│ │ │ │ - │ │ │ │ -
63{
│ │ │ │ -
64 assert(d_instance == 0);
│ │ │ │ -
65 d_instance = this;
│ │ │ │ - │ │ │ │ -
67#ifdef SILLY_HAVE_JPG
│ │ │ │ - │ │ │ │ -
69#endif
│ │ │ │ -
70#ifdef SILLY_HAVE_PNG
│ │ │ │ - │ │ │ │ -
72#endif
│ │ │ │ -
73// Add other builtins loader here
│ │ │ │ -
74
│ │ │ │ -
75}
│ │ │ │ -
76
│ │ │ │ - │ │ │ │ -
78{
│ │ │ │ -
79 for(ImageLoaderList::iterator iter = d_loaders.begin() ; iter != d_loaders.end() ; ++iter)
│ │ │ │ -
80 {
│ │ │ │ -
81 delete (*iter);
│ │ │ │ -
82 }
│ │ │ │ -
83 d_instance = 0;
│ │ │ │ -
84}
│ │ │ │ -
85
│ │ │ │ -
86
│ │ │ │ - │ │ │ │ -
88{
│ │ │ │ -
89 if (ImageLoaderManager::getSingletonPtr() == 0)
│ │ │ │ -
90 {
│ │ │ │ -
91 if (!new ImageLoaderManager)
│ │ │ │ -
92 {
│ │ │ │ -
93 return false;
│ │ │ │ -
94 }
│ │ │ │ -
95 }
│ │ │ │ -
96 ++silly_init_counter;
│ │ │ │ -
97 return true;
│ │ │ │ -
98}
│ │ │ │ -
99
│ │ │ │ - │ │ │ │ -
101{
│ │ │ │ -
102 if (--silly_init_counter == 0)
│ │ │ │ -
103 {
│ │ │ │ -
104 delete ImageLoaderManager::getSingletonPtr();
│ │ │ │ -
105 }
│ │ │ │ -
106}
│ │ │ │ -
107
│ │ │ │ -
108} // End of SILLY namespace section
│ │ │ │ -
109
│ │ │ │ -
110
│ │ │ │ -
Simple Image Loading LibrarY namespace.
│ │ │ │ -
void SILLYCleanup()
Cleanup SILLY library internal.
│ │ │ │ -
bool SILLYInit()
Initialize the SILLY Library.
│ │ │ │ -
Loader class for JPG Image.
│ │ │ │ -
Loader for PNG Image.
│ │ │ │ -
Loader for Targa image.
│ │ │ │ -
Manage the list of all supported ImageLoader.
│ │ │ │ - │ │ │ │ -
void add(ImageLoader *loader)
Register an ImageLoader object.
│ │ │ │ - │ │ │ │ +
48
│ │ │ │ +
49
│ │ │ │ +
50
│ │ │ │ +
Simple Image Loading LibrarY namespace.
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,21 +4,21 @@ │ │ │ │ │ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ │ │ │ │ │ * build │ │ │ │ │ * reproducible-path │ │ │ │ │ * silly-0.1.0 │ │ │ │ │ * src │ │ │ │ │ -SILLYImageLoaderManager.cpp │ │ │ │ │ +SILLYDataSource.cpp │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ - 2 filename: ImageLoaderManager.cpp │ │ │ │ │ + 2 filename: SILLYDataSource.cpp │ │ │ │ │ 3 created: 10 Jun 2006 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ - 6 purpose: Manage the list of existing ImageLoader │ │ │ │ │ + 6 purpose: SILLYDataSource definition for the SILLY library │ │ │ │ │ 7*************************************************************************/ │ │ │ │ │ 8/*************************************************************************** │ │ │ │ │ 9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team │ │ │ │ │ 10 * │ │ │ │ │ 11 * Permission is hereby granted, free of charge, to any person obtaining │ │ │ │ │ 12 * a copy of this software and associated documentation files (the │ │ │ │ │ 13 * "Software"), to deal in the Software without restriction, including │ │ │ │ │ @@ -39,123 +39,30 @@ │ │ │ │ │ 28 * OTHER DEALINGS IN THE SOFTWARE. │ │ │ │ │ 29 │ │ │ │ │ ***************************************************************************/ │ │ │ │ │ 30#ifdef HAVE_CONFIG_H │ │ │ │ │ 31#include │ │ │ │ │ 32#endif │ │ │ │ │ 33 │ │ │ │ │ - 34#include "SILLYImageLoaderManager.h" │ │ │ │ │ + 34#include "SILLYDataSource.h" │ │ │ │ │ 35 │ │ │ │ │ 36#ifndef SILLY_OPT_INLINE │ │ │ │ │ 37#define inline │ │ │ │ │ - 38#include "SILLYImageLoaderManager.icpp" │ │ │ │ │ + 38#include "SILLYDataSource.icpp" │ │ │ │ │ 39#undef inline │ │ │ │ │ 40#endif │ │ │ │ │ - 41#include "SILLYImageLoader.h" │ │ │ │ │ - 42#include "loaders/SILLYTGAImageLoader.h" │ │ │ │ │ - 43 │ │ │ │ │ - 44#ifdef SILLY_HAVE_JPG │ │ │ │ │ - 45#include "loaders/SILLYJPGImageLoader.h" │ │ │ │ │ - 46#endif │ │ │ │ │ + 41 │ │ │ │ │ + 42// Start of SILLY namespace section │ │ │ │ │ + 43namespace SILLY │ │ │ │ │ + 44{ │ │ │ │ │ + 45 │ │ │ │ │ + 46} // End of SILLY namespace section │ │ │ │ │ 47 │ │ │ │ │ - 48#ifdef SILLY_HAVE_PNG │ │ │ │ │ - 49#include "loaders/SILLYPNGImageLoader.h" │ │ │ │ │ - 50#endif │ │ │ │ │ - 51 │ │ │ │ │ - 52// Start of SILLY namespace section │ │ │ │ │ - 53namespace SILLY │ │ │ │ │ - 54{ │ │ │ │ │ - 55 │ │ │ │ │ - 56// we need to do "reference counting" for init/exit to allow silly to be │ │ │ │ │ -used │ │ │ │ │ - 57// from inside multiple independent libraries simultaneously. │ │ │ │ │ - 58static size_t silly_init_counter = 0; │ │ │ │ │ - 59 │ │ │ │ │ - 60ImageLoaderManager* ImageLoaderManager::d_instance = 0; │ │ │ │ │ - 61 │ │ │ │ │ -62ImageLoaderManager::ImageLoaderManager() │ │ │ │ │ - 63{ │ │ │ │ │ - 64 assert(d_instance == 0); │ │ │ │ │ - 65 d_instance = this; │ │ │ │ │ - 66 add(new TGAImageLoader); │ │ │ │ │ - 67#ifdef SILLY_HAVE_JPG │ │ │ │ │ - 68 add(new JPGImageLoader); │ │ │ │ │ - 69#endif │ │ │ │ │ - 70#ifdef SILLY_HAVE_PNG │ │ │ │ │ - 71 add(new PNGImageLoader); │ │ │ │ │ - 72#endif │ │ │ │ │ - 73// Add other builtins loader here │ │ │ │ │ - 74 │ │ │ │ │ - 75} │ │ │ │ │ - 76 │ │ │ │ │ -77ImageLoaderManager::~ImageLoaderManager() │ │ │ │ │ - 78{ │ │ │ │ │ - 79 for(ImageLoaderList::iterator iter = d_loaders.begin() ; iter != │ │ │ │ │ -d_loaders.end() ; ++iter) │ │ │ │ │ - 80 { │ │ │ │ │ - 81 delete (*iter); │ │ │ │ │ - 82 } │ │ │ │ │ - 83 d_instance = 0; │ │ │ │ │ - 84} │ │ │ │ │ - 85 │ │ │ │ │ - 86 │ │ │ │ │ -87bool SILLYInit() │ │ │ │ │ - 88{ │ │ │ │ │ - 89 if (ImageLoaderManager::getSingletonPtr() == 0) │ │ │ │ │ - 90 { │ │ │ │ │ - 91 if (!new ImageLoaderManager) │ │ │ │ │ - 92 { │ │ │ │ │ - 93 return false; │ │ │ │ │ - 94 } │ │ │ │ │ - 95 } │ │ │ │ │ - 96 ++silly_init_counter; │ │ │ │ │ - 97 return true; │ │ │ │ │ - 98} │ │ │ │ │ - 99 │ │ │ │ │ -100void SILLYCleanup() │ │ │ │ │ - 101{ │ │ │ │ │ - 102 if (--silly_init_counter == 0) │ │ │ │ │ - 103 { │ │ │ │ │ - 104 delete ImageLoaderManager::getSingletonPtr(); │ │ │ │ │ - 105 } │ │ │ │ │ - 106} │ │ │ │ │ - 107 │ │ │ │ │ - 108} // End of SILLY namespace section │ │ │ │ │ - 109 │ │ │ │ │ - 110 │ │ │ │ │ + 48 │ │ │ │ │ + 49 │ │ │ │ │ + 50 │ │ │ │ │ SILLY │ │ │ │ │ Simple Image Loading LibrarY namespace. │ │ │ │ │ Definition: SILLYJPGImageContext.cpp:46 │ │ │ │ │ -SILLY::SILLYCleanup │ │ │ │ │ -void SILLYCleanup() │ │ │ │ │ -Cleanup SILLY library internal. │ │ │ │ │ -Definition: SILLYImageLoaderManager.cpp:100 │ │ │ │ │ -SILLY::SILLYInit │ │ │ │ │ -bool SILLYInit() │ │ │ │ │ -Initialize the SILLY Library. │ │ │ │ │ -Definition: SILLYImageLoaderManager.cpp:87 │ │ │ │ │ -SILLY::JPGImageLoader │ │ │ │ │ -Loader class for JPG Image. │ │ │ │ │ -Definition: SILLYJPGImageLoader.h:43 │ │ │ │ │ -SILLY::PNGImageLoader │ │ │ │ │ -Loader for PNG Image. │ │ │ │ │ -Definition: SILLYPNGImageLoader.h:43 │ │ │ │ │ -SILLY::TGAImageLoader │ │ │ │ │ -Loader for Targa image. │ │ │ │ │ -Definition: SILLYTGAImageLoader.h:44 │ │ │ │ │ -SILLY::ImageLoaderManager │ │ │ │ │ -Manage the list of all supported ImageLoader. │ │ │ │ │ -Definition: SILLYImageLoaderManager.h:57 │ │ │ │ │ -SILLY::ImageLoaderManager::~ImageLoaderManager │ │ │ │ │ -~ImageLoaderManager() │ │ │ │ │ -Destructor. │ │ │ │ │ -Definition: SILLYImageLoaderManager.cpp:77 │ │ │ │ │ -SILLY::ImageLoaderManager::add │ │ │ │ │ -void add(ImageLoader *loader) │ │ │ │ │ -Register an ImageLoader object. │ │ │ │ │ -SILLY::ImageLoaderManager::ImageLoaderManager │ │ │ │ │ -ImageLoaderManager() │ │ │ │ │ -Constructor. │ │ │ │ │ -Definition: SILLYImageLoaderManager.cpp:62 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libsilly-doc/html/a00041_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/SILLYImage.icpp Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/SILLYImageLoaderManager.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -39,101 +39,110 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYImage.icpp
│ │ │ │ +
SILLYImageLoaderManager.h
│ │ │ │
│ │ │ │
│ │ │ │ -
1/***********************************************************************
│ │ │ │ -
2 filename: SILLYImage.icpp
│ │ │ │ -
3 created: 10 Jun 2006
│ │ │ │ -
4 author: Olivier Delannoy
│ │ │ │ -
5
│ │ │ │ -
6 purpose: Inline definition of the image class
│ │ │ │ -
7*************************************************************************/
│ │ │ │ -
8/***************************************************************************
│ │ │ │ -
9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
│ │ │ │ -
10 *
│ │ │ │ -
11 * Permission is hereby granted, free of charge, to any person obtaining
│ │ │ │ -
12 * a copy of this software and associated documentation files (the
│ │ │ │ -
13 * "Software"), to deal in the Software without restriction, including
│ │ │ │ -
14 * without limitation the rights to use, copy, modify, merge, publish,
│ │ │ │ -
15 * distribute, sublicense, and/or sell copies of the Software, and to
│ │ │ │ -
16 * permit persons to whom the Software is furnished to do so, subject to
│ │ │ │ -
17 * the following conditions:
│ │ │ │ -
18 *
│ │ │ │ -
19 * The above copyright notice and this permission notice shall be
│ │ │ │ -
20 * included in all copies or substantial portions of the Software.
│ │ │ │ -
21 *
│ │ │ │ -
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
│ │ │ │ -
23 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
│ │ │ │ -
24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
│ │ │ │ -
25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
│ │ │ │ -
26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
│ │ │ │ -
27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
│ │ │ │ -
28 * OTHER DEALINGS IN THE SOFTWARE.
│ │ │ │ -
29 ***************************************************************************/
│ │ │ │ -
30
│ │ │ │ -
31// Start of section namespace SILLY
│ │ │ │ -
32namespace SILLY
│ │ │ │ -
33{
│ │ │ │ -
34
│ │ │ │ -
35inline bool Image::isValid() const
│ │ │ │ +
1/***********************************************************************
│ │ │ │ +
2 filename: ImageLoaderManager.h
│ │ │ │ +
3 created: 10 Jun 2006
│ │ │ │ +
4 author: Olivier Delannoy
│ │ │ │ +
5
│ │ │ │ +
6 purpose: Manage all available loader
│ │ │ │ +
7*************************************************************************/
│ │ │ │ +
8/***************************************************************************
│ │ │ │ +
9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
│ │ │ │ +
10 *
│ │ │ │ +
11 * Permission is hereby granted, free of charge, to any person obtaining
│ │ │ │ +
12 * a copy of this software and associated documentation files (the
│ │ │ │ +
13 * "Software"), to deal in the Software without restriction, including
│ │ │ │ +
14 * without limitation the rights to use, copy, modify, merge, publish,
│ │ │ │ +
15 * distribute, sublicense, and/or sell copies of the Software, and to
│ │ │ │ +
16 * permit persons to whom the Software is furnished to do so, subject to
│ │ │ │ +
17 * the following conditions:
│ │ │ │ +
18 *
│ │ │ │ +
19 * The above copyright notice and this permission notice shall be
│ │ │ │ +
20 * included in all copies or substantial portions of the Software.
│ │ │ │ +
21 *
│ │ │ │ +
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
│ │ │ │ +
23 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
│ │ │ │ +
24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
│ │ │ │ +
25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
│ │ │ │ +
26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
│ │ │ │ +
27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
│ │ │ │ +
28 * OTHER DEALINGS IN THE SOFTWARE.
│ │ │ │ +
29 ***************************************************************************/
│ │ │ │ +
30#ifndef _SILLYImageLoaderManager_h_
│ │ │ │ +
31#define _SILLYImageLoaderManager_h_
│ │ │ │ +
32#include "SILLYBase.h"
│ │ │ │ +
33#include <vector>
│ │ │ │ +
34// Start of section namespace SILLY
│ │ │ │ +
35namespace SILLY
│ │ │ │
36{
│ │ │ │ -
37 return d_imageContext && d_pixels;
│ │ │ │ -
38}
│ │ │ │ -
39
│ │ │ │ -
40inline size_t Image::getWidth() const
│ │ │ │ -
41{
│ │ │ │ -
42 return d_imageContext->getWidth();
│ │ │ │ -
43}
│ │ │ │ -
44
│ │ │ │ -
45inline size_t Image::getHeight() const
│ │ │ │ -
46{
│ │ │ │ -
47 return d_imageContext->getHeight();
│ │ │ │ -
48}
│ │ │ │ +
37class ImageLoader; // Forward declaration
│ │ │ │ +
42typedef std::vector<ImageLoader*> ImageLoaderList;
│ │ │ │ +
43
│ │ │ │ +
44#if defined(_MSC_VER)
│ │ │ │ +
45
│ │ │ │ +
46# pragma warning(push)
│ │ │ │ +
47
│ │ │ │ +
48# pragma warning(disable : 4251)
│ │ │ │
49
│ │ │ │ -
50inline PixelFormat Image::getSourcePixelFormat() const
│ │ │ │ -
51{
│ │ │ │ -
52 return d_pfSource;
│ │ │ │ -
53}
│ │ │ │ -
54
│ │ │ │ -
55inline PixelFormat Image::getPixelFormat() const
│ │ │ │ -
56{
│ │ │ │ -
57 return d_imageContext->getPixelFormat();
│ │ │ │ -
58}
│ │ │ │ -
59
│ │ │ │ -
60inline const byte* Image::getPixelsDataPtr() const
│ │ │ │ -
61{
│ │ │ │ -
62 return d_pixels;
│ │ │ │ -
63}
│ │ │ │ -
64
│ │ │ │ -
65inline size_t Image::getPixelsDataSize() const
│ │ │ │ -
66{
│ │ │ │ -
67 return getWidth() * getHeight() * d_bpp;
│ │ │ │ -
68}
│ │ │ │ -
69
│ │ │ │ -
70inline Image::~Image()
│ │ │ │ -
71{
│ │ │ │ -
72 delete [] d_pixels;
│ │ │ │ -
73 if (d_imageLoader)
│ │ │ │ -
74 d_imageLoader->destroyContext(d_imageContext);
│ │ │ │ -
75}
│ │ │ │ -
76inline const char* Image::getLoaderIdentifierString() const
│ │ │ │ -
77{
│ │ │ │ -
78 if (d_imageLoader)
│ │ │ │ -
79 return d_imageLoader->getIdentifierString();
│ │ │ │ -
80 return 0;
│ │ │ │ -
81}
│ │ │ │ -
82
│ │ │ │ -
83} // End of section namespace SILLY
│ │ │ │ -
84
│ │ │ │ +
50#endif
│ │ │ │ +
51
│ │ │ │ +
56class SILLY_EXPORT ImageLoaderManager
│ │ │ │ +
57{
│ │ │ │ +
58
│ │ │ │ +
59public:
│ │ │ │ + │ │ │ │ + │ │ │ │ +
74 ImageLoaderList::iterator begin();
│ │ │ │ +
79 ImageLoaderList::iterator end();
│ │ │ │ +
86 void add(ImageLoader* loader);
│ │ │ │ +
87
│ │ │ │ +
88private:
│ │ │ │ +
89 ImageLoaderList d_loaders;
│ │ │ │ +
90
│ │ │ │ +
91public:
│ │ │ │ +
92 static ImageLoaderManager* getSingletonPtr();
│ │ │ │ +
93 static ImageLoaderManager& getSingleton();
│ │ │ │ +
94
│ │ │ │ +
95private:
│ │ │ │ +
96 static ImageLoaderManager* d_instance;
│ │ │ │ +
97
│ │ │ │ +
98 // Disabled operations
│ │ │ │ + │ │ │ │ + │ │ │ │ +
101};
│ │ │ │ +
102
│ │ │ │ +
103#if defined(_MSC_VER)
│ │ │ │ +
104
│ │ │ │ +
105# pragma warning(pop)
│ │ │ │ +
106
│ │ │ │ +
107#endif
│ │ │ │ +
108
│ │ │ │ +
109} // End of section namespace SILLY
│ │ │ │ +
110
│ │ │ │ +
111// Inclue inline function when needed
│ │ │ │ +
112#ifdef SILLY_OPT_INLINE
│ │ │ │ +
113#include "SILLYImageLoaderManager.icpp"
│ │ │ │ +
114#endif
│ │ │ │ +
115
│ │ │ │ +
116#endif // end of guard _SILLYImageLoaderManager_h_
│ │ │ │ +
Simple Image Loading LibrarY namespace.
│ │ │ │ +
std::vector< ImageLoader * > ImageLoaderList
Typename for a collection of image loader.
│ │ │ │ +
This is an abstract class that define the interface of all image loader.
│ │ │ │ +
Manage the list of all supported ImageLoader.
│ │ │ │ +
void add(ImageLoader *loader)
Register an ImageLoader object.
│ │ │ │ +
ImageLoaderList::iterator begin()
Get an iterator to the first ImageLoader registered.
│ │ │ │ +
ImageLoaderList::iterator end()
Get an iterator to the first not registered ImageLoader.
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,21 +4,21 @@ │ │ │ │ │ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ │ │ │ │ │ * build │ │ │ │ │ * reproducible-path │ │ │ │ │ * silly-0.1.0 │ │ │ │ │ * include │ │ │ │ │ -SILLYImage.icpp │ │ │ │ │ +SILLYImageLoaderManager.h │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ - 2 filename: SILLYImage.icpp │ │ │ │ │ + 2 filename: ImageLoaderManager.h │ │ │ │ │ 3 created: 10 Jun 2006 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ - 6 purpose: Inline definition of the image class │ │ │ │ │ + 6 purpose: Manage all available loader │ │ │ │ │ 7*************************************************************************/ │ │ │ │ │ 8/*************************************************************************** │ │ │ │ │ 9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team │ │ │ │ │ 10 * │ │ │ │ │ 11 * Permission is hereby granted, free of charge, to any person obtaining │ │ │ │ │ 12 * a copy of this software and associated documentation files (the │ │ │ │ │ 13 * "Software"), to deal in the Software without restriction, including │ │ │ │ │ @@ -35,65 +35,89 @@ │ │ │ │ │ 24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. │ │ │ │ │ 25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR │ │ │ │ │ 26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ │ │ │ │ 27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR │ │ │ │ │ 28 * OTHER DEALINGS IN THE SOFTWARE. │ │ │ │ │ 29 │ │ │ │ │ ***************************************************************************/ │ │ │ │ │ - 30 │ │ │ │ │ - 31// Start of section namespace SILLY │ │ │ │ │ - 32namespace SILLY │ │ │ │ │ - 33{ │ │ │ │ │ - 34 │ │ │ │ │ - 35inline bool Image::isValid() const │ │ │ │ │ + 30#ifndef _SILLYImageLoaderManager_h_ │ │ │ │ │ + 31#define _SILLYImageLoaderManager_h_ │ │ │ │ │ + 32#include "SILLYBase.h" │ │ │ │ │ + 33#include │ │ │ │ │ + 34// Start of section namespace SILLY │ │ │ │ │ + 35namespace SILLY │ │ │ │ │ 36{ │ │ │ │ │ - 37 return d_imageContext && d_pixels; │ │ │ │ │ - 38} │ │ │ │ │ - 39 │ │ │ │ │ - 40inline size_t Image::getWidth() const │ │ │ │ │ - 41{ │ │ │ │ │ - 42 return d_imageContext->getWidth(); │ │ │ │ │ - 43} │ │ │ │ │ - 44 │ │ │ │ │ - 45inline size_t Image::getHeight() const │ │ │ │ │ - 46{ │ │ │ │ │ - 47 return d_imageContext->getHeight(); │ │ │ │ │ - 48} │ │ │ │ │ + 37class ImageLoader; // Forward declaration │ │ │ │ │ +42typedef std::vector ImageLoaderList; │ │ │ │ │ + 43 │ │ │ │ │ + 44#if defined(_MSC_VER) │ │ │ │ │ + 45 │ │ │ │ │ + 46# pragma warning(push) │ │ │ │ │ + 47 │ │ │ │ │ + 48# pragma warning(disable : 4251) │ │ │ │ │ 49 │ │ │ │ │ - 50inline PixelFormat Image::getSourcePixelFormat() const │ │ │ │ │ - 51{ │ │ │ │ │ - 52 return d_pfSource; │ │ │ │ │ - 53} │ │ │ │ │ - 54 │ │ │ │ │ - 55inline PixelFormat Image::getPixelFormat() const │ │ │ │ │ - 56{ │ │ │ │ │ - 57 return d_imageContext->getPixelFormat(); │ │ │ │ │ - 58} │ │ │ │ │ - 59 │ │ │ │ │ - 60inline const byte* Image::getPixelsDataPtr() const │ │ │ │ │ - 61{ │ │ │ │ │ - 62 return d_pixels; │ │ │ │ │ - 63} │ │ │ │ │ - 64 │ │ │ │ │ - 65inline size_t Image::getPixelsDataSize() const │ │ │ │ │ - 66{ │ │ │ │ │ - 67 return getWidth() * getHeight() * d_bpp; │ │ │ │ │ - 68} │ │ │ │ │ - 69 │ │ │ │ │ - 70inline Image::~Image() │ │ │ │ │ - 71{ │ │ │ │ │ - 72 delete [] d_pixels; │ │ │ │ │ - 73 if (d_imageLoader) │ │ │ │ │ - 74 d_imageLoader->destroyContext(d_imageContext); │ │ │ │ │ - 75} │ │ │ │ │ - 76inline const char* Image::getLoaderIdentifierString() const │ │ │ │ │ - 77{ │ │ │ │ │ - 78 if (d_imageLoader) │ │ │ │ │ - 79 return d_imageLoader->getIdentifierString(); │ │ │ │ │ - 80 return 0; │ │ │ │ │ - 81} │ │ │ │ │ - 82 │ │ │ │ │ - 83} // End of section namespace SILLY │ │ │ │ │ - 84 │ │ │ │ │ + 50#endif │ │ │ │ │ + 51 │ │ │ │ │ +56class SILLY_EXPORT ImageLoaderManager │ │ │ │ │ + 57{ │ │ │ │ │ + 58 │ │ │ │ │ + 59public: │ │ │ │ │ + 64 ImageLoaderManager(); │ │ │ │ │ + 69 ~ImageLoaderManager(); │ │ │ │ │ +74 ImageLoaderList::iterator begin(); │ │ │ │ │ +79 ImageLoaderList::iterator end(); │ │ │ │ │ +86 void add(ImageLoader* loader); │ │ │ │ │ + 87 │ │ │ │ │ + 88private: │ │ │ │ │ + 89 ImageLoaderList d_loaders; │ │ │ │ │ + 90 │ │ │ │ │ + 91public: │ │ │ │ │ + 92 static ImageLoaderManager* getSingletonPtr(); │ │ │ │ │ + 93 static ImageLoaderManager& getSingleton(); │ │ │ │ │ + 94 │ │ │ │ │ + 95private: │ │ │ │ │ + 96 static ImageLoaderManager* d_instance; │ │ │ │ │ + 97 │ │ │ │ │ + 98 // Disabled operations │ │ │ │ │ + 99 ImageLoaderManager(ImageLoaderManager&); │ │ │ │ │ + 100 ImageLoaderManager& operator=(ImageLoaderManager&); │ │ │ │ │ + 101}; │ │ │ │ │ + 102 │ │ │ │ │ + 103#if defined(_MSC_VER) │ │ │ │ │ + 104 │ │ │ │ │ + 105# pragma warning(pop) │ │ │ │ │ + 106 │ │ │ │ │ + 107#endif │ │ │ │ │ + 108 │ │ │ │ │ + 109} // End of section namespace SILLY │ │ │ │ │ + 110 │ │ │ │ │ + 111// Inclue inline function when needed │ │ │ │ │ + 112#ifdef SILLY_OPT_INLINE │ │ │ │ │ + 113#include "SILLYImageLoaderManager.icpp" │ │ │ │ │ + 114#endif │ │ │ │ │ + 115 │ │ │ │ │ + 116#endif // end of guard _SILLYImageLoaderManager_h_ │ │ │ │ │ +SILLY │ │ │ │ │ +Simple Image Loading LibrarY namespace. │ │ │ │ │ +Definition: SILLYJPGImageContext.cpp:46 │ │ │ │ │ +SILLY::ImageLoaderList │ │ │ │ │ +std::vector< ImageLoader * > ImageLoaderList │ │ │ │ │ +Typename for a collection of image loader. │ │ │ │ │ +Definition: SILLYImageLoaderManager.h:42 │ │ │ │ │ +SILLY::ImageLoader │ │ │ │ │ +This is an abstract class that define the interface of all image loader. │ │ │ │ │ +Definition: SILLYImageLoader.h:47 │ │ │ │ │ +SILLY::ImageLoaderManager │ │ │ │ │ +Manage the list of all supported ImageLoader. │ │ │ │ │ +Definition: SILLYImageLoaderManager.h:57 │ │ │ │ │ +SILLY::ImageLoaderManager::add │ │ │ │ │ +void add(ImageLoader *loader) │ │ │ │ │ +Register an ImageLoader object. │ │ │ │ │ +SILLY::ImageLoaderManager::begin │ │ │ │ │ +ImageLoaderList::iterator begin() │ │ │ │ │ +Get an iterator to the first ImageLoader registered. │ │ │ │ │ +SILLY::ImageLoaderManager::end │ │ │ │ │ +ImageLoaderList::iterator end() │ │ │ │ │ +Get an iterator to the first not registered ImageLoader. │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libsilly-doc/html/a00044_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/SILLYImageLoaderManager.h Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/SILLYOptions.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -39,110 +39,56 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYImageLoaderManager.h
│ │ │ │ +
SILLYOptions.h
│ │ │ │
│ │ │ │
│ │ │ │ -
1/***********************************************************************
│ │ │ │ -
2 filename: ImageLoaderManager.h
│ │ │ │ -
3 created: 10 Jun 2006
│ │ │ │ -
4 author: Olivier Delannoy
│ │ │ │ -
5
│ │ │ │ -
6 purpose: Manage all available loader
│ │ │ │ -
7*************************************************************************/
│ │ │ │ -
8/***************************************************************************
│ │ │ │ -
9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
│ │ │ │ -
10 *
│ │ │ │ -
11 * Permission is hereby granted, free of charge, to any person obtaining
│ │ │ │ -
12 * a copy of this software and associated documentation files (the
│ │ │ │ -
13 * "Software"), to deal in the Software without restriction, including
│ │ │ │ -
14 * without limitation the rights to use, copy, modify, merge, publish,
│ │ │ │ -
15 * distribute, sublicense, and/or sell copies of the Software, and to
│ │ │ │ -
16 * permit persons to whom the Software is furnished to do so, subject to
│ │ │ │ -
17 * the following conditions:
│ │ │ │ -
18 *
│ │ │ │ -
19 * The above copyright notice and this permission notice shall be
│ │ │ │ -
20 * included in all copies or substantial portions of the Software.
│ │ │ │ -
21 *
│ │ │ │ -
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
│ │ │ │ -
23 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
│ │ │ │ -
24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
│ │ │ │ -
25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
│ │ │ │ -
26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
│ │ │ │ -
27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
│ │ │ │ -
28 * OTHER DEALINGS IN THE SOFTWARE.
│ │ │ │ -
29 ***************************************************************************/
│ │ │ │ -
30#ifndef _SILLYImageLoaderManager_h_
│ │ │ │ -
31#define _SILLYImageLoaderManager_h_
│ │ │ │ -
32#include "SILLYBase.h"
│ │ │ │ -
33#include <vector>
│ │ │ │ -
34// Start of section namespace SILLY
│ │ │ │ -
35namespace SILLY
│ │ │ │ -
36{
│ │ │ │ -
37class ImageLoader; // Forward declaration
│ │ │ │ -
42typedef std::vector<ImageLoader*> ImageLoaderList;
│ │ │ │ -
43
│ │ │ │ -
44#if defined(_MSC_VER)
│ │ │ │ -
45
│ │ │ │ -
46# pragma warning(push)
│ │ │ │ -
47
│ │ │ │ -
48# pragma warning(disable : 4251)
│ │ │ │ -
49
│ │ │ │ -
50#endif
│ │ │ │ -
51
│ │ │ │ -
56class SILLY_EXPORT ImageLoaderManager
│ │ │ │ -
57{
│ │ │ │ -
58
│ │ │ │ -
59public:
│ │ │ │ - │ │ │ │ - │ │ │ │ -
74 ImageLoaderList::iterator begin();
│ │ │ │ -
79 ImageLoaderList::iterator end();
│ │ │ │ -
86 void add(ImageLoader* loader);
│ │ │ │ -
87
│ │ │ │ -
88private:
│ │ │ │ -
89 ImageLoaderList d_loaders;
│ │ │ │ -
90
│ │ │ │ -
91public:
│ │ │ │ -
92 static ImageLoaderManager* getSingletonPtr();
│ │ │ │ -
93 static ImageLoaderManager& getSingleton();
│ │ │ │ -
94
│ │ │ │ -
95private:
│ │ │ │ -
96 static ImageLoaderManager* d_instance;
│ │ │ │ -
97
│ │ │ │ -
98 // Disabled operations
│ │ │ │ - │ │ │ │ - │ │ │ │ -
101};
│ │ │ │ -
102
│ │ │ │ -
103#if defined(_MSC_VER)
│ │ │ │ -
104
│ │ │ │ -
105# pragma warning(pop)
│ │ │ │ -
106
│ │ │ │ -
107#endif
│ │ │ │ -
108
│ │ │ │ -
109} // End of section namespace SILLY
│ │ │ │ -
110
│ │ │ │ -
111// Inclue inline function when needed
│ │ │ │ -
112#ifdef SILLY_OPT_INLINE
│ │ │ │ -
113#include "SILLYImageLoaderManager.icpp"
│ │ │ │ -
114#endif
│ │ │ │ -
115
│ │ │ │ -
116#endif // end of guard _SILLYImageLoaderManager_h_
│ │ │ │ -
Simple Image Loading LibrarY namespace.
│ │ │ │ -
std::vector< ImageLoader * > ImageLoaderList
Typename for a collection of image loader.
│ │ │ │ -
This is an abstract class that define the interface of all image loader.
│ │ │ │ -
Manage the list of all supported ImageLoader.
│ │ │ │ -
void add(ImageLoader *loader)
Register an ImageLoader object.
│ │ │ │ -
ImageLoaderList::iterator begin()
Get an iterator to the first ImageLoader registered.
│ │ │ │ -
ImageLoaderList::iterator end()
Get an iterator to the first not registered ImageLoader.
│ │ │ │ +
1/* include/SILLYOptions.h. Generated from SILLYOptions.h.in by configure. */
│ │ │ │ +
2/***********************************************************************
│ │ │ │ +
3 filename: SILLYOptions.h.in
│ │ │ │ +
4 created: 2006/06/10
│ │ │ │ +
5 author: Olivier Delannoy
│ │ │ │ +
6
│ │ │ │ +
7 purpose: Store options of the SILLY library
│ │ │ │ +
8*************************************************************************/
│ │ │ │ +
9/***************************************************************************
│ │ │ │ +
10 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
│ │ │ │ +
11 *
│ │ │ │ +
12 * Permission is hereby granted, free of charge, to any person obtaining
│ │ │ │ +
13 * a copy of this software and associated documentation files (the
│ │ │ │ +
14 * "Software"), to deal in the Software without restriction, including
│ │ │ │ +
15 * without limitation the rights to use, copy, modify, merge, publish,
│ │ │ │ +
16 * distribute, sublicense, and/or sell copies of the Software, and to
│ │ │ │ +
17 * permit persons to whom the Software is furnished to do so, subject to
│ │ │ │ +
18 * the following conditions:
│ │ │ │ +
19 *
│ │ │ │ +
20 * The above copyright notice and this permission notice shall be
│ │ │ │ +
21 * included in all copies or substantial portions of the Software.
│ │ │ │ +
22 *
│ │ │ │ +
23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
│ │ │ │ +
24 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
│ │ │ │ +
25 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
│ │ │ │ +
26 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
│ │ │ │ +
27 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
│ │ │ │ +
28 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
│ │ │ │ +
29 * OTHER DEALINGS IN THE SOFTWARE.
│ │ │ │ +
30 ***************************************************************************/
│ │ │ │ +
31/* Defined to 1 if inline is enabled */
│ │ │ │ +
32#define SILLY_OPT_INLINE 1
│ │ │ │ +
33
│ │ │ │ +
34/* Defined to 1 if debug is enabled */
│ │ │ │ +
35/* #undef SILLY_OPT_DEBUG */
│ │ │ │ +
36
│ │ │ │ +
37/* Defined to 1 if profile is enabled */
│ │ │ │ +
38/* #undef SILLY_OPT_PROFILE */
│ │ │ │ +
39
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,120 +4,51 @@ │ │ │ │ │ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ │ │ │ │ │ * build │ │ │ │ │ * reproducible-path │ │ │ │ │ * silly-0.1.0 │ │ │ │ │ * include │ │ │ │ │ -SILLYImageLoaderManager.h │ │ │ │ │ - 1/*********************************************************************** │ │ │ │ │ - 2 filename: ImageLoaderManager.h │ │ │ │ │ - 3 created: 10 Jun 2006 │ │ │ │ │ - 4 author: Olivier Delannoy │ │ │ │ │ - 5 │ │ │ │ │ - 6 purpose: Manage all available loader │ │ │ │ │ - 7*************************************************************************/ │ │ │ │ │ - 8/*************************************************************************** │ │ │ │ │ - 9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team │ │ │ │ │ - 10 * │ │ │ │ │ - 11 * Permission is hereby granted, free of charge, to any person obtaining │ │ │ │ │ - 12 * a copy of this software and associated documentation files (the │ │ │ │ │ - 13 * "Software"), to deal in the Software without restriction, including │ │ │ │ │ - 14 * without limitation the rights to use, copy, modify, merge, publish, │ │ │ │ │ - 15 * distribute, sublicense, and/or sell copies of the Software, and to │ │ │ │ │ - 16 * permit persons to whom the Software is furnished to do so, subject to │ │ │ │ │ - 17 * the following conditions: │ │ │ │ │ - 18 * │ │ │ │ │ - 19 * The above copyright notice and this permission notice shall be │ │ │ │ │ - 20 * included in all copies or substantial portions of the Software. │ │ │ │ │ - 21 * │ │ │ │ │ - 22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, │ │ │ │ │ - 23 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF │ │ │ │ │ - 24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. │ │ │ │ │ - 25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR │ │ │ │ │ - 26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ │ │ │ │ - 27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR │ │ │ │ │ - 28 * OTHER DEALINGS IN THE SOFTWARE. │ │ │ │ │ - 29 │ │ │ │ │ +SILLYOptions.h │ │ │ │ │ + 1/* include/SILLYOptions.h. Generated from SILLYOptions.h.in by configure. */ │ │ │ │ │ + 2/*********************************************************************** │ │ │ │ │ + 3 filename: SILLYOptions.h.in │ │ │ │ │ + 4 created: 2006/06/10 │ │ │ │ │ + 5 author: Olivier Delannoy │ │ │ │ │ + 6 │ │ │ │ │ + 7 purpose: Store options of the SILLY library │ │ │ │ │ + 8*************************************************************************/ │ │ │ │ │ + 9/*************************************************************************** │ │ │ │ │ + 10 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team │ │ │ │ │ + 11 * │ │ │ │ │ + 12 * Permission is hereby granted, free of charge, to any person obtaining │ │ │ │ │ + 13 * a copy of this software and associated documentation files (the │ │ │ │ │ + 14 * "Software"), to deal in the Software without restriction, including │ │ │ │ │ + 15 * without limitation the rights to use, copy, modify, merge, publish, │ │ │ │ │ + 16 * distribute, sublicense, and/or sell copies of the Software, and to │ │ │ │ │ + 17 * permit persons to whom the Software is furnished to do so, subject to │ │ │ │ │ + 18 * the following conditions: │ │ │ │ │ + 19 * │ │ │ │ │ + 20 * The above copyright notice and this permission notice shall be │ │ │ │ │ + 21 * included in all copies or substantial portions of the Software. │ │ │ │ │ + 22 * │ │ │ │ │ + 23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, │ │ │ │ │ + 24 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF │ │ │ │ │ + 25 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. │ │ │ │ │ + 26 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR │ │ │ │ │ + 27 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ │ │ │ │ + 28 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR │ │ │ │ │ + 29 * OTHER DEALINGS IN THE SOFTWARE. │ │ │ │ │ + 30 │ │ │ │ │ ***************************************************************************/ │ │ │ │ │ - 30#ifndef _SILLYImageLoaderManager_h_ │ │ │ │ │ - 31#define _SILLYImageLoaderManager_h_ │ │ │ │ │ - 32#include "SILLYBase.h" │ │ │ │ │ - 33#include │ │ │ │ │ - 34// Start of section namespace SILLY │ │ │ │ │ - 35namespace SILLY │ │ │ │ │ - 36{ │ │ │ │ │ - 37class ImageLoader; // Forward declaration │ │ │ │ │ -42typedef std::vector ImageLoaderList; │ │ │ │ │ - 43 │ │ │ │ │ - 44#if defined(_MSC_VER) │ │ │ │ │ - 45 │ │ │ │ │ - 46# pragma warning(push) │ │ │ │ │ - 47 │ │ │ │ │ - 48# pragma warning(disable : 4251) │ │ │ │ │ - 49 │ │ │ │ │ - 50#endif │ │ │ │ │ - 51 │ │ │ │ │ -56class SILLY_EXPORT ImageLoaderManager │ │ │ │ │ - 57{ │ │ │ │ │ - 58 │ │ │ │ │ - 59public: │ │ │ │ │ - 64 ImageLoaderManager(); │ │ │ │ │ - 69 ~ImageLoaderManager(); │ │ │ │ │ -74 ImageLoaderList::iterator begin(); │ │ │ │ │ -79 ImageLoaderList::iterator end(); │ │ │ │ │ -86 void add(ImageLoader* loader); │ │ │ │ │ - 87 │ │ │ │ │ - 88private: │ │ │ │ │ - 89 ImageLoaderList d_loaders; │ │ │ │ │ - 90 │ │ │ │ │ - 91public: │ │ │ │ │ - 92 static ImageLoaderManager* getSingletonPtr(); │ │ │ │ │ - 93 static ImageLoaderManager& getSingleton(); │ │ │ │ │ - 94 │ │ │ │ │ - 95private: │ │ │ │ │ - 96 static ImageLoaderManager* d_instance; │ │ │ │ │ - 97 │ │ │ │ │ - 98 // Disabled operations │ │ │ │ │ - 99 ImageLoaderManager(ImageLoaderManager&); │ │ │ │ │ - 100 ImageLoaderManager& operator=(ImageLoaderManager&); │ │ │ │ │ - 101}; │ │ │ │ │ - 102 │ │ │ │ │ - 103#if defined(_MSC_VER) │ │ │ │ │ - 104 │ │ │ │ │ - 105# pragma warning(pop) │ │ │ │ │ - 106 │ │ │ │ │ - 107#endif │ │ │ │ │ - 108 │ │ │ │ │ - 109} // End of section namespace SILLY │ │ │ │ │ - 110 │ │ │ │ │ - 111// Inclue inline function when needed │ │ │ │ │ - 112#ifdef SILLY_OPT_INLINE │ │ │ │ │ - 113#include "SILLYImageLoaderManager.icpp" │ │ │ │ │ - 114#endif │ │ │ │ │ - 115 │ │ │ │ │ - 116#endif // end of guard _SILLYImageLoaderManager_h_ │ │ │ │ │ -SILLY │ │ │ │ │ -Simple Image Loading LibrarY namespace. │ │ │ │ │ -Definition: SILLYJPGImageContext.cpp:46 │ │ │ │ │ -SILLY::ImageLoaderList │ │ │ │ │ -std::vector< ImageLoader * > ImageLoaderList │ │ │ │ │ -Typename for a collection of image loader. │ │ │ │ │ -Definition: SILLYImageLoaderManager.h:42 │ │ │ │ │ -SILLY::ImageLoader │ │ │ │ │ -This is an abstract class that define the interface of all image loader. │ │ │ │ │ -Definition: SILLYImageLoader.h:47 │ │ │ │ │ -SILLY::ImageLoaderManager │ │ │ │ │ -Manage the list of all supported ImageLoader. │ │ │ │ │ -Definition: SILLYImageLoaderManager.h:57 │ │ │ │ │ -SILLY::ImageLoaderManager::add │ │ │ │ │ -void add(ImageLoader *loader) │ │ │ │ │ -Register an ImageLoader object. │ │ │ │ │ -SILLY::ImageLoaderManager::begin │ │ │ │ │ -ImageLoaderList::iterator begin() │ │ │ │ │ -Get an iterator to the first ImageLoader registered. │ │ │ │ │ -SILLY::ImageLoaderManager::end │ │ │ │ │ -ImageLoaderList::iterator end() │ │ │ │ │ -Get an iterator to the first not registered ImageLoader. │ │ │ │ │ + 31/* Defined to 1 if inline is enabled */ │ │ │ │ │ + 32#define SILLY_OPT_INLINE 1 │ │ │ │ │ + 33 │ │ │ │ │ + 34/* Defined to 1 if debug is enabled */ │ │ │ │ │ + 35/* #undef SILLY_OPT_DEBUG */ │ │ │ │ │ + 36 │ │ │ │ │ + 37/* Defined to 1 if profile is enabled */ │ │ │ │ │ + 38/* #undef SILLY_OPT_PROFILE */ │ │ │ │ │ + 39 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libsilly-doc/html/a00047_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/SILLYImageContext.h Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/SILLYImageLoader.icpp Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -39,104 +39,64 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYImageContext.h
│ │ │ │ +
SILLYImageLoader.icpp
│ │ │ │
│ │ │ │
│ │ │ │ -
1/***********************************************************************
│ │ │ │ -
2 filename: SILLYImageContext.h
│ │ │ │ -
3 created: 10 Jun 2006
│ │ │ │ -
4 author: Olivier Delannoy
│ │ │ │ -
5
│ │ │ │ -
6 purpose: ImageContext is an abstract class used to hide the loader specific data needed during the parsing of an image
│ │ │ │ -
7*************************************************************************/
│ │ │ │ -
8/***************************************************************************
│ │ │ │ -
9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
│ │ │ │ -
10 *
│ │ │ │ -
11 * Permission is hereby granted, free of charge, to any person obtaining
│ │ │ │ -
12 * a copy of this software and associated documentation files (the
│ │ │ │ -
13 * "Software"), to deal in the Software without restriction, including
│ │ │ │ -
14 * without limitation the rights to use, copy, modify, merge, publish,
│ │ │ │ -
15 * distribute, sublicense, and/or sell copies of the Software, and to
│ │ │ │ -
16 * permit persons to whom the Software is furnished to do so, subject to
│ │ │ │ -
17 * the following conditions:
│ │ │ │ -
18 *
│ │ │ │ -
19 * The above copyright notice and this permission notice shall be
│ │ │ │ -
20 * included in all copies or substantial portions of the Software.
│ │ │ │ -
21 *
│ │ │ │ -
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
│ │ │ │ -
23 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
│ │ │ │ -
24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
│ │ │ │ -
25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
│ │ │ │ -
26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
│ │ │ │ -
27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
│ │ │ │ -
28 * OTHER DEALINGS IN THE SOFTWARE.
│ │ │ │ -
29 ***************************************************************************/
│ │ │ │ -
30#ifndef _SILLYImageContext_h_
│ │ │ │ -
31#define _SILLYImageContext_h_
│ │ │ │ -
32#include "SILLYBase.h"
│ │ │ │ -
33
│ │ │ │ -
34// Start of section namespace SILLY
│ │ │ │ -
35namespace SILLY
│ │ │ │ +
1/***********************************************************************
│ │ │ │ +
2 filename: ImageLoader.icpp
│ │ │ │ +
3 created: 10 Jun 2006
│ │ │ │ +
4 author: Olivier Delannoy
│ │ │ │ +
5
│ │ │ │ +
6 purpose: Inline function definition for ImageLoader class
│ │ │ │ +
7*************************************************************************/
│ │ │ │ +
8/***************************************************************************
│ │ │ │ +
9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
│ │ │ │ +
10 *
│ │ │ │ +
11 * Permission is hereby granted, free of charge, to any person obtaining
│ │ │ │ +
12 * a copy of this software and associated documentation files (the
│ │ │ │ +
13 * "Software"), to deal in the Software without restriction, including
│ │ │ │ +
14 * without limitation the rights to use, copy, modify, merge, publish,
│ │ │ │ +
15 * distribute, sublicense, and/or sell copies of the Software, and to
│ │ │ │ +
16 * permit persons to whom the Software is furnished to do so, subject to
│ │ │ │ +
17 * the following conditions:
│ │ │ │ +
18 *
│ │ │ │ +
19 * The above copyright notice and this permission notice shall be
│ │ │ │ +
20 * included in all copies or substantial portions of the Software.
│ │ │ │ +
21 *
│ │ │ │ +
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
│ │ │ │ +
23 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
│ │ │ │ +
24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
│ │ │ │ +
25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
│ │ │ │ +
26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
│ │ │ │ +
27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
│ │ │ │ +
28 * OTHER DEALINGS IN THE SOFTWARE.
│ │ │ │ +
29 ***************************************************************************/
│ │ │ │ +
30
│ │ │ │ +
31// Start of section namespace SILLY
│ │ │ │ +
32namespace SILLY
│ │ │ │ +
33{
│ │ │ │ +
34inline ImageLoader::ImageLoader(const char* name)
│ │ │ │ +
35 : d_name(name)
│ │ │ │
36{
│ │ │ │ -
37
│ │ │ │ -
43class SILLY_EXPORT ImageContext
│ │ │ │ -
44{
│ │ │ │ -
45public:
│ │ │ │ -
50 virtual ~ImageContext();
│ │ │ │ -
51
│ │ │ │ -
56 void setDestination(byte* pixels, size_t length, PixelFormat format);
│ │ │ │ -
57
│ │ │ │ -
62 void setNextPixel(byte red, byte green, byte bleu, byte alpha);
│ │ │ │ -
63
│ │ │ │ -
64 size_t getWidth() const;
│ │ │ │ -
65 size_t getHeight() const;
│ │ │ │ -
66 PixelFormat getPixelFormat() const;
│ │ │ │ -
67
│ │ │ │ -
74 bool flipVertically();
│ │ │ │ -
75 protected:
│ │ │ │ -
76 void setWidth(size_t width);
│ │ │ │ -
77
│ │ │ │ -
78 void setHeight(size_t height);
│ │ │ │ -
79
│ │ │ │ -
88 ImageContext(size_t width, size_t height);
│ │ │ │ -
89
│ │ │ │ -
90private:
│ │ │ │ -
91 byte* d_pixels;
│ │ │ │ -
92 size_t d_length;
│ │ │ │ -
93 size_t d_width;
│ │ │ │ -
94 size_t d_height;
│ │ │ │ -
95 size_t d_currentOffset;
│ │ │ │ -
96 PixelFormat d_format;
│ │ │ │ -
97
│ │ │ │ -
98 // Disabled operation
│ │ │ │ - │ │ │ │ -
100 ImageContext& operator=(ImageContext&);
│ │ │ │ -
101};
│ │ │ │ -
102
│ │ │ │ -
103
│ │ │ │ -
104} // End of section namespace SILLY
│ │ │ │ -
105
│ │ │ │ -
106// Inclue inline function when needed
│ │ │ │ -
107#ifdef SILLY_OPT_INLINE
│ │ │ │ -
108#include "SILLYImageContext.icpp"
│ │ │ │ -
109#endif
│ │ │ │ -
110
│ │ │ │ -
111#endif // end of guard _SILLYImageContext_h_
│ │ │ │ -
Simple Image Loading LibrarY namespace.
│ │ │ │ -
PixelFormat
List all pixel format supported.
Definition: SILLYBase.h:60
│ │ │ │ -
Store the data needed by an ImageLoader object during the parsing of an image.
│ │ │ │ -
void setNextPixel(byte red, byte green, byte bleu, byte alpha)
Set the next pixel of the image.
│ │ │ │ -
void setDestination(byte *pixels, size_t length, PixelFormat format)
Set the destination of the loading.
│ │ │ │ -
ImageContext(size_t width, size_t height)
Constructor.
│ │ │ │ -
virtual ~ImageContext()
Destructor.
│ │ │ │ +
37}
│ │ │ │ +
38inline ImageLoader::~ImageLoader()
│ │ │ │ +
39{
│ │ │ │ +
40}
│ │ │ │ +
41inline const char* ImageLoader::getIdentifierString() const
│ │ │ │ +
42{
│ │ │ │ +
43 return d_name;
│ │ │ │ +
44}
│ │ │ │ +
45
│ │ │ │ +
46} // End of section namespace SILLY
│ │ │ │ +
47
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,22 +4,21 @@ │ │ │ │ │ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ │ │ │ │ │ * build │ │ │ │ │ * reproducible-path │ │ │ │ │ * silly-0.1.0 │ │ │ │ │ * include │ │ │ │ │ -SILLYImageContext.h │ │ │ │ │ +SILLYImageLoader.icpp │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ - 2 filename: SILLYImageContext.h │ │ │ │ │ + 2 filename: ImageLoader.icpp │ │ │ │ │ 3 created: 10 Jun 2006 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ - 6 purpose: ImageContext is an abstract class used to hide the loader specific │ │ │ │ │ -data needed during the parsing of an image │ │ │ │ │ + 6 purpose: Inline function definition for ImageLoader class │ │ │ │ │ 7*************************************************************************/ │ │ │ │ │ 8/*************************************************************************** │ │ │ │ │ 9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team │ │ │ │ │ 10 * │ │ │ │ │ 11 * Permission is hereby granted, free of charge, to any person obtaining │ │ │ │ │ 12 * a copy of this software and associated documentation files (the │ │ │ │ │ 13 * "Software"), to deal in the Software without restriction, including │ │ │ │ │ @@ -36,83 +35,28 @@ │ │ │ │ │ 24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. │ │ │ │ │ 25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR │ │ │ │ │ 26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ │ │ │ │ 27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR │ │ │ │ │ 28 * OTHER DEALINGS IN THE SOFTWARE. │ │ │ │ │ 29 │ │ │ │ │ ***************************************************************************/ │ │ │ │ │ - 30#ifndef _SILLYImageContext_h_ │ │ │ │ │ - 31#define _SILLYImageContext_h_ │ │ │ │ │ - 32#include "SILLYBase.h" │ │ │ │ │ - 33 │ │ │ │ │ - 34// Start of section namespace SILLY │ │ │ │ │ - 35namespace SILLY │ │ │ │ │ + 30 │ │ │ │ │ + 31// Start of section namespace SILLY │ │ │ │ │ + 32namespace SILLY │ │ │ │ │ + 33{ │ │ │ │ │ + 34inline ImageLoader::ImageLoader(const char* name) │ │ │ │ │ + 35 : d_name(name) │ │ │ │ │ 36{ │ │ │ │ │ - 37 │ │ │ │ │ -43class SILLY_EXPORT ImageContext │ │ │ │ │ - 44{ │ │ │ │ │ - 45public: │ │ │ │ │ -50 virtual ~ImageContext(); │ │ │ │ │ - 51 │ │ │ │ │ -56 void setDestination(byte* pixels, size_t length, PixelFormat format); │ │ │ │ │ - 57 │ │ │ │ │ -62 void setNextPixel(byte red, byte green, byte bleu, byte alpha); │ │ │ │ │ - 63 │ │ │ │ │ - 64 size_t getWidth() const; │ │ │ │ │ - 65 size_t getHeight() const; │ │ │ │ │ - 66 PixelFormat getPixelFormat() const; │ │ │ │ │ - 67 │ │ │ │ │ - 74 bool flipVertically(); │ │ │ │ │ - 75 protected: │ │ │ │ │ - 76 void setWidth(size_t width); │ │ │ │ │ - 77 │ │ │ │ │ - 78 void setHeight(size_t height); │ │ │ │ │ - 79 │ │ │ │ │ -88 ImageContext(size_t width, size_t height); │ │ │ │ │ - 89 │ │ │ │ │ - 90private: │ │ │ │ │ - 91 byte* d_pixels; │ │ │ │ │ - 92 size_t d_length; │ │ │ │ │ - 93 size_t d_width; │ │ │ │ │ - 94 size_t d_height; │ │ │ │ │ - 95 size_t d_currentOffset; │ │ │ │ │ - 96 PixelFormat d_format; │ │ │ │ │ - 97 │ │ │ │ │ - 98 // Disabled operation │ │ │ │ │ - 99 ImageContext(ImageContext&); │ │ │ │ │ - 100 ImageContext& operator=(ImageContext&); │ │ │ │ │ - 101}; │ │ │ │ │ - 102 │ │ │ │ │ - 103 │ │ │ │ │ - 104} // End of section namespace SILLY │ │ │ │ │ - 105 │ │ │ │ │ - 106// Inclue inline function when needed │ │ │ │ │ - 107#ifdef SILLY_OPT_INLINE │ │ │ │ │ - 108#include "SILLYImageContext.icpp" │ │ │ │ │ - 109#endif │ │ │ │ │ - 110 │ │ │ │ │ - 111#endif // end of guard _SILLYImageContext_h_ │ │ │ │ │ -SILLY │ │ │ │ │ -Simple Image Loading LibrarY namespace. │ │ │ │ │ -Definition: SILLYJPGImageContext.cpp:46 │ │ │ │ │ -SILLY::PixelFormat │ │ │ │ │ -PixelFormat │ │ │ │ │ -List all pixel format supported. │ │ │ │ │ -Definition: SILLYBase.h:60 │ │ │ │ │ -SILLY::ImageContext │ │ │ │ │ -Store the data needed by an ImageLoader object during the parsing of an image. │ │ │ │ │ -Definition: SILLYImageContext.h:44 │ │ │ │ │ -SILLY::ImageContext::setNextPixel │ │ │ │ │ -void setNextPixel(byte red, byte green, byte bleu, byte alpha) │ │ │ │ │ -Set the next pixel of the image. │ │ │ │ │ -SILLY::ImageContext::setDestination │ │ │ │ │ -void setDestination(byte *pixels, size_t length, PixelFormat format) │ │ │ │ │ -Set the destination of the loading. │ │ │ │ │ -SILLY::ImageContext::ImageContext │ │ │ │ │ -ImageContext(size_t width, size_t height) │ │ │ │ │ -Constructor. │ │ │ │ │ -SILLY::ImageContext::~ImageContext │ │ │ │ │ -virtual ~ImageContext() │ │ │ │ │ -Destructor. │ │ │ │ │ + 37} │ │ │ │ │ + 38inline ImageLoader::~ImageLoader() │ │ │ │ │ + 39{ │ │ │ │ │ + 40} │ │ │ │ │ + 41inline const char* ImageLoader::getIdentifierString() const │ │ │ │ │ + 42{ │ │ │ │ │ + 43 return d_name; │ │ │ │ │ + 44} │ │ │ │ │ + 45 │ │ │ │ │ + 46} // End of section namespace SILLY │ │ │ │ │ + 47 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libsilly-doc/html/a00050_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/SILLYImageLoader.icpp Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/SILLYImage.icpp Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -39,23 +39,23 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYImageLoader.icpp
│ │ │ │ +
SILLYImage.icpp
│ │ │ │
│ │ │ │
│ │ │ │
1/***********************************************************************
│ │ │ │ -
2 filename: ImageLoader.icpp
│ │ │ │ +
2 filename: SILLYImage.icpp
│ │ │ │
3 created: 10 Jun 2006
│ │ │ │
4 author: Olivier Delannoy
│ │ │ │
5
│ │ │ │ -
6 purpose: Inline function definition for ImageLoader class
│ │ │ │ +
6 purpose: Inline definition of the image class
│ │ │ │
7*************************************************************************/
│ │ │ │
8/***************************************************************************
│ │ │ │
9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
│ │ │ │
10 *
│ │ │ │
11 * Permission is hereby granted, free of charge, to any person obtaining
│ │ │ │
12 * a copy of this software and associated documentation files (the
│ │ │ │
13 * "Software"), to deal in the Software without restriction, including
│ │ │ │ @@ -75,28 +75,65 @@ │ │ │ │
27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
│ │ │ │
28 * OTHER DEALINGS IN THE SOFTWARE.
│ │ │ │
29 ***************************************************************************/
│ │ │ │
30
│ │ │ │
31// Start of section namespace SILLY
│ │ │ │
32namespace SILLY
│ │ │ │
33{
│ │ │ │ -
34inline ImageLoader::ImageLoader(const char* name)
│ │ │ │ -
35 : d_name(name)
│ │ │ │ +
34
│ │ │ │ +
35inline bool Image::isValid() const
│ │ │ │
36{
│ │ │ │ -
37}
│ │ │ │ -
38inline ImageLoader::~ImageLoader()
│ │ │ │ -
39{
│ │ │ │ -
40}
│ │ │ │ -
41inline const char* ImageLoader::getIdentifierString() const
│ │ │ │ -
42{
│ │ │ │ -
43 return d_name;
│ │ │ │ -
44}
│ │ │ │ -
45
│ │ │ │ -
46} // End of section namespace SILLY
│ │ │ │ -
47
│ │ │ │ +
37 return d_imageContext && d_pixels;
│ │ │ │ +
38}
│ │ │ │ +
39
│ │ │ │ +
40inline size_t Image::getWidth() const
│ │ │ │ +
41{
│ │ │ │ +
42 return d_imageContext->getWidth();
│ │ │ │ +
43}
│ │ │ │ +
44
│ │ │ │ +
45inline size_t Image::getHeight() const
│ │ │ │ +
46{
│ │ │ │ +
47 return d_imageContext->getHeight();
│ │ │ │ +
48}
│ │ │ │ +
49
│ │ │ │ +
50inline PixelFormat Image::getSourcePixelFormat() const
│ │ │ │ +
51{
│ │ │ │ +
52 return d_pfSource;
│ │ │ │ +
53}
│ │ │ │ +
54
│ │ │ │ +
55inline PixelFormat Image::getPixelFormat() const
│ │ │ │ +
56{
│ │ │ │ +
57 return d_imageContext->getPixelFormat();
│ │ │ │ +
58}
│ │ │ │ +
59
│ │ │ │ +
60inline const byte* Image::getPixelsDataPtr() const
│ │ │ │ +
61{
│ │ │ │ +
62 return d_pixels;
│ │ │ │ +
63}
│ │ │ │ +
64
│ │ │ │ +
65inline size_t Image::getPixelsDataSize() const
│ │ │ │ +
66{
│ │ │ │ +
67 return getWidth() * getHeight() * d_bpp;
│ │ │ │ +
68}
│ │ │ │ +
69
│ │ │ │ +
70inline Image::~Image()
│ │ │ │ +
71{
│ │ │ │ +
72 delete [] d_pixels;
│ │ │ │ +
73 if (d_imageLoader)
│ │ │ │ +
74 d_imageLoader->destroyContext(d_imageContext);
│ │ │ │ +
75}
│ │ │ │ +
76inline const char* Image::getLoaderIdentifierString() const
│ │ │ │ +
77{
│ │ │ │ +
78 if (d_imageLoader)
│ │ │ │ +
79 return d_imageLoader->getIdentifierString();
│ │ │ │ +
80 return 0;
│ │ │ │ +
81}
│ │ │ │ +
82
│ │ │ │ +
83} // End of section namespace SILLY
│ │ │ │ +
84
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,21 +4,21 @@ │ │ │ │ │ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ │ │ │ │ │ * build │ │ │ │ │ * reproducible-path │ │ │ │ │ * silly-0.1.0 │ │ │ │ │ * include │ │ │ │ │ -SILLYImageLoader.icpp │ │ │ │ │ +SILLYImage.icpp │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ - 2 filename: ImageLoader.icpp │ │ │ │ │ + 2 filename: SILLYImage.icpp │ │ │ │ │ 3 created: 10 Jun 2006 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ - 6 purpose: Inline function definition for ImageLoader class │ │ │ │ │ + 6 purpose: Inline definition of the image class │ │ │ │ │ 7*************************************************************************/ │ │ │ │ │ 8/*************************************************************************** │ │ │ │ │ 9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team │ │ │ │ │ 10 * │ │ │ │ │ 11 * Permission is hereby granted, free of charge, to any person obtaining │ │ │ │ │ 12 * a copy of this software and associated documentation files (the │ │ │ │ │ 13 * "Software"), to deal in the Software without restriction, including │ │ │ │ │ @@ -39,24 +39,61 @@ │ │ │ │ │ 28 * OTHER DEALINGS IN THE SOFTWARE. │ │ │ │ │ 29 │ │ │ │ │ ***************************************************************************/ │ │ │ │ │ 30 │ │ │ │ │ 31// Start of section namespace SILLY │ │ │ │ │ 32namespace SILLY │ │ │ │ │ 33{ │ │ │ │ │ - 34inline ImageLoader::ImageLoader(const char* name) │ │ │ │ │ - 35 : d_name(name) │ │ │ │ │ + 34 │ │ │ │ │ + 35inline bool Image::isValid() const │ │ │ │ │ 36{ │ │ │ │ │ - 37} │ │ │ │ │ - 38inline ImageLoader::~ImageLoader() │ │ │ │ │ - 39{ │ │ │ │ │ - 40} │ │ │ │ │ - 41inline const char* ImageLoader::getIdentifierString() const │ │ │ │ │ - 42{ │ │ │ │ │ - 43 return d_name; │ │ │ │ │ - 44} │ │ │ │ │ - 45 │ │ │ │ │ - 46} // End of section namespace SILLY │ │ │ │ │ - 47 │ │ │ │ │ + 37 return d_imageContext && d_pixels; │ │ │ │ │ + 38} │ │ │ │ │ + 39 │ │ │ │ │ + 40inline size_t Image::getWidth() const │ │ │ │ │ + 41{ │ │ │ │ │ + 42 return d_imageContext->getWidth(); │ │ │ │ │ + 43} │ │ │ │ │ + 44 │ │ │ │ │ + 45inline size_t Image::getHeight() const │ │ │ │ │ + 46{ │ │ │ │ │ + 47 return d_imageContext->getHeight(); │ │ │ │ │ + 48} │ │ │ │ │ + 49 │ │ │ │ │ + 50inline PixelFormat Image::getSourcePixelFormat() const │ │ │ │ │ + 51{ │ │ │ │ │ + 52 return d_pfSource; │ │ │ │ │ + 53} │ │ │ │ │ + 54 │ │ │ │ │ + 55inline PixelFormat Image::getPixelFormat() const │ │ │ │ │ + 56{ │ │ │ │ │ + 57 return d_imageContext->getPixelFormat(); │ │ │ │ │ + 58} │ │ │ │ │ + 59 │ │ │ │ │ + 60inline const byte* Image::getPixelsDataPtr() const │ │ │ │ │ + 61{ │ │ │ │ │ + 62 return d_pixels; │ │ │ │ │ + 63} │ │ │ │ │ + 64 │ │ │ │ │ + 65inline size_t Image::getPixelsDataSize() const │ │ │ │ │ + 66{ │ │ │ │ │ + 67 return getWidth() * getHeight() * d_bpp; │ │ │ │ │ + 68} │ │ │ │ │ + 69 │ │ │ │ │ + 70inline Image::~Image() │ │ │ │ │ + 71{ │ │ │ │ │ + 72 delete [] d_pixels; │ │ │ │ │ + 73 if (d_imageLoader) │ │ │ │ │ + 74 d_imageLoader->destroyContext(d_imageContext); │ │ │ │ │ + 75} │ │ │ │ │ + 76inline const char* Image::getLoaderIdentifierString() const │ │ │ │ │ + 77{ │ │ │ │ │ + 78 if (d_imageLoader) │ │ │ │ │ + 79 return d_imageLoader->getIdentifierString(); │ │ │ │ │ + 80 return 0; │ │ │ │ │ + 81} │ │ │ │ │ + 82 │ │ │ │ │ + 83} // End of section namespace SILLY │ │ │ │ │ + 84 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libsilly-doc/html/a00053_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/SILLYBase.h Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/SILLYFileDataSource.icpp Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -39,99 +39,67 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYBase.h
│ │ │ │ +
SILLYFileDataSource.icpp
│ │ │ │
│ │ │ │
│ │ │ │ -
1/***********************************************************************
│ │ │ │ -
2 filename: SILLYBase.h
│ │ │ │ -
3 created: 2006/06/10
│ │ │ │ -
4 author: Olivier Delannoy
│ │ │ │ -
5
│ │ │ │ -
6 purpose: Common header for the SILLY library
│ │ │ │ -
7*************************************************************************/
│ │ │ │ -
8/***************************************************************************
│ │ │ │ -
9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
│ │ │ │ -
10 *
│ │ │ │ -
11 * Permission is hereby granted, free of charge, to any person obtaining
│ │ │ │ -
12 * a copy of this software and associated documentation files (the
│ │ │ │ -
13 * "Software"), to deal in the Software without restriction, including
│ │ │ │ -
14 * without limitation the rights to use, copy, modify, merge, publish,
│ │ │ │ -
15 * distribute, sublicense, and/or sell copies of the Software, and to
│ │ │ │ -
16 * permit persons to whom the Software is furnished to do so, subject to
│ │ │ │ -
17 * the following conditions:
│ │ │ │ -
18 *
│ │ │ │ -
19 * The above copyright notice and this permission notice shall be
│ │ │ │ -
20 * included in all copies or substantial portions of the Software.
│ │ │ │ -
21 *
│ │ │ │ -
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
│ │ │ │ -
23 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
│ │ │ │ -
24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
│ │ │ │ -
25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
│ │ │ │ -
26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
│ │ │ │ -
27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
│ │ │ │ -
28 * OTHER DEALINGS IN THE SOFTWARE.
│ │ │ │ -
29 ***************************************************************************/
│ │ │ │ -
30#ifndef _SILLYBase_h_
│ │ │ │ -
31#define _SILLYBase_h_
│ │ │ │ -
32#include <cassert>
│ │ │ │ -
33#include <cstddef>
│ │ │ │ -
34
│ │ │ │ -
35#if defined(USE_SILLYOPTIONS_H)
│ │ │ │ -
36#include "SILLYOptions.h"
│ │ │ │ -
37#endif
│ │ │ │ +
1/***********************************************************************
│ │ │ │ +
2 filename: SILLYFileDataSource.icpp
│ │ │ │ +
3 created: 20 Jul 2006
│ │ │ │ +
4 author: Olivier Delannoy
│ │ │ │ +
5
│ │ │ │ +
6 purpose: Inline function definition for the FileDataSource class
│ │ │ │ +
7*************************************************************************/
│ │ │ │ +
8/***************************************************************************
│ │ │ │ +
9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
│ │ │ │ +
10 *
│ │ │ │ +
11 * Permission is hereby granted, free of charge, to any person obtaining
│ │ │ │ +
12 * a copy of this software and associated documentation files (the
│ │ │ │ +
13 * "Software"), to deal in the Software without restriction, including
│ │ │ │ +
14 * without limitation the rights to use, copy, modify, merge, publish,
│ │ │ │ +
15 * distribute, sublicense, and/or sell copies of the Software, and to
│ │ │ │ +
16 * permit persons to whom the Software is furnished to do so, subject to
│ │ │ │ +
17 * the following conditions:
│ │ │ │ +
18 *
│ │ │ │ +
19 * The above copyright notice and this permission notice shall be
│ │ │ │ +
20 * included in all copies or substantial portions of the Software.
│ │ │ │ +
21 *
│ │ │ │ +
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
│ │ │ │ +
23 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
│ │ │ │ +
24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
│ │ │ │ +
25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
│ │ │ │ +
26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
│ │ │ │ +
27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
│ │ │ │ +
28 * OTHER DEALINGS IN THE SOFTWARE.
│ │ │ │ +
29 ***************************************************************************/
│ │ │ │ +
30
│ │ │ │ +
31// Start of section namespace SILLY
│ │ │ │ +
32namespace SILLY
│ │ │ │ +
33{
│ │ │ │ +
34inline bool FileDataSource::isValid() const
│ │ │ │ +
35{
│ │ │ │ +
36 return d_error;
│ │ │ │ +
37}
│ │ │ │
38
│ │ │ │ -
39#if defined(_WIN32) || defined(__WIN32__)
│ │ │ │ -
40# undef SILLY_OPT_INLINE // No inlining
│ │ │ │ -
41# undef SILLY_BE // Little Endian
│ │ │ │ -
42# ifdef SILLY_EXPORTS
│ │ │ │ -
43# define SILLY_EXPORT __declspec(dllexport)
│ │ │ │ -
44# else
│ │ │ │ -
45# define SILLY_EXPORT __declspec(dllimport)
│ │ │ │ -
46# endif
│ │ │ │ -
47#else
│ │ │ │ -
48# define SILLY_EXPORT
│ │ │ │ -
49#endif
│ │ │ │ +
39inline const byte* FileDataSource::getDataPtr() const
│ │ │ │ +
40{
│ │ │ │ +
41 return d_bytes;
│ │ │ │ +
42}
│ │ │ │ +
43
│ │ │ │ +
44inline size_t FileDataSource::getSize() const
│ │ │ │ +
45{
│ │ │ │ +
46 return d_size;
│ │ │ │ +
47}
│ │ │ │ +
48
│ │ │ │ +
49} // End of section namespace SILLY
│ │ │ │
50
│ │ │ │ -
51// Start of section namespace SILLY
│ │ │ │ -
52namespace SILLY
│ │ │ │ -
53{
│ │ │ │ -
54
│ │ │ │ - │ │ │ │ -
60{
│ │ │ │ -
61 PF_A1B5G5R5, //<! 16 bits, pixel format is A1R5G5B5 (GGGBBBBB,ARRRRRGG on disk)
│ │ │ │ -
62 PF_RGB, //<! 24 bits, pixel format is 8 bits for R, G, B
│ │ │ │ -
63 PF_RGBA, //<! 32 bits, pixel format is 8 bits for R, G, B and A channel
│ │ │ │ -
64 PF_ORIGIN, //<! This format is used when the input storage use a specific pixel format
│ │ │ │ -
65};
│ │ │ │ - │ │ │ │ -
71{
│ │ │ │ -
72 PO_TOP_LEFT, //<! The resulting image origine is Top Left
│ │ │ │ -
73 PO_BOTTOM_LEFT, //<! The resulting image origine is Bottom Left
│ │ │ │ -
74};
│ │ │ │ -
75
│ │ │ │ -
80typedef unsigned char byte;
│ │ │ │ -
88bool SILLY_EXPORT SILLYInit();
│ │ │ │ -
89
│ │ │ │ -
94void SILLY_EXPORT SILLYCleanup();
│ │ │ │ -
95
│ │ │ │ -
96} // End of section namespace SILLY
│ │ │ │ -
97
│ │ │ │ -
98#endif // end of guard _SILLYBase_h_
│ │ │ │ -
99
│ │ │ │ -
Simple Image Loading LibrarY namespace.
│ │ │ │ -
unsigned char byte
Typename for a byte.
Definition: SILLYBase.h:80
│ │ │ │ -
void SILLYCleanup()
Cleanup SILLY library internal.
│ │ │ │ -
PixelFormat
List all pixel format supported.
Definition: SILLYBase.h:60
│ │ │ │ -
bool SILLYInit()
Initialize the SILLY Library.
│ │ │ │ -
PixelOrigin
List all pixel origin supported.
Definition: SILLYBase.h:71
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,21 +4,21 @@ │ │ │ │ │ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ │ │ │ │ │ * build │ │ │ │ │ * reproducible-path │ │ │ │ │ * silly-0.1.0 │ │ │ │ │ * include │ │ │ │ │ -SILLYBase.h │ │ │ │ │ +SILLYFileDataSource.icpp │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ - 2 filename: SILLYBase.h │ │ │ │ │ - 3 created: 2006/06/10 │ │ │ │ │ + 2 filename: SILLYFileDataSource.icpp │ │ │ │ │ + 3 created: 20 Jul 2006 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ - 6 purpose: Common header for the SILLY library │ │ │ │ │ + 6 purpose: Inline function definition for the FileDataSource class │ │ │ │ │ 7*************************************************************************/ │ │ │ │ │ 8/*************************************************************************** │ │ │ │ │ 9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team │ │ │ │ │ 10 * │ │ │ │ │ 11 * Permission is hereby granted, free of charge, to any person obtaining │ │ │ │ │ 12 * a copy of this software and associated documentation files (the │ │ │ │ │ 13 * "Software"), to deal in the Software without restriction, including │ │ │ │ │ @@ -35,82 +35,31 @@ │ │ │ │ │ 24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. │ │ │ │ │ 25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR │ │ │ │ │ 26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ │ │ │ │ 27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR │ │ │ │ │ 28 * OTHER DEALINGS IN THE SOFTWARE. │ │ │ │ │ 29 │ │ │ │ │ ***************************************************************************/ │ │ │ │ │ - 30#ifndef _SILLYBase_h_ │ │ │ │ │ - 31#define _SILLYBase_h_ │ │ │ │ │ - 32#include │ │ │ │ │ - 33#include │ │ │ │ │ - 34 │ │ │ │ │ - 35#if defined(USE_SILLYOPTIONS_H) │ │ │ │ │ - 36#include "SILLYOptions.h" │ │ │ │ │ - 37#endif │ │ │ │ │ + 30 │ │ │ │ │ + 31// Start of section namespace SILLY │ │ │ │ │ + 32namespace SILLY │ │ │ │ │ + 33{ │ │ │ │ │ + 34inline bool FileDataSource::isValid() const │ │ │ │ │ + 35{ │ │ │ │ │ + 36 return d_error; │ │ │ │ │ + 37} │ │ │ │ │ 38 │ │ │ │ │ - 39#if defined(_WIN32) || defined(__WIN32__) │ │ │ │ │ - 40# undef SILLY_OPT_INLINE // No inlining │ │ │ │ │ - 41# undef SILLY_BE // Little Endian │ │ │ │ │ - 42# ifdef SILLY_EXPORTS │ │ │ │ │ - 43# define SILLY_EXPORT __declspec(dllexport) │ │ │ │ │ - 44# else │ │ │ │ │ - 45# define SILLY_EXPORT __declspec(dllimport) │ │ │ │ │ - 46# endif │ │ │ │ │ - 47#else │ │ │ │ │ - 48# define SILLY_EXPORT │ │ │ │ │ - 49#endif │ │ │ │ │ + 39inline const byte* FileDataSource::getDataPtr() const │ │ │ │ │ + 40{ │ │ │ │ │ + 41 return d_bytes; │ │ │ │ │ + 42} │ │ │ │ │ + 43 │ │ │ │ │ + 44inline size_t FileDataSource::getSize() const │ │ │ │ │ + 45{ │ │ │ │ │ + 46 return d_size; │ │ │ │ │ + 47} │ │ │ │ │ + 48 │ │ │ │ │ + 49} // End of section namespace SILLY │ │ │ │ │ 50 │ │ │ │ │ - 51// Start of section namespace SILLY │ │ │ │ │ - 52namespace SILLY │ │ │ │ │ - 53{ │ │ │ │ │ - 54 │ │ │ │ │ -59enum PixelFormat │ │ │ │ │ - 60{ │ │ │ │ │ - 61 PF_A1B5G5R5, // │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/SILLYMemoryDataSource.h Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/loaders/SILLYJPGImageLoader.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -35,27 +35,27 @@ │ │ │ │ initMenu('',false,false,'search.php','Search'); │ │ │ │ }); │ │ │ │ /* @license-end */ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYMemoryDataSource.h
│ │ │ │ +
SILLYJPGImageLoader.h
│ │ │ │
│ │ │ │
│ │ │ │
1/***********************************************************************
│ │ │ │ -
2 filename: SILLYMemoryDataSource.h
│ │ │ │ -
3 created: 10 Jun 2006
│ │ │ │ -
4 author: Olivier Delannoy
│ │ │ │ +
2 filename: SILLYJPGImageLoader.h
│ │ │ │ +
3 created: 11 Jun 2006
│ │ │ │ +
4 author: Olivier Delannoy
│ │ │ │
5
│ │ │ │ -
6 purpose: SILLYMemoryDataSource declaration for the SILLY library
│ │ │ │ +
6 purpose: Declaration of the JPGImageLoader class
│ │ │ │
7*************************************************************************/
│ │ │ │
8/***************************************************************************
│ │ │ │
9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
│ │ │ │
10 *
│ │ │ │
11 * Permission is hereby granted, free of charge, to any person obtaining
│ │ │ │
12 * a copy of this software and associated documentation files (the
│ │ │ │
13 * "Software"), to deal in the Software without restriction, including
│ │ │ │ @@ -71,50 +71,50 @@ │ │ │ │
23 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
│ │ │ │
24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
│ │ │ │
25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
│ │ │ │
26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
│ │ │ │
27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
│ │ │ │
28 * OTHER DEALINGS IN THE SOFTWARE.
│ │ │ │
29 ***************************************************************************/
│ │ │ │ -
30#ifndef _SILLYMemoryDataSource_h_
│ │ │ │ -
31#define _SILLYMemoryDataSource_h_
│ │ │ │ -
32#include "SILLYBase.h"
│ │ │ │ -
33#include "SILLYDataSource.h"
│ │ │ │ +
30#ifndef _SILLYJPGImageLoader_h_
│ │ │ │ +
31#define _SILLYJPGImageLoader_h_
│ │ │ │ +
32#include "SILLYBase.h"
│ │ │ │ +
33#include "SILLYImageLoader.h"
│ │ │ │
34// Start of section namespace SILLY
│ │ │ │
35namespace SILLY
│ │ │ │
36{
│ │ │ │ -
37
│ │ │ │ -
48class SILLY_EXPORT MemoryDataSource : public DataSource
│ │ │ │ -
49{
│ │ │ │ -
50public:
│ │ │ │ -
63 MemoryDataSource(const byte* data, size_t size);
│ │ │ │ -
64
│ │ │ │ -
65
│ │ │ │ -
66 const byte* getDataPtr() const;
│ │ │ │ -
67
│ │ │ │ -
68 size_t getSize() const;
│ │ │ │ -
69private:
│ │ │ │ -
70 const byte* d_bytes;
│ │ │ │ -
71 size_t d_size;
│ │ │ │ -
72};
│ │ │ │ -
73
│ │ │ │ -
74
│ │ │ │ -
75} // End of section namespace SILLY
│ │ │ │ -
76
│ │ │ │ -
77// Inclue inline function when needed
│ │ │ │ -
78#ifdef SILLY_OPT_INLINE
│ │ │ │ -
79#include "SILLYMemoryDataSource.icpp"
│ │ │ │ -
80#endif
│ │ │ │ -
81
│ │ │ │ -
82#endif // end of guard _SILLYMemoryDataSource_h_
│ │ │ │ -
Simple Image Loading LibrarY namespace.
│ │ │ │ -
This is an abstract class used to provide data to the loader.
│ │ │ │ -
Load an image from a memory area.
│ │ │ │ -
const byte * getDataPtr() const
Get raw access to the image data.
│ │ │ │ -
size_t getSize() const
Return the size of the data.
│ │ │ │ +
37
│ │ │ │ + │ │ │ │ +
43{
│ │ │ │ +
44public:
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
48 bool loadImageData(PixelOrigin origin, DataSource* data, ImageContext* context);
│ │ │ │ +
49private:
│ │ │ │ +
50};
│ │ │ │ +
51
│ │ │ │ +
52
│ │ │ │ +
53} // End of section namespace SILLY
│ │ │ │ +
54
│ │ │ │ +
55// Inclue inline function when needed
│ │ │ │ +
56#ifdef SILLY_OPT_INLINE
│ │ │ │ +
57#include "SILLYJPGImageLoader.icpp"
│ │ │ │ +
58#endif
│ │ │ │ +
59
│ │ │ │ +
60#endif // end of guard _SILLYJPGImageLoader_h_
│ │ │ │ +
Simple Image Loading LibrarY namespace.
│ │ │ │ +
PixelFormat
List all pixel format supported.
Definition: SILLYBase.h:60
│ │ │ │ +
PixelOrigin
List all pixel origin supported.
Definition: SILLYBase.h:71
│ │ │ │ +
Loader class for JPG Image.
│ │ │ │ +
bool loadImageData(PixelOrigin origin, DataSource *data, ImageContext *context)
Parse the pixels data of the image and fill the header struct.
│ │ │ │ +
ImageContext * loadHeader(PixelFormat &header, DataSource *data)
Parse the header of the image and fill the header struct.
│ │ │ │ +
This is an abstract class used to provide data to the loader.
│ │ │ │ +
Store the data needed by an ImageLoader object during the parsing of an image.
│ │ │ │ +
This is an abstract class that define the interface of all image loader.
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,21 +4,22 @@ │ │ │ │ │ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ │ │ │ │ │ * build │ │ │ │ │ * reproducible-path │ │ │ │ │ * silly-0.1.0 │ │ │ │ │ * include │ │ │ │ │ -SILLYMemoryDataSource.h │ │ │ │ │ + * loaders │ │ │ │ │ +SILLYJPGImageLoader.h │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ - 2 filename: SILLYMemoryDataSource.h │ │ │ │ │ - 3 created: 10 Jun 2006 │ │ │ │ │ + 2 filename: SILLYJPGImageLoader.h │ │ │ │ │ + 3 created: 11 Jun 2006 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ - 6 purpose: SILLYMemoryDataSource declaration for the SILLY library │ │ │ │ │ + 6 purpose: Declaration of the JPGImageLoader class │ │ │ │ │ 7*************************************************************************/ │ │ │ │ │ 8/*************************************************************************** │ │ │ │ │ 9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team │ │ │ │ │ 10 * │ │ │ │ │ 11 * Permission is hereby granted, free of charge, to any person obtaining │ │ │ │ │ 12 * a copy of this software and associated documentation files (the │ │ │ │ │ 13 * "Software"), to deal in the Software without restriction, including │ │ │ │ │ @@ -35,56 +36,69 @@ │ │ │ │ │ 24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. │ │ │ │ │ 25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR │ │ │ │ │ 26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ │ │ │ │ 27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR │ │ │ │ │ 28 * OTHER DEALINGS IN THE SOFTWARE. │ │ │ │ │ 29 │ │ │ │ │ ***************************************************************************/ │ │ │ │ │ - 30#ifndef _SILLYMemoryDataSource_h_ │ │ │ │ │ - 31#define _SILLYMemoryDataSource_h_ │ │ │ │ │ + 30#ifndef _SILLYJPGImageLoader_h_ │ │ │ │ │ + 31#define _SILLYJPGImageLoader_h_ │ │ │ │ │ 32#include "SILLYBase.h" │ │ │ │ │ - 33#include "SILLYDataSource.h" │ │ │ │ │ + 33#include "SILLYImageLoader.h" │ │ │ │ │ 34// Start of section namespace SILLY │ │ │ │ │ 35namespace SILLY │ │ │ │ │ 36{ │ │ │ │ │ 37 │ │ │ │ │ -48class SILLY_EXPORT MemoryDataSource : public DataSource │ │ │ │ │ - 49{ │ │ │ │ │ - 50public: │ │ │ │ │ - 63 MemoryDataSource(const byte* data, size_t size); │ │ │ │ │ - 64 │ │ │ │ │ - 65 │ │ │ │ │ -66 const byte* getDataPtr() const; │ │ │ │ │ - 67 │ │ │ │ │ -68 size_t getSize() const; │ │ │ │ │ - 69private: │ │ │ │ │ - 70 const byte* d_bytes; │ │ │ │ │ - 71 size_t d_size; │ │ │ │ │ - 72}; │ │ │ │ │ - 73 │ │ │ │ │ - 74 │ │ │ │ │ - 75} // End of section namespace SILLY │ │ │ │ │ - 76 │ │ │ │ │ - 77// Inclue inline function when needed │ │ │ │ │ - 78#ifdef SILLY_OPT_INLINE │ │ │ │ │ - 79#include "SILLYMemoryDataSource.icpp" │ │ │ │ │ - 80#endif │ │ │ │ │ - 81 │ │ │ │ │ - 82#endif // end of guard _SILLYMemoryDataSource_h_ │ │ │ │ │ +42class JPGImageLoader : public ImageLoader │ │ │ │ │ + 43{ │ │ │ │ │ + 44public: │ │ │ │ │ + 45 JPGImageLoader(); │ │ │ │ │ + 46 ~JPGImageLoader(); │ │ │ │ │ + 47 ImageContext* loadHeader(PixelFormat& header, DataSource* data); │ │ │ │ │ + 48 bool loadImageData(PixelOrigin origin, DataSource* data, ImageContext* │ │ │ │ │ +context); │ │ │ │ │ + 49private: │ │ │ │ │ + 50}; │ │ │ │ │ + 51 │ │ │ │ │ + 52 │ │ │ │ │ + 53} // End of section namespace SILLY │ │ │ │ │ + 54 │ │ │ │ │ + 55// Inclue inline function when needed │ │ │ │ │ + 56#ifdef SILLY_OPT_INLINE │ │ │ │ │ + 57#include "SILLYJPGImageLoader.icpp" │ │ │ │ │ + 58#endif │ │ │ │ │ + 59 │ │ │ │ │ + 60#endif // end of guard _SILLYJPGImageLoader_h_ │ │ │ │ │ SILLY │ │ │ │ │ Simple Image Loading LibrarY namespace. │ │ │ │ │ Definition: SILLYJPGImageContext.cpp:46 │ │ │ │ │ +SILLY::PixelFormat │ │ │ │ │ +PixelFormat │ │ │ │ │ +List all pixel format supported. │ │ │ │ │ +Definition: SILLYBase.h:60 │ │ │ │ │ +SILLY::PixelOrigin │ │ │ │ │ +PixelOrigin │ │ │ │ │ +List all pixel origin supported. │ │ │ │ │ +Definition: SILLYBase.h:71 │ │ │ │ │ +SILLY::JPGImageLoader │ │ │ │ │ +Loader class for JPG Image. │ │ │ │ │ +Definition: SILLYJPGImageLoader.h:43 │ │ │ │ │ +SILLY::JPGImageLoader::loadImageData │ │ │ │ │ +bool loadImageData(PixelOrigin origin, DataSource *data, ImageContext *context) │ │ │ │ │ +Parse the pixels data of the image and fill the header struct. │ │ │ │ │ +Definition: SILLYJPGImageLoader.cpp:90 │ │ │ │ │ +SILLY::JPGImageLoader::loadHeader │ │ │ │ │ +ImageContext * loadHeader(PixelFormat &header, DataSource *data) │ │ │ │ │ +Parse the header of the image and fill the header struct. │ │ │ │ │ +Definition: SILLYJPGImageLoader.cpp:56 │ │ │ │ │ SILLY::DataSource │ │ │ │ │ This is an abstract class used to provide data to the loader. │ │ │ │ │ Definition: SILLYDataSource.h:47 │ │ │ │ │ -SILLY::MemoryDataSource │ │ │ │ │ -Load an image from a memory area. │ │ │ │ │ -Definition: SILLYMemoryDataSource.h:49 │ │ │ │ │ -SILLY::MemoryDataSource::getDataPtr │ │ │ │ │ -const byte * getDataPtr() const │ │ │ │ │ -Get raw access to the image data. │ │ │ │ │ -SILLY::MemoryDataSource::getSize │ │ │ │ │ -size_t getSize() const │ │ │ │ │ -Return the size of the data. │ │ │ │ │ +SILLY::ImageContext │ │ │ │ │ +Store the data needed by an ImageLoader object during the parsing of an image. │ │ │ │ │ +Definition: SILLYImageContext.h:44 │ │ │ │ │ +SILLY::ImageLoader │ │ │ │ │ +This is an abstract class that define the interface of all image loader. │ │ │ │ │ +Definition: SILLYImageLoader.h:47 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libsilly-doc/html/a00059_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/SILLYImageLoaderManager.icpp Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/loaders/SILLYTGAImageContext.icpp Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -35,27 +35,27 @@ │ │ │ │ initMenu('',false,false,'search.php','Search'); │ │ │ │ }); │ │ │ │ /* @license-end */ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYImageLoaderManager.icpp
│ │ │ │ +
SILLYTGAImageContext.icpp
│ │ │ │
│ │ │ │
│ │ │ │
1/***********************************************************************
│ │ │ │ -
2 filename: SILLYImageLoaderManager.icpp
│ │ │ │ -
3 created: 10 Jun 2006
│ │ │ │ +
2 filename: SILLYTGAImageContext.icpp
│ │ │ │ +
3 created: 11 Jun 2006
│ │ │ │
4 author: Olivier Delannoy
│ │ │ │
5
│ │ │ │ -
6 purpose: Inline definition for ImageLoaderManager class
│ │ │ │ +
6 purpose: Inline definition for TGAImageContext class
│ │ │ │
7*************************************************************************/
│ │ │ │
8/***************************************************************************
│ │ │ │
9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
│ │ │ │
10 *
│ │ │ │
11 * Permission is hereby granted, free of charge, to any person obtaining
│ │ │ │
12 * a copy of this software and associated documentation files (the
│ │ │ │
13 * "Software"), to deal in the Software without restriction, including
│ │ │ │ @@ -75,43 +75,25 @@ │ │ │ │
27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
│ │ │ │
28 * OTHER DEALINGS IN THE SOFTWARE.
│ │ │ │
29 ***************************************************************************/
│ │ │ │
30
│ │ │ │
31// Start of section namespace SILLY
│ │ │ │
32namespace SILLY
│ │ │ │
33{
│ │ │ │ -
34inline ImageLoaderList::iterator ImageLoaderManager::begin()
│ │ │ │ -
35{
│ │ │ │ -
36 return d_loaders.begin();
│ │ │ │ +
34inline TGAImageContext::TGAImageContext(size_t width, size_t height)
│ │ │ │ +
35 : ImageContext(width, height)
│ │ │ │ +
36{
│ │ │ │
37}
│ │ │ │
38
│ │ │ │ -
39inline ImageLoaderList::iterator ImageLoaderManager::end()
│ │ │ │ +
39inline TGAImageContext::~TGAImageContext()
│ │ │ │
40{
│ │ │ │ -
41 return d_loaders.end();
│ │ │ │ -
42}
│ │ │ │ -
43
│ │ │ │ -
44inline ImageLoaderManager* ImageLoaderManager::getSingletonPtr()
│ │ │ │ -
45{
│ │ │ │ -
46 return d_instance;
│ │ │ │ -
47}
│ │ │ │ -
48
│ │ │ │ -
49inline ImageLoaderManager& ImageLoaderManager::getSingleton()
│ │ │ │ -
50{
│ │ │ │ -
51 assert(d_instance && "ASSERT: Singleton object not yet created");
│ │ │ │ -
52 return *d_instance;
│ │ │ │ -
53}
│ │ │ │ -
54
│ │ │ │ -
55inline void ImageLoaderManager::add(ImageLoader* loader)
│ │ │ │ -
56{
│ │ │ │ -
57 assert(loader && "ASSERT: adding a none existing loader object");
│ │ │ │ -
58 d_loaders.push_back(loader);
│ │ │ │ -
59}
│ │ │ │ -
60
│ │ │ │ -
61} // End of section namespace SILLY
│ │ │ │ -
62
│ │ │ │ +
41}
│ │ │ │ +
42
│ │ │ │ +
43} // End of section namespace SILLY
│ │ │ │ +
44
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,21 +4,22 @@ │ │ │ │ │ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ │ │ │ │ │ * build │ │ │ │ │ * reproducible-path │ │ │ │ │ * silly-0.1.0 │ │ │ │ │ * include │ │ │ │ │ -SILLYImageLoaderManager.icpp │ │ │ │ │ + * loaders │ │ │ │ │ +SILLYTGAImageContext.icpp │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ - 2 filename: SILLYImageLoaderManager.icpp │ │ │ │ │ - 3 created: 10 Jun 2006 │ │ │ │ │ + 2 filename: SILLYTGAImageContext.icpp │ │ │ │ │ + 3 created: 11 Jun 2006 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ - 6 purpose: Inline definition for ImageLoaderManager class │ │ │ │ │ + 6 purpose: Inline definition for TGAImageContext class │ │ │ │ │ 7*************************************************************************/ │ │ │ │ │ 8/*************************************************************************** │ │ │ │ │ 9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team │ │ │ │ │ 10 * │ │ │ │ │ 11 * Permission is hereby granted, free of charge, to any person obtaining │ │ │ │ │ 12 * a copy of this software and associated documentation files (the │ │ │ │ │ 13 * "Software"), to deal in the Software without restriction, including │ │ │ │ │ @@ -39,39 +40,21 @@ │ │ │ │ │ 28 * OTHER DEALINGS IN THE SOFTWARE. │ │ │ │ │ 29 │ │ │ │ │ ***************************************************************************/ │ │ │ │ │ 30 │ │ │ │ │ 31// Start of section namespace SILLY │ │ │ │ │ 32namespace SILLY │ │ │ │ │ 33{ │ │ │ │ │ - 34inline ImageLoaderList::iterator ImageLoaderManager::begin() │ │ │ │ │ - 35{ │ │ │ │ │ - 36 return d_loaders.begin(); │ │ │ │ │ + 34inline TGAImageContext::TGAImageContext(size_t width, size_t height) │ │ │ │ │ + 35 : ImageContext(width, height) │ │ │ │ │ + 36{ │ │ │ │ │ 37} │ │ │ │ │ 38 │ │ │ │ │ - 39inline ImageLoaderList::iterator ImageLoaderManager::end() │ │ │ │ │ + 39inline TGAImageContext::~TGAImageContext() │ │ │ │ │ 40{ │ │ │ │ │ - 41 return d_loaders.end(); │ │ │ │ │ - 42} │ │ │ │ │ - 43 │ │ │ │ │ - 44inline ImageLoaderManager* ImageLoaderManager::getSingletonPtr() │ │ │ │ │ - 45{ │ │ │ │ │ - 46 return d_instance; │ │ │ │ │ - 47} │ │ │ │ │ - 48 │ │ │ │ │ - 49inline ImageLoaderManager& ImageLoaderManager::getSingleton() │ │ │ │ │ - 50{ │ │ │ │ │ - 51 assert(d_instance && "ASSERT: Singleton object not yet created"); │ │ │ │ │ - 52 return *d_instance; │ │ │ │ │ - 53} │ │ │ │ │ - 54 │ │ │ │ │ - 55inline void ImageLoaderManager::add(ImageLoader* loader) │ │ │ │ │ - 56{ │ │ │ │ │ - 57 assert(loader && "ASSERT: adding a none existing loader object"); │ │ │ │ │ - 58 d_loaders.push_back(loader); │ │ │ │ │ - 59} │ │ │ │ │ - 60 │ │ │ │ │ - 61} // End of section namespace SILLY │ │ │ │ │ - 62 │ │ │ │ │ + 41} │ │ │ │ │ + 42 │ │ │ │ │ + 43} // End of section namespace SILLY │ │ │ │ │ + 44 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libsilly-doc/html/a00062_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/SILLYImageContext.icpp Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/loaders/SILLYTGAImageContext.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -35,125 +35,86 @@ │ │ │ │ initMenu('',false,false,'search.php','Search'); │ │ │ │ }); │ │ │ │ /* @license-end */ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYImageContext.icpp
│ │ │ │ +
SILLYTGAImageContext.h
│ │ │ │
│ │ │ │
│ │ │ │ -
1/***********************************************************************
│ │ │ │ -
2 filename: SILLYImageContext.icpp
│ │ │ │ -
3 created: 10 Jun 2006
│ │ │ │ -
4 author: Olivier Delannoy
│ │ │ │ -
5
│ │ │ │ -
6 purpose: Inline definition for ImageContext
│ │ │ │ -
7*************************************************************************/
│ │ │ │ -
8/***************************************************************************
│ │ │ │ -
9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
│ │ │ │ -
10 *
│ │ │ │ -
11 * Permission is hereby granted, free of charge, to any person obtaining
│ │ │ │ -
12 * a copy of this software and associated documentation files (the
│ │ │ │ -
13 * "Software"), to deal in the Software without restriction, including
│ │ │ │ -
14 * without limitation the rights to use, copy, modify, merge, publish,
│ │ │ │ -
15 * distribute, sublicense, and/or sell copies of the Software, and to
│ │ │ │ -
16 * permit persons to whom the Software is furnished to do so, subject to
│ │ │ │ -
17 * the following conditions:
│ │ │ │ -
18 *
│ │ │ │ -
19 * The above copyright notice and this permission notice shall be
│ │ │ │ -
20 * included in all copies or substantial portions of the Software.
│ │ │ │ -
21 *
│ │ │ │ -
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
│ │ │ │ -
23 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
│ │ │ │ -
24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
│ │ │ │ -
25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
│ │ │ │ -
26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
│ │ │ │ -
27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
│ │ │ │ -
28 * OTHER DEALINGS IN THE SOFTWARE.
│ │ │ │ -
29 ***************************************************************************/
│ │ │ │ -
30
│ │ │ │ -
31// Start of section namespace SILLY
│ │ │ │ -
32namespace SILLY
│ │ │ │ -
33{
│ │ │ │ -
34
│ │ │ │ -
35inline ImageContext::ImageContext(size_t width, size_t height)
│ │ │ │ -
36 : d_pixels(0), d_length(0), d_width(width), d_height(height), d_currentOffset(0), d_format(PF_RGBA)
│ │ │ │ -
37{
│ │ │ │ -
38}
│ │ │ │ -
39
│ │ │ │ -
40
│ │ │ │ -
41inline ImageContext::~ImageContext()
│ │ │ │ -
42{
│ │ │ │ -
43}
│ │ │ │ -
44
│ │ │ │ -
45
│ │ │ │ -
46inline void ImageContext::setDestination(byte* pixels, size_t length, PixelFormat format)
│ │ │ │ -
47{
│ │ │ │ -
48 d_pixels = pixels;
│ │ │ │ -
49 d_length = length;
│ │ │ │ -
50 d_currentOffset = 0;
│ │ │ │ -
51 d_format = format;
│ │ │ │ -
52}
│ │ │ │ +
1/***********************************************************************
│ │ │ │ +
2 filename: SILLYTGAImageContext.h
│ │ │ │ +
3 created: 11 Jun 2006
│ │ │ │ +
4 author: Olivier Delannoy
│ │ │ │ +
5
│ │ │ │ +
6 purpose: Declaration of the TGAImageContext class
│ │ │ │ +
7*************************************************************************/
│ │ │ │ +
8/***************************************************************************
│ │ │ │ +
9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
│ │ │ │ +
10 *
│ │ │ │ +
11 * Permission is hereby granted, free of charge, to any person obtaining
│ │ │ │ +
12 * a copy of this software and associated documentation files (the
│ │ │ │ +
13 * "Software"), to deal in the Software without restriction, including
│ │ │ │ +
14 * without limitation the rights to use, copy, modify, merge, publish,
│ │ │ │ +
15 * distribute, sublicense, and/or sell copies of the Software, and to
│ │ │ │ +
16 * permit persons to whom the Software is furnished to do so, subject to
│ │ │ │ +
17 * the following conditions:
│ │ │ │ +
18 *
│ │ │ │ +
19 * The above copyright notice and this permission notice shall be
│ │ │ │ +
20 * included in all copies or substantial portions of the Software.
│ │ │ │ +
21 *
│ │ │ │ +
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
│ │ │ │ +
23 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
│ │ │ │ +
24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
│ │ │ │ +
25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
│ │ │ │ +
26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
│ │ │ │ +
27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
│ │ │ │ +
28 * OTHER DEALINGS IN THE SOFTWARE.
│ │ │ │ +
29 ***************************************************************************/
│ │ │ │ +
30#ifndef _SILLYTGAImageContext_h_
│ │ │ │ +
31#define _SILLYTGAImageContext_h_
│ │ │ │ +
32#include "SILLYBase.h"
│ │ │ │ +
33#include "SILLYImageContext.h"
│ │ │ │ +
34// Start of section namespace SILLY
│ │ │ │ +
35namespace SILLY
│ │ │ │ +
36{
│ │ │ │ + │ │ │ │ +
43{
│ │ │ │ +
44public:
│ │ │ │ +
45 TGAImageContext(size_t width, size_t height);
│ │ │ │ + │ │ │ │ +
47
│ │ │ │ +
48private:
│ │ │ │ +
49 byte d_idLength;
│ │ │ │ +
50 byte d_imageType;
│ │ │ │ +
51 byte d_depth;
│ │ │ │ +
52 byte d_description;
│ │ │ │
53
│ │ │ │ -
54inline void ImageContext::setNextPixel(byte red, byte green, byte bleu, byte alpha)
│ │ │ │ -
55{
│ │ │ │ -
56 //assert(d_currentOffset < d_length && "ASSERT: try to set a pixel outside of the image");
│ │ │ │ -
57 switch(d_format)
│ │ │ │ -
58 {
│ │ │ │ -
59 case PF_A1B5G5R5:
│ │ │ │ -
60 // The hard part
│ │ │ │ -
61 assert(0 && "ASSERT: Not yet implemented");
│ │ │ │ -
62 break;
│ │ │ │ -
63 case PF_RGB:
│ │ │ │ -
64 // Ignore alpha channel
│ │ │ │ -
65 d_pixels[d_currentOffset++] = red;
│ │ │ │ -
66 d_pixels[d_currentOffset++] = green;
│ │ │ │ -
67 d_pixels[d_currentOffset++] = bleu;
│ │ │ │ -
68 break;
│ │ │ │ -
69
│ │ │ │ -
70 case PF_RGBA:
│ │ │ │ -
71 d_pixels[d_currentOffset++] = red;
│ │ │ │ -
72 d_pixels[d_currentOffset++] = green;
│ │ │ │ -
73 d_pixels[d_currentOffset++] = bleu;
│ │ │ │ -
74 d_pixels[d_currentOffset++] = alpha;
│ │ │ │ -
75 break;
│ │ │ │ -
76
│ │ │ │ -
77 }
│ │ │ │ -
78}
│ │ │ │ -
79inline size_t ImageContext::getWidth() const
│ │ │ │ -
80{
│ │ │ │ -
81 return d_width;
│ │ │ │ -
82}
│ │ │ │ -
83
│ │ │ │ -
84inline void ImageContext::setWidth(size_t width)
│ │ │ │ -
85{
│ │ │ │ -
86 d_width = width;
│ │ │ │ -
87}
│ │ │ │ -
88
│ │ │ │ -
89inline size_t ImageContext::getHeight() const
│ │ │ │ -
90{
│ │ │ │ -
91 return d_height;
│ │ │ │ -
92}
│ │ │ │ -
93
│ │ │ │ -
94inline void ImageContext::setHeight(size_t height)
│ │ │ │ -
95{
│ │ │ │ -
96 d_height = height;
│ │ │ │ -
97}
│ │ │ │ -
98inline PixelFormat ImageContext::getPixelFormat() const
│ │ │ │ -
99{
│ │ │ │ -
100 return d_format;
│ │ │ │ -
101}
│ │ │ │ -
102
│ │ │ │ -
103} // End of section namespace SILLY
│ │ │ │ -
104
│ │ │ │ +
54 friend class TGAImageLoader;
│ │ │ │ +
55
│ │ │ │ +
56};
│ │ │ │ +
57
│ │ │ │ +
58
│ │ │ │ +
59} // End of section namespace SILLY
│ │ │ │ +
60
│ │ │ │ +
61// Inclue inline function when needed
│ │ │ │ +
62#ifdef SILLY_OPT_INLINE
│ │ │ │ +
63#include "SILLYTGAImageContext.icpp"
│ │ │ │ +
64#endif
│ │ │ │ +
65
│ │ │ │ +
66#endif // end of guard _SILLYTGAImageContext_h_
│ │ │ │ +
Simple Image Loading LibrarY namespace.
│ │ │ │ +
Image Context for Targa image.
│ │ │ │ +
Loader for Targa image.
│ │ │ │ +
Store the data needed by an ImageLoader object during the parsing of an image.
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,21 +4,22 @@ │ │ │ │ │ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ │ │ │ │ │ * build │ │ │ │ │ * reproducible-path │ │ │ │ │ * silly-0.1.0 │ │ │ │ │ * include │ │ │ │ │ -SILLYImageContext.icpp │ │ │ │ │ + * loaders │ │ │ │ │ +SILLYTGAImageContext.h │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ - 2 filename: SILLYImageContext.icpp │ │ │ │ │ - 3 created: 10 Jun 2006 │ │ │ │ │ + 2 filename: SILLYTGAImageContext.h │ │ │ │ │ + 3 created: 11 Jun 2006 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ - 6 purpose: Inline definition for ImageContext │ │ │ │ │ + 6 purpose: Declaration of the TGAImageContext class │ │ │ │ │ 7*************************************************************************/ │ │ │ │ │ 8/*************************************************************************** │ │ │ │ │ 9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team │ │ │ │ │ 10 * │ │ │ │ │ 11 * Permission is hereby granted, free of charge, to any person obtaining │ │ │ │ │ 12 * a copy of this software and associated documentation files (the │ │ │ │ │ 13 * "Software"), to deal in the Software without restriction, including │ │ │ │ │ @@ -35,89 +36,54 @@ │ │ │ │ │ 24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. │ │ │ │ │ 25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR │ │ │ │ │ 26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ │ │ │ │ 27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR │ │ │ │ │ 28 * OTHER DEALINGS IN THE SOFTWARE. │ │ │ │ │ 29 │ │ │ │ │ ***************************************************************************/ │ │ │ │ │ - 30 │ │ │ │ │ - 31// Start of section namespace SILLY │ │ │ │ │ - 32namespace SILLY │ │ │ │ │ - 33{ │ │ │ │ │ - 34 │ │ │ │ │ - 35inline ImageContext::ImageContext(size_t width, size_t height) │ │ │ │ │ - 36 : d_pixels(0), d_length(0), d_width(width), d_height(height), │ │ │ │ │ -d_currentOffset(0), d_format(PF_RGBA) │ │ │ │ │ - 37{ │ │ │ │ │ - 38} │ │ │ │ │ - 39 │ │ │ │ │ - 40 │ │ │ │ │ - 41inline ImageContext::~ImageContext() │ │ │ │ │ - 42{ │ │ │ │ │ - 43} │ │ │ │ │ - 44 │ │ │ │ │ - 45 │ │ │ │ │ - 46inline void ImageContext::setDestination(byte* pixels, size_t length, │ │ │ │ │ -PixelFormat format) │ │ │ │ │ - 47{ │ │ │ │ │ - 48 d_pixels = pixels; │ │ │ │ │ - 49 d_length = length; │ │ │ │ │ - 50 d_currentOffset = 0; │ │ │ │ │ - 51 d_format = format; │ │ │ │ │ - 52} │ │ │ │ │ + 30#ifndef _SILLYTGAImageContext_h_ │ │ │ │ │ + 31#define _SILLYTGAImageContext_h_ │ │ │ │ │ + 32#include "SILLYBase.h" │ │ │ │ │ + 33#include "SILLYImageContext.h" │ │ │ │ │ + 34// Start of section namespace SILLY │ │ │ │ │ + 35namespace SILLY │ │ │ │ │ + 36{ │ │ │ │ │ +42class TGAImageContext : public ImageContext │ │ │ │ │ + 43{ │ │ │ │ │ + 44public: │ │ │ │ │ + 45 TGAImageContext(size_t width, size_t height); │ │ │ │ │ + 46 ~TGAImageContext(); │ │ │ │ │ + 47 │ │ │ │ │ + 48private: │ │ │ │ │ + 49 byte d_idLength; │ │ │ │ │ + 50 byte d_imageType; │ │ │ │ │ + 51 byte d_depth; │ │ │ │ │ + 52 byte d_description; │ │ │ │ │ 53 │ │ │ │ │ - 54inline void ImageContext::setNextPixel(byte red, byte green, byte bleu, byte │ │ │ │ │ -alpha) │ │ │ │ │ - 55{ │ │ │ │ │ - 56 //assert(d_currentOffset < d_length && "ASSERT: try to set a pixel outside │ │ │ │ │ -of the image"); │ │ │ │ │ - 57 switch(d_format) │ │ │ │ │ - 58 { │ │ │ │ │ - 59 case PF_A1B5G5R5: │ │ │ │ │ - 60 // The hard part │ │ │ │ │ - 61 assert(0 && "ASSERT: Not yet implemented"); │ │ │ │ │ - 62 break; │ │ │ │ │ - 63 case PF_RGB: │ │ │ │ │ - 64 // Ignore alpha channel │ │ │ │ │ - 65 d_pixels[d_currentOffset++] = red; │ │ │ │ │ - 66 d_pixels[d_currentOffset++] = green; │ │ │ │ │ - 67 d_pixels[d_currentOffset++] = bleu; │ │ │ │ │ - 68 break; │ │ │ │ │ - 69 │ │ │ │ │ - 70 case PF_RGBA: │ │ │ │ │ - 71 d_pixels[d_currentOffset++] = red; │ │ │ │ │ - 72 d_pixels[d_currentOffset++] = green; │ │ │ │ │ - 73 d_pixels[d_currentOffset++] = bleu; │ │ │ │ │ - 74 d_pixels[d_currentOffset++] = alpha; │ │ │ │ │ - 75 break; │ │ │ │ │ - 76 │ │ │ │ │ - 77 } │ │ │ │ │ - 78} │ │ │ │ │ - 79inline size_t ImageContext::getWidth() const │ │ │ │ │ - 80{ │ │ │ │ │ - 81 return d_width; │ │ │ │ │ - 82} │ │ │ │ │ - 83 │ │ │ │ │ - 84inline void ImageContext::setWidth(size_t width) │ │ │ │ │ - 85{ │ │ │ │ │ - 86 d_width = width; │ │ │ │ │ - 87} │ │ │ │ │ - 88 │ │ │ │ │ - 89inline size_t ImageContext::getHeight() const │ │ │ │ │ - 90{ │ │ │ │ │ - 91 return d_height; │ │ │ │ │ - 92} │ │ │ │ │ - 93 │ │ │ │ │ - 94inline void ImageContext::setHeight(size_t height) │ │ │ │ │ - 95{ │ │ │ │ │ - 96 d_height = height; │ │ │ │ │ - 97} │ │ │ │ │ - 98inline PixelFormat ImageContext::getPixelFormat() const │ │ │ │ │ - 99{ │ │ │ │ │ - 100 return d_format; │ │ │ │ │ - 101} │ │ │ │ │ - 102 │ │ │ │ │ - 103} // End of section namespace SILLY │ │ │ │ │ - 104 │ │ │ │ │ + 54 friend class TGAImageLoader; │ │ │ │ │ + 55 │ │ │ │ │ + 56}; │ │ │ │ │ + 57 │ │ │ │ │ + 58 │ │ │ │ │ + 59} // End of section namespace SILLY │ │ │ │ │ + 60 │ │ │ │ │ + 61// Inclue inline function when needed │ │ │ │ │ + 62#ifdef SILLY_OPT_INLINE │ │ │ │ │ + 63#include "SILLYTGAImageContext.icpp" │ │ │ │ │ + 64#endif │ │ │ │ │ + 65 │ │ │ │ │ + 66#endif // end of guard _SILLYTGAImageContext_h_ │ │ │ │ │ +SILLY │ │ │ │ │ +Simple Image Loading LibrarY namespace. │ │ │ │ │ +Definition: SILLYJPGImageContext.cpp:46 │ │ │ │ │ +SILLY::TGAImageContext │ │ │ │ │ +Image Context for Targa image. │ │ │ │ │ +Definition: SILLYTGAImageContext.h:43 │ │ │ │ │ +SILLY::TGAImageLoader │ │ │ │ │ +Loader for Targa image. │ │ │ │ │ +Definition: SILLYTGAImageLoader.h:44 │ │ │ │ │ +SILLY::ImageContext │ │ │ │ │ +Store the data needed by an ImageLoader object during the parsing of an image. │ │ │ │ │ +Definition: SILLYImageContext.h:44 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libsilly-doc/html/a00065_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/SILLYMemoryDataSource.icpp Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/loaders/SILLYJPGImageContext.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -35,67 +35,96 @@ │ │ │ │ initMenu('',false,false,'search.php','Search'); │ │ │ │ }); │ │ │ │ /* @license-end */ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYMemoryDataSource.icpp
│ │ │ │ +
SILLYJPGImageContext.h
│ │ │ │
│ │ │ │
│ │ │ │ -
1/***********************************************************************
│ │ │ │ -
2 Filename: SILLYMemoryDataSource.icpp
│ │ │ │ -
3 created: 10 Jun 2006
│ │ │ │ -
4 author: Olivier Delannoy
│ │ │ │ -
5
│ │ │ │ -
6 purpose: Inline function definition for MemoryDataSource class
│ │ │ │ -
7*************************************************************************/
│ │ │ │ -
8/***************************************************************************
│ │ │ │ -
9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
│ │ │ │ -
10 *
│ │ │ │ -
11 * Permission is hereby granted, free of charge, to any person obtaining
│ │ │ │ -
12 * a copy of this software and associated documentation files (the
│ │ │ │ -
13 * "Software"), to deal in the Software without restriction, including
│ │ │ │ -
14 * without limitation the rights to use, copy, modify, merge, publish,
│ │ │ │ -
15 * distribute, sublicense, and/or sell copies of the Software, and to
│ │ │ │ -
16 * permit persons to whom the Software is furnished to do so, subject to
│ │ │ │ -
17 * the following conditions:
│ │ │ │ -
18 *
│ │ │ │ -
19 * The above copyright notice and this permission notice shall be
│ │ │ │ -
20 * included in all copies or substantial portions of the Software.
│ │ │ │ -
21 *
│ │ │ │ -
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
│ │ │ │ -
23 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
│ │ │ │ -
24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
│ │ │ │ -
25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
│ │ │ │ -
26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
│ │ │ │ -
27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
│ │ │ │ -
28 * OTHER DEALINGS IN THE SOFTWARE.
│ │ │ │ -
29 ***************************************************************************/
│ │ │ │ -
30
│ │ │ │ -
31// Start of section namespace SILLY
│ │ │ │ -
32namespace SILLY
│ │ │ │ -
33{
│ │ │ │ -
34
│ │ │ │ -
35inline const byte* MemoryDataSource::getDataPtr() const
│ │ │ │ -
36{
│ │ │ │ -
37 return d_bytes;
│ │ │ │ -
38}
│ │ │ │ -
39
│ │ │ │ -
40inline size_t MemoryDataSource::getSize() const
│ │ │ │ -
41{
│ │ │ │ -
42 return d_size;
│ │ │ │ -
43}
│ │ │ │ -
44
│ │ │ │ -
45} // End of section namespace SILLY
│ │ │ │ -
46
│ │ │ │ +
1/***********************************************************************
│ │ │ │ +
2 filename: SILLYJPGImageContext.h
│ │ │ │ +
3 created: 11 Jun 2006
│ │ │ │ +
4 author: Olivier Delannoy
│ │ │ │ +
5
│ │ │ │ +
6 purpose: Declaration of the JPGImageContext class
│ │ │ │ +
7*************************************************************************/
│ │ │ │ +
8/***************************************************************************
│ │ │ │ +
9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
│ │ │ │ +
10 *
│ │ │ │ +
11 * Permission is hereby granted, free of charge, to any person obtaining
│ │ │ │ +
12 * a copy of this software and associated documentation files (the
│ │ │ │ +
13 * "Software"), to deal in the Software without restriction, including
│ │ │ │ +
14 * without limitation the rights to use, copy, modify, merge, publish,
│ │ │ │ +
15 * distribute, sublicense, and/or sell copies of the Software, and to
│ │ │ │ +
16 * permit persons to whom the Software is furnished to do so, subject to
│ │ │ │ +
17 * the following conditions:
│ │ │ │ +
18 *
│ │ │ │ +
19 * The above copyright notice and this permission notice shall be
│ │ │ │ +
20 * included in all copies or substantial portions of the Software.
│ │ │ │ +
21 *
│ │ │ │ +
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
│ │ │ │ +
23 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
│ │ │ │ +
24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
│ │ │ │ +
25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
│ │ │ │ +
26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
│ │ │ │ +
27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
│ │ │ │ +
28 * OTHER DEALINGS IN THE SOFTWARE.
│ │ │ │ +
29 ***************************************************************************/
│ │ │ │ +
30#ifndef _SILLYJPGImageContext_h_
│ │ │ │ +
31#define _SILLYJPGImageContext_h_
│ │ │ │ +
32#include "SILLYBase.h"
│ │ │ │ +
33#include "SILLYImageContext.h"
│ │ │ │ +
34#include "SILLYDataSource.h"
│ │ │ │ +
35// Start of section namespace SILLY
│ │ │ │ +
36#include <setjmp.h>
│ │ │ │ +
37#include <stdio.h>
│ │ │ │ +
38#include <string.h>
│ │ │ │ +
39extern "C"
│ │ │ │ +
40{
│ │ │ │ +
41#include <jpeglib.h>
│ │ │ │ +
42}
│ │ │ │ +
43namespace SILLY
│ │ │ │ +
44{
│ │ │ │ +
45
│ │ │ │ + │ │ │ │ +
57{
│ │ │ │ +
58public:
│ │ │ │ + │ │ │ │ + │ │ │ │ +
61
│ │ │ │ +
62 void setImageSize();
│ │ │ │ +
63
│ │ │ │ +
64
│ │ │ │ +
65 jpeg_source_mgr src_mgr;
│ │ │ │ +
66 jpeg_decompress_struct cinfo;
│ │ │ │ +
67
│ │ │ │ +
68 jpeg_error_mgr d_error_mgr;
│ │ │ │ +
69 jmp_buf setjmp_buffer;
│ │ │ │ +
70 DataSource* d_source;
│ │ │ │ +
71};
│ │ │ │ +
72
│ │ │ │ +
73
│ │ │ │ +
74} // End of section namespace SILLY
│ │ │ │ +
75
│ │ │ │ +
76// Inclue inline function when needed
│ │ │ │ +
77#ifdef SILLY_OPT_INLINE
│ │ │ │ +
78#include "SILLYJPGImageContext.icpp"
│ │ │ │ +
79#endif
│ │ │ │ +
80
│ │ │ │ +
81#endif // end of guard _SILLYJPGImageContext_h_
│ │ │ │ +
Simple Image Loading LibrarY namespace.
│ │ │ │ +
Image Context for JPG image loader.
│ │ │ │ +
This is an abstract class used to provide data to the loader.
│ │ │ │ +
Store the data needed by an ImageLoader object during the parsing of an image.
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,21 +4,22 @@ │ │ │ │ │ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ │ │ │ │ │ * build │ │ │ │ │ * reproducible-path │ │ │ │ │ * silly-0.1.0 │ │ │ │ │ * include │ │ │ │ │ -SILLYMemoryDataSource.icpp │ │ │ │ │ + * loaders │ │ │ │ │ +SILLYJPGImageContext.h │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ - 2 Filename: SILLYMemoryDataSource.icpp │ │ │ │ │ - 3 created: 10 Jun 2006 │ │ │ │ │ + 2 filename: SILLYJPGImageContext.h │ │ │ │ │ + 3 created: 11 Jun 2006 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ - 6 purpose: Inline function definition for MemoryDataSource class │ │ │ │ │ + 6 purpose: Declaration of the JPGImageContext class │ │ │ │ │ 7*************************************************************************/ │ │ │ │ │ 8/*************************************************************************** │ │ │ │ │ 9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team │ │ │ │ │ 10 * │ │ │ │ │ 11 * Permission is hereby granted, free of charge, to any person obtaining │ │ │ │ │ 12 * a copy of this software and associated documentation files (the │ │ │ │ │ 13 * "Software"), to deal in the Software without restriction, including │ │ │ │ │ @@ -35,27 +36,64 @@ │ │ │ │ │ 24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. │ │ │ │ │ 25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR │ │ │ │ │ 26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ │ │ │ │ 27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR │ │ │ │ │ 28 * OTHER DEALINGS IN THE SOFTWARE. │ │ │ │ │ 29 │ │ │ │ │ ***************************************************************************/ │ │ │ │ │ - 30 │ │ │ │ │ - 31// Start of section namespace SILLY │ │ │ │ │ - 32namespace SILLY │ │ │ │ │ - 33{ │ │ │ │ │ - 34 │ │ │ │ │ - 35inline const byte* MemoryDataSource::getDataPtr() const │ │ │ │ │ - 36{ │ │ │ │ │ - 37 return d_bytes; │ │ │ │ │ - 38} │ │ │ │ │ - 39 │ │ │ │ │ - 40inline size_t MemoryDataSource::getSize() const │ │ │ │ │ - 41{ │ │ │ │ │ - 42 return d_size; │ │ │ │ │ - 43} │ │ │ │ │ - 44 │ │ │ │ │ - 45} // End of section namespace SILLY │ │ │ │ │ - 46 │ │ │ │ │ + 30#ifndef _SILLYJPGImageContext_h_ │ │ │ │ │ + 31#define _SILLYJPGImageContext_h_ │ │ │ │ │ + 32#include "SILLYBase.h" │ │ │ │ │ + 33#include "SILLYImageContext.h" │ │ │ │ │ + 34#include "SILLYDataSource.h" │ │ │ │ │ + 35// Start of section namespace SILLY │ │ │ │ │ + 36#include │ │ │ │ │ + 37#include │ │ │ │ │ + 38#include │ │ │ │ │ + 39extern "C" │ │ │ │ │ + 40{ │ │ │ │ │ + 41#include │ │ │ │ │ + 42} │ │ │ │ │ + 43namespace SILLY │ │ │ │ │ + 44{ │ │ │ │ │ + 45 │ │ │ │ │ +56class JPGImageContext : public ImageContext │ │ │ │ │ + 57{ │ │ │ │ │ + 58public: │ │ │ │ │ + 59 JPGImageContext(); │ │ │ │ │ + 60 ~JPGImageContext(); │ │ │ │ │ + 61 │ │ │ │ │ + 62 void setImageSize(); │ │ │ │ │ + 63 │ │ │ │ │ + 64 │ │ │ │ │ + 65 jpeg_source_mgr src_mgr; │ │ │ │ │ + 66 jpeg_decompress_struct cinfo; │ │ │ │ │ + 67 │ │ │ │ │ + 68 jpeg_error_mgr d_error_mgr; │ │ │ │ │ + 69 jmp_buf setjmp_buffer; │ │ │ │ │ + 70 DataSource* d_source; │ │ │ │ │ + 71}; │ │ │ │ │ + 72 │ │ │ │ │ + 73 │ │ │ │ │ + 74} // End of section namespace SILLY │ │ │ │ │ + 75 │ │ │ │ │ + 76// Inclue inline function when needed │ │ │ │ │ + 77#ifdef SILLY_OPT_INLINE │ │ │ │ │ + 78#include "SILLYJPGImageContext.icpp" │ │ │ │ │ + 79#endif │ │ │ │ │ + 80 │ │ │ │ │ + 81#endif // end of guard _SILLYJPGImageContext_h_ │ │ │ │ │ +SILLY │ │ │ │ │ +Simple Image Loading LibrarY namespace. │ │ │ │ │ +Definition: SILLYJPGImageContext.cpp:46 │ │ │ │ │ +SILLY::JPGImageContext │ │ │ │ │ +Image Context for JPG image loader. │ │ │ │ │ +Definition: SILLYJPGImageContext.h:57 │ │ │ │ │ +SILLY::DataSource │ │ │ │ │ +This is an abstract class used to provide data to the loader. │ │ │ │ │ +Definition: SILLYDataSource.h:47 │ │ │ │ │ +SILLY::ImageContext │ │ │ │ │ +Store the data needed by an ImageLoader object during the parsing of an image. │ │ │ │ │ +Definition: SILLYImageContext.h:44 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libsilly-doc/html/a00068_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/SILLYDataSource.icpp Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/loaders/SILLYPNGImageLoader.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -35,66 +35,92 @@ │ │ │ │ initMenu('',false,false,'search.php','Search'); │ │ │ │ }); │ │ │ │ /* @license-end */ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYDataSource.icpp
│ │ │ │ +
SILLYPNGImageLoader.h
│ │ │ │
│ │ │ │
│ │ │ │ -
1/***********************************************************************
│ │ │ │ -
2 filename: SILLYDataSource.icpp
│ │ │ │ -
3 created: 10 Jun 2006
│ │ │ │ -
4 author: ode@dalfy.dalfy.dyndns.org
│ │ │ │ -
5
│ │ │ │ -
6 purpose: Inline function definition for (F>>>ILE_SANS<<<) class
│ │ │ │ -
7*************************************************************************/
│ │ │ │ -
8/***************************************************************************
│ │ │ │ -
9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
│ │ │ │ -
10 *
│ │ │ │ -
11 * Permission is hereby granted, free of charge, to any person obtaining
│ │ │ │ -
12 * a copy of this software and associated documentation files (the
│ │ │ │ -
13 * "Software"), to deal in the Software without restriction, including
│ │ │ │ -
14 * without limitation the rights to use, copy, modify, merge, publish,
│ │ │ │ -
15 * distribute, sublicense, and/or sell copies of the Software, and to
│ │ │ │ -
16 * permit persons to whom the Software is furnished to do so, subject to
│ │ │ │ -
17 * the following conditions:
│ │ │ │ -
18 *
│ │ │ │ -
19 * The above copyright notice and this permission notice shall be
│ │ │ │ -
20 * included in all copies or substantial portions of the Software.
│ │ │ │ -
21 *
│ │ │ │ -
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
│ │ │ │ -
23 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
│ │ │ │ -
24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
│ │ │ │ -
25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
│ │ │ │ -
26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
│ │ │ │ -
27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
│ │ │ │ -
28 * OTHER DEALINGS IN THE SOFTWARE.
│ │ │ │ -
29 ***************************************************************************/
│ │ │ │ -
30
│ │ │ │ -
31// Start of section namespace SILLY
│ │ │ │ -
32namespace SILLY
│ │ │ │ -
33{
│ │ │ │ -
34inline DataSource::~DataSource()
│ │ │ │ -
35{
│ │ │ │ -
36}
│ │ │ │ -
37
│ │ │ │ -
38inline byte DataSource::operator[](size_t offset) const
│ │ │ │ -
39{
│ │ │ │ -
40 assert(offset < getSize() && "ASSERT: Trying to access pixel outside of the data");
│ │ │ │ -
41 return getDataPtr()[offset];
│ │ │ │ -
42}
│ │ │ │ -
43
│ │ │ │ -
44} // End of section namespace SILLY
│ │ │ │ -
45
│ │ │ │ +
1/***********************************************************************
│ │ │ │ +
2 filename: SILLYPNGImageLoader.h
│ │ │ │ +
3 created: 11 Jun 2006
│ │ │ │ +
4 author: Olivier Delannoy
│ │ │ │ +
5
│ │ │ │ +
6 purpose: Declaration of the PNGImageLoader class
│ │ │ │ +
7*************************************************************************/
│ │ │ │ +
8/***************************************************************************
│ │ │ │ +
9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
│ │ │ │ +
10 *
│ │ │ │ +
11 * Permission is hereby granted, free of charge, to any person obtaining
│ │ │ │ +
12 * a copy of this software and associated documentation files (the
│ │ │ │ +
13 * "Software"), to deal in the Software without restriction, including
│ │ │ │ +
14 * without limitation the rights to use, copy, modify, merge, publish,
│ │ │ │ +
15 * distribute, sublicense, and/or sell copies of the Software, and to
│ │ │ │ +
16 * permit persons to whom the Software is furnished to do so, subject to
│ │ │ │ +
17 * the following conditions:
│ │ │ │ +
18 *
│ │ │ │ +
19 * The above copyright notice and this permission notice shall be
│ │ │ │ +
20 * included in all copies or substantial portions of the Software.
│ │ │ │ +
21 *
│ │ │ │ +
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
│ │ │ │ +
23 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
│ │ │ │ +
24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
│ │ │ │ +
25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
│ │ │ │ +
26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
│ │ │ │ +
27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
│ │ │ │ +
28 * OTHER DEALINGS IN THE SOFTWARE.
│ │ │ │ +
29 ***************************************************************************/
│ │ │ │ +
30#ifndef _SILLYPNGImageLoader_h_
│ │ │ │ +
31#define _SILLYPNGImageLoader_h_
│ │ │ │ +
32#include "SILLYBase.h"
│ │ │ │ +
33#include "SILLYImageLoader.h"
│ │ │ │ +
34#include "SILLYDataSource.h"
│ │ │ │ +
35// Start of section namespace SILLY
│ │ │ │ +
36namespace SILLY
│ │ │ │ +
37{
│ │ │ │ + │ │ │ │ +
43{
│ │ │ │ +
44public:
│ │ │ │ + │ │ │ │ +
46
│ │ │ │ + │ │ │ │ +
48
│ │ │ │ +
49 ImageContext* loadHeader(PixelFormat& formatSource, DataSource* data);
│ │ │ │ +
50
│ │ │ │ +
51 bool loadImageData(PixelOrigin origin,
│ │ │ │ +
52 DataSource* data,
│ │ │ │ +
53 ImageContext* context);
│ │ │ │ +
54private:
│ │ │ │ +
55
│ │ │ │ +
56};
│ │ │ │ +
57
│ │ │ │ +
58
│ │ │ │ +
59} // End of section namespace SILLY
│ │ │ │ +
60
│ │ │ │ +
61// Inclue inline function when needed
│ │ │ │ +
62#ifdef SILLY_OPT_INLINE
│ │ │ │ +
63#include "SILLYPNGImageLoader.icpp"
│ │ │ │ +
64#endif
│ │ │ │ +
65
│ │ │ │ +
66#endif // end of guard _SILLYPNGImageLoader_h_
│ │ │ │ +
Simple Image Loading LibrarY namespace.
│ │ │ │ +
PixelFormat
List all pixel format supported.
Definition: SILLYBase.h:60
│ │ │ │ +
PixelOrigin
List all pixel origin supported.
Definition: SILLYBase.h:71
│ │ │ │ +
Loader for PNG Image.
│ │ │ │ +
ImageContext * loadHeader(PixelFormat &formatSource, DataSource *data)
Parse the header of the image and fill the header struct.
│ │ │ │ +
bool loadImageData(PixelOrigin origin, DataSource *data, ImageContext *context)
Parse the pixels data of the image and fill the header struct.
│ │ │ │ +
This is an abstract class used to provide data to the loader.
│ │ │ │ +
Store the data needed by an ImageLoader object during the parsing of an image.
│ │ │ │ +
This is an abstract class that define the interface of all image loader.
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,21 +4,22 @@ │ │ │ │ │ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ │ │ │ │ │ * build │ │ │ │ │ * reproducible-path │ │ │ │ │ * silly-0.1.0 │ │ │ │ │ * include │ │ │ │ │ -SILLYDataSource.icpp │ │ │ │ │ + * loaders │ │ │ │ │ +SILLYPNGImageLoader.h │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ - 2 filename: SILLYDataSource.icpp │ │ │ │ │ - 3 created: 10 Jun 2006 │ │ │ │ │ - 4 author: ode@dalfy.dalfy.dyndns.org │ │ │ │ │ + 2 filename: SILLYPNGImageLoader.h │ │ │ │ │ + 3 created: 11 Jun 2006 │ │ │ │ │ + 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ - 6 purpose: Inline function definition for (F>>>ILE_SANS<<<) class │ │ │ │ │ + 6 purpose: Declaration of the PNGImageLoader class │ │ │ │ │ 7*************************************************************************/ │ │ │ │ │ 8/*************************************************************************** │ │ │ │ │ 9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team │ │ │ │ │ 10 * │ │ │ │ │ 11 * Permission is hereby granted, free of charge, to any person obtaining │ │ │ │ │ 12 * a copy of this software and associated documentation files (the │ │ │ │ │ 13 * "Software"), to deal in the Software without restriction, including │ │ │ │ │ @@ -35,27 +36,74 @@ │ │ │ │ │ 24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. │ │ │ │ │ 25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR │ │ │ │ │ 26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ │ │ │ │ 27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR │ │ │ │ │ 28 * OTHER DEALINGS IN THE SOFTWARE. │ │ │ │ │ 29 │ │ │ │ │ ***************************************************************************/ │ │ │ │ │ - 30 │ │ │ │ │ - 31// Start of section namespace SILLY │ │ │ │ │ - 32namespace SILLY │ │ │ │ │ - 33{ │ │ │ │ │ - 34inline DataSource::~DataSource() │ │ │ │ │ - 35{ │ │ │ │ │ - 36} │ │ │ │ │ - 37 │ │ │ │ │ - 38inline byte DataSource::operator[](size_t offset) const │ │ │ │ │ - 39{ │ │ │ │ │ - 40 assert(offset < getSize() && "ASSERT: Trying to access pixel outside of the │ │ │ │ │ -data"); │ │ │ │ │ - 41 return getDataPtr()[offset]; │ │ │ │ │ - 42} │ │ │ │ │ - 43 │ │ │ │ │ - 44} // End of section namespace SILLY │ │ │ │ │ - 45 │ │ │ │ │ + 30#ifndef _SILLYPNGImageLoader_h_ │ │ │ │ │ + 31#define _SILLYPNGImageLoader_h_ │ │ │ │ │ + 32#include "SILLYBase.h" │ │ │ │ │ + 33#include "SILLYImageLoader.h" │ │ │ │ │ + 34#include "SILLYDataSource.h" │ │ │ │ │ + 35// Start of section namespace SILLY │ │ │ │ │ + 36namespace SILLY │ │ │ │ │ + 37{ │ │ │ │ │ +42class PNGImageLoader : public ImageLoader │ │ │ │ │ + 43{ │ │ │ │ │ + 44public: │ │ │ │ │ + 45 PNGImageLoader(); │ │ │ │ │ + 46 │ │ │ │ │ + 47 ~PNGImageLoader(); │ │ │ │ │ + 48 │ │ │ │ │ + 49 ImageContext* loadHeader(PixelFormat& formatSource, DataSource* data); │ │ │ │ │ + 50 │ │ │ │ │ + 51 bool loadImageData(PixelOrigin origin, │ │ │ │ │ + 52 DataSource* data, │ │ │ │ │ + 53 ImageContext* context); │ │ │ │ │ + 54private: │ │ │ │ │ + 55 │ │ │ │ │ + 56}; │ │ │ │ │ + 57 │ │ │ │ │ + 58 │ │ │ │ │ + 59} // End of section namespace SILLY │ │ │ │ │ + 60 │ │ │ │ │ + 61// Inclue inline function when needed │ │ │ │ │ + 62#ifdef SILLY_OPT_INLINE │ │ │ │ │ + 63#include "SILLYPNGImageLoader.icpp" │ │ │ │ │ + 64#endif │ │ │ │ │ + 65 │ │ │ │ │ + 66#endif // end of guard _SILLYPNGImageLoader_h_ │ │ │ │ │ +SILLY │ │ │ │ │ +Simple Image Loading LibrarY namespace. │ │ │ │ │ +Definition: SILLYJPGImageContext.cpp:46 │ │ │ │ │ +SILLY::PixelFormat │ │ │ │ │ +PixelFormat │ │ │ │ │ +List all pixel format supported. │ │ │ │ │ +Definition: SILLYBase.h:60 │ │ │ │ │ +SILLY::PixelOrigin │ │ │ │ │ +PixelOrigin │ │ │ │ │ +List all pixel origin supported. │ │ │ │ │ +Definition: SILLYBase.h:71 │ │ │ │ │ +SILLY::PNGImageLoader │ │ │ │ │ +Loader for PNG Image. │ │ │ │ │ +Definition: SILLYPNGImageLoader.h:43 │ │ │ │ │ +SILLY::PNGImageLoader::loadHeader │ │ │ │ │ +ImageContext * loadHeader(PixelFormat &formatSource, DataSource *data) │ │ │ │ │ +Parse the header of the image and fill the header struct. │ │ │ │ │ +Definition: SILLYPNGImageLoader.cpp:88 │ │ │ │ │ +SILLY::PNGImageLoader::loadImageData │ │ │ │ │ +bool loadImageData(PixelOrigin origin, DataSource *data, ImageContext *context) │ │ │ │ │ +Parse the pixels data of the image and fill the header struct. │ │ │ │ │ +Definition: SILLYPNGImageLoader.cpp:154 │ │ │ │ │ +SILLY::DataSource │ │ │ │ │ +This is an abstract class used to provide data to the loader. │ │ │ │ │ +Definition: SILLYDataSource.h:47 │ │ │ │ │ +SILLY::ImageContext │ │ │ │ │ +Store the data needed by an ImageLoader object during the parsing of an image. │ │ │ │ │ +Definition: SILLYImageContext.h:44 │ │ │ │ │ +SILLY::ImageLoader │ │ │ │ │ +This is an abstract class that define the interface of all image loader. │ │ │ │ │ +Definition: SILLYImageLoader.h:47 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libsilly-doc/html/a00071_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/SILLYImage.h Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/loaders/SILLYJPGImageLoader.icpp Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -35,128 +35,57 @@ │ │ │ │ initMenu('',false,false,'search.php','Search'); │ │ │ │ }); │ │ │ │ /* @license-end */ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYImage.h
│ │ │ │ +
SILLYJPGImageLoader.icpp
│ │ │ │
│ │ │ │
│ │ │ │ -
1
│ │ │ │ -
2/***********************************************************************
│ │ │ │ -
3 filename: SILLYImage.h
│ │ │ │ -
4 created: 10 Jun 2006
│ │ │ │ -
5 author: Olivier Delannoy
│ │ │ │ -
6
│ │ │ │ -
7 purpose: Image class definition
│ │ │ │ -
8*************************************************************************/
│ │ │ │ -
9/***************************************************************************
│ │ │ │ -
10 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
│ │ │ │ -
11 *
│ │ │ │ -
12 * Permission is hereby granted, free of charge, to any person obtaining
│ │ │ │ -
13 * a copy of this software and associated documentation files (the
│ │ │ │ -
14 * "Software"), to deal in the Software without restriction, including
│ │ │ │ -
15 * without limitation the rights to use, copy, modify, merge, publish,
│ │ │ │ -
16 * distribute, sublicense, and/or sell copies of the Software, and to
│ │ │ │ -
17 * permit persons to whom the Software is furnished to do so, subject to
│ │ │ │ -
18 * the following conditions:
│ │ │ │ -
19 *
│ │ │ │ -
20 * The above copyright notice and this permission notice shall be
│ │ │ │ -
21 * included in all copies or substantial portions of the Software.
│ │ │ │ -
22 *
│ │ │ │ -
23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
│ │ │ │ -
24 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
│ │ │ │ -
25 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
│ │ │ │ -
26 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
│ │ │ │ -
27 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
│ │ │ │ -
28 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
│ │ │ │ -
29 * OTHER DEALINGS IN THE SOFTWARE.
│ │ │ │ -
30 ***************************************************************************/
│ │ │ │ -
31#ifndef _SILLYImage_h_
│ │ │ │ -
32#define _SILLYImage_h_
│ │ │ │ -
33#include "SILLYBase.h"
│ │ │ │ -
34#include "SILLYImageContext.h"
│ │ │ │ -
35#include "SILLYDataSource.h"
│ │ │ │ -
36#include "SILLYImageLoader.h"
│ │ │ │ -
37
│ │ │ │ -
38// Start of section namespace SILLY
│ │ │ │ -
39namespace SILLY
│ │ │ │ -
40{
│ │ │ │ -
41
│ │ │ │ -
46class SILLY_EXPORT Image
│ │ │ │ -
47{
│ │ │ │ -
48public:
│ │ │ │ -
55 Image(DataSource& data);
│ │ │ │ -
56
│ │ │ │ - │ │ │ │ -
62
│ │ │ │ -
67 bool isValid() const;
│ │ │ │ -
68
│ │ │ │ -
69
│ │ │ │ -
76 bool loadImageHeader();
│ │ │ │ -
77
│ │ │ │ -
91 bool loadImageData(PixelFormat resultFormat = PF_RGBA, PixelOrigin origin = PO_TOP_LEFT);
│ │ │ │ -
92
│ │ │ │ -
97 size_t getWidth() const;
│ │ │ │ -
98
│ │ │ │ -
103 size_t getHeight() const;
│ │ │ │ -
104
│ │ │ │ - │ │ │ │ -
110
│ │ │ │ - │ │ │ │ -
116
│ │ │ │ -
120 const byte* getPixelsDataPtr() const;
│ │ │ │ -
125 size_t getPixelsDataSize() const;
│ │ │ │ -
130 const char* getLoaderIdentifierString() const;
│ │ │ │ -
131private:
│ │ │ │ -
132 bool allocate();
│ │ │ │ -
133
│ │ │ │ -
134private:
│ │ │ │ -
135
│ │ │ │ -
136 size_t d_bpp;
│ │ │ │ -
137 PixelFormat d_pfSource;
│ │ │ │ -
138 byte* d_pixels;
│ │ │ │ -
139 DataSource* d_data;
│ │ │ │ -
140 ImageContext* d_imageContext;
│ │ │ │ -
141 ImageLoader* d_imageLoader;
│ │ │ │ -
142
│ │ │ │ -
143 // Disabled operation
│ │ │ │ -
144 Image(Image&);
│ │ │ │ -
145 Image& operator=(Image&);
│ │ │ │ -
146};
│ │ │ │ -
147
│ │ │ │ -
148} // End of section namespace SILLY
│ │ │ │ -
149
│ │ │ │ -
150// Inclue inline function when needed
│ │ │ │ -
151#ifdef SILLY_OPT_INLINE
│ │ │ │ -
152#include "SILLYImage.icpp"
│ │ │ │ -
153#endif
│ │ │ │ -
154
│ │ │ │ -
155#endif // end of guard _SILLYImage_h_
│ │ │ │ -
Simple Image Loading LibrarY namespace.
│ │ │ │ -
PixelFormat
List all pixel format supported.
Definition: SILLYBase.h:60
│ │ │ │ -
PixelOrigin
List all pixel origin supported.
Definition: SILLYBase.h:71
│ │ │ │ -
This is an abstract class used to provide data to the loader.
│ │ │ │ -
Image is the main user class of the library.
Definition: SILLYImage.h:47
│ │ │ │ -
PixelFormat getSourcePixelFormat() const
Retrieve the pixel format used for the image storage.
│ │ │ │ -
const char * getLoaderIdentifierString() const
Get Image loader identifier string.
│ │ │ │ -
const byte * getPixelsDataPtr() const
Get a pointer to the pixels data.
│ │ │ │ -
bool isValid() const
Return true if the image is valid after its loading.
│ │ │ │ -
size_t getPixelsDataSize() const
Get the size of the pixel buffer.
│ │ │ │ -
~Image()
Destructor.
│ │ │ │ -
size_t getWidth() const
Retrieve the width of the image.
│ │ │ │ -
PixelFormat getPixelFormat() const
Retrieve the pixel format of the resulting image.
│ │ │ │ -
size_t getHeight() const
Retrieve the height of the image.
│ │ │ │ -
Store the data needed by an ImageLoader object during the parsing of an image.
│ │ │ │ -
This is an abstract class that define the interface of all image loader.
│ │ │ │ +
1/***********************************************************************
│ │ │ │ +
2 filename: SILLYJPGImageLoader.icpp
│ │ │ │ +
3 created: 11 Jun 2006
│ │ │ │ +
4 author: Olivier Delannoy
│ │ │ │ +
5
│ │ │ │ +
6 purpose: Inline definition of JPGImageLoader class
│ │ │ │ +
7*************************************************************************/
│ │ │ │ +
8/***************************************************************************
│ │ │ │ +
9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
│ │ │ │ +
10 *
│ │ │ │ +
11 * Permission is hereby granted, free of charge, to any person obtaining
│ │ │ │ +
12 * a copy of this software and associated documentation files (the
│ │ │ │ +
13 * "Software"), to deal in the Software without restriction, including
│ │ │ │ +
14 * without limitation the rights to use, copy, modify, merge, publish,
│ │ │ │ +
15 * distribute, sublicense, and/or sell copies of the Software, and to
│ │ │ │ +
16 * permit persons to whom the Software is furnished to do so, subject to
│ │ │ │ +
17 * the following conditions:
│ │ │ │ +
18 *
│ │ │ │ +
19 * The above copyright notice and this permission notice shall be
│ │ │ │ +
20 * included in all copies or substantial portions of the Software.
│ │ │ │ +
21 *
│ │ │ │ +
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
│ │ │ │ +
23 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
│ │ │ │ +
24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
│ │ │ │ +
25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
│ │ │ │ +
26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
│ │ │ │ +
27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
│ │ │ │ +
28 * OTHER DEALINGS IN THE SOFTWARE.
│ │ │ │ +
29 ***************************************************************************/
│ │ │ │ +
30
│ │ │ │ +
31// Start of section namespace SILLY
│ │ │ │ +
32namespace SILLY
│ │ │ │ +
33{
│ │ │ │ +
34
│ │ │ │ +
35} // End of section namespace SILLY
│ │ │ │ +
36
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,154 +4,49 @@ │ │ │ │ │ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ │ │ │ │ │ * build │ │ │ │ │ * reproducible-path │ │ │ │ │ * silly-0.1.0 │ │ │ │ │ * include │ │ │ │ │ -SILLYImage.h │ │ │ │ │ - 1 │ │ │ │ │ - 2/*********************************************************************** │ │ │ │ │ - 3 filename: SILLYImage.h │ │ │ │ │ - 4 created: 10 Jun 2006 │ │ │ │ │ - 5 author: Olivier Delannoy │ │ │ │ │ - 6 │ │ │ │ │ - 7 purpose: Image class definition │ │ │ │ │ - 8*************************************************************************/ │ │ │ │ │ - 9/*************************************************************************** │ │ │ │ │ - 10 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team │ │ │ │ │ - 11 * │ │ │ │ │ - 12 * Permission is hereby granted, free of charge, to any person obtaining │ │ │ │ │ - 13 * a copy of this software and associated documentation files (the │ │ │ │ │ - 14 * "Software"), to deal in the Software without restriction, including │ │ │ │ │ - 15 * without limitation the rights to use, copy, modify, merge, publish, │ │ │ │ │ - 16 * distribute, sublicense, and/or sell copies of the Software, and to │ │ │ │ │ - 17 * permit persons to whom the Software is furnished to do so, subject to │ │ │ │ │ - 18 * the following conditions: │ │ │ │ │ - 19 * │ │ │ │ │ - 20 * The above copyright notice and this permission notice shall be │ │ │ │ │ - 21 * included in all copies or substantial portions of the Software. │ │ │ │ │ - 22 * │ │ │ │ │ - 23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, │ │ │ │ │ - 24 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF │ │ │ │ │ - 25 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. │ │ │ │ │ - 26 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR │ │ │ │ │ - 27 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ │ │ │ │ - 28 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR │ │ │ │ │ - 29 * OTHER DEALINGS IN THE SOFTWARE. │ │ │ │ │ - 30 │ │ │ │ │ + * loaders │ │ │ │ │ +SILLYJPGImageLoader.icpp │ │ │ │ │ + 1/*********************************************************************** │ │ │ │ │ + 2 filename: SILLYJPGImageLoader.icpp │ │ │ │ │ + 3 created: 11 Jun 2006 │ │ │ │ │ + 4 author: Olivier Delannoy │ │ │ │ │ + 5 │ │ │ │ │ + 6 purpose: Inline definition of JPGImageLoader class │ │ │ │ │ + 7*************************************************************************/ │ │ │ │ │ + 8/*************************************************************************** │ │ │ │ │ + 9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team │ │ │ │ │ + 10 * │ │ │ │ │ + 11 * Permission is hereby granted, free of charge, to any person obtaining │ │ │ │ │ + 12 * a copy of this software and associated documentation files (the │ │ │ │ │ + 13 * "Software"), to deal in the Software without restriction, including │ │ │ │ │ + 14 * without limitation the rights to use, copy, modify, merge, publish, │ │ │ │ │ + 15 * distribute, sublicense, and/or sell copies of the Software, and to │ │ │ │ │ + 16 * permit persons to whom the Software is furnished to do so, subject to │ │ │ │ │ + 17 * the following conditions: │ │ │ │ │ + 18 * │ │ │ │ │ + 19 * The above copyright notice and this permission notice shall be │ │ │ │ │ + 20 * included in all copies or substantial portions of the Software. │ │ │ │ │ + 21 * │ │ │ │ │ + 22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, │ │ │ │ │ + 23 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF │ │ │ │ │ + 24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. │ │ │ │ │ + 25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR │ │ │ │ │ + 26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ │ │ │ │ + 27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR │ │ │ │ │ + 28 * OTHER DEALINGS IN THE SOFTWARE. │ │ │ │ │ + 29 │ │ │ │ │ ***************************************************************************/ │ │ │ │ │ - 31#ifndef _SILLYImage_h_ │ │ │ │ │ - 32#define _SILLYImage_h_ │ │ │ │ │ - 33#include "SILLYBase.h" │ │ │ │ │ - 34#include "SILLYImageContext.h" │ │ │ │ │ - 35#include "SILLYDataSource.h" │ │ │ │ │ - 36#include "SILLYImageLoader.h" │ │ │ │ │ - 37 │ │ │ │ │ - 38// Start of section namespace SILLY │ │ │ │ │ - 39namespace SILLY │ │ │ │ │ - 40{ │ │ │ │ │ - 41 │ │ │ │ │ -46class SILLY_EXPORT Image │ │ │ │ │ - 47{ │ │ │ │ │ - 48public: │ │ │ │ │ - 55 Image(DataSource& data); │ │ │ │ │ - 56 │ │ │ │ │ -61 ~Image(); │ │ │ │ │ - 62 │ │ │ │ │ -67 bool isValid() const; │ │ │ │ │ - 68 │ │ │ │ │ - 69 │ │ │ │ │ - 76 bool loadImageHeader(); │ │ │ │ │ - 77 │ │ │ │ │ - 91 bool loadImageData(PixelFormat resultFormat = PF_RGBA, PixelOrigin origin = │ │ │ │ │ -PO_TOP_LEFT); │ │ │ │ │ - 92 │ │ │ │ │ -97 size_t getWidth() const; │ │ │ │ │ - 98 │ │ │ │ │ -103 size_t getHeight() const; │ │ │ │ │ - 104 │ │ │ │ │ -109 PixelFormat getSourcePixelFormat() const; │ │ │ │ │ - 110 │ │ │ │ │ -115 PixelFormat getPixelFormat() const; │ │ │ │ │ - 116 │ │ │ │ │ -120 const byte* getPixelsDataPtr() const; │ │ │ │ │ -125 size_t getPixelsDataSize() const; │ │ │ │ │ -130 const char* getLoaderIdentifierString() const; │ │ │ │ │ - 131private: │ │ │ │ │ - 132 bool allocate(); │ │ │ │ │ - 133 │ │ │ │ │ - 134private: │ │ │ │ │ - 135 │ │ │ │ │ - 136 size_t d_bpp; │ │ │ │ │ - 137 PixelFormat d_pfSource; │ │ │ │ │ - 138 byte* d_pixels; │ │ │ │ │ - 139 DataSource* d_data; │ │ │ │ │ - 140 ImageContext* d_imageContext; │ │ │ │ │ - 141 ImageLoader* d_imageLoader; │ │ │ │ │ - 142 │ │ │ │ │ - 143 // Disabled operation │ │ │ │ │ - 144 Image(Image&); │ │ │ │ │ - 145 Image& operator=(Image&); │ │ │ │ │ - 146}; │ │ │ │ │ - 147 │ │ │ │ │ - 148} // End of section namespace SILLY │ │ │ │ │ - 149 │ │ │ │ │ - 150// Inclue inline function when needed │ │ │ │ │ - 151#ifdef SILLY_OPT_INLINE │ │ │ │ │ - 152#include "SILLYImage.icpp" │ │ │ │ │ - 153#endif │ │ │ │ │ - 154 │ │ │ │ │ - 155#endif // end of guard _SILLYImage_h_ │ │ │ │ │ -SILLY │ │ │ │ │ -Simple Image Loading LibrarY namespace. │ │ │ │ │ -Definition: SILLYJPGImageContext.cpp:46 │ │ │ │ │ -SILLY::PixelFormat │ │ │ │ │ -PixelFormat │ │ │ │ │ -List all pixel format supported. │ │ │ │ │ -Definition: SILLYBase.h:60 │ │ │ │ │ -SILLY::PixelOrigin │ │ │ │ │ -PixelOrigin │ │ │ │ │ -List all pixel origin supported. │ │ │ │ │ -Definition: SILLYBase.h:71 │ │ │ │ │ -SILLY::DataSource │ │ │ │ │ -This is an abstract class used to provide data to the loader. │ │ │ │ │ -Definition: SILLYDataSource.h:47 │ │ │ │ │ -SILLY::Image │ │ │ │ │ -Image is the main user class of the library. │ │ │ │ │ -Definition: SILLYImage.h:47 │ │ │ │ │ -SILLY::Image::getSourcePixelFormat │ │ │ │ │ -PixelFormat getSourcePixelFormat() const │ │ │ │ │ -Retrieve the pixel format used for the image storage. │ │ │ │ │ -SILLY::Image::getLoaderIdentifierString │ │ │ │ │ -const char * getLoaderIdentifierString() const │ │ │ │ │ -Get Image loader identifier string. │ │ │ │ │ -SILLY::Image::getPixelsDataPtr │ │ │ │ │ -const byte * getPixelsDataPtr() const │ │ │ │ │ -Get a pointer to the pixels data. │ │ │ │ │ -SILLY::Image::isValid │ │ │ │ │ -bool isValid() const │ │ │ │ │ -Return true if the image is valid after its loading. │ │ │ │ │ -SILLY::Image::getPixelsDataSize │ │ │ │ │ -size_t getPixelsDataSize() const │ │ │ │ │ -Get the size of the pixel buffer. │ │ │ │ │ -SILLY::Image::~Image │ │ │ │ │ -~Image() │ │ │ │ │ -Destructor. │ │ │ │ │ -SILLY::Image::getWidth │ │ │ │ │ -size_t getWidth() const │ │ │ │ │ -Retrieve the width of the image. │ │ │ │ │ -SILLY::Image::getPixelFormat │ │ │ │ │ -PixelFormat getPixelFormat() const │ │ │ │ │ -Retrieve the pixel format of the resulting image. │ │ │ │ │ -SILLY::Image::getHeight │ │ │ │ │ -size_t getHeight() const │ │ │ │ │ -Retrieve the height of the image. │ │ │ │ │ -SILLY::ImageContext │ │ │ │ │ -Store the data needed by an ImageLoader object during the parsing of an image. │ │ │ │ │ -Definition: SILLYImageContext.h:44 │ │ │ │ │ -SILLY::ImageLoader │ │ │ │ │ -This is an abstract class that define the interface of all image loader. │ │ │ │ │ -Definition: SILLYImageLoader.h:47 │ │ │ │ │ + 30 │ │ │ │ │ + 31// Start of section namespace SILLY │ │ │ │ │ + 32namespace SILLY │ │ │ │ │ + 33{ │ │ │ │ │ + 34 │ │ │ │ │ + 35} // End of section namespace SILLY │ │ │ │ │ + 36 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libsilly-doc/html/a00074_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/SILLYOptions.h Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/loaders/SILLYPNGImageLoader.icpp Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -35,60 +35,57 @@ │ │ │ │ initMenu('',false,false,'search.php','Search'); │ │ │ │ }); │ │ │ │ /* @license-end */ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYOptions.h
│ │ │ │ +
SILLYPNGImageLoader.icpp
│ │ │ │
│ │ │ │
│ │ │ │ -
1/* include/SILLYOptions.h. Generated from SILLYOptions.h.in by configure. */
│ │ │ │ -
2/***********************************************************************
│ │ │ │ -
3 filename: SILLYOptions.h.in
│ │ │ │ -
4 created: 2006/06/10
│ │ │ │ -
5 author: Olivier Delannoy
│ │ │ │ -
6
│ │ │ │ -
7 purpose: Store options of the SILLY library
│ │ │ │ -
8*************************************************************************/
│ │ │ │ -
9/***************************************************************************
│ │ │ │ -
10 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
│ │ │ │ -
11 *
│ │ │ │ -
12 * Permission is hereby granted, free of charge, to any person obtaining
│ │ │ │ -
13 * a copy of this software and associated documentation files (the
│ │ │ │ -
14 * "Software"), to deal in the Software without restriction, including
│ │ │ │ -
15 * without limitation the rights to use, copy, modify, merge, publish,
│ │ │ │ -
16 * distribute, sublicense, and/or sell copies of the Software, and to
│ │ │ │ -
17 * permit persons to whom the Software is furnished to do so, subject to
│ │ │ │ -
18 * the following conditions:
│ │ │ │ -
19 *
│ │ │ │ -
20 * The above copyright notice and this permission notice shall be
│ │ │ │ -
21 * included in all copies or substantial portions of the Software.
│ │ │ │ -
22 *
│ │ │ │ -
23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
│ │ │ │ -
24 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
│ │ │ │ -
25 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
│ │ │ │ -
26 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
│ │ │ │ -
27 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
│ │ │ │ -
28 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
│ │ │ │ -
29 * OTHER DEALINGS IN THE SOFTWARE.
│ │ │ │ -
30 ***************************************************************************/
│ │ │ │ -
31/* Defined to 1 if inline is enabled */
│ │ │ │ -
32#define SILLY_OPT_INLINE 1
│ │ │ │ -
33
│ │ │ │ -
34/* Defined to 1 if debug is enabled */
│ │ │ │ -
35/* #undef SILLY_OPT_DEBUG */
│ │ │ │ +
1/***********************************************************************
│ │ │ │ +
2 filename: SILLYPNGImageLoader.icpp
│ │ │ │ +
3 created: 11 Jun 2006
│ │ │ │ +
4 author: Olivier Delannoy
│ │ │ │ +
5
│ │ │ │ +
6 purpose: Inline definition for PNGImageLoader
│ │ │ │ +
7*************************************************************************/
│ │ │ │ +
8/***************************************************************************
│ │ │ │ +
9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
│ │ │ │ +
10 *
│ │ │ │ +
11 * Permission is hereby granted, free of charge, to any person obtaining
│ │ │ │ +
12 * a copy of this software and associated documentation files (the
│ │ │ │ +
13 * "Software"), to deal in the Software without restriction, including
│ │ │ │ +
14 * without limitation the rights to use, copy, modify, merge, publish,
│ │ │ │ +
15 * distribute, sublicense, and/or sell copies of the Software, and to
│ │ │ │ +
16 * permit persons to whom the Software is furnished to do so, subject to
│ │ │ │ +
17 * the following conditions:
│ │ │ │ +
18 *
│ │ │ │ +
19 * The above copyright notice and this permission notice shall be
│ │ │ │ +
20 * included in all copies or substantial portions of the Software.
│ │ │ │ +
21 *
│ │ │ │ +
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
│ │ │ │ +
23 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
│ │ │ │ +
24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
│ │ │ │ +
25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
│ │ │ │ +
26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
│ │ │ │ +
27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
│ │ │ │ +
28 * OTHER DEALINGS IN THE SOFTWARE.
│ │ │ │ +
29 ***************************************************************************/
│ │ │ │ +
30
│ │ │ │ +
31// Start of section namespace SILLY
│ │ │ │ +
32namespace SILLY
│ │ │ │ +
33{
│ │ │ │ +
34
│ │ │ │ +
35} // End of section namespace SILLY
│ │ │ │
36
│ │ │ │ -
37/* Defined to 1 if profile is enabled */
│ │ │ │ -
38/* #undef SILLY_OPT_PROFILE */
│ │ │ │ -
39
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,51 +4,49 @@ │ │ │ │ │ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ │ │ │ │ │ * build │ │ │ │ │ * reproducible-path │ │ │ │ │ * silly-0.1.0 │ │ │ │ │ * include │ │ │ │ │ -SILLYOptions.h │ │ │ │ │ - 1/* include/SILLYOptions.h. Generated from SILLYOptions.h.in by configure. */ │ │ │ │ │ - 2/*********************************************************************** │ │ │ │ │ - 3 filename: SILLYOptions.h.in │ │ │ │ │ - 4 created: 2006/06/10 │ │ │ │ │ - 5 author: Olivier Delannoy │ │ │ │ │ - 6 │ │ │ │ │ - 7 purpose: Store options of the SILLY library │ │ │ │ │ - 8*************************************************************************/ │ │ │ │ │ - 9/*************************************************************************** │ │ │ │ │ - 10 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team │ │ │ │ │ - 11 * │ │ │ │ │ - 12 * Permission is hereby granted, free of charge, to any person obtaining │ │ │ │ │ - 13 * a copy of this software and associated documentation files (the │ │ │ │ │ - 14 * "Software"), to deal in the Software without restriction, including │ │ │ │ │ - 15 * without limitation the rights to use, copy, modify, merge, publish, │ │ │ │ │ - 16 * distribute, sublicense, and/or sell copies of the Software, and to │ │ │ │ │ - 17 * permit persons to whom the Software is furnished to do so, subject to │ │ │ │ │ - 18 * the following conditions: │ │ │ │ │ - 19 * │ │ │ │ │ - 20 * The above copyright notice and this permission notice shall be │ │ │ │ │ - 21 * included in all copies or substantial portions of the Software. │ │ │ │ │ - 22 * │ │ │ │ │ - 23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, │ │ │ │ │ - 24 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF │ │ │ │ │ - 25 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. │ │ │ │ │ - 26 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR │ │ │ │ │ - 27 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ │ │ │ │ - 28 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR │ │ │ │ │ - 29 * OTHER DEALINGS IN THE SOFTWARE. │ │ │ │ │ - 30 │ │ │ │ │ + * loaders │ │ │ │ │ +SILLYPNGImageLoader.icpp │ │ │ │ │ + 1/*********************************************************************** │ │ │ │ │ + 2 filename: SILLYPNGImageLoader.icpp │ │ │ │ │ + 3 created: 11 Jun 2006 │ │ │ │ │ + 4 author: Olivier Delannoy │ │ │ │ │ + 5 │ │ │ │ │ + 6 purpose: Inline definition for PNGImageLoader │ │ │ │ │ + 7*************************************************************************/ │ │ │ │ │ + 8/*************************************************************************** │ │ │ │ │ + 9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team │ │ │ │ │ + 10 * │ │ │ │ │ + 11 * Permission is hereby granted, free of charge, to any person obtaining │ │ │ │ │ + 12 * a copy of this software and associated documentation files (the │ │ │ │ │ + 13 * "Software"), to deal in the Software without restriction, including │ │ │ │ │ + 14 * without limitation the rights to use, copy, modify, merge, publish, │ │ │ │ │ + 15 * distribute, sublicense, and/or sell copies of the Software, and to │ │ │ │ │ + 16 * permit persons to whom the Software is furnished to do so, subject to │ │ │ │ │ + 17 * the following conditions: │ │ │ │ │ + 18 * │ │ │ │ │ + 19 * The above copyright notice and this permission notice shall be │ │ │ │ │ + 20 * included in all copies or substantial portions of the Software. │ │ │ │ │ + 21 * │ │ │ │ │ + 22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, │ │ │ │ │ + 23 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF │ │ │ │ │ + 24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. │ │ │ │ │ + 25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR │ │ │ │ │ + 26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ │ │ │ │ + 27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR │ │ │ │ │ + 28 * OTHER DEALINGS IN THE SOFTWARE. │ │ │ │ │ + 29 │ │ │ │ │ ***************************************************************************/ │ │ │ │ │ - 31/* Defined to 1 if inline is enabled */ │ │ │ │ │ - 32#define SILLY_OPT_INLINE 1 │ │ │ │ │ - 33 │ │ │ │ │ - 34/* Defined to 1 if debug is enabled */ │ │ │ │ │ - 35/* #undef SILLY_OPT_DEBUG */ │ │ │ │ │ + 30 │ │ │ │ │ + 31// Start of section namespace SILLY │ │ │ │ │ + 32namespace SILLY │ │ │ │ │ + 33{ │ │ │ │ │ + 34 │ │ │ │ │ + 35} // End of section namespace SILLY │ │ │ │ │ 36 │ │ │ │ │ - 37/* Defined to 1 if profile is enabled */ │ │ │ │ │ - 38/* #undef SILLY_OPT_PROFILE */ │ │ │ │ │ - 39 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libsilly-doc/html/a00077_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/loaders/SILLYTGAImageContext.icpp Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/loaders/SILLYTGAImageLoader.icpp Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -39,23 +39,23 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYTGAImageContext.icpp
│ │ │ │ +
SILLYTGAImageLoader.icpp
│ │ │ │
│ │ │ │
│ │ │ │
1/***********************************************************************
│ │ │ │ -
2 filename: SILLYTGAImageContext.icpp
│ │ │ │ +
2 filename: SILLYTGAImageLoader.icpp
│ │ │ │
3 created: 11 Jun 2006
│ │ │ │
4 author: Olivier Delannoy
│ │ │ │
5
│ │ │ │ -
6 purpose: Inline definition for TGAImageContext class
│ │ │ │ +
6 purpose: Inline defintion of TGAImageLoader class
│ │ │ │
7*************************************************************************/
│ │ │ │
8/***************************************************************************
│ │ │ │
9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
│ │ │ │
10 *
│ │ │ │
11 * Permission is hereby granted, free of charge, to any person obtaining
│ │ │ │
12 * a copy of this software and associated documentation files (the
│ │ │ │
13 * "Software"), to deal in the Software without restriction, including
│ │ │ │ @@ -75,25 +75,17 @@ │ │ │ │
27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
│ │ │ │
28 * OTHER DEALINGS IN THE SOFTWARE.
│ │ │ │
29 ***************************************************************************/
│ │ │ │
30
│ │ │ │
31// Start of section namespace SILLY
│ │ │ │
32namespace SILLY
│ │ │ │
33{
│ │ │ │ -
34inline TGAImageContext::TGAImageContext(size_t width, size_t height)
│ │ │ │ -
35 : ImageContext(width, height)
│ │ │ │ -
36{
│ │ │ │ -
37}
│ │ │ │ -
38
│ │ │ │ -
39inline TGAImageContext::~TGAImageContext()
│ │ │ │ -
40{
│ │ │ │ -
41}
│ │ │ │ -
42
│ │ │ │ -
43} // End of section namespace SILLY
│ │ │ │ -
44
│ │ │ │ +
34
│ │ │ │ +
35} // End of section namespace SILLY
│ │ │ │ +
36
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,21 +5,21 @@ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ │ │ │ │ │ * build │ │ │ │ │ * reproducible-path │ │ │ │ │ * silly-0.1.0 │ │ │ │ │ * include │ │ │ │ │ * loaders │ │ │ │ │ -SILLYTGAImageContext.icpp │ │ │ │ │ +SILLYTGAImageLoader.icpp │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ - 2 filename: SILLYTGAImageContext.icpp │ │ │ │ │ + 2 filename: SILLYTGAImageLoader.icpp │ │ │ │ │ 3 created: 11 Jun 2006 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ - 6 purpose: Inline definition for TGAImageContext class │ │ │ │ │ + 6 purpose: Inline defintion of TGAImageLoader class │ │ │ │ │ 7*************************************************************************/ │ │ │ │ │ 8/*************************************************************************** │ │ │ │ │ 9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team │ │ │ │ │ 10 * │ │ │ │ │ 11 * Permission is hereby granted, free of charge, to any person obtaining │ │ │ │ │ 12 * a copy of this software and associated documentation files (the │ │ │ │ │ 13 * "Software"), to deal in the Software without restriction, including │ │ │ │ │ @@ -40,21 +40,13 @@ │ │ │ │ │ 28 * OTHER DEALINGS IN THE SOFTWARE. │ │ │ │ │ 29 │ │ │ │ │ ***************************************************************************/ │ │ │ │ │ 30 │ │ │ │ │ 31// Start of section namespace SILLY │ │ │ │ │ 32namespace SILLY │ │ │ │ │ 33{ │ │ │ │ │ - 34inline TGAImageContext::TGAImageContext(size_t width, size_t height) │ │ │ │ │ - 35 : ImageContext(width, height) │ │ │ │ │ - 36{ │ │ │ │ │ - 37} │ │ │ │ │ - 38 │ │ │ │ │ - 39inline TGAImageContext::~TGAImageContext() │ │ │ │ │ - 40{ │ │ │ │ │ - 41} │ │ │ │ │ - 42 │ │ │ │ │ - 43} // End of section namespace SILLY │ │ │ │ │ - 44 │ │ │ │ │ + 34 │ │ │ │ │ + 35} // End of section namespace SILLY │ │ │ │ │ + 36 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libsilly-doc/html/a00080_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/loaders/SILLYJPGImageContext.h Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/loaders/SILLYJPGImageContext.icpp Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -39,92 +39,53 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYJPGImageContext.h
│ │ │ │ +
SILLYJPGImageContext.icpp
│ │ │ │
│ │ │ │
│ │ │ │ -
1/***********************************************************************
│ │ │ │ -
2 filename: SILLYJPGImageContext.h
│ │ │ │ -
3 created: 11 Jun 2006
│ │ │ │ -
4 author: Olivier Delannoy
│ │ │ │ -
5
│ │ │ │ -
6 purpose: Declaration of the JPGImageContext class
│ │ │ │ -
7*************************************************************************/
│ │ │ │ -
8/***************************************************************************
│ │ │ │ -
9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
│ │ │ │ -
10 *
│ │ │ │ -
11 * Permission is hereby granted, free of charge, to any person obtaining
│ │ │ │ -
12 * a copy of this software and associated documentation files (the
│ │ │ │ -
13 * "Software"), to deal in the Software without restriction, including
│ │ │ │ -
14 * without limitation the rights to use, copy, modify, merge, publish,
│ │ │ │ -
15 * distribute, sublicense, and/or sell copies of the Software, and to
│ │ │ │ -
16 * permit persons to whom the Software is furnished to do so, subject to
│ │ │ │ -
17 * the following conditions:
│ │ │ │ -
18 *
│ │ │ │ -
19 * The above copyright notice and this permission notice shall be
│ │ │ │ -
20 * included in all copies or substantial portions of the Software.
│ │ │ │ -
21 *
│ │ │ │ -
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
│ │ │ │ -
23 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
│ │ │ │ -
24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
│ │ │ │ -
25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
│ │ │ │ -
26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
│ │ │ │ -
27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
│ │ │ │ -
28 * OTHER DEALINGS IN THE SOFTWARE.
│ │ │ │ -
29 ***************************************************************************/
│ │ │ │ -
30#ifndef _SILLYJPGImageContext_h_
│ │ │ │ -
31#define _SILLYJPGImageContext_h_
│ │ │ │ -
32#include "SILLYBase.h"
│ │ │ │ -
33#include "SILLYImageContext.h"
│ │ │ │ -
34#include "SILLYDataSource.h"
│ │ │ │ -
35// Start of section namespace SILLY
│ │ │ │ -
36#include <setjmp.h>
│ │ │ │ -
37#include <stdio.h>
│ │ │ │ -
38#include <string.h>
│ │ │ │ -
39extern "C"
│ │ │ │ -
40{
│ │ │ │ -
41#include <jpeglib.h>
│ │ │ │ -
42}
│ │ │ │ -
43namespace SILLY
│ │ │ │ -
44{
│ │ │ │ -
45
│ │ │ │ - │ │ │ │ -
57{
│ │ │ │ -
58public:
│ │ │ │ - │ │ │ │ - │ │ │ │ -
61
│ │ │ │ -
62 void setImageSize();
│ │ │ │ -
63
│ │ │ │ -
64
│ │ │ │ -
65 jpeg_source_mgr src_mgr;
│ │ │ │ -
66 jpeg_decompress_struct cinfo;
│ │ │ │ -
67
│ │ │ │ -
68 jpeg_error_mgr d_error_mgr;
│ │ │ │ -
69 jmp_buf setjmp_buffer;
│ │ │ │ -
70 DataSource* d_source;
│ │ │ │ -
71};
│ │ │ │ -
72
│ │ │ │ -
73
│ │ │ │ -
74} // End of section namespace SILLY
│ │ │ │ -
75
│ │ │ │ -
76// Inclue inline function when needed
│ │ │ │ -
77#ifdef SILLY_OPT_INLINE
│ │ │ │ -
78#include "SILLYJPGImageContext.icpp"
│ │ │ │ -
79#endif
│ │ │ │ -
80
│ │ │ │ -
81#endif // end of guard _SILLYJPGImageContext_h_
│ │ │ │ -
Simple Image Loading LibrarY namespace.
│ │ │ │ -
Image Context for JPG image loader.
│ │ │ │ -
This is an abstract class used to provide data to the loader.
│ │ │ │ -
Store the data needed by an ImageLoader object during the parsing of an image.
│ │ │ │ +
1/***********************************************************************
│ │ │ │ +
2 filename: SILLYJPGImageContext.icpp
│ │ │ │ +
3 created: 11 Jun 2006
│ │ │ │ +
4 author: Olivier Delannoy
│ │ │ │ +
5
│ │ │ │ +
6 purpose: Inline definition for JPG context
│ │ │ │ +
7*************************************************************************/
│ │ │ │ +
8/***************************************************************************
│ │ │ │ +
9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
│ │ │ │ +
10 *
│ │ │ │ +
11 * Permission is hereby granted, free of charge, to any person obtaining
│ │ │ │ +
12 * a copy of this software and associated documentation files (the
│ │ │ │ +
13 * "Software"), to deal in the Software without restriction, including
│ │ │ │ +
14 * without limitation the rights to use, copy, modify, merge, publish,
│ │ │ │ +
15 * distribute, sublicense, and/or sell copies of the Software, and to
│ │ │ │ +
16 * permit persons to whom the Software is furnished to do so, subject to
│ │ │ │ +
17 * the following conditions:
│ │ │ │ +
18 *
│ │ │ │ +
19 * The above copyright notice and this permission notice shall be
│ │ │ │ +
20 * included in all copies or substantial portions of the Software.
│ │ │ │ +
21 *
│ │ │ │ +
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
│ │ │ │ +
23 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
│ │ │ │ +
24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
│ │ │ │ +
25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
│ │ │ │ +
26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
│ │ │ │ +
27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
│ │ │ │ +
28 * OTHER DEALINGS IN THE SOFTWARE.
│ │ │ │ +
29 ***************************************************************************/
│ │ │ │ +
30
│ │ │ │ +
31// Start of section namespace SILLY
│ │ │ │ +
32namespace SILLY
│ │ │ │ +
33{
│ │ │ │ +
34
│ │ │ │ +
35} // End of section namespace SILLY
│ │ │ │ +
36
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,21 +5,21 @@ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ │ │ │ │ │ * build │ │ │ │ │ * reproducible-path │ │ │ │ │ * silly-0.1.0 │ │ │ │ │ * include │ │ │ │ │ * loaders │ │ │ │ │ -SILLYJPGImageContext.h │ │ │ │ │ +SILLYJPGImageContext.icpp │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ - 2 filename: SILLYJPGImageContext.h │ │ │ │ │ + 2 filename: SILLYJPGImageContext.icpp │ │ │ │ │ 3 created: 11 Jun 2006 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ - 6 purpose: Declaration of the JPGImageContext class │ │ │ │ │ + 6 purpose: Inline definition for JPG context │ │ │ │ │ 7*************************************************************************/ │ │ │ │ │ 8/*************************************************************************** │ │ │ │ │ 9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team │ │ │ │ │ 10 * │ │ │ │ │ 11 * Permission is hereby granted, free of charge, to any person obtaining │ │ │ │ │ 12 * a copy of this software and associated documentation files (the │ │ │ │ │ 13 * "Software"), to deal in the Software without restriction, including │ │ │ │ │ @@ -36,64 +36,17 @@ │ │ │ │ │ 24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. │ │ │ │ │ 25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR │ │ │ │ │ 26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ │ │ │ │ 27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR │ │ │ │ │ 28 * OTHER DEALINGS IN THE SOFTWARE. │ │ │ │ │ 29 │ │ │ │ │ ***************************************************************************/ │ │ │ │ │ - 30#ifndef _SILLYJPGImageContext_h_ │ │ │ │ │ - 31#define _SILLYJPGImageContext_h_ │ │ │ │ │ - 32#include "SILLYBase.h" │ │ │ │ │ - 33#include "SILLYImageContext.h" │ │ │ │ │ - 34#include "SILLYDataSource.h" │ │ │ │ │ - 35// Start of section namespace SILLY │ │ │ │ │ - 36#include │ │ │ │ │ - 37#include │ │ │ │ │ - 38#include │ │ │ │ │ - 39extern "C" │ │ │ │ │ - 40{ │ │ │ │ │ - 41#include │ │ │ │ │ - 42} │ │ │ │ │ - 43namespace SILLY │ │ │ │ │ - 44{ │ │ │ │ │ - 45 │ │ │ │ │ -56class JPGImageContext : public ImageContext │ │ │ │ │ - 57{ │ │ │ │ │ - 58public: │ │ │ │ │ - 59 JPGImageContext(); │ │ │ │ │ - 60 ~JPGImageContext(); │ │ │ │ │ - 61 │ │ │ │ │ - 62 void setImageSize(); │ │ │ │ │ - 63 │ │ │ │ │ - 64 │ │ │ │ │ - 65 jpeg_source_mgr src_mgr; │ │ │ │ │ - 66 jpeg_decompress_struct cinfo; │ │ │ │ │ - 67 │ │ │ │ │ - 68 jpeg_error_mgr d_error_mgr; │ │ │ │ │ - 69 jmp_buf setjmp_buffer; │ │ │ │ │ - 70 DataSource* d_source; │ │ │ │ │ - 71}; │ │ │ │ │ - 72 │ │ │ │ │ - 73 │ │ │ │ │ - 74} // End of section namespace SILLY │ │ │ │ │ - 75 │ │ │ │ │ - 76// Inclue inline function when needed │ │ │ │ │ - 77#ifdef SILLY_OPT_INLINE │ │ │ │ │ - 78#include "SILLYJPGImageContext.icpp" │ │ │ │ │ - 79#endif │ │ │ │ │ - 80 │ │ │ │ │ - 81#endif // end of guard _SILLYJPGImageContext_h_ │ │ │ │ │ -SILLY │ │ │ │ │ -Simple Image Loading LibrarY namespace. │ │ │ │ │ -Definition: SILLYJPGImageContext.cpp:46 │ │ │ │ │ -SILLY::JPGImageContext │ │ │ │ │ -Image Context for JPG image loader. │ │ │ │ │ -Definition: SILLYJPGImageContext.h:57 │ │ │ │ │ -SILLY::DataSource │ │ │ │ │ -This is an abstract class used to provide data to the loader. │ │ │ │ │ -Definition: SILLYDataSource.h:47 │ │ │ │ │ -SILLY::ImageContext │ │ │ │ │ -Store the data needed by an ImageLoader object during the parsing of an image. │ │ │ │ │ -Definition: SILLYImageContext.h:44 │ │ │ │ │ + 30 │ │ │ │ │ + 31// Start of section namespace SILLY │ │ │ │ │ + 32namespace SILLY │ │ │ │ │ + 33{ │ │ │ │ │ + 34 │ │ │ │ │ + 35} // End of section namespace SILLY │ │ │ │ │ + 36 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libsilly-doc/html/a00086_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/loaders/SILLYJPGImageLoader.h Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/loaders/SILLYTGAImageLoader.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -39,23 +39,23 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYJPGImageLoader.h
│ │ │ │ +
SILLYTGAImageLoader.h
│ │ │ │
│ │ │ │
│ │ │ │
1/***********************************************************************
│ │ │ │ -
2 filename: SILLYJPGImageLoader.h
│ │ │ │ +
2 filename: SILLYTGAImageLoader.h
│ │ │ │
3 created: 11 Jun 2006
│ │ │ │
4 author: Olivier Delannoy
│ │ │ │
5
│ │ │ │ -
6 purpose: Declaration of the JPGImageLoader class
│ │ │ │ +
6 purpose: Declaration of the TGAImageLoader class
│ │ │ │
7*************************************************************************/
│ │ │ │
8/***************************************************************************
│ │ │ │
9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
│ │ │ │
10 *
│ │ │ │
11 * Permission is hereby granted, free of charge, to any person obtaining
│ │ │ │
12 * a copy of this software and associated documentation files (the
│ │ │ │
13 * "Software"), to deal in the Software without restriction, including
│ │ │ │ @@ -71,50 +71,52 @@ │ │ │ │
23 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
│ │ │ │
24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
│ │ │ │
25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
│ │ │ │
26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
│ │ │ │
27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
│ │ │ │
28 * OTHER DEALINGS IN THE SOFTWARE.
│ │ │ │
29 ***************************************************************************/
│ │ │ │ -
30#ifndef _SILLYJPGImageLoader_h_
│ │ │ │ -
31#define _SILLYJPGImageLoader_h_
│ │ │ │ -
32#include "SILLYBase.h"
│ │ │ │ +
30#ifndef _SILLYTGAImageLoader_h_
│ │ │ │ +
31#define _SILLYTGAImageLoader_h_
│ │ │ │ +
32#include "SILLYBase.h"
│ │ │ │
33#include "SILLYImageLoader.h"
│ │ │ │
34// Start of section namespace SILLY
│ │ │ │
35namespace SILLY
│ │ │ │
36{
│ │ │ │ -
37
│ │ │ │ - │ │ │ │ -
43{
│ │ │ │ -
44public:
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
48 bool loadImageData(PixelOrigin origin, DataSource* data, ImageContext* context);
│ │ │ │ -
49private:
│ │ │ │ -
50};
│ │ │ │ -
51
│ │ │ │ -
52
│ │ │ │ -
53} // End of section namespace SILLY
│ │ │ │ -
54
│ │ │ │ -
55// Inclue inline function when needed
│ │ │ │ -
56#ifdef SILLY_OPT_INLINE
│ │ │ │ -
57#include "SILLYJPGImageLoader.icpp"
│ │ │ │ -
58#endif
│ │ │ │ -
59
│ │ │ │ -
60#endif // end of guard _SILLYJPGImageLoader_h_
│ │ │ │ -
Simple Image Loading LibrarY namespace.
│ │ │ │ -
PixelFormat
List all pixel format supported.
Definition: SILLYBase.h:60
│ │ │ │ -
PixelOrigin
List all pixel origin supported.
Definition: SILLYBase.h:71
│ │ │ │ -
Loader class for JPG Image.
│ │ │ │ -
bool loadImageData(PixelOrigin origin, DataSource *data, ImageContext *context)
Parse the pixels data of the image and fill the header struct.
│ │ │ │ -
ImageContext * loadHeader(PixelFormat &header, DataSource *data)
Parse the header of the image and fill the header struct.
│ │ │ │ -
This is an abstract class used to provide data to the loader.
│ │ │ │ -
Store the data needed by an ImageLoader object during the parsing of an image.
│ │ │ │ -
This is an abstract class that define the interface of all image loader.
│ │ │ │ +
37class TGAImageContext;
│ │ │ │ + │ │ │ │ +
44{
│ │ │ │ +
45public:
│ │ │ │ + │ │ │ │ + │ │ │ │ +
48 ImageContext* loadHeader(PixelFormat& formatSource, DataSource* data);
│ │ │ │ +
49 bool loadImageData(PixelOrigin origin,
│ │ │ │ +
50 DataSource* data,
│ │ │ │ +
51 ImageContext* context);
│ │ │ │ +
52private:
│ │ │ │ +
53
│ │ │ │ +
54};
│ │ │ │ +
55
│ │ │ │ +
56} // End of section namespace SILLY
│ │ │ │ +
57
│ │ │ │ +
58// Inclue inline function when needed
│ │ │ │ +
59#ifdef SILLY_OPT_INLINE
│ │ │ │ +
60#include "SILLYTGAImageLoader.icpp"
│ │ │ │ +
61#endif
│ │ │ │ +
62
│ │ │ │ +
63#endif // end of guard _SILLYTGAImageLoader_h_
│ │ │ │ +
Simple Image Loading LibrarY namespace.
│ │ │ │ +
PixelFormat
List all pixel format supported.
Definition: SILLYBase.h:60
│ │ │ │ +
PixelOrigin
List all pixel origin supported.
Definition: SILLYBase.h:71
│ │ │ │ +
Loader for Targa image.
│ │ │ │ +
ImageContext * loadHeader(PixelFormat &formatSource, DataSource *data)
Parse the header of the image and fill the header struct.
│ │ │ │ +
bool loadImageData(PixelOrigin origin, DataSource *data, ImageContext *context)
Parse the pixels data of the image and fill the header struct.
│ │ │ │ +
This is an abstract class used to provide data to the loader.
│ │ │ │ +
Store the data needed by an ImageLoader object during the parsing of an image.
│ │ │ │ +
This is an abstract class that define the interface of all image loader.
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,21 +5,21 @@ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ │ │ │ │ │ * build │ │ │ │ │ * reproducible-path │ │ │ │ │ * silly-0.1.0 │ │ │ │ │ * include │ │ │ │ │ * loaders │ │ │ │ │ -SILLYJPGImageLoader.h │ │ │ │ │ +SILLYTGAImageLoader.h │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ - 2 filename: SILLYJPGImageLoader.h │ │ │ │ │ + 2 filename: SILLYTGAImageLoader.h │ │ │ │ │ 3 created: 11 Jun 2006 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ - 6 purpose: Declaration of the JPGImageLoader class │ │ │ │ │ + 6 purpose: Declaration of the TGAImageLoader class │ │ │ │ │ 7*************************************************************************/ │ │ │ │ │ 8/*************************************************************************** │ │ │ │ │ 9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team │ │ │ │ │ 10 * │ │ │ │ │ 11 * Permission is hereby granted, free of charge, to any person obtaining │ │ │ │ │ 12 * a copy of this software and associated documentation files (the │ │ │ │ │ 13 * "Software"), to deal in the Software without restriction, including │ │ │ │ │ @@ -36,64 +36,65 @@ │ │ │ │ │ 24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. │ │ │ │ │ 25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR │ │ │ │ │ 26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ │ │ │ │ 27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR │ │ │ │ │ 28 * OTHER DEALINGS IN THE SOFTWARE. │ │ │ │ │ 29 │ │ │ │ │ ***************************************************************************/ │ │ │ │ │ - 30#ifndef _SILLYJPGImageLoader_h_ │ │ │ │ │ - 31#define _SILLYJPGImageLoader_h_ │ │ │ │ │ + 30#ifndef _SILLYTGAImageLoader_h_ │ │ │ │ │ + 31#define _SILLYTGAImageLoader_h_ │ │ │ │ │ 32#include "SILLYBase.h" │ │ │ │ │ 33#include "SILLYImageLoader.h" │ │ │ │ │ 34// Start of section namespace SILLY │ │ │ │ │ 35namespace SILLY │ │ │ │ │ 36{ │ │ │ │ │ - 37 │ │ │ │ │ -42class JPGImageLoader : public ImageLoader │ │ │ │ │ - 43{ │ │ │ │ │ - 44public: │ │ │ │ │ - 45 JPGImageLoader(); │ │ │ │ │ - 46 ~JPGImageLoader(); │ │ │ │ │ - 47 ImageContext* loadHeader(PixelFormat& header, DataSource* data); │ │ │ │ │ - 48 bool loadImageData(PixelOrigin origin, DataSource* data, ImageContext* │ │ │ │ │ -context); │ │ │ │ │ - 49private: │ │ │ │ │ - 50}; │ │ │ │ │ - 51 │ │ │ │ │ - 52 │ │ │ │ │ - 53} // End of section namespace SILLY │ │ │ │ │ - 54 │ │ │ │ │ - 55// Inclue inline function when needed │ │ │ │ │ - 56#ifdef SILLY_OPT_INLINE │ │ │ │ │ - 57#include "SILLYJPGImageLoader.icpp" │ │ │ │ │ - 58#endif │ │ │ │ │ - 59 │ │ │ │ │ - 60#endif // end of guard _SILLYJPGImageLoader_h_ │ │ │ │ │ + 37class TGAImageContext; │ │ │ │ │ +43class TGAImageLoader : public ImageLoader │ │ │ │ │ + 44{ │ │ │ │ │ + 45public: │ │ │ │ │ + 46 TGAImageLoader(); │ │ │ │ │ + 47 ~TGAImageLoader(); │ │ │ │ │ + 48 ImageContext* loadHeader(PixelFormat& formatSource, DataSource* data); │ │ │ │ │ + 49 bool loadImageData(PixelOrigin origin, │ │ │ │ │ + 50 DataSource* data, │ │ │ │ │ + 51 ImageContext* context); │ │ │ │ │ + 52private: │ │ │ │ │ + 53 │ │ │ │ │ + 54}; │ │ │ │ │ + 55 │ │ │ │ │ + 56} // End of section namespace SILLY │ │ │ │ │ + 57 │ │ │ │ │ + 58// Inclue inline function when needed │ │ │ │ │ + 59#ifdef SILLY_OPT_INLINE │ │ │ │ │ + 60#include "SILLYTGAImageLoader.icpp" │ │ │ │ │ + 61#endif │ │ │ │ │ + 62 │ │ │ │ │ + 63#endif // end of guard _SILLYTGAImageLoader_h_ │ │ │ │ │ SILLY │ │ │ │ │ Simple Image Loading LibrarY namespace. │ │ │ │ │ Definition: SILLYJPGImageContext.cpp:46 │ │ │ │ │ SILLY::PixelFormat │ │ │ │ │ PixelFormat │ │ │ │ │ List all pixel format supported. │ │ │ │ │ Definition: SILLYBase.h:60 │ │ │ │ │ SILLY::PixelOrigin │ │ │ │ │ PixelOrigin │ │ │ │ │ List all pixel origin supported. │ │ │ │ │ Definition: SILLYBase.h:71 │ │ │ │ │ -SILLY::JPGImageLoader │ │ │ │ │ -Loader class for JPG Image. │ │ │ │ │ -Definition: SILLYJPGImageLoader.h:43 │ │ │ │ │ -SILLY::JPGImageLoader::loadImageData │ │ │ │ │ +SILLY::TGAImageLoader │ │ │ │ │ +Loader for Targa image. │ │ │ │ │ +Definition: SILLYTGAImageLoader.h:44 │ │ │ │ │ +SILLY::TGAImageLoader::loadHeader │ │ │ │ │ +ImageContext * loadHeader(PixelFormat &formatSource, DataSource *data) │ │ │ │ │ +Parse the header of the image and fill the header struct. │ │ │ │ │ +Definition: SILLYTGAImageLoader.cpp:74 │ │ │ │ │ +SILLY::TGAImageLoader::loadImageData │ │ │ │ │ bool loadImageData(PixelOrigin origin, DataSource *data, ImageContext *context) │ │ │ │ │ Parse the pixels data of the image and fill the header struct. │ │ │ │ │ -Definition: SILLYJPGImageLoader.cpp:90 │ │ │ │ │ -SILLY::JPGImageLoader::loadHeader │ │ │ │ │ -ImageContext * loadHeader(PixelFormat &header, DataSource *data) │ │ │ │ │ -Parse the header of the image and fill the header struct. │ │ │ │ │ -Definition: SILLYJPGImageLoader.cpp:56 │ │ │ │ │ +Definition: SILLYTGAImageLoader.cpp:134 │ │ │ │ │ SILLY::DataSource │ │ │ │ │ This is an abstract class used to provide data to the loader. │ │ │ │ │ Definition: SILLYDataSource.h:47 │ │ │ │ │ SILLY::ImageContext │ │ │ │ │ Store the data needed by an ImageLoader object during the parsing of an image. │ │ │ │ │ Definition: SILLYImageContext.h:44 │ │ │ │ │ SILLY::ImageLoader │ │ │ ├── ./usr/share/doc/libsilly-doc/html/a00089_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/loaders/SILLYJPGImageLoader.icpp Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/loaders/SILLYPNGImageContext.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -39,53 +39,98 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYJPGImageLoader.icpp
│ │ │ │ +
SILLYPNGImageContext.h
│ │ │ │
│ │ │ │
│ │ │ │ -
1/***********************************************************************
│ │ │ │ -
2 filename: SILLYJPGImageLoader.icpp
│ │ │ │ -
3 created: 11 Jun 2006
│ │ │ │ -
4 author: Olivier Delannoy
│ │ │ │ -
5
│ │ │ │ -
6 purpose: Inline definition of JPGImageLoader class
│ │ │ │ -
7*************************************************************************/
│ │ │ │ -
8/***************************************************************************
│ │ │ │ -
9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
│ │ │ │ -
10 *
│ │ │ │ -
11 * Permission is hereby granted, free of charge, to any person obtaining
│ │ │ │ -
12 * a copy of this software and associated documentation files (the
│ │ │ │ -
13 * "Software"), to deal in the Software without restriction, including
│ │ │ │ -
14 * without limitation the rights to use, copy, modify, merge, publish,
│ │ │ │ -
15 * distribute, sublicense, and/or sell copies of the Software, and to
│ │ │ │ -
16 * permit persons to whom the Software is furnished to do so, subject to
│ │ │ │ -
17 * the following conditions:
│ │ │ │ -
18 *
│ │ │ │ -
19 * The above copyright notice and this permission notice shall be
│ │ │ │ -
20 * included in all copies or substantial portions of the Software.
│ │ │ │ -
21 *
│ │ │ │ -
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
│ │ │ │ -
23 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
│ │ │ │ -
24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
│ │ │ │ -
25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
│ │ │ │ -
26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
│ │ │ │ -
27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
│ │ │ │ -
28 * OTHER DEALINGS IN THE SOFTWARE.
│ │ │ │ -
29 ***************************************************************************/
│ │ │ │ -
30
│ │ │ │ -
31// Start of section namespace SILLY
│ │ │ │ -
32namespace SILLY
│ │ │ │ -
33{
│ │ │ │ -
34
│ │ │ │ -
35} // End of section namespace SILLY
│ │ │ │ -
36
│ │ │ │ +
1/***********************************************************************
│ │ │ │ +
2 filename: SILLYPNGImageContext.h
│ │ │ │ +
3 created: 11 Jun 2006
│ │ │ │ +
4 author: Olivier Delannoy
│ │ │ │ +
5
│ │ │ │ +
6 purpose: Declaration of the PNGImageContext class
│ │ │ │ +
7*************************************************************************/
│ │ │ │ +
8/***************************************************************************
│ │ │ │ +
9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
│ │ │ │ +
10 *
│ │ │ │ +
11 * Permission is hereby granted, free of charge, to any person obtaining
│ │ │ │ +
12 * a copy of this software and associated documentation files (the
│ │ │ │ +
13 * "Software"), to deal in the Software without restriction, including
│ │ │ │ +
14 * without limitation the rights to use, copy, modify, merge, publish,
│ │ │ │ +
15 * distribute, sublicense, and/or sell copies of the Software, and to
│ │ │ │ +
16 * permit persons to whom the Software is furnished to do so, subject to
│ │ │ │ +
17 * the following conditions:
│ │ │ │ +
18 *
│ │ │ │ +
19 * The above copyright notice and this permission notice shall be
│ │ │ │ +
20 * included in all copies or substantial portions of the Software.
│ │ │ │ +
21 *
│ │ │ │ +
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
│ │ │ │ +
23 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
│ │ │ │ +
24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
│ │ │ │ +
25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
│ │ │ │ +
26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
│ │ │ │ +
27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
│ │ │ │ +
28 * OTHER DEALINGS IN THE SOFTWARE.
│ │ │ │ +
29 ***************************************************************************/
│ │ │ │ +
30#ifndef _SILLYPNGImageContext_h_
│ │ │ │ +
31#define _SILLYPNGImageContext_h_
│ │ │ │ +
32#include "SILLYBase.h"
│ │ │ │ +
33#include "SILLYImageContext.h"
│ │ │ │ +
34#include "SILLYDataSource.h"
│ │ │ │ +
35#include <png.h>
│ │ │ │ +
36// Start of section namespace SILLY
│ │ │ │ +
37namespace SILLY
│ │ │ │ +
38{
│ │ │ │ +
39
│ │ │ │ +
45class SILLY_EXPORT PNGImageContext : public ImageContext
│ │ │ │ +
46{
│ │ │ │ +
47public:
│ │ │ │ + │ │ │ │ + │ │ │ │ +
50
│ │ │ │ +
51 int read(png_bytep data, png_size_t length);
│ │ │ │ +
52
│ │ │ │ +
53
│ │ │ │ +
54
│ │ │ │ +
55private:
│ │ │ │ +
56 void setImageSize();
│ │ │ │ +
57
│ │ │ │ +
58 size_t d_offset;
│ │ │ │ +
59
│ │ │ │ +
60 DataSource* d_data;
│ │ │ │ +
61
│ │ │ │ +
62 png_structp d_png_ptr;
│ │ │ │ +
63
│ │ │ │ +
64 png_infop d_info_ptr;
│ │ │ │ +
65
│ │ │ │ +
66 size_t d_bit_depth;
│ │ │ │ +
67 size_t d_num_channels;
│ │ │ │ +
68
│ │ │ │ +
69
│ │ │ │ +
70 friend class PNGImageLoader;
│ │ │ │ +
71};
│ │ │ │ +
72
│ │ │ │ +
73
│ │ │ │ +
74} // End of section namespace SILLY
│ │ │ │ +
75
│ │ │ │ +
76// Inclue inline function when needed
│ │ │ │ +
77#ifdef SILLY_OPT_INLINE
│ │ │ │ +
78#include "SILLYPNGImageContext.icpp"
│ │ │ │ +
79#endif
│ │ │ │ +
80
│ │ │ │ +
81#endif // end of guard _SILLYPNGImageContext_h_
│ │ │ │ +
Simple Image Loading LibrarY namespace.
│ │ │ │ +
Image Context for PNG Image Loader.
│ │ │ │ +
Loader for PNG Image.
│ │ │ │ +
This is an abstract class used to provide data to the loader.
│ │ │ │ +
Store the data needed by an ImageLoader object during the parsing of an image.
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,21 +5,21 @@ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ │ │ │ │ │ * build │ │ │ │ │ * reproducible-path │ │ │ │ │ * silly-0.1.0 │ │ │ │ │ * include │ │ │ │ │ * loaders │ │ │ │ │ -SILLYJPGImageLoader.icpp │ │ │ │ │ +SILLYPNGImageContext.h │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ - 2 filename: SILLYJPGImageLoader.icpp │ │ │ │ │ + 2 filename: SILLYPNGImageContext.h │ │ │ │ │ 3 created: 11 Jun 2006 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ - 6 purpose: Inline definition of JPGImageLoader class │ │ │ │ │ + 6 purpose: Declaration of the PNGImageContext class │ │ │ │ │ 7*************************************************************************/ │ │ │ │ │ 8/*************************************************************************** │ │ │ │ │ 9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team │ │ │ │ │ 10 * │ │ │ │ │ 11 * Permission is hereby granted, free of charge, to any person obtaining │ │ │ │ │ 12 * a copy of this software and associated documentation files (the │ │ │ │ │ 13 * "Software"), to deal in the Software without restriction, including │ │ │ │ │ @@ -36,17 +36,72 @@ │ │ │ │ │ 24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. │ │ │ │ │ 25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR │ │ │ │ │ 26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ │ │ │ │ 27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR │ │ │ │ │ 28 * OTHER DEALINGS IN THE SOFTWARE. │ │ │ │ │ 29 │ │ │ │ │ ***************************************************************************/ │ │ │ │ │ - 30 │ │ │ │ │ - 31// Start of section namespace SILLY │ │ │ │ │ - 32namespace SILLY │ │ │ │ │ - 33{ │ │ │ │ │ - 34 │ │ │ │ │ - 35} // End of section namespace SILLY │ │ │ │ │ - 36 │ │ │ │ │ + 30#ifndef _SILLYPNGImageContext_h_ │ │ │ │ │ + 31#define _SILLYPNGImageContext_h_ │ │ │ │ │ + 32#include "SILLYBase.h" │ │ │ │ │ + 33#include "SILLYImageContext.h" │ │ │ │ │ + 34#include "SILLYDataSource.h" │ │ │ │ │ + 35#include │ │ │ │ │ + 36// Start of section namespace SILLY │ │ │ │ │ + 37namespace SILLY │ │ │ │ │ + 38{ │ │ │ │ │ + 39 │ │ │ │ │ +45class SILLY_EXPORT PNGImageContext : public ImageContext │ │ │ │ │ + 46{ │ │ │ │ │ + 47public: │ │ │ │ │ + 48 PNGImageContext(DataSource* data); │ │ │ │ │ + 49 ~PNGImageContext(); │ │ │ │ │ + 50 │ │ │ │ │ + 51 int read(png_bytep data, png_size_t length); │ │ │ │ │ + 52 │ │ │ │ │ + 53 │ │ │ │ │ + 54 │ │ │ │ │ + 55private: │ │ │ │ │ + 56 void setImageSize(); │ │ │ │ │ + 57 │ │ │ │ │ + 58 size_t d_offset; │ │ │ │ │ + 59 │ │ │ │ │ + 60 DataSource* d_data; │ │ │ │ │ + 61 │ │ │ │ │ + 62 png_structp d_png_ptr; │ │ │ │ │ + 63 │ │ │ │ │ + 64 png_infop d_info_ptr; │ │ │ │ │ + 65 │ │ │ │ │ + 66 size_t d_bit_depth; │ │ │ │ │ + 67 size_t d_num_channels; │ │ │ │ │ + 68 │ │ │ │ │ + 69 │ │ │ │ │ + 70 friend class PNGImageLoader; │ │ │ │ │ + 71}; │ │ │ │ │ + 72 │ │ │ │ │ + 73 │ │ │ │ │ + 74} // End of section namespace SILLY │ │ │ │ │ + 75 │ │ │ │ │ + 76// Inclue inline function when needed │ │ │ │ │ + 77#ifdef SILLY_OPT_INLINE │ │ │ │ │ + 78#include "SILLYPNGImageContext.icpp" │ │ │ │ │ + 79#endif │ │ │ │ │ + 80 │ │ │ │ │ + 81#endif // end of guard _SILLYPNGImageContext_h_ │ │ │ │ │ +SILLY │ │ │ │ │ +Simple Image Loading LibrarY namespace. │ │ │ │ │ +Definition: SILLYJPGImageContext.cpp:46 │ │ │ │ │ +SILLY::PNGImageContext │ │ │ │ │ +Image Context for PNG Image Loader. │ │ │ │ │ +Definition: SILLYPNGImageContext.h:46 │ │ │ │ │ +SILLY::PNGImageLoader │ │ │ │ │ +Loader for PNG Image. │ │ │ │ │ +Definition: SILLYPNGImageLoader.h:43 │ │ │ │ │ +SILLY::DataSource │ │ │ │ │ +This is an abstract class used to provide data to the loader. │ │ │ │ │ +Definition: SILLYDataSource.h:47 │ │ │ │ │ +SILLY::ImageContext │ │ │ │ │ +Store the data needed by an ImageLoader object during the parsing of an image. │ │ │ │ │ +Definition: SILLYImageContext.h:44 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libsilly-doc/html/a00092_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/loaders/SILLYTGAImageContext.h Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/SILLYImageLoader.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -35,27 +35,27 @@ │ │ │ │ initMenu('',false,false,'search.php','Search'); │ │ │ │ }); │ │ │ │ /* @license-end */ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYTGAImageContext.h
│ │ │ │ +
SILLYImageLoader.h
│ │ │ │
│ │ │ │
│ │ │ │
1/***********************************************************************
│ │ │ │ -
2 filename: SILLYTGAImageContext.h
│ │ │ │ -
3 created: 11 Jun 2006
│ │ │ │ +
2 filename: SILLYImageLoader.h
│ │ │ │ +
3 created: 10 Jun 2006
│ │ │ │
4 author: Olivier Delannoy
│ │ │ │
5
│ │ │ │ -
6 purpose: Declaration of the TGAImageContext class
│ │ │ │ +
6 purpose: Abstract class for all image loader
│ │ │ │
7*************************************************************************/
│ │ │ │
8/***************************************************************************
│ │ │ │
9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
│ │ │ │
10 *
│ │ │ │
11 * Permission is hereby granted, free of charge, to any person obtaining
│ │ │ │
12 * a copy of this software and associated documentation files (the
│ │ │ │
13 * "Software"), to deal in the Software without restriction, including
│ │ │ │ @@ -71,50 +71,63 @@ │ │ │ │
23 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
│ │ │ │
24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
│ │ │ │
25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
│ │ │ │
26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
│ │ │ │
27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
│ │ │ │
28 * OTHER DEALINGS IN THE SOFTWARE.
│ │ │ │
29 ***************************************************************************/
│ │ │ │ -
30#ifndef _SILLYTGAImageContext_h_
│ │ │ │ -
31#define _SILLYTGAImageContext_h_
│ │ │ │ -
32#include "SILLYBase.h"
│ │ │ │ -
33#include "SILLYImageContext.h"
│ │ │ │ -
34// Start of section namespace SILLY
│ │ │ │ -
35namespace SILLY
│ │ │ │ -
36{
│ │ │ │ - │ │ │ │ -
43{
│ │ │ │ -
44public:
│ │ │ │ -
45 TGAImageContext(size_t width, size_t height);
│ │ │ │ - │ │ │ │ -
47
│ │ │ │ -
48private:
│ │ │ │ -
49 byte d_idLength;
│ │ │ │ -
50 byte d_imageType;
│ │ │ │ -
51 byte d_depth;
│ │ │ │ -
52 byte d_description;
│ │ │ │ -
53
│ │ │ │ -
54 friend class TGAImageLoader;
│ │ │ │ -
55
│ │ │ │ -
56};
│ │ │ │ -
57
│ │ │ │ -
58
│ │ │ │ -
59} // End of section namespace SILLY
│ │ │ │ +
30#ifndef _SILLYImageLoader_h_
│ │ │ │ +
31#define _SILLYImageLoader_h_
│ │ │ │ +
32#include "SILLYBase.h"
│ │ │ │ +
33// Start of section namespace SILLY
│ │ │ │ +
34namespace SILLY
│ │ │ │ +
35{
│ │ │ │ +
36class DataSource; // Forward declaration
│ │ │ │ +
37class ImageContext; // Forward declaration
│ │ │ │ +
38
│ │ │ │ +
46class SILLY_EXPORT ImageLoader
│ │ │ │ +
47{
│ │ │ │ +
48protected:
│ │ │ │ +
52 ImageLoader(const char* name);
│ │ │ │ +
53public:
│ │ │ │ +
54
│ │ │ │ +
59 virtual ~ImageLoader();
│ │ │ │
60
│ │ │ │ -
61// Inclue inline function when needed
│ │ │ │ -
62#ifdef SILLY_OPT_INLINE
│ │ │ │ -
63#include "SILLYTGAImageContext.icpp"
│ │ │ │ -
64#endif
│ │ │ │ -
65
│ │ │ │ -
66#endif // end of guard _SILLYTGAImageContext_h_
│ │ │ │ -
Simple Image Loading LibrarY namespace.
│ │ │ │ -
Image Context for Targa image.
│ │ │ │ -
Loader for Targa image.
│ │ │ │ -
Store the data needed by an ImageLoader object during the parsing of an image.
│ │ │ │ +
71 virtual ImageContext* loadHeader(PixelFormat& formatSource, DataSource* data) = 0;
│ │ │ │ +
72
│ │ │ │ +
73
│ │ │ │ +
86 virtual bool loadImageData(PixelOrigin origin, DataSource* data, ImageContext* context) = 0;
│ │ │ │ +
87
│ │ │ │ +
94 void destroyContext(ImageContext* context);
│ │ │ │ +
95
│ │ │ │ +
100 const char* getIdentifierString() const;
│ │ │ │ +
101private:
│ │ │ │ +
102 const char* d_name;
│ │ │ │ +
103
│ │ │ │ +
104};
│ │ │ │ +
105
│ │ │ │ +
106} // End of section namespace SILLY
│ │ │ │ +
107
│ │ │ │ +
108// Inclue inline function when needed
│ │ │ │ +
109#ifdef SILLY_OPT_INLINE
│ │ │ │ +
110#include "SILLYImageLoader.icpp"
│ │ │ │ +
111#endif
│ │ │ │ +
112
│ │ │ │ +
113#endif // end of guard _SILLYImageLoader_h_
│ │ │ │ +
Simple Image Loading LibrarY namespace.
│ │ │ │ +
PixelFormat
List all pixel format supported.
Definition: SILLYBase.h:60
│ │ │ │ +
PixelOrigin
List all pixel origin supported.
Definition: SILLYBase.h:71
│ │ │ │ +
This is an abstract class used to provide data to the loader.
│ │ │ │ +
Store the data needed by an ImageLoader object during the parsing of an image.
│ │ │ │ +
This is an abstract class that define the interface of all image loader.
│ │ │ │ +
ImageLoader(const char *name)
Constructor.
│ │ │ │ +
virtual ImageContext * loadHeader(PixelFormat &formatSource, DataSource *data)=0
Parse the header of the image and fill the header struct.
│ │ │ │ +
virtual bool loadImageData(PixelOrigin origin, DataSource *data, ImageContext *context)=0
Parse the pixels data of the image and fill the header struct.
│ │ │ │ +
virtual ~ImageLoader()
Destructor.
│ │ │ │ +
const char * getIdentifierString() const
Return the name of the loader.
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,22 +4,21 @@ │ │ │ │ │ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ │ │ │ │ │ * build │ │ │ │ │ * reproducible-path │ │ │ │ │ * silly-0.1.0 │ │ │ │ │ * include │ │ │ │ │ - * loaders │ │ │ │ │ -SILLYTGAImageContext.h │ │ │ │ │ +SILLYImageLoader.h │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ - 2 filename: SILLYTGAImageContext.h │ │ │ │ │ - 3 created: 11 Jun 2006 │ │ │ │ │ + 2 filename: SILLYImageLoader.h │ │ │ │ │ + 3 created: 10 Jun 2006 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ - 6 purpose: Declaration of the TGAImageContext class │ │ │ │ │ + 6 purpose: Abstract class for all image loader │ │ │ │ │ 7*************************************************************************/ │ │ │ │ │ 8/*************************************************************************** │ │ │ │ │ 9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team │ │ │ │ │ 10 * │ │ │ │ │ 11 * Permission is hereby granted, free of charge, to any person obtaining │ │ │ │ │ 12 * a copy of this software and associated documentation files (the │ │ │ │ │ 13 * "Software"), to deal in the Software without restriction, including │ │ │ │ │ @@ -36,54 +35,87 @@ │ │ │ │ │ 24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. │ │ │ │ │ 25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR │ │ │ │ │ 26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ │ │ │ │ 27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR │ │ │ │ │ 28 * OTHER DEALINGS IN THE SOFTWARE. │ │ │ │ │ 29 │ │ │ │ │ ***************************************************************************/ │ │ │ │ │ - 30#ifndef _SILLYTGAImageContext_h_ │ │ │ │ │ - 31#define _SILLYTGAImageContext_h_ │ │ │ │ │ + 30#ifndef _SILLYImageLoader_h_ │ │ │ │ │ + 31#define _SILLYImageLoader_h_ │ │ │ │ │ 32#include "SILLYBase.h" │ │ │ │ │ - 33#include "SILLYImageContext.h" │ │ │ │ │ - 34// Start of section namespace SILLY │ │ │ │ │ - 35namespace SILLY │ │ │ │ │ - 36{ │ │ │ │ │ -42class TGAImageContext : public ImageContext │ │ │ │ │ - 43{ │ │ │ │ │ - 44public: │ │ │ │ │ - 45 TGAImageContext(size_t width, size_t height); │ │ │ │ │ - 46 ~TGAImageContext(); │ │ │ │ │ - 47 │ │ │ │ │ - 48private: │ │ │ │ │ - 49 byte d_idLength; │ │ │ │ │ - 50 byte d_imageType; │ │ │ │ │ - 51 byte d_depth; │ │ │ │ │ - 52 byte d_description; │ │ │ │ │ - 53 │ │ │ │ │ - 54 friend class TGAImageLoader; │ │ │ │ │ - 55 │ │ │ │ │ - 56}; │ │ │ │ │ - 57 │ │ │ │ │ - 58 │ │ │ │ │ - 59} // End of section namespace SILLY │ │ │ │ │ + 33// Start of section namespace SILLY │ │ │ │ │ + 34namespace SILLY │ │ │ │ │ + 35{ │ │ │ │ │ + 36class DataSource; // Forward declaration │ │ │ │ │ + 37class ImageContext; // Forward declaration │ │ │ │ │ + 38 │ │ │ │ │ +46class SILLY_EXPORT ImageLoader │ │ │ │ │ + 47{ │ │ │ │ │ + 48protected: │ │ │ │ │ +52 ImageLoader(const char* name); │ │ │ │ │ + 53public: │ │ │ │ │ + 54 │ │ │ │ │ +59 virtual ~ImageLoader(); │ │ │ │ │ 60 │ │ │ │ │ - 61// Inclue inline function when needed │ │ │ │ │ - 62#ifdef SILLY_OPT_INLINE │ │ │ │ │ - 63#include "SILLYTGAImageContext.icpp" │ │ │ │ │ - 64#endif │ │ │ │ │ - 65 │ │ │ │ │ - 66#endif // end of guard _SILLYTGAImageContext_h_ │ │ │ │ │ +71 virtual ImageContext* loadHeader(PixelFormat& formatSource, DataSource* │ │ │ │ │ +data) = 0; │ │ │ │ │ + 72 │ │ │ │ │ + 73 │ │ │ │ │ +86 virtual bool loadImageData(PixelOrigin origin, DataSource* data, │ │ │ │ │ +ImageContext* context) = 0; │ │ │ │ │ + 87 │ │ │ │ │ + 94 void destroyContext(ImageContext* context); │ │ │ │ │ + 95 │ │ │ │ │ +100 const char* getIdentifierString() const; │ │ │ │ │ + 101private: │ │ │ │ │ + 102 const char* d_name; │ │ │ │ │ + 103 │ │ │ │ │ + 104}; │ │ │ │ │ + 105 │ │ │ │ │ + 106} // End of section namespace SILLY │ │ │ │ │ + 107 │ │ │ │ │ + 108// Inclue inline function when needed │ │ │ │ │ + 109#ifdef SILLY_OPT_INLINE │ │ │ │ │ + 110#include "SILLYImageLoader.icpp" │ │ │ │ │ + 111#endif │ │ │ │ │ + 112 │ │ │ │ │ + 113#endif // end of guard _SILLYImageLoader_h_ │ │ │ │ │ SILLY │ │ │ │ │ Simple Image Loading LibrarY namespace. │ │ │ │ │ Definition: SILLYJPGImageContext.cpp:46 │ │ │ │ │ -SILLY::TGAImageContext │ │ │ │ │ -Image Context for Targa image. │ │ │ │ │ -Definition: SILLYTGAImageContext.h:43 │ │ │ │ │ -SILLY::TGAImageLoader │ │ │ │ │ -Loader for Targa image. │ │ │ │ │ -Definition: SILLYTGAImageLoader.h:44 │ │ │ │ │ +SILLY::PixelFormat │ │ │ │ │ +PixelFormat │ │ │ │ │ +List all pixel format supported. │ │ │ │ │ +Definition: SILLYBase.h:60 │ │ │ │ │ +SILLY::PixelOrigin │ │ │ │ │ +PixelOrigin │ │ │ │ │ +List all pixel origin supported. │ │ │ │ │ +Definition: SILLYBase.h:71 │ │ │ │ │ +SILLY::DataSource │ │ │ │ │ +This is an abstract class used to provide data to the loader. │ │ │ │ │ +Definition: SILLYDataSource.h:47 │ │ │ │ │ SILLY::ImageContext │ │ │ │ │ Store the data needed by an ImageLoader object during the parsing of an image. │ │ │ │ │ Definition: SILLYImageContext.h:44 │ │ │ │ │ +SILLY::ImageLoader │ │ │ │ │ +This is an abstract class that define the interface of all image loader. │ │ │ │ │ +Definition: SILLYImageLoader.h:47 │ │ │ │ │ +SILLY::ImageLoader::ImageLoader │ │ │ │ │ +ImageLoader(const char *name) │ │ │ │ │ +Constructor. │ │ │ │ │ +SILLY::ImageLoader::loadHeader │ │ │ │ │ +virtual ImageContext * loadHeader(PixelFormat &formatSource, DataSource │ │ │ │ │ +*data)=0 │ │ │ │ │ +Parse the header of the image and fill the header struct. │ │ │ │ │ +SILLY::ImageLoader::loadImageData │ │ │ │ │ +virtual bool loadImageData(PixelOrigin origin, DataSource *data, ImageContext │ │ │ │ │ +*context)=0 │ │ │ │ │ +Parse the pixels data of the image and fill the header struct. │ │ │ │ │ +SILLY::ImageLoader::~ImageLoader │ │ │ │ │ +virtual ~ImageLoader() │ │ │ │ │ +Destructor. │ │ │ │ │ +SILLY::ImageLoader::getIdentifierString │ │ │ │ │ +const char * getIdentifierString() const │ │ │ │ │ +Return the name of the loader. │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libsilly-doc/html/a00095_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/loaders/SILLYPNGImageContext.h Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/SILLY.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -35,27 +35,27 @@ │ │ │ │ initMenu('',false,false,'search.php','Search'); │ │ │ │ }); │ │ │ │ /* @license-end */ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYPNGImageContext.h
│ │ │ │ +
SILLY.h
│ │ │ │
│ │ │ │
│ │ │ │
1/***********************************************************************
│ │ │ │ -
2 filename: SILLYPNGImageContext.h
│ │ │ │ -
3 created: 11 Jun 2006
│ │ │ │ +
2 filename: SILLY.h
│ │ │ │ +
3 created: 10 Jun 2006
│ │ │ │
4 author: Olivier Delannoy
│ │ │ │
5
│ │ │ │ -
6 purpose: Declaration of the PNGImageContext class
│ │ │ │ +
6 purpose: Master include for the SILLY library
│ │ │ │
7*************************************************************************/
│ │ │ │
8/***************************************************************************
│ │ │ │
9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
│ │ │ │
10 *
│ │ │ │
11 * Permission is hereby granted, free of charge, to any person obtaining
│ │ │ │
12 * a copy of this software and associated documentation files (the
│ │ │ │
13 * "Software"), to deal in the Software without restriction, including
│ │ │ │ @@ -71,66 +71,35 @@ │ │ │ │
23 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
│ │ │ │
24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
│ │ │ │
25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
│ │ │ │
26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
│ │ │ │
27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
│ │ │ │
28 * OTHER DEALINGS IN THE SOFTWARE.
│ │ │ │
29 ***************************************************************************/
│ │ │ │ -
30#ifndef _SILLYPNGImageContext_h_
│ │ │ │ -
31#define _SILLYPNGImageContext_h_
│ │ │ │ -
32#include "SILLYBase.h"
│ │ │ │ -
33#include "SILLYImageContext.h"
│ │ │ │ -
34#include "SILLYDataSource.h"
│ │ │ │ -
35#include <png.h>
│ │ │ │ -
36// Start of section namespace SILLY
│ │ │ │ -
37namespace SILLY
│ │ │ │ -
38{
│ │ │ │ -
39
│ │ │ │ -
45class SILLY_EXPORT PNGImageContext : public ImageContext
│ │ │ │ -
46{
│ │ │ │ -
47public:
│ │ │ │ - │ │ │ │ - │ │ │ │ -
50
│ │ │ │ -
51 int read(png_bytep data, png_size_t length);
│ │ │ │ -
52
│ │ │ │ -
53
│ │ │ │ -
54
│ │ │ │ -
55private:
│ │ │ │ -
56 void setImageSize();
│ │ │ │ -
57
│ │ │ │ -
58 size_t d_offset;
│ │ │ │ -
59
│ │ │ │ -
60 DataSource* d_data;
│ │ │ │ -
61
│ │ │ │ -
62 png_structp d_png_ptr;
│ │ │ │ -
63
│ │ │ │ -
64 png_infop d_info_ptr;
│ │ │ │ -
65
│ │ │ │ -
66 size_t d_bit_depth;
│ │ │ │ -
67 size_t d_num_channels;
│ │ │ │ -
68
│ │ │ │ -
69
│ │ │ │ -
70 friend class PNGImageLoader;
│ │ │ │ -
71};
│ │ │ │ -
72
│ │ │ │ -
73
│ │ │ │ -
74} // End of section namespace SILLY
│ │ │ │ -
75
│ │ │ │ -
76// Inclue inline function when needed
│ │ │ │ -
77#ifdef SILLY_OPT_INLINE
│ │ │ │ -
78#include "SILLYPNGImageContext.icpp"
│ │ │ │ -
79#endif
│ │ │ │ -
80
│ │ │ │ -
81#endif // end of guard _SILLYPNGImageContext_h_
│ │ │ │ -
Simple Image Loading LibrarY namespace.
│ │ │ │ -
Image Context for PNG Image Loader.
│ │ │ │ -
Loader for PNG Image.
│ │ │ │ -
This is an abstract class used to provide data to the loader.
│ │ │ │ -
Store the data needed by an ImageLoader object during the parsing of an image.
│ │ │ │ +
30#ifndef _SILLY_h_
│ │ │ │ +
31#define _SILLY_h_
│ │ │ │ +
109namespace SILLY
│ │ │ │ +
110{
│ │ │ │ +
111
│ │ │ │ +
112}
│ │ │ │ +
113
│ │ │ │ +
114
│ │ │ │ +
115
│ │ │ │ +
116
│ │ │ │ +
117#include "SILLYBase.h"
│ │ │ │ +
118#include "SILLYDataSource.h"
│ │ │ │ +
119#include "SILLYFileDataSource.h"
│ │ │ │ +
120#include "SILLYMemoryDataSource.h"
│ │ │ │ +
121#include "SILLYImageLoader.h"
│ │ │ │ +
122#include "SILLYImageContext.h"
│ │ │ │ +
123#include "SILLYImageLoaderManager.h"
│ │ │ │ +
124#include "SILLYImage.h"
│ │ │ │ +
125
│ │ │ │ +
126#endif // end of guard _SILLY_h_
│ │ │ │ +
Simple Image Loading LibrarY namespace.
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,22 +4,21 @@ │ │ │ │ │ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ │ │ │ │ │ * build │ │ │ │ │ * reproducible-path │ │ │ │ │ * silly-0.1.0 │ │ │ │ │ * include │ │ │ │ │ - * loaders │ │ │ │ │ -SILLYPNGImageContext.h │ │ │ │ │ +SILLY.h │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ - 2 filename: SILLYPNGImageContext.h │ │ │ │ │ - 3 created: 11 Jun 2006 │ │ │ │ │ + 2 filename: SILLY.h │ │ │ │ │ + 3 created: 10 Jun 2006 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ - 6 purpose: Declaration of the PNGImageContext class │ │ │ │ │ + 6 purpose: Master include for the SILLY library │ │ │ │ │ 7*************************************************************************/ │ │ │ │ │ 8/*************************************************************************** │ │ │ │ │ 9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team │ │ │ │ │ 10 * │ │ │ │ │ 11 * Permission is hereby granted, free of charge, to any person obtaining │ │ │ │ │ 12 * a copy of this software and associated documentation files (the │ │ │ │ │ 13 * "Software"), to deal in the Software without restriction, including │ │ │ │ │ @@ -36,72 +35,33 @@ │ │ │ │ │ 24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. │ │ │ │ │ 25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR │ │ │ │ │ 26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ │ │ │ │ 27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR │ │ │ │ │ 28 * OTHER DEALINGS IN THE SOFTWARE. │ │ │ │ │ 29 │ │ │ │ │ ***************************************************************************/ │ │ │ │ │ - 30#ifndef _SILLYPNGImageContext_h_ │ │ │ │ │ - 31#define _SILLYPNGImageContext_h_ │ │ │ │ │ - 32#include "SILLYBase.h" │ │ │ │ │ - 33#include "SILLYImageContext.h" │ │ │ │ │ - 34#include "SILLYDataSource.h" │ │ │ │ │ - 35#include │ │ │ │ │ - 36// Start of section namespace SILLY │ │ │ │ │ - 37namespace SILLY │ │ │ │ │ - 38{ │ │ │ │ │ - 39 │ │ │ │ │ -45class SILLY_EXPORT PNGImageContext : public ImageContext │ │ │ │ │ - 46{ │ │ │ │ │ - 47public: │ │ │ │ │ - 48 PNGImageContext(DataSource* data); │ │ │ │ │ - 49 ~PNGImageContext(); │ │ │ │ │ - 50 │ │ │ │ │ - 51 int read(png_bytep data, png_size_t length); │ │ │ │ │ - 52 │ │ │ │ │ - 53 │ │ │ │ │ - 54 │ │ │ │ │ - 55private: │ │ │ │ │ - 56 void setImageSize(); │ │ │ │ │ - 57 │ │ │ │ │ - 58 size_t d_offset; │ │ │ │ │ - 59 │ │ │ │ │ - 60 DataSource* d_data; │ │ │ │ │ - 61 │ │ │ │ │ - 62 png_structp d_png_ptr; │ │ │ │ │ - 63 │ │ │ │ │ - 64 png_infop d_info_ptr; │ │ │ │ │ - 65 │ │ │ │ │ - 66 size_t d_bit_depth; │ │ │ │ │ - 67 size_t d_num_channels; │ │ │ │ │ - 68 │ │ │ │ │ - 69 │ │ │ │ │ - 70 friend class PNGImageLoader; │ │ │ │ │ - 71}; │ │ │ │ │ - 72 │ │ │ │ │ - 73 │ │ │ │ │ - 74} // End of section namespace SILLY │ │ │ │ │ - 75 │ │ │ │ │ - 76// Inclue inline function when needed │ │ │ │ │ - 77#ifdef SILLY_OPT_INLINE │ │ │ │ │ - 78#include "SILLYPNGImageContext.icpp" │ │ │ │ │ - 79#endif │ │ │ │ │ - 80 │ │ │ │ │ - 81#endif // end of guard _SILLYPNGImageContext_h_ │ │ │ │ │ + 30#ifndef _SILLY_h_ │ │ │ │ │ + 31#define _SILLY_h_ │ │ │ │ │ + 109namespace SILLY │ │ │ │ │ + 110{ │ │ │ │ │ + 111 │ │ │ │ │ + 112} │ │ │ │ │ + 113 │ │ │ │ │ + 114 │ │ │ │ │ + 115 │ │ │ │ │ + 116 │ │ │ │ │ + 117#include "SILLYBase.h" │ │ │ │ │ + 118#include "SILLYDataSource.h" │ │ │ │ │ + 119#include "SILLYFileDataSource.h" │ │ │ │ │ + 120#include "SILLYMemoryDataSource.h" │ │ │ │ │ + 121#include "SILLYImageLoader.h" │ │ │ │ │ + 122#include "SILLYImageContext.h" │ │ │ │ │ + 123#include "SILLYImageLoaderManager.h" │ │ │ │ │ + 124#include "SILLYImage.h" │ │ │ │ │ + 125 │ │ │ │ │ + 126#endif // end of guard _SILLY_h_ │ │ │ │ │ SILLY │ │ │ │ │ Simple Image Loading LibrarY namespace. │ │ │ │ │ Definition: SILLYJPGImageContext.cpp:46 │ │ │ │ │ -SILLY::PNGImageContext │ │ │ │ │ -Image Context for PNG Image Loader. │ │ │ │ │ -Definition: SILLYPNGImageContext.h:46 │ │ │ │ │ -SILLY::PNGImageLoader │ │ │ │ │ -Loader for PNG Image. │ │ │ │ │ -Definition: SILLYPNGImageLoader.h:43 │ │ │ │ │ -SILLY::DataSource │ │ │ │ │ -This is an abstract class used to provide data to the loader. │ │ │ │ │ -Definition: SILLYDataSource.h:47 │ │ │ │ │ -SILLY::ImageContext │ │ │ │ │ -Store the data needed by an ImageLoader object during the parsing of an image. │ │ │ │ │ -Definition: SILLYImageContext.h:44 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libsilly-doc/html/a00098_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/loaders/SILLYPNGImageLoader.h Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/SILLYMemoryDataSource.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -35,27 +35,27 @@ │ │ │ │ initMenu('',false,false,'search.php','Search'); │ │ │ │ }); │ │ │ │ /* @license-end */ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYPNGImageLoader.h
│ │ │ │ +
SILLYMemoryDataSource.h
│ │ │ │
│ │ │ │
│ │ │ │
1/***********************************************************************
│ │ │ │ -
2 filename: SILLYPNGImageLoader.h
│ │ │ │ -
3 created: 11 Jun 2006
│ │ │ │ -
4 author: Olivier Delannoy
│ │ │ │ +
2 filename: SILLYMemoryDataSource.h
│ │ │ │ +
3 created: 10 Jun 2006
│ │ │ │ +
4 author: Olivier Delannoy
│ │ │ │
5
│ │ │ │ -
6 purpose: Declaration of the PNGImageLoader class
│ │ │ │ +
6 purpose: SILLYMemoryDataSource declaration for the SILLY library
│ │ │ │
7*************************************************************************/
│ │ │ │
8/***************************************************************************
│ │ │ │
9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
│ │ │ │
10 *
│ │ │ │
11 * Permission is hereby granted, free of charge, to any person obtaining
│ │ │ │
12 * a copy of this software and associated documentation files (the
│ │ │ │
13 * "Software"), to deal in the Software without restriction, including
│ │ │ │ @@ -71,56 +71,50 @@ │ │ │ │
23 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
│ │ │ │
24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
│ │ │ │
25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
│ │ │ │
26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
│ │ │ │
27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
│ │ │ │
28 * OTHER DEALINGS IN THE SOFTWARE.
│ │ │ │
29 ***************************************************************************/
│ │ │ │ -
30#ifndef _SILLYPNGImageLoader_h_
│ │ │ │ -
31#define _SILLYPNGImageLoader_h_
│ │ │ │ +
30#ifndef _SILLYMemoryDataSource_h_
│ │ │ │ +
31#define _SILLYMemoryDataSource_h_
│ │ │ │
32#include "SILLYBase.h"
│ │ │ │ -
33#include "SILLYImageLoader.h"
│ │ │ │ -
34#include "SILLYDataSource.h"
│ │ │ │ -
35// Start of section namespace SILLY
│ │ │ │ -
36namespace SILLY
│ │ │ │ -
37{
│ │ │ │ - │ │ │ │ -
43{
│ │ │ │ -
44public:
│ │ │ │ - │ │ │ │ -
46
│ │ │ │ - │ │ │ │ -
48
│ │ │ │ -
49 ImageContext* loadHeader(PixelFormat& formatSource, DataSource* data);
│ │ │ │ -
50
│ │ │ │ -
51 bool loadImageData(PixelOrigin origin,
│ │ │ │ -
52 DataSource* data,
│ │ │ │ -
53 ImageContext* context);
│ │ │ │ -
54private:
│ │ │ │ -
55
│ │ │ │ -
56};
│ │ │ │ -
57
│ │ │ │ -
58
│ │ │ │ -
59} // End of section namespace SILLY
│ │ │ │ -
60
│ │ │ │ -
61// Inclue inline function when needed
│ │ │ │ -
62#ifdef SILLY_OPT_INLINE
│ │ │ │ -
63#include "SILLYPNGImageLoader.icpp"
│ │ │ │ -
64#endif
│ │ │ │ +
33#include "SILLYDataSource.h"
│ │ │ │ +
34// Start of section namespace SILLY
│ │ │ │ +
35namespace SILLY
│ │ │ │ +
36{
│ │ │ │ +
37
│ │ │ │ +
48class SILLY_EXPORT MemoryDataSource : public DataSource
│ │ │ │ +
49{
│ │ │ │ +
50public:
│ │ │ │ +
63 MemoryDataSource(const byte* data, size_t size);
│ │ │ │ +
64
│ │ │ │
65
│ │ │ │ -
66#endif // end of guard _SILLYPNGImageLoader_h_
│ │ │ │ -
Simple Image Loading LibrarY namespace.
│ │ │ │ -
PixelFormat
List all pixel format supported.
Definition: SILLYBase.h:60
│ │ │ │ -
PixelOrigin
List all pixel origin supported.
Definition: SILLYBase.h:71
│ │ │ │ -
Loader for PNG Image.
│ │ │ │ -
ImageContext * loadHeader(PixelFormat &formatSource, DataSource *data)
Parse the header of the image and fill the header struct.
│ │ │ │ -
bool loadImageData(PixelOrigin origin, DataSource *data, ImageContext *context)
Parse the pixels data of the image and fill the header struct.
│ │ │ │ -
This is an abstract class used to provide data to the loader.
│ │ │ │ -
Store the data needed by an ImageLoader object during the parsing of an image.
│ │ │ │ -
This is an abstract class that define the interface of all image loader.
│ │ │ │ +
66 const byte* getDataPtr() const;
│ │ │ │ +
67
│ │ │ │ +
68 size_t getSize() const;
│ │ │ │ +
69private:
│ │ │ │ +
70 const byte* d_bytes;
│ │ │ │ +
71 size_t d_size;
│ │ │ │ +
72};
│ │ │ │ +
73
│ │ │ │ +
74
│ │ │ │ +
75} // End of section namespace SILLY
│ │ │ │ +
76
│ │ │ │ +
77// Inclue inline function when needed
│ │ │ │ +
78#ifdef SILLY_OPT_INLINE
│ │ │ │ +
79#include "SILLYMemoryDataSource.icpp"
│ │ │ │ +
80#endif
│ │ │ │ +
81
│ │ │ │ +
82#endif // end of guard _SILLYMemoryDataSource_h_
│ │ │ │ +
Simple Image Loading LibrarY namespace.
│ │ │ │ +
This is an abstract class used to provide data to the loader.
│ │ │ │ +
Load an image from a memory area.
│ │ │ │ +
const byte * getDataPtr() const
Get raw access to the image data.
│ │ │ │ +
size_t getSize() const
Return the size of the data.
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,22 +4,21 @@ │ │ │ │ │ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ │ │ │ │ │ * build │ │ │ │ │ * reproducible-path │ │ │ │ │ * silly-0.1.0 │ │ │ │ │ * include │ │ │ │ │ - * loaders │ │ │ │ │ -SILLYPNGImageLoader.h │ │ │ │ │ +SILLYMemoryDataSource.h │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ - 2 filename: SILLYPNGImageLoader.h │ │ │ │ │ - 3 created: 11 Jun 2006 │ │ │ │ │ + 2 filename: SILLYMemoryDataSource.h │ │ │ │ │ + 3 created: 10 Jun 2006 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ - 6 purpose: Declaration of the PNGImageLoader class │ │ │ │ │ + 6 purpose: SILLYMemoryDataSource declaration for the SILLY library │ │ │ │ │ 7*************************************************************************/ │ │ │ │ │ 8/*************************************************************************** │ │ │ │ │ 9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team │ │ │ │ │ 10 * │ │ │ │ │ 11 * Permission is hereby granted, free of charge, to any person obtaining │ │ │ │ │ 12 * a copy of this software and associated documentation files (the │ │ │ │ │ 13 * "Software"), to deal in the Software without restriction, including │ │ │ │ │ @@ -36,74 +35,56 @@ │ │ │ │ │ 24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. │ │ │ │ │ 25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR │ │ │ │ │ 26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ │ │ │ │ 27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR │ │ │ │ │ 28 * OTHER DEALINGS IN THE SOFTWARE. │ │ │ │ │ 29 │ │ │ │ │ ***************************************************************************/ │ │ │ │ │ - 30#ifndef _SILLYPNGImageLoader_h_ │ │ │ │ │ - 31#define _SILLYPNGImageLoader_h_ │ │ │ │ │ + 30#ifndef _SILLYMemoryDataSource_h_ │ │ │ │ │ + 31#define _SILLYMemoryDataSource_h_ │ │ │ │ │ 32#include "SILLYBase.h" │ │ │ │ │ - 33#include "SILLYImageLoader.h" │ │ │ │ │ - 34#include "SILLYDataSource.h" │ │ │ │ │ - 35// Start of section namespace SILLY │ │ │ │ │ - 36namespace SILLY │ │ │ │ │ - 37{ │ │ │ │ │ -42class PNGImageLoader : public ImageLoader │ │ │ │ │ - 43{ │ │ │ │ │ - 44public: │ │ │ │ │ - 45 PNGImageLoader(); │ │ │ │ │ - 46 │ │ │ │ │ - 47 ~PNGImageLoader(); │ │ │ │ │ - 48 │ │ │ │ │ - 49 ImageContext* loadHeader(PixelFormat& formatSource, DataSource* data); │ │ │ │ │ - 50 │ │ │ │ │ - 51 bool loadImageData(PixelOrigin origin, │ │ │ │ │ - 52 DataSource* data, │ │ │ │ │ - 53 ImageContext* context); │ │ │ │ │ - 54private: │ │ │ │ │ - 55 │ │ │ │ │ - 56}; │ │ │ │ │ - 57 │ │ │ │ │ - 58 │ │ │ │ │ - 59} // End of section namespace SILLY │ │ │ │ │ - 60 │ │ │ │ │ - 61// Inclue inline function when needed │ │ │ │ │ - 62#ifdef SILLY_OPT_INLINE │ │ │ │ │ - 63#include "SILLYPNGImageLoader.icpp" │ │ │ │ │ - 64#endif │ │ │ │ │ + 33#include "SILLYDataSource.h" │ │ │ │ │ + 34// Start of section namespace SILLY │ │ │ │ │ + 35namespace SILLY │ │ │ │ │ + 36{ │ │ │ │ │ + 37 │ │ │ │ │ +48class SILLY_EXPORT MemoryDataSource : public DataSource │ │ │ │ │ + 49{ │ │ │ │ │ + 50public: │ │ │ │ │ + 63 MemoryDataSource(const byte* data, size_t size); │ │ │ │ │ + 64 │ │ │ │ │ 65 │ │ │ │ │ - 66#endif // end of guard _SILLYPNGImageLoader_h_ │ │ │ │ │ +66 const byte* getDataPtr() const; │ │ │ │ │ + 67 │ │ │ │ │ +68 size_t getSize() const; │ │ │ │ │ + 69private: │ │ │ │ │ + 70 const byte* d_bytes; │ │ │ │ │ + 71 size_t d_size; │ │ │ │ │ + 72}; │ │ │ │ │ + 73 │ │ │ │ │ + 74 │ │ │ │ │ + 75} // End of section namespace SILLY │ │ │ │ │ + 76 │ │ │ │ │ + 77// Inclue inline function when needed │ │ │ │ │ + 78#ifdef SILLY_OPT_INLINE │ │ │ │ │ + 79#include "SILLYMemoryDataSource.icpp" │ │ │ │ │ + 80#endif │ │ │ │ │ + 81 │ │ │ │ │ + 82#endif // end of guard _SILLYMemoryDataSource_h_ │ │ │ │ │ SILLY │ │ │ │ │ Simple Image Loading LibrarY namespace. │ │ │ │ │ Definition: SILLYJPGImageContext.cpp:46 │ │ │ │ │ -SILLY::PixelFormat │ │ │ │ │ -PixelFormat │ │ │ │ │ -List all pixel format supported. │ │ │ │ │ -Definition: SILLYBase.h:60 │ │ │ │ │ -SILLY::PixelOrigin │ │ │ │ │ -PixelOrigin │ │ │ │ │ -List all pixel origin supported. │ │ │ │ │ -Definition: SILLYBase.h:71 │ │ │ │ │ -SILLY::PNGImageLoader │ │ │ │ │ -Loader for PNG Image. │ │ │ │ │ -Definition: SILLYPNGImageLoader.h:43 │ │ │ │ │ -SILLY::PNGImageLoader::loadHeader │ │ │ │ │ -ImageContext * loadHeader(PixelFormat &formatSource, DataSource *data) │ │ │ │ │ -Parse the header of the image and fill the header struct. │ │ │ │ │ -Definition: SILLYPNGImageLoader.cpp:88 │ │ │ │ │ -SILLY::PNGImageLoader::loadImageData │ │ │ │ │ -bool loadImageData(PixelOrigin origin, DataSource *data, ImageContext *context) │ │ │ │ │ -Parse the pixels data of the image and fill the header struct. │ │ │ │ │ -Definition: SILLYPNGImageLoader.cpp:154 │ │ │ │ │ SILLY::DataSource │ │ │ │ │ This is an abstract class used to provide data to the loader. │ │ │ │ │ Definition: SILLYDataSource.h:47 │ │ │ │ │ -SILLY::ImageContext │ │ │ │ │ -Store the data needed by an ImageLoader object during the parsing of an image. │ │ │ │ │ -Definition: SILLYImageContext.h:44 │ │ │ │ │ -SILLY::ImageLoader │ │ │ │ │ -This is an abstract class that define the interface of all image loader. │ │ │ │ │ -Definition: SILLYImageLoader.h:47 │ │ │ │ │ +SILLY::MemoryDataSource │ │ │ │ │ +Load an image from a memory area. │ │ │ │ │ +Definition: SILLYMemoryDataSource.h:49 │ │ │ │ │ +SILLY::MemoryDataSource::getDataPtr │ │ │ │ │ +const byte * getDataPtr() const │ │ │ │ │ +Get raw access to the image data. │ │ │ │ │ +SILLY::MemoryDataSource::getSize │ │ │ │ │ +size_t getSize() const │ │ │ │ │ +Return the size of the data. │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libsilly-doc/html/a00101_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/loaders/SILLYTGAImageLoader.h Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/SILLYImageContext.icpp Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -35,88 +35,125 @@ │ │ │ │ initMenu('',false,false,'search.php','Search'); │ │ │ │ }); │ │ │ │ /* @license-end */ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYTGAImageLoader.h
│ │ │ │ +
SILLYImageContext.icpp
│ │ │ │
│ │ │ │
│ │ │ │ -
1/***********************************************************************
│ │ │ │ -
2 filename: SILLYTGAImageLoader.h
│ │ │ │ -
3 created: 11 Jun 2006
│ │ │ │ -
4 author: Olivier Delannoy
│ │ │ │ -
5
│ │ │ │ -
6 purpose: Declaration of the TGAImageLoader class
│ │ │ │ -
7*************************************************************************/
│ │ │ │ -
8/***************************************************************************
│ │ │ │ -
9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
│ │ │ │ -
10 *
│ │ │ │ -
11 * Permission is hereby granted, free of charge, to any person obtaining
│ │ │ │ -
12 * a copy of this software and associated documentation files (the
│ │ │ │ -
13 * "Software"), to deal in the Software without restriction, including
│ │ │ │ -
14 * without limitation the rights to use, copy, modify, merge, publish,
│ │ │ │ -
15 * distribute, sublicense, and/or sell copies of the Software, and to
│ │ │ │ -
16 * permit persons to whom the Software is furnished to do so, subject to
│ │ │ │ -
17 * the following conditions:
│ │ │ │ -
18 *
│ │ │ │ -
19 * The above copyright notice and this permission notice shall be
│ │ │ │ -
20 * included in all copies or substantial portions of the Software.
│ │ │ │ -
21 *
│ │ │ │ -
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
│ │ │ │ -
23 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
│ │ │ │ -
24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
│ │ │ │ -
25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
│ │ │ │ -
26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
│ │ │ │ -
27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
│ │ │ │ -
28 * OTHER DEALINGS IN THE SOFTWARE.
│ │ │ │ -
29 ***************************************************************************/
│ │ │ │ -
30#ifndef _SILLYTGAImageLoader_h_
│ │ │ │ -
31#define _SILLYTGAImageLoader_h_
│ │ │ │ -
32#include "SILLYBase.h"
│ │ │ │ -
33#include "SILLYImageLoader.h"
│ │ │ │ -
34// Start of section namespace SILLY
│ │ │ │ -
35namespace SILLY
│ │ │ │ -
36{
│ │ │ │ -
37class TGAImageContext;
│ │ │ │ - │ │ │ │ -
44{
│ │ │ │ -
45public:
│ │ │ │ - │ │ │ │ - │ │ │ │ -
48 ImageContext* loadHeader(PixelFormat& formatSource, DataSource* data);
│ │ │ │ -
49 bool loadImageData(PixelOrigin origin,
│ │ │ │ -
50 DataSource* data,
│ │ │ │ -
51 ImageContext* context);
│ │ │ │ -
52private:
│ │ │ │ +
1/***********************************************************************
│ │ │ │ +
2 filename: SILLYImageContext.icpp
│ │ │ │ +
3 created: 10 Jun 2006
│ │ │ │ +
4 author: Olivier Delannoy
│ │ │ │ +
5
│ │ │ │ +
6 purpose: Inline definition for ImageContext
│ │ │ │ +
7*************************************************************************/
│ │ │ │ +
8/***************************************************************************
│ │ │ │ +
9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
│ │ │ │ +
10 *
│ │ │ │ +
11 * Permission is hereby granted, free of charge, to any person obtaining
│ │ │ │ +
12 * a copy of this software and associated documentation files (the
│ │ │ │ +
13 * "Software"), to deal in the Software without restriction, including
│ │ │ │ +
14 * without limitation the rights to use, copy, modify, merge, publish,
│ │ │ │ +
15 * distribute, sublicense, and/or sell copies of the Software, and to
│ │ │ │ +
16 * permit persons to whom the Software is furnished to do so, subject to
│ │ │ │ +
17 * the following conditions:
│ │ │ │ +
18 *
│ │ │ │ +
19 * The above copyright notice and this permission notice shall be
│ │ │ │ +
20 * included in all copies or substantial portions of the Software.
│ │ │ │ +
21 *
│ │ │ │ +
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
│ │ │ │ +
23 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
│ │ │ │ +
24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
│ │ │ │ +
25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
│ │ │ │ +
26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
│ │ │ │ +
27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
│ │ │ │ +
28 * OTHER DEALINGS IN THE SOFTWARE.
│ │ │ │ +
29 ***************************************************************************/
│ │ │ │ +
30
│ │ │ │ +
31// Start of section namespace SILLY
│ │ │ │ +
32namespace SILLY
│ │ │ │ +
33{
│ │ │ │ +
34
│ │ │ │ +
35inline ImageContext::ImageContext(size_t width, size_t height)
│ │ │ │ +
36 : d_pixels(0), d_length(0), d_width(width), d_height(height), d_currentOffset(0), d_format(PF_RGBA)
│ │ │ │ +
37{
│ │ │ │ +
38}
│ │ │ │ +
39
│ │ │ │ +
40
│ │ │ │ +
41inline ImageContext::~ImageContext()
│ │ │ │ +
42{
│ │ │ │ +
43}
│ │ │ │ +
44
│ │ │ │ +
45
│ │ │ │ +
46inline void ImageContext::setDestination(byte* pixels, size_t length, PixelFormat format)
│ │ │ │ +
47{
│ │ │ │ +
48 d_pixels = pixels;
│ │ │ │ +
49 d_length = length;
│ │ │ │ +
50 d_currentOffset = 0;
│ │ │ │ +
51 d_format = format;
│ │ │ │ +
52}
│ │ │ │
53
│ │ │ │ -
54};
│ │ │ │ -
55
│ │ │ │ -
56} // End of section namespace SILLY
│ │ │ │ -
57
│ │ │ │ -
58// Inclue inline function when needed
│ │ │ │ -
59#ifdef SILLY_OPT_INLINE
│ │ │ │ -
60#include "SILLYTGAImageLoader.icpp"
│ │ │ │ -
61#endif
│ │ │ │ -
62
│ │ │ │ -
63#endif // end of guard _SILLYTGAImageLoader_h_
│ │ │ │ -
Simple Image Loading LibrarY namespace.
│ │ │ │ -
PixelFormat
List all pixel format supported.
Definition: SILLYBase.h:60
│ │ │ │ -
PixelOrigin
List all pixel origin supported.
Definition: SILLYBase.h:71
│ │ │ │ -
Loader for Targa image.
│ │ │ │ -
ImageContext * loadHeader(PixelFormat &formatSource, DataSource *data)
Parse the header of the image and fill the header struct.
│ │ │ │ -
bool loadImageData(PixelOrigin origin, DataSource *data, ImageContext *context)
Parse the pixels data of the image and fill the header struct.
│ │ │ │ -
This is an abstract class used to provide data to the loader.
│ │ │ │ -
Store the data needed by an ImageLoader object during the parsing of an image.
│ │ │ │ -
This is an abstract class that define the interface of all image loader.
│ │ │ │ +
54inline void ImageContext::setNextPixel(byte red, byte green, byte bleu, byte alpha)
│ │ │ │ +
55{
│ │ │ │ +
56 //assert(d_currentOffset < d_length && "ASSERT: try to set a pixel outside of the image");
│ │ │ │ +
57 switch(d_format)
│ │ │ │ +
58 {
│ │ │ │ +
59 case PF_A1B5G5R5:
│ │ │ │ +
60 // The hard part
│ │ │ │ +
61 assert(0 && "ASSERT: Not yet implemented");
│ │ │ │ +
62 break;
│ │ │ │ +
63 case PF_RGB:
│ │ │ │ +
64 // Ignore alpha channel
│ │ │ │ +
65 d_pixels[d_currentOffset++] = red;
│ │ │ │ +
66 d_pixels[d_currentOffset++] = green;
│ │ │ │ +
67 d_pixels[d_currentOffset++] = bleu;
│ │ │ │ +
68 break;
│ │ │ │ +
69
│ │ │ │ +
70 case PF_RGBA:
│ │ │ │ +
71 d_pixels[d_currentOffset++] = red;
│ │ │ │ +
72 d_pixels[d_currentOffset++] = green;
│ │ │ │ +
73 d_pixels[d_currentOffset++] = bleu;
│ │ │ │ +
74 d_pixels[d_currentOffset++] = alpha;
│ │ │ │ +
75 break;
│ │ │ │ +
76
│ │ │ │ +
77 }
│ │ │ │ +
78}
│ │ │ │ +
79inline size_t ImageContext::getWidth() const
│ │ │ │ +
80{
│ │ │ │ +
81 return d_width;
│ │ │ │ +
82}
│ │ │ │ +
83
│ │ │ │ +
84inline void ImageContext::setWidth(size_t width)
│ │ │ │ +
85{
│ │ │ │ +
86 d_width = width;
│ │ │ │ +
87}
│ │ │ │ +
88
│ │ │ │ +
89inline size_t ImageContext::getHeight() const
│ │ │ │ +
90{
│ │ │ │ +
91 return d_height;
│ │ │ │ +
92}
│ │ │ │ +
93
│ │ │ │ +
94inline void ImageContext::setHeight(size_t height)
│ │ │ │ +
95{
│ │ │ │ +
96 d_height = height;
│ │ │ │ +
97}
│ │ │ │ +
98inline PixelFormat ImageContext::getPixelFormat() const
│ │ │ │ +
99{
│ │ │ │ +
100 return d_format;
│ │ │ │ +
101}
│ │ │ │ +
102
│ │ │ │ +
103} // End of section namespace SILLY
│ │ │ │ +
104
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,22 +4,21 @@ │ │ │ │ │ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ │ │ │ │ │ * build │ │ │ │ │ * reproducible-path │ │ │ │ │ * silly-0.1.0 │ │ │ │ │ * include │ │ │ │ │ - * loaders │ │ │ │ │ -SILLYTGAImageLoader.h │ │ │ │ │ +SILLYImageContext.icpp │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ - 2 filename: SILLYTGAImageLoader.h │ │ │ │ │ - 3 created: 11 Jun 2006 │ │ │ │ │ + 2 filename: SILLYImageContext.icpp │ │ │ │ │ + 3 created: 10 Jun 2006 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ - 6 purpose: Declaration of the TGAImageLoader class │ │ │ │ │ + 6 purpose: Inline definition for ImageContext │ │ │ │ │ 7*************************************************************************/ │ │ │ │ │ 8/*************************************************************************** │ │ │ │ │ 9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team │ │ │ │ │ 10 * │ │ │ │ │ 11 * Permission is hereby granted, free of charge, to any person obtaining │ │ │ │ │ 12 * a copy of this software and associated documentation files (the │ │ │ │ │ 13 * "Software"), to deal in the Software without restriction, including │ │ │ │ │ @@ -36,70 +35,89 @@ │ │ │ │ │ 24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. │ │ │ │ │ 25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR │ │ │ │ │ 26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ │ │ │ │ 27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR │ │ │ │ │ 28 * OTHER DEALINGS IN THE SOFTWARE. │ │ │ │ │ 29 │ │ │ │ │ ***************************************************************************/ │ │ │ │ │ - 30#ifndef _SILLYTGAImageLoader_h_ │ │ │ │ │ - 31#define _SILLYTGAImageLoader_h_ │ │ │ │ │ - 32#include "SILLYBase.h" │ │ │ │ │ - 33#include "SILLYImageLoader.h" │ │ │ │ │ - 34// Start of section namespace SILLY │ │ │ │ │ - 35namespace SILLY │ │ │ │ │ - 36{ │ │ │ │ │ - 37class TGAImageContext; │ │ │ │ │ -43class TGAImageLoader : public ImageLoader │ │ │ │ │ - 44{ │ │ │ │ │ - 45public: │ │ │ │ │ - 46 TGAImageLoader(); │ │ │ │ │ - 47 ~TGAImageLoader(); │ │ │ │ │ - 48 ImageContext* loadHeader(PixelFormat& formatSource, DataSource* data); │ │ │ │ │ - 49 bool loadImageData(PixelOrigin origin, │ │ │ │ │ - 50 DataSource* data, │ │ │ │ │ - 51 ImageContext* context); │ │ │ │ │ - 52private: │ │ │ │ │ + 30 │ │ │ │ │ + 31// Start of section namespace SILLY │ │ │ │ │ + 32namespace SILLY │ │ │ │ │ + 33{ │ │ │ │ │ + 34 │ │ │ │ │ + 35inline ImageContext::ImageContext(size_t width, size_t height) │ │ │ │ │ + 36 : d_pixels(0), d_length(0), d_width(width), d_height(height), │ │ │ │ │ +d_currentOffset(0), d_format(PF_RGBA) │ │ │ │ │ + 37{ │ │ │ │ │ + 38} │ │ │ │ │ + 39 │ │ │ │ │ + 40 │ │ │ │ │ + 41inline ImageContext::~ImageContext() │ │ │ │ │ + 42{ │ │ │ │ │ + 43} │ │ │ │ │ + 44 │ │ │ │ │ + 45 │ │ │ │ │ + 46inline void ImageContext::setDestination(byte* pixels, size_t length, │ │ │ │ │ +PixelFormat format) │ │ │ │ │ + 47{ │ │ │ │ │ + 48 d_pixels = pixels; │ │ │ │ │ + 49 d_length = length; │ │ │ │ │ + 50 d_currentOffset = 0; │ │ │ │ │ + 51 d_format = format; │ │ │ │ │ + 52} │ │ │ │ │ 53 │ │ │ │ │ - 54}; │ │ │ │ │ - 55 │ │ │ │ │ - 56} // End of section namespace SILLY │ │ │ │ │ - 57 │ │ │ │ │ - 58// Inclue inline function when needed │ │ │ │ │ - 59#ifdef SILLY_OPT_INLINE │ │ │ │ │ - 60#include "SILLYTGAImageLoader.icpp" │ │ │ │ │ - 61#endif │ │ │ │ │ - 62 │ │ │ │ │ - 63#endif // end of guard _SILLYTGAImageLoader_h_ │ │ │ │ │ -SILLY │ │ │ │ │ -Simple Image Loading LibrarY namespace. │ │ │ │ │ -Definition: SILLYJPGImageContext.cpp:46 │ │ │ │ │ -SILLY::PixelFormat │ │ │ │ │ -PixelFormat │ │ │ │ │ -List all pixel format supported. │ │ │ │ │ -Definition: SILLYBase.h:60 │ │ │ │ │ -SILLY::PixelOrigin │ │ │ │ │ -PixelOrigin │ │ │ │ │ -List all pixel origin supported. │ │ │ │ │ -Definition: SILLYBase.h:71 │ │ │ │ │ -SILLY::TGAImageLoader │ │ │ │ │ -Loader for Targa image. │ │ │ │ │ -Definition: SILLYTGAImageLoader.h:44 │ │ │ │ │ -SILLY::TGAImageLoader::loadHeader │ │ │ │ │ -ImageContext * loadHeader(PixelFormat &formatSource, DataSource *data) │ │ │ │ │ -Parse the header of the image and fill the header struct. │ │ │ │ │ -Definition: SILLYTGAImageLoader.cpp:74 │ │ │ │ │ -SILLY::TGAImageLoader::loadImageData │ │ │ │ │ -bool loadImageData(PixelOrigin origin, DataSource *data, ImageContext *context) │ │ │ │ │ -Parse the pixels data of the image and fill the header struct. │ │ │ │ │ -Definition: SILLYTGAImageLoader.cpp:134 │ │ │ │ │ -SILLY::DataSource │ │ │ │ │ -This is an abstract class used to provide data to the loader. │ │ │ │ │ -Definition: SILLYDataSource.h:47 │ │ │ │ │ -SILLY::ImageContext │ │ │ │ │ -Store the data needed by an ImageLoader object during the parsing of an image. │ │ │ │ │ -Definition: SILLYImageContext.h:44 │ │ │ │ │ -SILLY::ImageLoader │ │ │ │ │ -This is an abstract class that define the interface of all image loader. │ │ │ │ │ -Definition: SILLYImageLoader.h:47 │ │ │ │ │ + 54inline void ImageContext::setNextPixel(byte red, byte green, byte bleu, byte │ │ │ │ │ +alpha) │ │ │ │ │ + 55{ │ │ │ │ │ + 56 //assert(d_currentOffset < d_length && "ASSERT: try to set a pixel outside │ │ │ │ │ +of the image"); │ │ │ │ │ + 57 switch(d_format) │ │ │ │ │ + 58 { │ │ │ │ │ + 59 case PF_A1B5G5R5: │ │ │ │ │ + 60 // The hard part │ │ │ │ │ + 61 assert(0 && "ASSERT: Not yet implemented"); │ │ │ │ │ + 62 break; │ │ │ │ │ + 63 case PF_RGB: │ │ │ │ │ + 64 // Ignore alpha channel │ │ │ │ │ + 65 d_pixels[d_currentOffset++] = red; │ │ │ │ │ + 66 d_pixels[d_currentOffset++] = green; │ │ │ │ │ + 67 d_pixels[d_currentOffset++] = bleu; │ │ │ │ │ + 68 break; │ │ │ │ │ + 69 │ │ │ │ │ + 70 case PF_RGBA: │ │ │ │ │ + 71 d_pixels[d_currentOffset++] = red; │ │ │ │ │ + 72 d_pixels[d_currentOffset++] = green; │ │ │ │ │ + 73 d_pixels[d_currentOffset++] = bleu; │ │ │ │ │ + 74 d_pixels[d_currentOffset++] = alpha; │ │ │ │ │ + 75 break; │ │ │ │ │ + 76 │ │ │ │ │ + 77 } │ │ │ │ │ + 78} │ │ │ │ │ + 79inline size_t ImageContext::getWidth() const │ │ │ │ │ + 80{ │ │ │ │ │ + 81 return d_width; │ │ │ │ │ + 82} │ │ │ │ │ + 83 │ │ │ │ │ + 84inline void ImageContext::setWidth(size_t width) │ │ │ │ │ + 85{ │ │ │ │ │ + 86 d_width = width; │ │ │ │ │ + 87} │ │ │ │ │ + 88 │ │ │ │ │ + 89inline size_t ImageContext::getHeight() const │ │ │ │ │ + 90{ │ │ │ │ │ + 91 return d_height; │ │ │ │ │ + 92} │ │ │ │ │ + 93 │ │ │ │ │ + 94inline void ImageContext::setHeight(size_t height) │ │ │ │ │ + 95{ │ │ │ │ │ + 96 d_height = height; │ │ │ │ │ + 97} │ │ │ │ │ + 98inline PixelFormat ImageContext::getPixelFormat() const │ │ │ │ │ + 99{ │ │ │ │ │ + 100 return d_format; │ │ │ │ │ + 101} │ │ │ │ │ + 102 │ │ │ │ │ + 103} // End of section namespace SILLY │ │ │ │ │ + 104 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libsilly-doc/html/a00104_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/loaders/SILLYPNGImageLoader.icpp Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/SILLYFileDataSource.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -35,57 +35,88 @@ │ │ │ │ initMenu('',false,false,'search.php','Search'); │ │ │ │ }); │ │ │ │ /* @license-end */ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYPNGImageLoader.icpp
│ │ │ │ +
SILLYFileDataSource.h
│ │ │ │
│ │ │ │
│ │ │ │ -
1/***********************************************************************
│ │ │ │ -
2 filename: SILLYPNGImageLoader.icpp
│ │ │ │ -
3 created: 11 Jun 2006
│ │ │ │ -
4 author: Olivier Delannoy
│ │ │ │ -
5
│ │ │ │ -
6 purpose: Inline definition for PNGImageLoader
│ │ │ │ -
7*************************************************************************/
│ │ │ │ -
8/***************************************************************************
│ │ │ │ -
9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
│ │ │ │ -
10 *
│ │ │ │ -
11 * Permission is hereby granted, free of charge, to any person obtaining
│ │ │ │ -
12 * a copy of this software and associated documentation files (the
│ │ │ │ -
13 * "Software"), to deal in the Software without restriction, including
│ │ │ │ -
14 * without limitation the rights to use, copy, modify, merge, publish,
│ │ │ │ -
15 * distribute, sublicense, and/or sell copies of the Software, and to
│ │ │ │ -
16 * permit persons to whom the Software is furnished to do so, subject to
│ │ │ │ -
17 * the following conditions:
│ │ │ │ -
18 *
│ │ │ │ -
19 * The above copyright notice and this permission notice shall be
│ │ │ │ -
20 * included in all copies or substantial portions of the Software.
│ │ │ │ -
21 *
│ │ │ │ -
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
│ │ │ │ -
23 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
│ │ │ │ -
24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
│ │ │ │ -
25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
│ │ │ │ -
26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
│ │ │ │ -
27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
│ │ │ │ -
28 * OTHER DEALINGS IN THE SOFTWARE.
│ │ │ │ -
29 ***************************************************************************/
│ │ │ │ -
30
│ │ │ │ -
31// Start of section namespace SILLY
│ │ │ │ -
32namespace SILLY
│ │ │ │ -
33{
│ │ │ │ -
34
│ │ │ │ -
35} // End of section namespace SILLY
│ │ │ │ -
36
│ │ │ │ +
1/***********************************************************************
│ │ │ │ +
2 filename: SILLYFileDataSource.h
│ │ │ │ +
3 created: 20 Jul 2006
│ │ │ │ +
4 author: Olivier Delannoy
│ │ │ │ +
5
│ │ │ │ +
6 purpose: Provide file based image loading
│ │ │ │ +
7*************************************************************************/
│ │ │ │ +
8/***************************************************************************
│ │ │ │ +
9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
│ │ │ │ +
10 *
│ │ │ │ +
11 * Permission is hereby granted, free of charge, to any person obtaining
│ │ │ │ +
12 * a copy of this software and associated documentation files (the
│ │ │ │ +
13 * "Software"), to deal in the Software without restriction, including
│ │ │ │ +
14 * without limitation the rights to use, copy, modify, merge, publish,
│ │ │ │ +
15 * distribute, sublicense, and/or sell copies of the Software, and to
│ │ │ │ +
16 * permit persons to whom the Software is furnished to do so, subject to
│ │ │ │ +
17 * the following conditions:
│ │ │ │ +
18 *
│ │ │ │ +
19 * The above copyright notice and this permission notice shall be
│ │ │ │ +
20 * included in all copies or substantial portions of the Software.
│ │ │ │ +
21 *
│ │ │ │ +
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
│ │ │ │ +
23 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
│ │ │ │ +
24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
│ │ │ │ +
25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
│ │ │ │ +
26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
│ │ │ │ +
27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
│ │ │ │ +
28 * OTHER DEALINGS IN THE SOFTWARE.
│ │ │ │ +
29 ***************************************************************************/
│ │ │ │ +
30#ifndef _SILLYFileDataSource_h_
│ │ │ │ +
31#define _SILLYFileDataSource_h_
│ │ │ │ +
32#include "SILLYBase.h"
│ │ │ │ +
33#include "SILLYDataSource.h"
│ │ │ │ +
34// Start of section namespace SILLY
│ │ │ │ +
35namespace SILLY
│ │ │ │ +
36{
│ │ │ │ +
37
│ │ │ │ +
48class SILLY_EXPORT FileDataSource : public DataSource
│ │ │ │ +
49{
│ │ │ │ +
50public:
│ │ │ │ +
60 FileDataSource(const char* filename);
│ │ │ │ + │ │ │ │ +
73 bool isValid() const;
│ │ │ │ +
74
│ │ │ │ +
75 const byte* getDataPtr() const;
│ │ │ │ +
76 size_t getSize() const;
│ │ │ │ +
77private:
│ │ │ │ +
78 bool d_error;
│ │ │ │ +
79 byte* d_bytes;
│ │ │ │ +
80 size_t d_size;
│ │ │ │ +
81};
│ │ │ │ +
82
│ │ │ │ +
83
│ │ │ │ +
84} // End of section namespace SILLY
│ │ │ │ +
85
│ │ │ │ +
86// Inclue inline function when needed
│ │ │ │ +
87#ifdef SILLY_OPT_INLINE
│ │ │ │ +
88#include "SILLYFileDataSource.icpp"
│ │ │ │ +
89#endif
│ │ │ │ +
90
│ │ │ │ +
91#endif // end of guard _SILLYFileDataSource_h_
│ │ │ │ +
Simple Image Loading LibrarY namespace.
│ │ │ │ +
This is an abstract class used to provide data to the loader.
│ │ │ │ +
This class allow the loading of an image directly from a file.
│ │ │ │ +
const byte * getDataPtr() const
Get raw access to the image data.
│ │ │ │ +
bool isValid() const
Check wether the loading is successfull or not.
│ │ │ │ +
size_t getSize() const
Return the size of the data.
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,22 +4,21 @@ │ │ │ │ │ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ │ │ │ │ │ * build │ │ │ │ │ * reproducible-path │ │ │ │ │ * silly-0.1.0 │ │ │ │ │ * include │ │ │ │ │ - * loaders │ │ │ │ │ -SILLYPNGImageLoader.icpp │ │ │ │ │ +SILLYFileDataSource.h │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ - 2 filename: SILLYPNGImageLoader.icpp │ │ │ │ │ - 3 created: 11 Jun 2006 │ │ │ │ │ + 2 filename: SILLYFileDataSource.h │ │ │ │ │ + 3 created: 20 Jul 2006 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ - 6 purpose: Inline definition for PNGImageLoader │ │ │ │ │ + 6 purpose: Provide file based image loading │ │ │ │ │ 7*************************************************************************/ │ │ │ │ │ 8/*************************************************************************** │ │ │ │ │ 9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team │ │ │ │ │ 10 * │ │ │ │ │ 11 * Permission is hereby granted, free of charge, to any person obtaining │ │ │ │ │ 12 * a copy of this software and associated documentation files (the │ │ │ │ │ 13 * "Software"), to deal in the Software without restriction, including │ │ │ │ │ @@ -36,17 +35,60 @@ │ │ │ │ │ 24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. │ │ │ │ │ 25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR │ │ │ │ │ 26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ │ │ │ │ 27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR │ │ │ │ │ 28 * OTHER DEALINGS IN THE SOFTWARE. │ │ │ │ │ 29 │ │ │ │ │ ***************************************************************************/ │ │ │ │ │ - 30 │ │ │ │ │ - 31// Start of section namespace SILLY │ │ │ │ │ - 32namespace SILLY │ │ │ │ │ - 33{ │ │ │ │ │ - 34 │ │ │ │ │ - 35} // End of section namespace SILLY │ │ │ │ │ - 36 │ │ │ │ │ + 30#ifndef _SILLYFileDataSource_h_ │ │ │ │ │ + 31#define _SILLYFileDataSource_h_ │ │ │ │ │ + 32#include "SILLYBase.h" │ │ │ │ │ + 33#include "SILLYDataSource.h" │ │ │ │ │ + 34// Start of section namespace SILLY │ │ │ │ │ + 35namespace SILLY │ │ │ │ │ + 36{ │ │ │ │ │ + 37 │ │ │ │ │ +48class SILLY_EXPORT FileDataSource : public DataSource │ │ │ │ │ + 49{ │ │ │ │ │ + 50public: │ │ │ │ │ + 60 FileDataSource(const char* filename); │ │ │ │ │ + 64 ~FileDataSource(); │ │ │ │ │ +73 bool isValid() const; │ │ │ │ │ + 74 │ │ │ │ │ +75 const byte* getDataPtr() const; │ │ │ │ │ +76 size_t getSize() const; │ │ │ │ │ + 77private: │ │ │ │ │ + 78 bool d_error; │ │ │ │ │ + 79 byte* d_bytes; │ │ │ │ │ + 80 size_t d_size; │ │ │ │ │ + 81}; │ │ │ │ │ + 82 │ │ │ │ │ + 83 │ │ │ │ │ + 84} // End of section namespace SILLY │ │ │ │ │ + 85 │ │ │ │ │ + 86// Inclue inline function when needed │ │ │ │ │ + 87#ifdef SILLY_OPT_INLINE │ │ │ │ │ + 88#include "SILLYFileDataSource.icpp" │ │ │ │ │ + 89#endif │ │ │ │ │ + 90 │ │ │ │ │ + 91#endif // end of guard _SILLYFileDataSource_h_ │ │ │ │ │ +SILLY │ │ │ │ │ +Simple Image Loading LibrarY namespace. │ │ │ │ │ +Definition: SILLYJPGImageContext.cpp:46 │ │ │ │ │ +SILLY::DataSource │ │ │ │ │ +This is an abstract class used to provide data to the loader. │ │ │ │ │ +Definition: SILLYDataSource.h:47 │ │ │ │ │ +SILLY::FileDataSource │ │ │ │ │ +This class allow the loading of an image directly from a file. │ │ │ │ │ +Definition: SILLYFileDataSource.h:49 │ │ │ │ │ +SILLY::FileDataSource::getDataPtr │ │ │ │ │ +const byte * getDataPtr() const │ │ │ │ │ +Get raw access to the image data. │ │ │ │ │ +SILLY::FileDataSource::isValid │ │ │ │ │ +bool isValid() const │ │ │ │ │ +Check wether the loading is successfull or not. │ │ │ │ │ +SILLY::FileDataSource::getSize │ │ │ │ │ +size_t getSize() const │ │ │ │ │ +Return the size of the data. │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libsilly-doc/html/a00107_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/loaders/SILLYTGAImageLoader.icpp Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/SILLYImage.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -35,57 +35,128 @@ │ │ │ │ initMenu('',false,false,'search.php','Search'); │ │ │ │ }); │ │ │ │ /* @license-end */ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYTGAImageLoader.icpp
│ │ │ │ +
SILLYImage.h
│ │ │ │
│ │ │ │
│ │ │ │ -
1/***********************************************************************
│ │ │ │ -
2 filename: SILLYTGAImageLoader.icpp
│ │ │ │ -
3 created: 11 Jun 2006
│ │ │ │ -
4 author: Olivier Delannoy
│ │ │ │ -
5
│ │ │ │ -
6 purpose: Inline defintion of TGAImageLoader class
│ │ │ │ -
7*************************************************************************/
│ │ │ │ -
8/***************************************************************************
│ │ │ │ -
9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
│ │ │ │ -
10 *
│ │ │ │ -
11 * Permission is hereby granted, free of charge, to any person obtaining
│ │ │ │ -
12 * a copy of this software and associated documentation files (the
│ │ │ │ -
13 * "Software"), to deal in the Software without restriction, including
│ │ │ │ -
14 * without limitation the rights to use, copy, modify, merge, publish,
│ │ │ │ -
15 * distribute, sublicense, and/or sell copies of the Software, and to
│ │ │ │ -
16 * permit persons to whom the Software is furnished to do so, subject to
│ │ │ │ -
17 * the following conditions:
│ │ │ │ -
18 *
│ │ │ │ -
19 * The above copyright notice and this permission notice shall be
│ │ │ │ -
20 * included in all copies or substantial portions of the Software.
│ │ │ │ -
21 *
│ │ │ │ -
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
│ │ │ │ -
23 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
│ │ │ │ -
24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
│ │ │ │ -
25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
│ │ │ │ -
26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
│ │ │ │ -
27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
│ │ │ │ -
28 * OTHER DEALINGS IN THE SOFTWARE.
│ │ │ │ -
29 ***************************************************************************/
│ │ │ │ -
30
│ │ │ │ -
31// Start of section namespace SILLY
│ │ │ │ -
32namespace SILLY
│ │ │ │ -
33{
│ │ │ │ -
34
│ │ │ │ -
35} // End of section namespace SILLY
│ │ │ │ -
36
│ │ │ │ +
1
│ │ │ │ +
2/***********************************************************************
│ │ │ │ +
3 filename: SILLYImage.h
│ │ │ │ +
4 created: 10 Jun 2006
│ │ │ │ +
5 author: Olivier Delannoy
│ │ │ │ +
6
│ │ │ │ +
7 purpose: Image class definition
│ │ │ │ +
8*************************************************************************/
│ │ │ │ +
9/***************************************************************************
│ │ │ │ +
10 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
│ │ │ │ +
11 *
│ │ │ │ +
12 * Permission is hereby granted, free of charge, to any person obtaining
│ │ │ │ +
13 * a copy of this software and associated documentation files (the
│ │ │ │ +
14 * "Software"), to deal in the Software without restriction, including
│ │ │ │ +
15 * without limitation the rights to use, copy, modify, merge, publish,
│ │ │ │ +
16 * distribute, sublicense, and/or sell copies of the Software, and to
│ │ │ │ +
17 * permit persons to whom the Software is furnished to do so, subject to
│ │ │ │ +
18 * the following conditions:
│ │ │ │ +
19 *
│ │ │ │ +
20 * The above copyright notice and this permission notice shall be
│ │ │ │ +
21 * included in all copies or substantial portions of the Software.
│ │ │ │ +
22 *
│ │ │ │ +
23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
│ │ │ │ +
24 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
│ │ │ │ +
25 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
│ │ │ │ +
26 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
│ │ │ │ +
27 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
│ │ │ │ +
28 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
│ │ │ │ +
29 * OTHER DEALINGS IN THE SOFTWARE.
│ │ │ │ +
30 ***************************************************************************/
│ │ │ │ +
31#ifndef _SILLYImage_h_
│ │ │ │ +
32#define _SILLYImage_h_
│ │ │ │ +
33#include "SILLYBase.h"
│ │ │ │ +
34#include "SILLYImageContext.h"
│ │ │ │ +
35#include "SILLYDataSource.h"
│ │ │ │ +
36#include "SILLYImageLoader.h"
│ │ │ │ +
37
│ │ │ │ +
38// Start of section namespace SILLY
│ │ │ │ +
39namespace SILLY
│ │ │ │ +
40{
│ │ │ │ +
41
│ │ │ │ +
46class SILLY_EXPORT Image
│ │ │ │ +
47{
│ │ │ │ +
48public:
│ │ │ │ +
55 Image(DataSource& data);
│ │ │ │ +
56
│ │ │ │ + │ │ │ │ +
62
│ │ │ │ +
67 bool isValid() const;
│ │ │ │ +
68
│ │ │ │ +
69
│ │ │ │ +
76 bool loadImageHeader();
│ │ │ │ +
77
│ │ │ │ +
91 bool loadImageData(PixelFormat resultFormat = PF_RGBA, PixelOrigin origin = PO_TOP_LEFT);
│ │ │ │ +
92
│ │ │ │ +
97 size_t getWidth() const;
│ │ │ │ +
98
│ │ │ │ +
103 size_t getHeight() const;
│ │ │ │ +
104
│ │ │ │ + │ │ │ │ +
110
│ │ │ │ + │ │ │ │ +
116
│ │ │ │ +
120 const byte* getPixelsDataPtr() const;
│ │ │ │ +
125 size_t getPixelsDataSize() const;
│ │ │ │ +
130 const char* getLoaderIdentifierString() const;
│ │ │ │ +
131private:
│ │ │ │ +
132 bool allocate();
│ │ │ │ +
133
│ │ │ │ +
134private:
│ │ │ │ +
135
│ │ │ │ +
136 size_t d_bpp;
│ │ │ │ +
137 PixelFormat d_pfSource;
│ │ │ │ +
138 byte* d_pixels;
│ │ │ │ +
139 DataSource* d_data;
│ │ │ │ +
140 ImageContext* d_imageContext;
│ │ │ │ +
141 ImageLoader* d_imageLoader;
│ │ │ │ +
142
│ │ │ │ +
143 // Disabled operation
│ │ │ │ +
144 Image(Image&);
│ │ │ │ +
145 Image& operator=(Image&);
│ │ │ │ +
146};
│ │ │ │ +
147
│ │ │ │ +
148} // End of section namespace SILLY
│ │ │ │ +
149
│ │ │ │ +
150// Inclue inline function when needed
│ │ │ │ +
151#ifdef SILLY_OPT_INLINE
│ │ │ │ +
152#include "SILLYImage.icpp"
│ │ │ │ +
153#endif
│ │ │ │ +
154
│ │ │ │ +
155#endif // end of guard _SILLYImage_h_
│ │ │ │ +
Simple Image Loading LibrarY namespace.
│ │ │ │ +
PixelFormat
List all pixel format supported.
Definition: SILLYBase.h:60
│ │ │ │ +
PixelOrigin
List all pixel origin supported.
Definition: SILLYBase.h:71
│ │ │ │ +
This is an abstract class used to provide data to the loader.
│ │ │ │ +
Image is the main user class of the library.
Definition: SILLYImage.h:47
│ │ │ │ +
PixelFormat getSourcePixelFormat() const
Retrieve the pixel format used for the image storage.
│ │ │ │ +
const char * getLoaderIdentifierString() const
Get Image loader identifier string.
│ │ │ │ +
const byte * getPixelsDataPtr() const
Get a pointer to the pixels data.
│ │ │ │ +
bool isValid() const
Return true if the image is valid after its loading.
│ │ │ │ +
size_t getPixelsDataSize() const
Get the size of the pixel buffer.
│ │ │ │ +
~Image()
Destructor.
│ │ │ │ +
size_t getWidth() const
Retrieve the width of the image.
│ │ │ │ +
PixelFormat getPixelFormat() const
Retrieve the pixel format of the resulting image.
│ │ │ │ +
size_t getHeight() const
Retrieve the height of the image.
│ │ │ │ +
Store the data needed by an ImageLoader object during the parsing of an image.
│ │ │ │ +
This is an abstract class that define the interface of all image loader.
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,49 +4,154 @@ │ │ │ │ │ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ │ │ │ │ │ * build │ │ │ │ │ * reproducible-path │ │ │ │ │ * silly-0.1.0 │ │ │ │ │ * include │ │ │ │ │ - * loaders │ │ │ │ │ -SILLYTGAImageLoader.icpp │ │ │ │ │ - 1/*********************************************************************** │ │ │ │ │ - 2 filename: SILLYTGAImageLoader.icpp │ │ │ │ │ - 3 created: 11 Jun 2006 │ │ │ │ │ - 4 author: Olivier Delannoy │ │ │ │ │ - 5 │ │ │ │ │ - 6 purpose: Inline defintion of TGAImageLoader class │ │ │ │ │ - 7*************************************************************************/ │ │ │ │ │ - 8/*************************************************************************** │ │ │ │ │ - 9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team │ │ │ │ │ - 10 * │ │ │ │ │ - 11 * Permission is hereby granted, free of charge, to any person obtaining │ │ │ │ │ - 12 * a copy of this software and associated documentation files (the │ │ │ │ │ - 13 * "Software"), to deal in the Software without restriction, including │ │ │ │ │ - 14 * without limitation the rights to use, copy, modify, merge, publish, │ │ │ │ │ - 15 * distribute, sublicense, and/or sell copies of the Software, and to │ │ │ │ │ - 16 * permit persons to whom the Software is furnished to do so, subject to │ │ │ │ │ - 17 * the following conditions: │ │ │ │ │ - 18 * │ │ │ │ │ - 19 * The above copyright notice and this permission notice shall be │ │ │ │ │ - 20 * included in all copies or substantial portions of the Software. │ │ │ │ │ - 21 * │ │ │ │ │ - 22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, │ │ │ │ │ - 23 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF │ │ │ │ │ - 24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. │ │ │ │ │ - 25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR │ │ │ │ │ - 26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ │ │ │ │ - 27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR │ │ │ │ │ - 28 * OTHER DEALINGS IN THE SOFTWARE. │ │ │ │ │ - 29 │ │ │ │ │ -***************************************************************************/ │ │ │ │ │ +SILLYImage.h │ │ │ │ │ + 1 │ │ │ │ │ + 2/*********************************************************************** │ │ │ │ │ + 3 filename: SILLYImage.h │ │ │ │ │ + 4 created: 10 Jun 2006 │ │ │ │ │ + 5 author: Olivier Delannoy │ │ │ │ │ + 6 │ │ │ │ │ + 7 purpose: Image class definition │ │ │ │ │ + 8*************************************************************************/ │ │ │ │ │ + 9/*************************************************************************** │ │ │ │ │ + 10 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team │ │ │ │ │ + 11 * │ │ │ │ │ + 12 * Permission is hereby granted, free of charge, to any person obtaining │ │ │ │ │ + 13 * a copy of this software and associated documentation files (the │ │ │ │ │ + 14 * "Software"), to deal in the Software without restriction, including │ │ │ │ │ + 15 * without limitation the rights to use, copy, modify, merge, publish, │ │ │ │ │ + 16 * distribute, sublicense, and/or sell copies of the Software, and to │ │ │ │ │ + 17 * permit persons to whom the Software is furnished to do so, subject to │ │ │ │ │ + 18 * the following conditions: │ │ │ │ │ + 19 * │ │ │ │ │ + 20 * The above copyright notice and this permission notice shall be │ │ │ │ │ + 21 * included in all copies or substantial portions of the Software. │ │ │ │ │ + 22 * │ │ │ │ │ + 23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, │ │ │ │ │ + 24 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF │ │ │ │ │ + 25 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. │ │ │ │ │ + 26 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR │ │ │ │ │ + 27 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ │ │ │ │ + 28 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR │ │ │ │ │ + 29 * OTHER DEALINGS IN THE SOFTWARE. │ │ │ │ │ 30 │ │ │ │ │ - 31// Start of section namespace SILLY │ │ │ │ │ - 32namespace SILLY │ │ │ │ │ - 33{ │ │ │ │ │ - 34 │ │ │ │ │ - 35} // End of section namespace SILLY │ │ │ │ │ - 36 │ │ │ │ │ +***************************************************************************/ │ │ │ │ │ + 31#ifndef _SILLYImage_h_ │ │ │ │ │ + 32#define _SILLYImage_h_ │ │ │ │ │ + 33#include "SILLYBase.h" │ │ │ │ │ + 34#include "SILLYImageContext.h" │ │ │ │ │ + 35#include "SILLYDataSource.h" │ │ │ │ │ + 36#include "SILLYImageLoader.h" │ │ │ │ │ + 37 │ │ │ │ │ + 38// Start of section namespace SILLY │ │ │ │ │ + 39namespace SILLY │ │ │ │ │ + 40{ │ │ │ │ │ + 41 │ │ │ │ │ +46class SILLY_EXPORT Image │ │ │ │ │ + 47{ │ │ │ │ │ + 48public: │ │ │ │ │ + 55 Image(DataSource& data); │ │ │ │ │ + 56 │ │ │ │ │ +61 ~Image(); │ │ │ │ │ + 62 │ │ │ │ │ +67 bool isValid() const; │ │ │ │ │ + 68 │ │ │ │ │ + 69 │ │ │ │ │ + 76 bool loadImageHeader(); │ │ │ │ │ + 77 │ │ │ │ │ + 91 bool loadImageData(PixelFormat resultFormat = PF_RGBA, PixelOrigin origin = │ │ │ │ │ +PO_TOP_LEFT); │ │ │ │ │ + 92 │ │ │ │ │ +97 size_t getWidth() const; │ │ │ │ │ + 98 │ │ │ │ │ +103 size_t getHeight() const; │ │ │ │ │ + 104 │ │ │ │ │ +109 PixelFormat getSourcePixelFormat() const; │ │ │ │ │ + 110 │ │ │ │ │ +115 PixelFormat getPixelFormat() const; │ │ │ │ │ + 116 │ │ │ │ │ +120 const byte* getPixelsDataPtr() const; │ │ │ │ │ +125 size_t getPixelsDataSize() const; │ │ │ │ │ +130 const char* getLoaderIdentifierString() const; │ │ │ │ │ + 131private: │ │ │ │ │ + 132 bool allocate(); │ │ │ │ │ + 133 │ │ │ │ │ + 134private: │ │ │ │ │ + 135 │ │ │ │ │ + 136 size_t d_bpp; │ │ │ │ │ + 137 PixelFormat d_pfSource; │ │ │ │ │ + 138 byte* d_pixels; │ │ │ │ │ + 139 DataSource* d_data; │ │ │ │ │ + 140 ImageContext* d_imageContext; │ │ │ │ │ + 141 ImageLoader* d_imageLoader; │ │ │ │ │ + 142 │ │ │ │ │ + 143 // Disabled operation │ │ │ │ │ + 144 Image(Image&); │ │ │ │ │ + 145 Image& operator=(Image&); │ │ │ │ │ + 146}; │ │ │ │ │ + 147 │ │ │ │ │ + 148} // End of section namespace SILLY │ │ │ │ │ + 149 │ │ │ │ │ + 150// Inclue inline function when needed │ │ │ │ │ + 151#ifdef SILLY_OPT_INLINE │ │ │ │ │ + 152#include "SILLYImage.icpp" │ │ │ │ │ + 153#endif │ │ │ │ │ + 154 │ │ │ │ │ + 155#endif // end of guard _SILLYImage_h_ │ │ │ │ │ +SILLY │ │ │ │ │ +Simple Image Loading LibrarY namespace. │ │ │ │ │ +Definition: SILLYJPGImageContext.cpp:46 │ │ │ │ │ +SILLY::PixelFormat │ │ │ │ │ +PixelFormat │ │ │ │ │ +List all pixel format supported. │ │ │ │ │ +Definition: SILLYBase.h:60 │ │ │ │ │ +SILLY::PixelOrigin │ │ │ │ │ +PixelOrigin │ │ │ │ │ +List all pixel origin supported. │ │ │ │ │ +Definition: SILLYBase.h:71 │ │ │ │ │ +SILLY::DataSource │ │ │ │ │ +This is an abstract class used to provide data to the loader. │ │ │ │ │ +Definition: SILLYDataSource.h:47 │ │ │ │ │ +SILLY::Image │ │ │ │ │ +Image is the main user class of the library. │ │ │ │ │ +Definition: SILLYImage.h:47 │ │ │ │ │ +SILLY::Image::getSourcePixelFormat │ │ │ │ │ +PixelFormat getSourcePixelFormat() const │ │ │ │ │ +Retrieve the pixel format used for the image storage. │ │ │ │ │ +SILLY::Image::getLoaderIdentifierString │ │ │ │ │ +const char * getLoaderIdentifierString() const │ │ │ │ │ +Get Image loader identifier string. │ │ │ │ │ +SILLY::Image::getPixelsDataPtr │ │ │ │ │ +const byte * getPixelsDataPtr() const │ │ │ │ │ +Get a pointer to the pixels data. │ │ │ │ │ +SILLY::Image::isValid │ │ │ │ │ +bool isValid() const │ │ │ │ │ +Return true if the image is valid after its loading. │ │ │ │ │ +SILLY::Image::getPixelsDataSize │ │ │ │ │ +size_t getPixelsDataSize() const │ │ │ │ │ +Get the size of the pixel buffer. │ │ │ │ │ +SILLY::Image::~Image │ │ │ │ │ +~Image() │ │ │ │ │ +Destructor. │ │ │ │ │ +SILLY::Image::getWidth │ │ │ │ │ +size_t getWidth() const │ │ │ │ │ +Retrieve the width of the image. │ │ │ │ │ +SILLY::Image::getPixelFormat │ │ │ │ │ +PixelFormat getPixelFormat() const │ │ │ │ │ +Retrieve the pixel format of the resulting image. │ │ │ │ │ +SILLY::Image::getHeight │ │ │ │ │ +size_t getHeight() const │ │ │ │ │ +Retrieve the height of the image. │ │ │ │ │ +SILLY::ImageContext │ │ │ │ │ +Store the data needed by an ImageLoader object during the parsing of an image. │ │ │ │ │ +Definition: SILLYImageContext.h:44 │ │ │ │ │ +SILLY::ImageLoader │ │ │ │ │ +This is an abstract class that define the interface of all image loader. │ │ │ │ │ +Definition: SILLYImageLoader.h:47 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libsilly-doc/html/a00110_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/loaders/SILLYJPGImageContext.icpp Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/SILLYImageContext.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -35,57 +35,108 @@ │ │ │ │ initMenu('',false,false,'search.php','Search'); │ │ │ │ }); │ │ │ │ /* @license-end */ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYJPGImageContext.icpp
│ │ │ │ +
SILLYImageContext.h
│ │ │ │
│ │ │ │
│ │ │ │ -
1/***********************************************************************
│ │ │ │ -
2 filename: SILLYJPGImageContext.icpp
│ │ │ │ -
3 created: 11 Jun 2006
│ │ │ │ -
4 author: Olivier Delannoy
│ │ │ │ -
5
│ │ │ │ -
6 purpose: Inline definition for JPG context
│ │ │ │ -
7*************************************************************************/
│ │ │ │ -
8/***************************************************************************
│ │ │ │ -
9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
│ │ │ │ -
10 *
│ │ │ │ -
11 * Permission is hereby granted, free of charge, to any person obtaining
│ │ │ │ -
12 * a copy of this software and associated documentation files (the
│ │ │ │ -
13 * "Software"), to deal in the Software without restriction, including
│ │ │ │ -
14 * without limitation the rights to use, copy, modify, merge, publish,
│ │ │ │ -
15 * distribute, sublicense, and/or sell copies of the Software, and to
│ │ │ │ -
16 * permit persons to whom the Software is furnished to do so, subject to
│ │ │ │ -
17 * the following conditions:
│ │ │ │ -
18 *
│ │ │ │ -
19 * The above copyright notice and this permission notice shall be
│ │ │ │ -
20 * included in all copies or substantial portions of the Software.
│ │ │ │ -
21 *
│ │ │ │ -
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
│ │ │ │ -
23 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
│ │ │ │ -
24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
│ │ │ │ -
25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
│ │ │ │ -
26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
│ │ │ │ -
27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
│ │ │ │ -
28 * OTHER DEALINGS IN THE SOFTWARE.
│ │ │ │ -
29 ***************************************************************************/
│ │ │ │ -
30
│ │ │ │ -
31// Start of section namespace SILLY
│ │ │ │ -
32namespace SILLY
│ │ │ │ -
33{
│ │ │ │ -
34
│ │ │ │ -
35} // End of section namespace SILLY
│ │ │ │ -
36
│ │ │ │ +
1/***********************************************************************
│ │ │ │ +
2 filename: SILLYImageContext.h
│ │ │ │ +
3 created: 10 Jun 2006
│ │ │ │ +
4 author: Olivier Delannoy
│ │ │ │ +
5
│ │ │ │ +
6 purpose: ImageContext is an abstract class used to hide the loader specific data needed during the parsing of an image
│ │ │ │ +
7*************************************************************************/
│ │ │ │ +
8/***************************************************************************
│ │ │ │ +
9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
│ │ │ │ +
10 *
│ │ │ │ +
11 * Permission is hereby granted, free of charge, to any person obtaining
│ │ │ │ +
12 * a copy of this software and associated documentation files (the
│ │ │ │ +
13 * "Software"), to deal in the Software without restriction, including
│ │ │ │ +
14 * without limitation the rights to use, copy, modify, merge, publish,
│ │ │ │ +
15 * distribute, sublicense, and/or sell copies of the Software, and to
│ │ │ │ +
16 * permit persons to whom the Software is furnished to do so, subject to
│ │ │ │ +
17 * the following conditions:
│ │ │ │ +
18 *
│ │ │ │ +
19 * The above copyright notice and this permission notice shall be
│ │ │ │ +
20 * included in all copies or substantial portions of the Software.
│ │ │ │ +
21 *
│ │ │ │ +
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
│ │ │ │ +
23 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
│ │ │ │ +
24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
│ │ │ │ +
25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
│ │ │ │ +
26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
│ │ │ │ +
27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
│ │ │ │ +
28 * OTHER DEALINGS IN THE SOFTWARE.
│ │ │ │ +
29 ***************************************************************************/
│ │ │ │ +
30#ifndef _SILLYImageContext_h_
│ │ │ │ +
31#define _SILLYImageContext_h_
│ │ │ │ +
32#include "SILLYBase.h"
│ │ │ │ +
33
│ │ │ │ +
34// Start of section namespace SILLY
│ │ │ │ +
35namespace SILLY
│ │ │ │ +
36{
│ │ │ │ +
37
│ │ │ │ +
43class SILLY_EXPORT ImageContext
│ │ │ │ +
44{
│ │ │ │ +
45public:
│ │ │ │ +
50 virtual ~ImageContext();
│ │ │ │ +
51
│ │ │ │ +
56 void setDestination(byte* pixels, size_t length, PixelFormat format);
│ │ │ │ +
57
│ │ │ │ +
62 void setNextPixel(byte red, byte green, byte bleu, byte alpha);
│ │ │ │ +
63
│ │ │ │ +
64 size_t getWidth() const;
│ │ │ │ +
65 size_t getHeight() const;
│ │ │ │ +
66 PixelFormat getPixelFormat() const;
│ │ │ │ +
67
│ │ │ │ +
74 bool flipVertically();
│ │ │ │ +
75 protected:
│ │ │ │ +
76 void setWidth(size_t width);
│ │ │ │ +
77
│ │ │ │ +
78 void setHeight(size_t height);
│ │ │ │ +
79
│ │ │ │ +
88 ImageContext(size_t width, size_t height);
│ │ │ │ +
89
│ │ │ │ +
90private:
│ │ │ │ +
91 byte* d_pixels;
│ │ │ │ +
92 size_t d_length;
│ │ │ │ +
93 size_t d_width;
│ │ │ │ +
94 size_t d_height;
│ │ │ │ +
95 size_t d_currentOffset;
│ │ │ │ +
96 PixelFormat d_format;
│ │ │ │ +
97
│ │ │ │ +
98 // Disabled operation
│ │ │ │ + │ │ │ │ +
100 ImageContext& operator=(ImageContext&);
│ │ │ │ +
101};
│ │ │ │ +
102
│ │ │ │ +
103
│ │ │ │ +
104} // End of section namespace SILLY
│ │ │ │ +
105
│ │ │ │ +
106// Inclue inline function when needed
│ │ │ │ +
107#ifdef SILLY_OPT_INLINE
│ │ │ │ +
108#include "SILLYImageContext.icpp"
│ │ │ │ +
109#endif
│ │ │ │ +
110
│ │ │ │ +
111#endif // end of guard _SILLYImageContext_h_
│ │ │ │ +
Simple Image Loading LibrarY namespace.
│ │ │ │ +
PixelFormat
List all pixel format supported.
Definition: SILLYBase.h:60
│ │ │ │ +
Store the data needed by an ImageLoader object during the parsing of an image.
│ │ │ │ +
void setNextPixel(byte red, byte green, byte bleu, byte alpha)
Set the next pixel of the image.
│ │ │ │ +
void setDestination(byte *pixels, size_t length, PixelFormat format)
Set the destination of the loading.
│ │ │ │ +
ImageContext(size_t width, size_t height)
Constructor.
│ │ │ │ +
virtual ~ImageContext()
Destructor.
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,22 +4,22 @@ │ │ │ │ │ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ │ │ │ │ │ * build │ │ │ │ │ * reproducible-path │ │ │ │ │ * silly-0.1.0 │ │ │ │ │ * include │ │ │ │ │ - * loaders │ │ │ │ │ -SILLYJPGImageContext.icpp │ │ │ │ │ +SILLYImageContext.h │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ - 2 filename: SILLYJPGImageContext.icpp │ │ │ │ │ - 3 created: 11 Jun 2006 │ │ │ │ │ + 2 filename: SILLYImageContext.h │ │ │ │ │ + 3 created: 10 Jun 2006 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ - 6 purpose: Inline definition for JPG context │ │ │ │ │ + 6 purpose: ImageContext is an abstract class used to hide the loader specific │ │ │ │ │ +data needed during the parsing of an image │ │ │ │ │ 7*************************************************************************/ │ │ │ │ │ 8/*************************************************************************** │ │ │ │ │ 9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team │ │ │ │ │ 10 * │ │ │ │ │ 11 * Permission is hereby granted, free of charge, to any person obtaining │ │ │ │ │ 12 * a copy of this software and associated documentation files (the │ │ │ │ │ 13 * "Software"), to deal in the Software without restriction, including │ │ │ │ │ @@ -36,17 +36,83 @@ │ │ │ │ │ 24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. │ │ │ │ │ 25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR │ │ │ │ │ 26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ │ │ │ │ 27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR │ │ │ │ │ 28 * OTHER DEALINGS IN THE SOFTWARE. │ │ │ │ │ 29 │ │ │ │ │ ***************************************************************************/ │ │ │ │ │ - 30 │ │ │ │ │ - 31// Start of section namespace SILLY │ │ │ │ │ - 32namespace SILLY │ │ │ │ │ - 33{ │ │ │ │ │ - 34 │ │ │ │ │ - 35} // End of section namespace SILLY │ │ │ │ │ - 36 │ │ │ │ │ + 30#ifndef _SILLYImageContext_h_ │ │ │ │ │ + 31#define _SILLYImageContext_h_ │ │ │ │ │ + 32#include "SILLYBase.h" │ │ │ │ │ + 33 │ │ │ │ │ + 34// Start of section namespace SILLY │ │ │ │ │ + 35namespace SILLY │ │ │ │ │ + 36{ │ │ │ │ │ + 37 │ │ │ │ │ +43class SILLY_EXPORT ImageContext │ │ │ │ │ + 44{ │ │ │ │ │ + 45public: │ │ │ │ │ +50 virtual ~ImageContext(); │ │ │ │ │ + 51 │ │ │ │ │ +56 void setDestination(byte* pixels, size_t length, PixelFormat format); │ │ │ │ │ + 57 │ │ │ │ │ +62 void setNextPixel(byte red, byte green, byte bleu, byte alpha); │ │ │ │ │ + 63 │ │ │ │ │ + 64 size_t getWidth() const; │ │ │ │ │ + 65 size_t getHeight() const; │ │ │ │ │ + 66 PixelFormat getPixelFormat() const; │ │ │ │ │ + 67 │ │ │ │ │ + 74 bool flipVertically(); │ │ │ │ │ + 75 protected: │ │ │ │ │ + 76 void setWidth(size_t width); │ │ │ │ │ + 77 │ │ │ │ │ + 78 void setHeight(size_t height); │ │ │ │ │ + 79 │ │ │ │ │ +88 ImageContext(size_t width, size_t height); │ │ │ │ │ + 89 │ │ │ │ │ + 90private: │ │ │ │ │ + 91 byte* d_pixels; │ │ │ │ │ + 92 size_t d_length; │ │ │ │ │ + 93 size_t d_width; │ │ │ │ │ + 94 size_t d_height; │ │ │ │ │ + 95 size_t d_currentOffset; │ │ │ │ │ + 96 PixelFormat d_format; │ │ │ │ │ + 97 │ │ │ │ │ + 98 // Disabled operation │ │ │ │ │ + 99 ImageContext(ImageContext&); │ │ │ │ │ + 100 ImageContext& operator=(ImageContext&); │ │ │ │ │ + 101}; │ │ │ │ │ + 102 │ │ │ │ │ + 103 │ │ │ │ │ + 104} // End of section namespace SILLY │ │ │ │ │ + 105 │ │ │ │ │ + 106// Inclue inline function when needed │ │ │ │ │ + 107#ifdef SILLY_OPT_INLINE │ │ │ │ │ + 108#include "SILLYImageContext.icpp" │ │ │ │ │ + 109#endif │ │ │ │ │ + 110 │ │ │ │ │ + 111#endif // end of guard _SILLYImageContext_h_ │ │ │ │ │ +SILLY │ │ │ │ │ +Simple Image Loading LibrarY namespace. │ │ │ │ │ +Definition: SILLYJPGImageContext.cpp:46 │ │ │ │ │ +SILLY::PixelFormat │ │ │ │ │ +PixelFormat │ │ │ │ │ +List all pixel format supported. │ │ │ │ │ +Definition: SILLYBase.h:60 │ │ │ │ │ +SILLY::ImageContext │ │ │ │ │ +Store the data needed by an ImageLoader object during the parsing of an image. │ │ │ │ │ +Definition: SILLYImageContext.h:44 │ │ │ │ │ +SILLY::ImageContext::setNextPixel │ │ │ │ │ +void setNextPixel(byte red, byte green, byte bleu, byte alpha) │ │ │ │ │ +Set the next pixel of the image. │ │ │ │ │ +SILLY::ImageContext::setDestination │ │ │ │ │ +void setDestination(byte *pixels, size_t length, PixelFormat format) │ │ │ │ │ +Set the destination of the loading. │ │ │ │ │ +SILLY::ImageContext::ImageContext │ │ │ │ │ +ImageContext(size_t width, size_t height) │ │ │ │ │ +Constructor. │ │ │ │ │ +SILLY::ImageContext::~ImageContext │ │ │ │ │ +virtual ~ImageContext() │ │ │ │ │ +Destructor. │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libsilly-doc/html/a00113_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/SILLY.h Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/SILLYBase.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -39,23 +39,23 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLY.h
│ │ │ │ +
SILLYBase.h
│ │ │ │
│ │ │ │
│ │ │ │
1/***********************************************************************
│ │ │ │ -
2 filename: SILLY.h
│ │ │ │ -
3 created: 10 Jun 2006
│ │ │ │ +
2 filename: SILLYBase.h
│ │ │ │ +
3 created: 2006/06/10
│ │ │ │
4 author: Olivier Delannoy
│ │ │ │
5
│ │ │ │ -
6 purpose: Master include for the SILLY library
│ │ │ │ +
6 purpose: Common header for the SILLY library
│ │ │ │
7*************************************************************************/
│ │ │ │
8/***************************************************************************
│ │ │ │
9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
│ │ │ │
10 *
│ │ │ │
11 * Permission is hereby granted, free of charge, to any person obtaining
│ │ │ │
12 * a copy of this software and associated documentation files (the
│ │ │ │
13 * "Software"), to deal in the Software without restriction, including
│ │ │ │ @@ -71,35 +71,67 @@ │ │ │ │
23 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
│ │ │ │
24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
│ │ │ │
25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
│ │ │ │
26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
│ │ │ │
27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
│ │ │ │
28 * OTHER DEALINGS IN THE SOFTWARE.
│ │ │ │
29 ***************************************************************************/
│ │ │ │ -
30#ifndef _SILLY_h_
│ │ │ │ -
31#define _SILLY_h_
│ │ │ │ -
109namespace SILLY
│ │ │ │ -
110{
│ │ │ │ -
111
│ │ │ │ -
112}
│ │ │ │ -
113
│ │ │ │ -
114
│ │ │ │ -
115
│ │ │ │ -
116
│ │ │ │ -
117#include "SILLYBase.h"
│ │ │ │ -
118#include "SILLYDataSource.h"
│ │ │ │ -
119#include "SILLYFileDataSource.h"
│ │ │ │ -
120#include "SILLYMemoryDataSource.h"
│ │ │ │ -
121#include "SILLYImageLoader.h"
│ │ │ │ -
122#include "SILLYImageContext.h"
│ │ │ │ -
123#include "SILLYImageLoaderManager.h"
│ │ │ │ -
124#include "SILLYImage.h"
│ │ │ │ -
125
│ │ │ │ -
126#endif // end of guard _SILLY_h_
│ │ │ │ -
Simple Image Loading LibrarY namespace.
│ │ │ │ +
30#ifndef _SILLYBase_h_
│ │ │ │ +
31#define _SILLYBase_h_
│ │ │ │ +
32#include <cassert>
│ │ │ │ +
33#include <cstddef>
│ │ │ │ +
34
│ │ │ │ +
35#if defined(USE_SILLYOPTIONS_H)
│ │ │ │ +
36#include "SILLYOptions.h"
│ │ │ │ +
37#endif
│ │ │ │ +
38
│ │ │ │ +
39#if defined(_WIN32) || defined(__WIN32__)
│ │ │ │ +
40# undef SILLY_OPT_INLINE // No inlining
│ │ │ │ +
41# undef SILLY_BE // Little Endian
│ │ │ │ +
42# ifdef SILLY_EXPORTS
│ │ │ │ +
43# define SILLY_EXPORT __declspec(dllexport)
│ │ │ │ +
44# else
│ │ │ │ +
45# define SILLY_EXPORT __declspec(dllimport)
│ │ │ │ +
46# endif
│ │ │ │ +
47#else
│ │ │ │ +
48# define SILLY_EXPORT
│ │ │ │ +
49#endif
│ │ │ │ +
50
│ │ │ │ +
51// Start of section namespace SILLY
│ │ │ │ +
52namespace SILLY
│ │ │ │ +
53{
│ │ │ │ +
54
│ │ │ │ + │ │ │ │ +
60{
│ │ │ │ +
61 PF_A1B5G5R5, //<! 16 bits, pixel format is A1R5G5B5 (GGGBBBBB,ARRRRRGG on disk)
│ │ │ │ +
62 PF_RGB, //<! 24 bits, pixel format is 8 bits for R, G, B
│ │ │ │ +
63 PF_RGBA, //<! 32 bits, pixel format is 8 bits for R, G, B and A channel
│ │ │ │ +
64 PF_ORIGIN, //<! This format is used when the input storage use a specific pixel format
│ │ │ │ +
65};
│ │ │ │ + │ │ │ │ +
71{
│ │ │ │ +
72 PO_TOP_LEFT, //<! The resulting image origine is Top Left
│ │ │ │ +
73 PO_BOTTOM_LEFT, //<! The resulting image origine is Bottom Left
│ │ │ │ +
74};
│ │ │ │ +
75
│ │ │ │ +
80typedef unsigned char byte;
│ │ │ │ +
88bool SILLY_EXPORT SILLYInit();
│ │ │ │ +
89
│ │ │ │ +
94void SILLY_EXPORT SILLYCleanup();
│ │ │ │ +
95
│ │ │ │ +
96} // End of section namespace SILLY
│ │ │ │ +
97
│ │ │ │ +
98#endif // end of guard _SILLYBase_h_
│ │ │ │ +
99
│ │ │ │ +
Simple Image Loading LibrarY namespace.
│ │ │ │ +
unsigned char byte
Typename for a byte.
Definition: SILLYBase.h:80
│ │ │ │ +
void SILLYCleanup()
Cleanup SILLY library internal.
│ │ │ │ +
PixelFormat
List all pixel format supported.
Definition: SILLYBase.h:60
│ │ │ │ +
bool SILLYInit()
Initialize the SILLY Library.
│ │ │ │ +
PixelOrigin
List all pixel origin supported.
Definition: SILLYBase.h:71
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,21 +4,21 @@ │ │ │ │ │ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ │ │ │ │ │ * build │ │ │ │ │ * reproducible-path │ │ │ │ │ * silly-0.1.0 │ │ │ │ │ * include │ │ │ │ │ -SILLY.h │ │ │ │ │ +SILLYBase.h │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ - 2 filename: SILLY.h │ │ │ │ │ - 3 created: 10 Jun 2006 │ │ │ │ │ + 2 filename: SILLYBase.h │ │ │ │ │ + 3 created: 2006/06/10 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ - 6 purpose: Master include for the SILLY library │ │ │ │ │ + 6 purpose: Common header for the SILLY library │ │ │ │ │ 7*************************************************************************/ │ │ │ │ │ 8/*************************************************************************** │ │ │ │ │ 9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team │ │ │ │ │ 10 * │ │ │ │ │ 11 * Permission is hereby granted, free of charge, to any person obtaining │ │ │ │ │ 12 * a copy of this software and associated documentation files (the │ │ │ │ │ 13 * "Software"), to deal in the Software without restriction, including │ │ │ │ │ @@ -35,33 +35,82 @@ │ │ │ │ │ 24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. │ │ │ │ │ 25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR │ │ │ │ │ 26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ │ │ │ │ 27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR │ │ │ │ │ 28 * OTHER DEALINGS IN THE SOFTWARE. │ │ │ │ │ 29 │ │ │ │ │ ***************************************************************************/ │ │ │ │ │ - 30#ifndef _SILLY_h_ │ │ │ │ │ - 31#define _SILLY_h_ │ │ │ │ │ - 109namespace SILLY │ │ │ │ │ - 110{ │ │ │ │ │ - 111 │ │ │ │ │ - 112} │ │ │ │ │ - 113 │ │ │ │ │ - 114 │ │ │ │ │ - 115 │ │ │ │ │ - 116 │ │ │ │ │ - 117#include "SILLYBase.h" │ │ │ │ │ - 118#include "SILLYDataSource.h" │ │ │ │ │ - 119#include "SILLYFileDataSource.h" │ │ │ │ │ - 120#include "SILLYMemoryDataSource.h" │ │ │ │ │ - 121#include "SILLYImageLoader.h" │ │ │ │ │ - 122#include "SILLYImageContext.h" │ │ │ │ │ - 123#include "SILLYImageLoaderManager.h" │ │ │ │ │ - 124#include "SILLYImage.h" │ │ │ │ │ - 125 │ │ │ │ │ - 126#endif // end of guard _SILLY_h_ │ │ │ │ │ + 30#ifndef _SILLYBase_h_ │ │ │ │ │ + 31#define _SILLYBase_h_ │ │ │ │ │ + 32#include │ │ │ │ │ + 33#include │ │ │ │ │ + 34 │ │ │ │ │ + 35#if defined(USE_SILLYOPTIONS_H) │ │ │ │ │ + 36#include "SILLYOptions.h" │ │ │ │ │ + 37#endif │ │ │ │ │ + 38 │ │ │ │ │ + 39#if defined(_WIN32) || defined(__WIN32__) │ │ │ │ │ + 40# undef SILLY_OPT_INLINE // No inlining │ │ │ │ │ + 41# undef SILLY_BE // Little Endian │ │ │ │ │ + 42# ifdef SILLY_EXPORTS │ │ │ │ │ + 43# define SILLY_EXPORT __declspec(dllexport) │ │ │ │ │ + 44# else │ │ │ │ │ + 45# define SILLY_EXPORT __declspec(dllimport) │ │ │ │ │ + 46# endif │ │ │ │ │ + 47#else │ │ │ │ │ + 48# define SILLY_EXPORT │ │ │ │ │ + 49#endif │ │ │ │ │ + 50 │ │ │ │ │ + 51// Start of section namespace SILLY │ │ │ │ │ + 52namespace SILLY │ │ │ │ │ + 53{ │ │ │ │ │ + 54 │ │ │ │ │ +59enum PixelFormat │ │ │ │ │ + 60{ │ │ │ │ │ + 61 PF_A1B5G5R5, // │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/SILLYImageLoader.h Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/SILLYImageLoaderManager.icpp Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -39,95 +39,79 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYImageLoader.h
│ │ │ │ +
SILLYImageLoaderManager.icpp
│ │ │ │
│ │ │ │
│ │ │ │ -
1/***********************************************************************
│ │ │ │ -
2 filename: SILLYImageLoader.h
│ │ │ │ -
3 created: 10 Jun 2006
│ │ │ │ -
4 author: Olivier Delannoy
│ │ │ │ -
5
│ │ │ │ -
6 purpose: Abstract class for all image loader
│ │ │ │ -
7*************************************************************************/
│ │ │ │ -
8/***************************************************************************
│ │ │ │ -
9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
│ │ │ │ -
10 *
│ │ │ │ -
11 * Permission is hereby granted, free of charge, to any person obtaining
│ │ │ │ -
12 * a copy of this software and associated documentation files (the
│ │ │ │ -
13 * "Software"), to deal in the Software without restriction, including
│ │ │ │ -
14 * without limitation the rights to use, copy, modify, merge, publish,
│ │ │ │ -
15 * distribute, sublicense, and/or sell copies of the Software, and to
│ │ │ │ -
16 * permit persons to whom the Software is furnished to do so, subject to
│ │ │ │ -
17 * the following conditions:
│ │ │ │ -
18 *
│ │ │ │ -
19 * The above copyright notice and this permission notice shall be
│ │ │ │ -
20 * included in all copies or substantial portions of the Software.
│ │ │ │ -
21 *
│ │ │ │ -
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
│ │ │ │ -
23 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
│ │ │ │ -
24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
│ │ │ │ -
25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
│ │ │ │ -
26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
│ │ │ │ -
27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
│ │ │ │ -
28 * OTHER DEALINGS IN THE SOFTWARE.
│ │ │ │ -
29 ***************************************************************************/
│ │ │ │ -
30#ifndef _SILLYImageLoader_h_
│ │ │ │ -
31#define _SILLYImageLoader_h_
│ │ │ │ -
32#include "SILLYBase.h"
│ │ │ │ -
33// Start of section namespace SILLY
│ │ │ │ -
34namespace SILLY
│ │ │ │ +
1/***********************************************************************
│ │ │ │ +
2 filename: SILLYImageLoaderManager.icpp
│ │ │ │ +
3 created: 10 Jun 2006
│ │ │ │ +
4 author: Olivier Delannoy
│ │ │ │ +
5
│ │ │ │ +
6 purpose: Inline definition for ImageLoaderManager class
│ │ │ │ +
7*************************************************************************/
│ │ │ │ +
8/***************************************************************************
│ │ │ │ +
9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
│ │ │ │ +
10 *
│ │ │ │ +
11 * Permission is hereby granted, free of charge, to any person obtaining
│ │ │ │ +
12 * a copy of this software and associated documentation files (the
│ │ │ │ +
13 * "Software"), to deal in the Software without restriction, including
│ │ │ │ +
14 * without limitation the rights to use, copy, modify, merge, publish,
│ │ │ │ +
15 * distribute, sublicense, and/or sell copies of the Software, and to
│ │ │ │ +
16 * permit persons to whom the Software is furnished to do so, subject to
│ │ │ │ +
17 * the following conditions:
│ │ │ │ +
18 *
│ │ │ │ +
19 * The above copyright notice and this permission notice shall be
│ │ │ │ +
20 * included in all copies or substantial portions of the Software.
│ │ │ │ +
21 *
│ │ │ │ +
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
│ │ │ │ +
23 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
│ │ │ │ +
24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
│ │ │ │ +
25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
│ │ │ │ +
26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
│ │ │ │ +
27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
│ │ │ │ +
28 * OTHER DEALINGS IN THE SOFTWARE.
│ │ │ │ +
29 ***************************************************************************/
│ │ │ │ +
30
│ │ │ │ +
31// Start of section namespace SILLY
│ │ │ │ +
32namespace SILLY
│ │ │ │ +
33{
│ │ │ │ +
34inline ImageLoaderList::iterator ImageLoaderManager::begin()
│ │ │ │
35{
│ │ │ │ -
36class DataSource; // Forward declaration
│ │ │ │ -
37class ImageContext; // Forward declaration
│ │ │ │ +
36 return d_loaders.begin();
│ │ │ │ +
37}
│ │ │ │
38
│ │ │ │ -
46class SILLY_EXPORT ImageLoader
│ │ │ │ -
47{
│ │ │ │ -
48protected:
│ │ │ │ -
52 ImageLoader(const char* name);
│ │ │ │ -
53public:
│ │ │ │ -
54
│ │ │ │ -
59 virtual ~ImageLoader();
│ │ │ │ +
39inline ImageLoaderList::iterator ImageLoaderManager::end()
│ │ │ │ +
40{
│ │ │ │ +
41 return d_loaders.end();
│ │ │ │ +
42}
│ │ │ │ +
43
│ │ │ │ +
44inline ImageLoaderManager* ImageLoaderManager::getSingletonPtr()
│ │ │ │ +
45{
│ │ │ │ +
46 return d_instance;
│ │ │ │ +
47}
│ │ │ │ +
48
│ │ │ │ +
49inline ImageLoaderManager& ImageLoaderManager::getSingleton()
│ │ │ │ +
50{
│ │ │ │ +
51 assert(d_instance && "ASSERT: Singleton object not yet created");
│ │ │ │ +
52 return *d_instance;
│ │ │ │ +
53}
│ │ │ │ +
54
│ │ │ │ +
55inline void ImageLoaderManager::add(ImageLoader* loader)
│ │ │ │ +
56{
│ │ │ │ +
57 assert(loader && "ASSERT: adding a none existing loader object");
│ │ │ │ +
58 d_loaders.push_back(loader);
│ │ │ │ +
59}
│ │ │ │
60
│ │ │ │ -
71 virtual ImageContext* loadHeader(PixelFormat& formatSource, DataSource* data) = 0;
│ │ │ │ -
72
│ │ │ │ -
73
│ │ │ │ -
86 virtual bool loadImageData(PixelOrigin origin, DataSource* data, ImageContext* context) = 0;
│ │ │ │ -
87
│ │ │ │ -
94 void destroyContext(ImageContext* context);
│ │ │ │ -
95
│ │ │ │ -
100 const char* getIdentifierString() const;
│ │ │ │ -
101private:
│ │ │ │ -
102 const char* d_name;
│ │ │ │ -
103
│ │ │ │ -
104};
│ │ │ │ -
105
│ │ │ │ -
106} // End of section namespace SILLY
│ │ │ │ -
107
│ │ │ │ -
108// Inclue inline function when needed
│ │ │ │ -
109#ifdef SILLY_OPT_INLINE
│ │ │ │ -
110#include "SILLYImageLoader.icpp"
│ │ │ │ -
111#endif
│ │ │ │ -
112
│ │ │ │ -
113#endif // end of guard _SILLYImageLoader_h_
│ │ │ │ -
Simple Image Loading LibrarY namespace.
│ │ │ │ -
PixelFormat
List all pixel format supported.
Definition: SILLYBase.h:60
│ │ │ │ -
PixelOrigin
List all pixel origin supported.
Definition: SILLYBase.h:71
│ │ │ │ -
This is an abstract class used to provide data to the loader.
│ │ │ │ -
Store the data needed by an ImageLoader object during the parsing of an image.
│ │ │ │ -
This is an abstract class that define the interface of all image loader.
│ │ │ │ -
ImageLoader(const char *name)
Constructor.
│ │ │ │ -
virtual ImageContext * loadHeader(PixelFormat &formatSource, DataSource *data)=0
Parse the header of the image and fill the header struct.
│ │ │ │ -
virtual bool loadImageData(PixelOrigin origin, DataSource *data, ImageContext *context)=0
Parse the pixels data of the image and fill the header struct.
│ │ │ │ -
virtual ~ImageLoader()
Destructor.
│ │ │ │ -
const char * getIdentifierString() const
Return the name of the loader.
│ │ │ │ +
61} // End of section namespace SILLY
│ │ │ │ +
62
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,21 +4,21 @@ │ │ │ │ │ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ │ │ │ │ │ * build │ │ │ │ │ * reproducible-path │ │ │ │ │ * silly-0.1.0 │ │ │ │ │ * include │ │ │ │ │ -SILLYImageLoader.h │ │ │ │ │ +SILLYImageLoaderManager.icpp │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ - 2 filename: SILLYImageLoader.h │ │ │ │ │ + 2 filename: SILLYImageLoaderManager.icpp │ │ │ │ │ 3 created: 10 Jun 2006 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ - 6 purpose: Abstract class for all image loader │ │ │ │ │ + 6 purpose: Inline definition for ImageLoaderManager class │ │ │ │ │ 7*************************************************************************/ │ │ │ │ │ 8/*************************************************************************** │ │ │ │ │ 9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team │ │ │ │ │ 10 * │ │ │ │ │ 11 * Permission is hereby granted, free of charge, to any person obtaining │ │ │ │ │ 12 * a copy of this software and associated documentation files (the │ │ │ │ │ 13 * "Software"), to deal in the Software without restriction, including │ │ │ │ │ @@ -35,87 +35,43 @@ │ │ │ │ │ 24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. │ │ │ │ │ 25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR │ │ │ │ │ 26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ │ │ │ │ 27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR │ │ │ │ │ 28 * OTHER DEALINGS IN THE SOFTWARE. │ │ │ │ │ 29 │ │ │ │ │ ***************************************************************************/ │ │ │ │ │ - 30#ifndef _SILLYImageLoader_h_ │ │ │ │ │ - 31#define _SILLYImageLoader_h_ │ │ │ │ │ - 32#include "SILLYBase.h" │ │ │ │ │ - 33// Start of section namespace SILLY │ │ │ │ │ - 34namespace SILLY │ │ │ │ │ + 30 │ │ │ │ │ + 31// Start of section namespace SILLY │ │ │ │ │ + 32namespace SILLY │ │ │ │ │ + 33{ │ │ │ │ │ + 34inline ImageLoaderList::iterator ImageLoaderManager::begin() │ │ │ │ │ 35{ │ │ │ │ │ - 36class DataSource; // Forward declaration │ │ │ │ │ - 37class ImageContext; // Forward declaration │ │ │ │ │ + 36 return d_loaders.begin(); │ │ │ │ │ + 37} │ │ │ │ │ 38 │ │ │ │ │ -46class SILLY_EXPORT ImageLoader │ │ │ │ │ - 47{ │ │ │ │ │ - 48protected: │ │ │ │ │ -52 ImageLoader(const char* name); │ │ │ │ │ - 53public: │ │ │ │ │ + 39inline ImageLoaderList::iterator ImageLoaderManager::end() │ │ │ │ │ + 40{ │ │ │ │ │ + 41 return d_loaders.end(); │ │ │ │ │ + 42} │ │ │ │ │ + 43 │ │ │ │ │ + 44inline ImageLoaderManager* ImageLoaderManager::getSingletonPtr() │ │ │ │ │ + 45{ │ │ │ │ │ + 46 return d_instance; │ │ │ │ │ + 47} │ │ │ │ │ + 48 │ │ │ │ │ + 49inline ImageLoaderManager& ImageLoaderManager::getSingleton() │ │ │ │ │ + 50{ │ │ │ │ │ + 51 assert(d_instance && "ASSERT: Singleton object not yet created"); │ │ │ │ │ + 52 return *d_instance; │ │ │ │ │ + 53} │ │ │ │ │ 54 │ │ │ │ │ -59 virtual ~ImageLoader(); │ │ │ │ │ + 55inline void ImageLoaderManager::add(ImageLoader* loader) │ │ │ │ │ + 56{ │ │ │ │ │ + 57 assert(loader && "ASSERT: adding a none existing loader object"); │ │ │ │ │ + 58 d_loaders.push_back(loader); │ │ │ │ │ + 59} │ │ │ │ │ 60 │ │ │ │ │ -71 virtual ImageContext* loadHeader(PixelFormat& formatSource, DataSource* │ │ │ │ │ -data) = 0; │ │ │ │ │ - 72 │ │ │ │ │ - 73 │ │ │ │ │ -86 virtual bool loadImageData(PixelOrigin origin, DataSource* data, │ │ │ │ │ -ImageContext* context) = 0; │ │ │ │ │ - 87 │ │ │ │ │ - 94 void destroyContext(ImageContext* context); │ │ │ │ │ - 95 │ │ │ │ │ -100 const char* getIdentifierString() const; │ │ │ │ │ - 101private: │ │ │ │ │ - 102 const char* d_name; │ │ │ │ │ - 103 │ │ │ │ │ - 104}; │ │ │ │ │ - 105 │ │ │ │ │ - 106} // End of section namespace SILLY │ │ │ │ │ - 107 │ │ │ │ │ - 108// Inclue inline function when needed │ │ │ │ │ - 109#ifdef SILLY_OPT_INLINE │ │ │ │ │ - 110#include "SILLYImageLoader.icpp" │ │ │ │ │ - 111#endif │ │ │ │ │ - 112 │ │ │ │ │ - 113#endif // end of guard _SILLYImageLoader_h_ │ │ │ │ │ -SILLY │ │ │ │ │ -Simple Image Loading LibrarY namespace. │ │ │ │ │ -Definition: SILLYJPGImageContext.cpp:46 │ │ │ │ │ -SILLY::PixelFormat │ │ │ │ │ -PixelFormat │ │ │ │ │ -List all pixel format supported. │ │ │ │ │ -Definition: SILLYBase.h:60 │ │ │ │ │ -SILLY::PixelOrigin │ │ │ │ │ -PixelOrigin │ │ │ │ │ -List all pixel origin supported. │ │ │ │ │ -Definition: SILLYBase.h:71 │ │ │ │ │ -SILLY::DataSource │ │ │ │ │ -This is an abstract class used to provide data to the loader. │ │ │ │ │ -Definition: SILLYDataSource.h:47 │ │ │ │ │ -SILLY::ImageContext │ │ │ │ │ -Store the data needed by an ImageLoader object during the parsing of an image. │ │ │ │ │ -Definition: SILLYImageContext.h:44 │ │ │ │ │ -SILLY::ImageLoader │ │ │ │ │ -This is an abstract class that define the interface of all image loader. │ │ │ │ │ -Definition: SILLYImageLoader.h:47 │ │ │ │ │ -SILLY::ImageLoader::ImageLoader │ │ │ │ │ -ImageLoader(const char *name) │ │ │ │ │ -Constructor. │ │ │ │ │ -SILLY::ImageLoader::loadHeader │ │ │ │ │ -virtual ImageContext * loadHeader(PixelFormat &formatSource, DataSource │ │ │ │ │ -*data)=0 │ │ │ │ │ -Parse the header of the image and fill the header struct. │ │ │ │ │ -SILLY::ImageLoader::loadImageData │ │ │ │ │ -virtual bool loadImageData(PixelOrigin origin, DataSource *data, ImageContext │ │ │ │ │ -*context)=0 │ │ │ │ │ -Parse the pixels data of the image and fill the header struct. │ │ │ │ │ -SILLY::ImageLoader::~ImageLoader │ │ │ │ │ -virtual ~ImageLoader() │ │ │ │ │ -Destructor. │ │ │ │ │ -SILLY::ImageLoader::getIdentifierString │ │ │ │ │ -const char * getIdentifierString() const │ │ │ │ │ -Return the name of the loader. │ │ │ │ │ + 61} // End of section namespace SILLY │ │ │ │ │ + 62 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libsilly-doc/html/a00119_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/SILLYFileDataSource.icpp Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/SILLYDataSource.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -39,67 +39,77 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYFileDataSource.icpp
│ │ │ │ +
SILLYDataSource.h
│ │ │ │
│ │ │ │
│ │ │ │ -
1/***********************************************************************
│ │ │ │ -
2 filename: SILLYFileDataSource.icpp
│ │ │ │ -
3 created: 20 Jul 2006
│ │ │ │ -
4 author: Olivier Delannoy
│ │ │ │ -
5
│ │ │ │ -
6 purpose: Inline function definition for the FileDataSource class
│ │ │ │ -
7*************************************************************************/
│ │ │ │ -
8/***************************************************************************
│ │ │ │ -
9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
│ │ │ │ -
10 *
│ │ │ │ -
11 * Permission is hereby granted, free of charge, to any person obtaining
│ │ │ │ -
12 * a copy of this software and associated documentation files (the
│ │ │ │ -
13 * "Software"), to deal in the Software without restriction, including
│ │ │ │ -
14 * without limitation the rights to use, copy, modify, merge, publish,
│ │ │ │ -
15 * distribute, sublicense, and/or sell copies of the Software, and to
│ │ │ │ -
16 * permit persons to whom the Software is furnished to do so, subject to
│ │ │ │ -
17 * the following conditions:
│ │ │ │ -
18 *
│ │ │ │ -
19 * The above copyright notice and this permission notice shall be
│ │ │ │ -
20 * included in all copies or substantial portions of the Software.
│ │ │ │ -
21 *
│ │ │ │ -
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
│ │ │ │ -
23 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
│ │ │ │ -
24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
│ │ │ │ -
25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
│ │ │ │ -
26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
│ │ │ │ -
27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
│ │ │ │ -
28 * OTHER DEALINGS IN THE SOFTWARE.
│ │ │ │ -
29 ***************************************************************************/
│ │ │ │ -
30
│ │ │ │ -
31// Start of section namespace SILLY
│ │ │ │ -
32namespace SILLY
│ │ │ │ -
33{
│ │ │ │ -
34inline bool FileDataSource::isValid() const
│ │ │ │ -
35{
│ │ │ │ -
36 return d_error;
│ │ │ │ -
37}
│ │ │ │ -
38
│ │ │ │ -
39inline const byte* FileDataSource::getDataPtr() const
│ │ │ │ -
40{
│ │ │ │ -
41 return d_bytes;
│ │ │ │ -
42}
│ │ │ │ -
43
│ │ │ │ -
44inline size_t FileDataSource::getSize() const
│ │ │ │ -
45{
│ │ │ │ -
46 return d_size;
│ │ │ │ -
47}
│ │ │ │ -
48
│ │ │ │ -
49} // End of section namespace SILLY
│ │ │ │ -
50
│ │ │ │ +
1/***********************************************************************
│ │ │ │ +
2 filename: SILLYDataSource.h
│ │ │ │ +
3 created: 10 Jun 2006
│ │ │ │ +
4 author: Olivier Delannoy
│ │ │ │ +
5
│ │ │ │ +
6 purpose: SILLY::DataSource declaration for the SILLY library
│ │ │ │ +
7*************************************************************************/
│ │ │ │ +
8/***************************************************************************
│ │ │ │ +
9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
│ │ │ │ +
10 *
│ │ │ │ +
11 * Permission is hereby granted, free of charge, to any person obtaining
│ │ │ │ +
12 * a copy of this software and associated documentation files (the
│ │ │ │ +
13 * "Software"), to deal in the Software without restriction, including
│ │ │ │ +
14 * without limitation the rights to use, copy, modify, merge, publish,
│ │ │ │ +
15 * distribute, sublicense, and/or sell copies of the Software, and to
│ │ │ │ +
16 * permit persons to whom the Software is furnished to do so, subject to
│ │ │ │ +
17 * the following conditions:
│ │ │ │ +
18 *
│ │ │ │ +
19 * The above copyright notice and this permission notice shall be
│ │ │ │ +
20 * included in all copies or substantial portions of the Software.
│ │ │ │ +
21 *
│ │ │ │ +
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
│ │ │ │ +
23 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
│ │ │ │ +
24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
│ │ │ │ +
25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
│ │ │ │ +
26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
│ │ │ │ +
27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
│ │ │ │ +
28 * OTHER DEALINGS IN THE SOFTWARE.
│ │ │ │ +
29 ***************************************************************************/
│ │ │ │ +
30#ifndef _SILLYDataSource_h_
│ │ │ │ +
31#define _SILLYDataSource_h_
│ │ │ │ +
32#include "SILLYBase.h"
│ │ │ │ +
33
│ │ │ │ +
34// Start of section namespace SILLY
│ │ │ │ +
35namespace SILLY
│ │ │ │ +
36{
│ │ │ │ +
37
│ │ │ │ +
46class SILLY_EXPORT DataSource
│ │ │ │ +
47{
│ │ │ │ +
48public:
│ │ │ │ +
53 virtual ~DataSource();
│ │ │ │ +
58 virtual const byte * getDataPtr() const = 0;
│ │ │ │ +
64 byte operator[] (size_t offset) const;
│ │ │ │ +
69 virtual size_t getSize() const = 0;
│ │ │ │ +
70};
│ │ │ │ +
71
│ │ │ │ +
72
│ │ │ │ +
73} // End of section namespace SILLY
│ │ │ │ +
74
│ │ │ │ +
75// Inclue inline function when needed
│ │ │ │ +
76#ifdef SILLY_OPT_INLINE
│ │ │ │ +
77#include "SILLYDataSource.icpp"
│ │ │ │ +
78#endif
│ │ │ │ +
79
│ │ │ │ +
80#endif // end of guard _SILLYDataSource_h_
│ │ │ │ +
Simple Image Loading LibrarY namespace.
│ │ │ │ +
This is an abstract class used to provide data to the loader.
│ │ │ │ +
virtual size_t getSize() const =0
Return the size of the data.
│ │ │ │ +
virtual const byte * getDataPtr() const =0
Get raw access to the image data.
│ │ │ │ +
virtual ~DataSource()
Destructor.
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,21 +4,21 @@ │ │ │ │ │ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ │ │ │ │ │ * build │ │ │ │ │ * reproducible-path │ │ │ │ │ * silly-0.1.0 │ │ │ │ │ * include │ │ │ │ │ -SILLYFileDataSource.icpp │ │ │ │ │ +SILLYDataSource.h │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ - 2 filename: SILLYFileDataSource.icpp │ │ │ │ │ - 3 created: 20 Jul 2006 │ │ │ │ │ + 2 filename: SILLYDataSource.h │ │ │ │ │ + 3 created: 10 Jun 2006 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ - 6 purpose: Inline function definition for the FileDataSource class │ │ │ │ │ + 6 purpose: SILLY::DataSource declaration for the SILLY library │ │ │ │ │ 7*************************************************************************/ │ │ │ │ │ 8/*************************************************************************** │ │ │ │ │ 9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team │ │ │ │ │ 10 * │ │ │ │ │ 11 * Permission is hereby granted, free of charge, to any person obtaining │ │ │ │ │ 12 * a copy of this software and associated documentation files (the │ │ │ │ │ 13 * "Software"), to deal in the Software without restriction, including │ │ │ │ │ @@ -35,31 +35,51 @@ │ │ │ │ │ 24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. │ │ │ │ │ 25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR │ │ │ │ │ 26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ │ │ │ │ 27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR │ │ │ │ │ 28 * OTHER DEALINGS IN THE SOFTWARE. │ │ │ │ │ 29 │ │ │ │ │ ***************************************************************************/ │ │ │ │ │ - 30 │ │ │ │ │ - 31// Start of section namespace SILLY │ │ │ │ │ - 32namespace SILLY │ │ │ │ │ - 33{ │ │ │ │ │ - 34inline bool FileDataSource::isValid() const │ │ │ │ │ - 35{ │ │ │ │ │ - 36 return d_error; │ │ │ │ │ - 37} │ │ │ │ │ - 38 │ │ │ │ │ - 39inline const byte* FileDataSource::getDataPtr() const │ │ │ │ │ - 40{ │ │ │ │ │ - 41 return d_bytes; │ │ │ │ │ - 42} │ │ │ │ │ - 43 │ │ │ │ │ - 44inline size_t FileDataSource::getSize() const │ │ │ │ │ - 45{ │ │ │ │ │ - 46 return d_size; │ │ │ │ │ - 47} │ │ │ │ │ - 48 │ │ │ │ │ - 49} // End of section namespace SILLY │ │ │ │ │ - 50 │ │ │ │ │ + 30#ifndef _SILLYDataSource_h_ │ │ │ │ │ + 31#define _SILLYDataSource_h_ │ │ │ │ │ + 32#include "SILLYBase.h" │ │ │ │ │ + 33 │ │ │ │ │ + 34// Start of section namespace SILLY │ │ │ │ │ + 35namespace SILLY │ │ │ │ │ + 36{ │ │ │ │ │ + 37 │ │ │ │ │ +46class SILLY_EXPORT DataSource │ │ │ │ │ + 47{ │ │ │ │ │ + 48public: │ │ │ │ │ +53 virtual ~DataSource(); │ │ │ │ │ +58 virtual const byte * getDataPtr() const = 0; │ │ │ │ │ +64 byte operator[] (size_t offset) const; │ │ │ │ │ +69 virtual size_t getSize() const = 0; │ │ │ │ │ + 70}; │ │ │ │ │ + 71 │ │ │ │ │ + 72 │ │ │ │ │ + 73} // End of section namespace SILLY │ │ │ │ │ + 74 │ │ │ │ │ + 75// Inclue inline function when needed │ │ │ │ │ + 76#ifdef SILLY_OPT_INLINE │ │ │ │ │ + 77#include "SILLYDataSource.icpp" │ │ │ │ │ + 78#endif │ │ │ │ │ + 79 │ │ │ │ │ + 80#endif // end of guard _SILLYDataSource_h_ │ │ │ │ │ +SILLY │ │ │ │ │ +Simple Image Loading LibrarY namespace. │ │ │ │ │ +Definition: SILLYJPGImageContext.cpp:46 │ │ │ │ │ +SILLY::DataSource │ │ │ │ │ +This is an abstract class used to provide data to the loader. │ │ │ │ │ +Definition: SILLYDataSource.h:47 │ │ │ │ │ +SILLY::DataSource::getSize │ │ │ │ │ +virtual size_t getSize() const =0 │ │ │ │ │ +Return the size of the data. │ │ │ │ │ +SILLY::DataSource::getDataPtr │ │ │ │ │ +virtual const byte * getDataPtr() const =0 │ │ │ │ │ +Get raw access to the image data. │ │ │ │ │ +SILLY::DataSource::~DataSource │ │ │ │ │ +virtual ~DataSource() │ │ │ │ │ +Destructor. │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libsilly-doc/html/a00122_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/SILLYDataSource.h Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/SILLYMemoryDataSource.icpp Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -39,77 +39,63 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYDataSource.h
│ │ │ │ +
SILLYMemoryDataSource.icpp
│ │ │ │
│ │ │ │
│ │ │ │ -
1/***********************************************************************
│ │ │ │ -
2 filename: SILLYDataSource.h
│ │ │ │ -
3 created: 10 Jun 2006
│ │ │ │ -
4 author: Olivier Delannoy
│ │ │ │ -
5
│ │ │ │ -
6 purpose: SILLY::DataSource declaration for the SILLY library
│ │ │ │ -
7*************************************************************************/
│ │ │ │ -
8/***************************************************************************
│ │ │ │ -
9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
│ │ │ │ -
10 *
│ │ │ │ -
11 * Permission is hereby granted, free of charge, to any person obtaining
│ │ │ │ -
12 * a copy of this software and associated documentation files (the
│ │ │ │ -
13 * "Software"), to deal in the Software without restriction, including
│ │ │ │ -
14 * without limitation the rights to use, copy, modify, merge, publish,
│ │ │ │ -
15 * distribute, sublicense, and/or sell copies of the Software, and to
│ │ │ │ -
16 * permit persons to whom the Software is furnished to do so, subject to
│ │ │ │ -
17 * the following conditions:
│ │ │ │ -
18 *
│ │ │ │ -
19 * The above copyright notice and this permission notice shall be
│ │ │ │ -
20 * included in all copies or substantial portions of the Software.
│ │ │ │ -
21 *
│ │ │ │ -
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
│ │ │ │ -
23 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
│ │ │ │ -
24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
│ │ │ │ -
25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
│ │ │ │ -
26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
│ │ │ │ -
27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
│ │ │ │ -
28 * OTHER DEALINGS IN THE SOFTWARE.
│ │ │ │ -
29 ***************************************************************************/
│ │ │ │ -
30#ifndef _SILLYDataSource_h_
│ │ │ │ -
31#define _SILLYDataSource_h_
│ │ │ │ -
32#include "SILLYBase.h"
│ │ │ │ -
33
│ │ │ │ -
34// Start of section namespace SILLY
│ │ │ │ -
35namespace SILLY
│ │ │ │ +
1/***********************************************************************
│ │ │ │ +
2 Filename: SILLYMemoryDataSource.icpp
│ │ │ │ +
3 created: 10 Jun 2006
│ │ │ │ +
4 author: Olivier Delannoy
│ │ │ │ +
5
│ │ │ │ +
6 purpose: Inline function definition for MemoryDataSource class
│ │ │ │ +
7*************************************************************************/
│ │ │ │ +
8/***************************************************************************
│ │ │ │ +
9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
│ │ │ │ +
10 *
│ │ │ │ +
11 * Permission is hereby granted, free of charge, to any person obtaining
│ │ │ │ +
12 * a copy of this software and associated documentation files (the
│ │ │ │ +
13 * "Software"), to deal in the Software without restriction, including
│ │ │ │ +
14 * without limitation the rights to use, copy, modify, merge, publish,
│ │ │ │ +
15 * distribute, sublicense, and/or sell copies of the Software, and to
│ │ │ │ +
16 * permit persons to whom the Software is furnished to do so, subject to
│ │ │ │ +
17 * the following conditions:
│ │ │ │ +
18 *
│ │ │ │ +
19 * The above copyright notice and this permission notice shall be
│ │ │ │ +
20 * included in all copies or substantial portions of the Software.
│ │ │ │ +
21 *
│ │ │ │ +
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
│ │ │ │ +
23 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
│ │ │ │ +
24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
│ │ │ │ +
25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
│ │ │ │ +
26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
│ │ │ │ +
27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
│ │ │ │ +
28 * OTHER DEALINGS IN THE SOFTWARE.
│ │ │ │ +
29 ***************************************************************************/
│ │ │ │ +
30
│ │ │ │ +
31// Start of section namespace SILLY
│ │ │ │ +
32namespace SILLY
│ │ │ │ +
33{
│ │ │ │ +
34
│ │ │ │ +
35inline const byte* MemoryDataSource::getDataPtr() const
│ │ │ │
36{
│ │ │ │ -
37
│ │ │ │ -
46class SILLY_EXPORT DataSource
│ │ │ │ -
47{
│ │ │ │ -
48public:
│ │ │ │ -
53 virtual ~DataSource();
│ │ │ │ -
58 virtual const byte * getDataPtr() const = 0;
│ │ │ │ -
64 byte operator[] (size_t offset) const;
│ │ │ │ -
69 virtual size_t getSize() const = 0;
│ │ │ │ -
70};
│ │ │ │ -
71
│ │ │ │ -
72
│ │ │ │ -
73} // End of section namespace SILLY
│ │ │ │ -
74
│ │ │ │ -
75// Inclue inline function when needed
│ │ │ │ -
76#ifdef SILLY_OPT_INLINE
│ │ │ │ -
77#include "SILLYDataSource.icpp"
│ │ │ │ -
78#endif
│ │ │ │ -
79
│ │ │ │ -
80#endif // end of guard _SILLYDataSource_h_
│ │ │ │ -
Simple Image Loading LibrarY namespace.
│ │ │ │ -
This is an abstract class used to provide data to the loader.
│ │ │ │ -
virtual size_t getSize() const =0
Return the size of the data.
│ │ │ │ -
virtual const byte * getDataPtr() const =0
Get raw access to the image data.
│ │ │ │ -
virtual ~DataSource()
Destructor.
│ │ │ │ +
37 return d_bytes;
│ │ │ │ +
38}
│ │ │ │ +
39
│ │ │ │ +
40inline size_t MemoryDataSource::getSize() const
│ │ │ │ +
41{
│ │ │ │ +
42 return d_size;
│ │ │ │ +
43}
│ │ │ │ +
44
│ │ │ │ +
45} // End of section namespace SILLY
│ │ │ │ +
46
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,21 +4,21 @@ │ │ │ │ │ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ │ │ │ │ │ * build │ │ │ │ │ * reproducible-path │ │ │ │ │ * silly-0.1.0 │ │ │ │ │ * include │ │ │ │ │ -SILLYDataSource.h │ │ │ │ │ +SILLYMemoryDataSource.icpp │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ - 2 filename: SILLYDataSource.h │ │ │ │ │ + 2 Filename: SILLYMemoryDataSource.icpp │ │ │ │ │ 3 created: 10 Jun 2006 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ - 6 purpose: SILLY::DataSource declaration for the SILLY library │ │ │ │ │ + 6 purpose: Inline function definition for MemoryDataSource class │ │ │ │ │ 7*************************************************************************/ │ │ │ │ │ 8/*************************************************************************** │ │ │ │ │ 9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team │ │ │ │ │ 10 * │ │ │ │ │ 11 * Permission is hereby granted, free of charge, to any person obtaining │ │ │ │ │ 12 * a copy of this software and associated documentation files (the │ │ │ │ │ 13 * "Software"), to deal in the Software without restriction, including │ │ │ │ │ @@ -35,51 +35,27 @@ │ │ │ │ │ 24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. │ │ │ │ │ 25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR │ │ │ │ │ 26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ │ │ │ │ 27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR │ │ │ │ │ 28 * OTHER DEALINGS IN THE SOFTWARE. │ │ │ │ │ 29 │ │ │ │ │ ***************************************************************************/ │ │ │ │ │ - 30#ifndef _SILLYDataSource_h_ │ │ │ │ │ - 31#define _SILLYDataSource_h_ │ │ │ │ │ - 32#include "SILLYBase.h" │ │ │ │ │ - 33 │ │ │ │ │ - 34// Start of section namespace SILLY │ │ │ │ │ - 35namespace SILLY │ │ │ │ │ + 30 │ │ │ │ │ + 31// Start of section namespace SILLY │ │ │ │ │ + 32namespace SILLY │ │ │ │ │ + 33{ │ │ │ │ │ + 34 │ │ │ │ │ + 35inline const byte* MemoryDataSource::getDataPtr() const │ │ │ │ │ 36{ │ │ │ │ │ - 37 │ │ │ │ │ -46class SILLY_EXPORT DataSource │ │ │ │ │ - 47{ │ │ │ │ │ - 48public: │ │ │ │ │ -53 virtual ~DataSource(); │ │ │ │ │ -58 virtual const byte * getDataPtr() const = 0; │ │ │ │ │ -64 byte operator[] (size_t offset) const; │ │ │ │ │ -69 virtual size_t getSize() const = 0; │ │ │ │ │ - 70}; │ │ │ │ │ - 71 │ │ │ │ │ - 72 │ │ │ │ │ - 73} // End of section namespace SILLY │ │ │ │ │ - 74 │ │ │ │ │ - 75// Inclue inline function when needed │ │ │ │ │ - 76#ifdef SILLY_OPT_INLINE │ │ │ │ │ - 77#include "SILLYDataSource.icpp" │ │ │ │ │ - 78#endif │ │ │ │ │ - 79 │ │ │ │ │ - 80#endif // end of guard _SILLYDataSource_h_ │ │ │ │ │ -SILLY │ │ │ │ │ -Simple Image Loading LibrarY namespace. │ │ │ │ │ -Definition: SILLYJPGImageContext.cpp:46 │ │ │ │ │ -SILLY::DataSource │ │ │ │ │ -This is an abstract class used to provide data to the loader. │ │ │ │ │ -Definition: SILLYDataSource.h:47 │ │ │ │ │ -SILLY::DataSource::getSize │ │ │ │ │ -virtual size_t getSize() const =0 │ │ │ │ │ -Return the size of the data. │ │ │ │ │ -SILLY::DataSource::getDataPtr │ │ │ │ │ -virtual const byte * getDataPtr() const =0 │ │ │ │ │ -Get raw access to the image data. │ │ │ │ │ -SILLY::DataSource::~DataSource │ │ │ │ │ -virtual ~DataSource() │ │ │ │ │ -Destructor. │ │ │ │ │ + 37 return d_bytes; │ │ │ │ │ + 38} │ │ │ │ │ + 39 │ │ │ │ │ + 40inline size_t MemoryDataSource::getSize() const │ │ │ │ │ + 41{ │ │ │ │ │ + 42 return d_size; │ │ │ │ │ + 43} │ │ │ │ │ + 44 │ │ │ │ │ + 45} // End of section namespace SILLY │ │ │ │ │ + 46 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libsilly-doc/html/a00125_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/SILLYFileDataSource.h Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/SILLYDataSource.icpp Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -39,84 +39,62 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYFileDataSource.h
│ │ │ │ +
SILLYDataSource.icpp
│ │ │ │
│ │ │ │
│ │ │ │ -
1/***********************************************************************
│ │ │ │ -
2 filename: SILLYFileDataSource.h
│ │ │ │ -
3 created: 20 Jul 2006
│ │ │ │ -
4 author: Olivier Delannoy
│ │ │ │ -
5
│ │ │ │ -
6 purpose: Provide file based image loading
│ │ │ │ -
7*************************************************************************/
│ │ │ │ -
8/***************************************************************************
│ │ │ │ -
9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
│ │ │ │ -
10 *
│ │ │ │ -
11 * Permission is hereby granted, free of charge, to any person obtaining
│ │ │ │ -
12 * a copy of this software and associated documentation files (the
│ │ │ │ -
13 * "Software"), to deal in the Software without restriction, including
│ │ │ │ -
14 * without limitation the rights to use, copy, modify, merge, publish,
│ │ │ │ -
15 * distribute, sublicense, and/or sell copies of the Software, and to
│ │ │ │ -
16 * permit persons to whom the Software is furnished to do so, subject to
│ │ │ │ -
17 * the following conditions:
│ │ │ │ -
18 *
│ │ │ │ -
19 * The above copyright notice and this permission notice shall be
│ │ │ │ -
20 * included in all copies or substantial portions of the Software.
│ │ │ │ -
21 *
│ │ │ │ -
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
│ │ │ │ -
23 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
│ │ │ │ -
24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
│ │ │ │ -
25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
│ │ │ │ -
26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
│ │ │ │ -
27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
│ │ │ │ -
28 * OTHER DEALINGS IN THE SOFTWARE.
│ │ │ │ -
29 ***************************************************************************/
│ │ │ │ -
30#ifndef _SILLYFileDataSource_h_
│ │ │ │ -
31#define _SILLYFileDataSource_h_
│ │ │ │ -
32#include "SILLYBase.h"
│ │ │ │ -
33#include "SILLYDataSource.h"
│ │ │ │ -
34// Start of section namespace SILLY
│ │ │ │ -
35namespace SILLY
│ │ │ │ -
36{
│ │ │ │ +
1/***********************************************************************
│ │ │ │ +
2 filename: SILLYDataSource.icpp
│ │ │ │ +
3 created: 10 Jun 2006
│ │ │ │ +
4 author: ode@dalfy.dalfy.dyndns.org
│ │ │ │ +
5
│ │ │ │ +
6 purpose: Inline function definition for (F>>>ILE_SANS<<<) class
│ │ │ │ +
7*************************************************************************/
│ │ │ │ +
8/***************************************************************************
│ │ │ │ +
9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
│ │ │ │ +
10 *
│ │ │ │ +
11 * Permission is hereby granted, free of charge, to any person obtaining
│ │ │ │ +
12 * a copy of this software and associated documentation files (the
│ │ │ │ +
13 * "Software"), to deal in the Software without restriction, including
│ │ │ │ +
14 * without limitation the rights to use, copy, modify, merge, publish,
│ │ │ │ +
15 * distribute, sublicense, and/or sell copies of the Software, and to
│ │ │ │ +
16 * permit persons to whom the Software is furnished to do so, subject to
│ │ │ │ +
17 * the following conditions:
│ │ │ │ +
18 *
│ │ │ │ +
19 * The above copyright notice and this permission notice shall be
│ │ │ │ +
20 * included in all copies or substantial portions of the Software.
│ │ │ │ +
21 *
│ │ │ │ +
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
│ │ │ │ +
23 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
│ │ │ │ +
24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
│ │ │ │ +
25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
│ │ │ │ +
26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
│ │ │ │ +
27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
│ │ │ │ +
28 * OTHER DEALINGS IN THE SOFTWARE.
│ │ │ │ +
29 ***************************************************************************/
│ │ │ │ +
30
│ │ │ │ +
31// Start of section namespace SILLY
│ │ │ │ +
32namespace SILLY
│ │ │ │ +
33{
│ │ │ │ +
34inline DataSource::~DataSource()
│ │ │ │ +
35{
│ │ │ │ +
36}
│ │ │ │
37
│ │ │ │ -
48class SILLY_EXPORT FileDataSource : public DataSource
│ │ │ │ -
49{
│ │ │ │ -
50public:
│ │ │ │ -
60 FileDataSource(const char* filename);
│ │ │ │ - │ │ │ │ -
73 bool isValid() const;
│ │ │ │ -
74
│ │ │ │ -
75 const byte* getDataPtr() const;
│ │ │ │ -
76 size_t getSize() const;
│ │ │ │ -
77private:
│ │ │ │ -
78 bool d_error;
│ │ │ │ -
79 byte* d_bytes;
│ │ │ │ -
80 size_t d_size;
│ │ │ │ -
81};
│ │ │ │ -
82
│ │ │ │ -
83
│ │ │ │ -
84} // End of section namespace SILLY
│ │ │ │ -
85
│ │ │ │ -
86// Inclue inline function when needed
│ │ │ │ -
87#ifdef SILLY_OPT_INLINE
│ │ │ │ -
88#include "SILLYFileDataSource.icpp"
│ │ │ │ -
89#endif
│ │ │ │ -
90
│ │ │ │ -
91#endif // end of guard _SILLYFileDataSource_h_
│ │ │ │ -
Simple Image Loading LibrarY namespace.
│ │ │ │ -
This is an abstract class used to provide data to the loader.
│ │ │ │ -
This class allow the loading of an image directly from a file.
│ │ │ │ -
const byte * getDataPtr() const
Get raw access to the image data.
│ │ │ │ -
bool isValid() const
Check wether the loading is successfull or not.
│ │ │ │ -
size_t getSize() const
Return the size of the data.
│ │ │ │ +
38inline byte DataSource::operator[](size_t offset) const
│ │ │ │ +
39{
│ │ │ │ +
40 assert(offset < getSize() && "ASSERT: Trying to access pixel outside of the data");
│ │ │ │ +
41 return getDataPtr()[offset];
│ │ │ │ +
42}
│ │ │ │ +
43
│ │ │ │ +
44} // End of section namespace SILLY
│ │ │ │ +
45
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,21 +4,21 @@ │ │ │ │ │ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ │ │ │ │ │ * build │ │ │ │ │ * reproducible-path │ │ │ │ │ * silly-0.1.0 │ │ │ │ │ * include │ │ │ │ │ -SILLYFileDataSource.h │ │ │ │ │ +SILLYDataSource.icpp │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ - 2 filename: SILLYFileDataSource.h │ │ │ │ │ - 3 created: 20 Jul 2006 │ │ │ │ │ - 4 author: Olivier Delannoy │ │ │ │ │ + 2 filename: SILLYDataSource.icpp │ │ │ │ │ + 3 created: 10 Jun 2006 │ │ │ │ │ + 4 author: ode@dalfy.dalfy.dyndns.org │ │ │ │ │ 5 │ │ │ │ │ - 6 purpose: Provide file based image loading │ │ │ │ │ + 6 purpose: Inline function definition for (F>>>ILE_SANS<<<) class │ │ │ │ │ 7*************************************************************************/ │ │ │ │ │ 8/*************************************************************************** │ │ │ │ │ 9 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team │ │ │ │ │ 10 * │ │ │ │ │ 11 * Permission is hereby granted, free of charge, to any person obtaining │ │ │ │ │ 12 * a copy of this software and associated documentation files (the │ │ │ │ │ 13 * "Software"), to deal in the Software without restriction, including │ │ │ │ │ @@ -35,60 +35,27 @@ │ │ │ │ │ 24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. │ │ │ │ │ 25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR │ │ │ │ │ 26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ │ │ │ │ 27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR │ │ │ │ │ 28 * OTHER DEALINGS IN THE SOFTWARE. │ │ │ │ │ 29 │ │ │ │ │ ***************************************************************************/ │ │ │ │ │ - 30#ifndef _SILLYFileDataSource_h_ │ │ │ │ │ - 31#define _SILLYFileDataSource_h_ │ │ │ │ │ - 32#include "SILLYBase.h" │ │ │ │ │ - 33#include "SILLYDataSource.h" │ │ │ │ │ - 34// Start of section namespace SILLY │ │ │ │ │ - 35namespace SILLY │ │ │ │ │ - 36{ │ │ │ │ │ + 30 │ │ │ │ │ + 31// Start of section namespace SILLY │ │ │ │ │ + 32namespace SILLY │ │ │ │ │ + 33{ │ │ │ │ │ + 34inline DataSource::~DataSource() │ │ │ │ │ + 35{ │ │ │ │ │ + 36} │ │ │ │ │ 37 │ │ │ │ │ -48class SILLY_EXPORT FileDataSource : public DataSource │ │ │ │ │ - 49{ │ │ │ │ │ - 50public: │ │ │ │ │ - 60 FileDataSource(const char* filename); │ │ │ │ │ - 64 ~FileDataSource(); │ │ │ │ │ -73 bool isValid() const; │ │ │ │ │ - 74 │ │ │ │ │ -75 const byte* getDataPtr() const; │ │ │ │ │ -76 size_t getSize() const; │ │ │ │ │ - 77private: │ │ │ │ │ - 78 bool d_error; │ │ │ │ │ - 79 byte* d_bytes; │ │ │ │ │ - 80 size_t d_size; │ │ │ │ │ - 81}; │ │ │ │ │ - 82 │ │ │ │ │ - 83 │ │ │ │ │ - 84} // End of section namespace SILLY │ │ │ │ │ - 85 │ │ │ │ │ - 86// Inclue inline function when needed │ │ │ │ │ - 87#ifdef SILLY_OPT_INLINE │ │ │ │ │ - 88#include "SILLYFileDataSource.icpp" │ │ │ │ │ - 89#endif │ │ │ │ │ - 90 │ │ │ │ │ - 91#endif // end of guard _SILLYFileDataSource_h_ │ │ │ │ │ -SILLY │ │ │ │ │ -Simple Image Loading LibrarY namespace. │ │ │ │ │ -Definition: SILLYJPGImageContext.cpp:46 │ │ │ │ │ -SILLY::DataSource │ │ │ │ │ -This is an abstract class used to provide data to the loader. │ │ │ │ │ -Definition: SILLYDataSource.h:47 │ │ │ │ │ -SILLY::FileDataSource │ │ │ │ │ -This class allow the loading of an image directly from a file. │ │ │ │ │ -Definition: SILLYFileDataSource.h:49 │ │ │ │ │ -SILLY::FileDataSource::getDataPtr │ │ │ │ │ -const byte * getDataPtr() const │ │ │ │ │ -Get raw access to the image data. │ │ │ │ │ -SILLY::FileDataSource::isValid │ │ │ │ │ -bool isValid() const │ │ │ │ │ -Check wether the loading is successfull or not. │ │ │ │ │ -SILLY::FileDataSource::getSize │ │ │ │ │ -size_t getSize() const │ │ │ │ │ -Return the size of the data. │ │ │ │ │ + 38inline byte DataSource::operator[](size_t offset) const │ │ │ │ │ + 39{ │ │ │ │ │ + 40 assert(offset < getSize() && "ASSERT: Trying to access pixel outside of the │ │ │ │ │ +data"); │ │ │ │ │ + 41 return getDataPtr()[offset]; │ │ │ │ │ + 42} │ │ │ │ │ + 43 │ │ │ │ │ + 44} // End of section namespace SILLY │ │ │ │ │ + 45 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libsilly-doc/html/a00129.html │ │ │ │ @@ -164,15 +164,15 @@ │ │ │ │ typedef unsigned char byte │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Typename for a byte.

│ │ │ │ │ │ │ │ -

Definition at line 80 of file SILLYBase.h.

│ │ │ │ +

Definition at line 80 of file SILLYBase.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ ImageLoaderList

│ │ │ │ │ │ │ │
│ │ │ │ @@ -182,15 +182,15 @@ │ │ │ │ typedef std::vector<ImageLoader*> ImageLoaderList │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Typename for a collection of image loader.

│ │ │ │ │ │ │ │ -

Definition at line 42 of file SILLYImageLoaderManager.h.

│ │ │ │ +

Definition at line 42 of file SILLYImageLoaderManager.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │

Enumeration Type Documentation

│ │ │ │ │ │ │ │

◆ PixelFormat

│ │ │ │ │ │ │ │ @@ -201,15 +201,15 @@ │ │ │ │ enum PixelFormat │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

List all pixel format supported.

│ │ │ │ │ │ │ │ -

Definition at line 59 of file SILLYBase.h.

│ │ │ │ +

Definition at line 59 of file SILLYBase.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ PixelOrigin

│ │ │ │ │ │ │ │
│ │ │ │ @@ -219,15 +219,15 @@ │ │ │ │ enum PixelOrigin │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

List all pixel origin supported.

│ │ │ │ │ │ │ │ -

Definition at line 70 of file SILLYBase.h.

│ │ │ │ +

Definition at line 70 of file SILLYBase.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │

Function Documentation

│ │ │ │ │ │ │ │

◆ JPG_emit_message()

│ │ │ │ │ │ │ │ @@ -250,15 +250,15 @@ │ │ │ │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 84 of file SILLYJPGImageContext.cpp.

│ │ │ │ +

Definition at line 84 of file SILLYJPGImageContext.cpp.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ JPG_error_exit()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -270,15 +270,15 @@ │ │ │ │ j_common_ptr  │ │ │ │ cinfo) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 76 of file SILLYJPGImageContext.cpp.

│ │ │ │ +

Definition at line 76 of file SILLYJPGImageContext.cpp.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ JPG_fill_input_buffer()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -290,15 +290,15 @@ │ │ │ │ j_decompress_ptr  │ │ │ │ cinfo) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 54 of file SILLYJPGImageContext.cpp.

│ │ │ │ +

Definition at line 54 of file SILLYJPGImageContext.cpp.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ JPG_init_source()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -310,15 +310,15 @@ │ │ │ │ j_decompress_ptr  │ │ │ │ cinfo) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 49 of file SILLYJPGImageContext.cpp.

│ │ │ │ +

Definition at line 49 of file SILLYJPGImageContext.cpp.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ JPG_skip_input_data()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -340,15 +340,15 @@ │ │ │ │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 62 of file SILLYJPGImageContext.cpp.

│ │ │ │ +

Definition at line 62 of file SILLYJPGImageContext.cpp.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ JPG_term_source()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -360,15 +360,15 @@ │ │ │ │ j_decompress_ptr  │ │ │ │ cinfo) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 71 of file SILLYJPGImageContext.cpp.

│ │ │ │ +

Definition at line 71 of file SILLYJPGImageContext.cpp.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ PNG_error_function()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -390,15 +390,15 @@ │ │ │ │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 64 of file SILLYPNGImageLoader.cpp.

│ │ │ │ +

Definition at line 64 of file SILLYPNGImageLoader.cpp.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ PNG_read_function()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -426,15 +426,15 @@ │ │ │ │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 48 of file SILLYPNGImageLoader.cpp.

│ │ │ │ +

Definition at line 48 of file SILLYPNGImageLoader.cpp.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ PNG_warning_function()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -456,15 +456,15 @@ │ │ │ │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 58 of file SILLYPNGImageLoader.cpp.

│ │ │ │ +

Definition at line 58 of file SILLYPNGImageLoader.cpp.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ SILLYCleanup()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -477,15 +477,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Cleanup SILLY library internal.

│ │ │ │ │ │ │ │ -

Definition at line 100 of file SILLYImageLoaderManager.cpp.

│ │ │ │ +

Definition at line 100 of file SILLYImageLoaderManager.cpp.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

◆ SILLYInit()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -499,15 +499,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Initialize the SILLY Library.

│ │ │ │
Returns
True if the initialization was successfull false otherwise.
│ │ │ │ │ │ │ │ -

Definition at line 87 of file SILLYImageLoaderManager.cpp.

│ │ │ │ +

Definition at line 87 of file SILLYImageLoaderManager.cpp.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │

Variable Documentation

│ │ │ │ │ │ │ │

◆ silly_init_counter

│ │ │ │ │ │ │ │ @@ -524,15 +524,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ static │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 58 of file SILLYImageLoaderManager.cpp.

│ │ │ │ +

Definition at line 58 of file SILLYImageLoaderManager.cpp.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │