--- /srv/reproducible-results/rbuild-debian/r-b-build.8JJO7LN0/b1/silly_0.1.0-8.1_i386.changes +++ /srv/reproducible-results/rbuild-debian/r-b-build.8JJO7LN0/b2/silly_0.1.0-8.1_i386.changes ├── Files │ @@ -1,5 +1,5 @@ │ │ bc431c29cbcacda4d28d2b4082175ef1 61532 debug optional libsilly-dbgsym_0.1.0-8.1_i386.deb │ c202286a43bc583e54ab2768e38e3ab2 25724 libdevel extra libsilly-dev_0.1.0-8.1_i386.deb │ - 647aa1b776f05247142142a77a571883 209272 doc extra libsilly-doc_0.1.0-8.1_all.deb │ + 49523324418a5e2f67d531ad5911d8bb 209576 doc extra libsilly-doc_0.1.0-8.1_all.deb │ dc442423c96a3a6dbea039d1961703ae 16116 libs extra libsilly_0.1.0-8.1_i386.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 3860 2021-01-03 15:26:07.000000 control.tar.xz │ │ --rw-r--r-- 0 0 0 205220 2021-01-03 15:26:07.000000 data.tar.xz │ │ +-rw-r--r-- 0 0 0 3844 2021-01-03 15:26:07.000000 control.tar.xz │ │ +-rw-r--r-- 0 0 0 205540 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) 15793 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00002_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 10914 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00005_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 21484 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00008_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 54330 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00011_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 35912 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00014_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 28761 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00017_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 12352 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00020_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 22980 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00023_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 17532 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00026_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 12352 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00002_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 23456 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00005_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 10751 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00008_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 35912 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00011_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 21484 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00014_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 15793 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00017_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 54330 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00020_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 10914 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00023_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 28761 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00026_source.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 16110 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00029_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 10751 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00032_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 12614 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00035_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 23456 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00038_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 15443 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00041_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 14954 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00044_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 18929 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00047_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 16006 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00050_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 12614 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00032_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 17532 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00035_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 22980 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00038_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 14314 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00041_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 23504 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00044_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 9235 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00047_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 13735 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00050_source.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 7846 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00053_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 16404 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00056_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7845 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00059_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8729 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00062_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 14968 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00065_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7850 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00068_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 15721 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00071_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7855 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00074_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 13840 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00077_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 15882 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00080_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7850 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00083_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 18535 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00086_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 9235 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00089_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 14314 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00092_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8821 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00095_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 23504 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00098_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8925 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00101_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 16006 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00056_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7855 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00059_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7850 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00062_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7850 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00065_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8729 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00068_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 14968 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00071_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 15721 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00074_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7845 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00077_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 16404 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00080_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 13840 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00083_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 15882 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00086_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 15443 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00089_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 14954 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00092_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 9222 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00095_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 18535 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00098_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 18929 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00101_source.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 18192 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00104_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 10785 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00107_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 13735 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00110_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 12945 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00107_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 17517 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00110_source.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 8816 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00113_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 9222 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00116_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 12945 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00119_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 10749 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00122_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 17517 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00125_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 10785 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00116_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 10749 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00119_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8821 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00122_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8925 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00125_source.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 32995 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00129.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 6976 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00942.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 21036 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00943.png │ │ │ │ -rw-r--r-- 0 root (0) root (0) 4742 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00944.png │ │ │ │ -rw-r--r-- 0 root (0) root (0) 19999 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00945.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 4488 2021-01-03 15:26:07.000000 ./usr/share/doc/libsilly-doc/html/a00946.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 3997 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/loaders/SILLYPNGImageContext.cpp Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/src/SILLYMemoryDataSource.cpp Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -40,27 +40,27 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYPNGImageContext.cpp
│ │ │ │ +
SILLYMemoryDataSource.cpp
│ │ │ │
│ │ │ │
│ │ │ │
1/***********************************************************************
│ │ │ │ -
2 filename: SILLYPNGImageContext.cpp
│ │ │ │ -
3 created: 11 Jun 2006
│ │ │ │ +
2 filename: SILLYMemoryDataSource.cpp
│ │ │ │ +
3 created: 10 Jun 2006
│ │ │ │
4 author: Olivier Delannoy
│ │ │ │
5
│ │ │ │ -
6 purpose: Definition of PNGImageContext 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
│ │ │ │ @@ -80,66 +80,40 @@ │ │ │ │
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"
│ │ │ │ +
34#include "SILLYMemoryDataSource.h"
│ │ │ │
35
│ │ │ │
36#ifndef SILLY_OPT_INLINE
│ │ │ │
37#define inline
│ │ │ │ -
38#include "loaders/SILLYPNGImageContext.icpp"
│ │ │ │ +
38#include "SILLYMemoryDataSource.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.
│ │ │ │ +
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.
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,20 +1,19 @@ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ * _b_u_i_l_d │ │ │ │ │ * _r_e_p_r_o_d_u_c_i_b_l_e_-_p_a_t_h │ │ │ │ │ * _s_i_l_l_y_-_0_._1_._0 │ │ │ │ │ * _s_r_c │ │ │ │ │ - * _l_o_a_d_e_r_s │ │ │ │ │ -SILLYPNGImageContext.cpp │ │ │ │ │ +SILLYMemoryDataSource.cpp │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ -2 filename: SILLYPNGImageContext.cpp │ │ │ │ │ -3 created: 11 Jun 2006 │ │ │ │ │ +2 filename: SILLYMemoryDataSource.cpp │ │ │ │ │ +3 created: 10 Jun 2006 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ -6 purpose: Definition of PNGImageContext 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 │ │ │ │ │ @@ -34,67 +33,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 │ │ │ │ │ 32#endif │ │ │ │ │ 33 │ │ │ │ │ -34#include "loaders/SILLYPNGImageContext.h" │ │ │ │ │ +34#include "SILLYMemoryDataSource.h" │ │ │ │ │ 35 │ │ │ │ │ 36#ifndef SILLY_OPT_INLINE │ │ │ │ │ 37#define inline │ │ │ │ │ -38#include "loaders/SILLYPNGImageContext.icpp" │ │ │ │ │ +38#include "SILLYMemoryDataSource.icpp" │ │ │ │ │ 39#undef inline │ │ │ │ │ 40#endif │ │ │ │ │ -41#include │ │ │ │ │ -42 │ │ │ │ │ -43// Start section of namespace SILLY │ │ │ │ │ -44namespace _S_I_L_L_Y │ │ │ │ │ -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->_g_e_t_S_i_z_e()) │ │ │ │ │ -52 return -1; │ │ │ │ │ -53 memcpy(data, d_data->_g_e_t_D_a_t_a_P_t_r() + 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 │ │ │ │ │ +41 │ │ │ │ │ +42// Start of SILLY namespace section │ │ │ │ │ +43namespace _S_I_L_L_Y │ │ │ │ │ +44{ │ │ │ │ │ +45 │ │ │ │ │ +_4_6_M_e_m_o_r_y_D_a_t_a_S_o_u_r_c_e_:_:_M_e_m_o_r_y_D_a_t_a_S_o_u_r_c_e(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 │ │ │ │ │ _S_I_L_L_Y │ │ │ │ │ Simple Image Loading LibrarY namespace. │ │ │ │ │ DDeeffiinniittiioonn _S_I_L_L_Y_J_P_G_I_m_a_g_e_C_o_n_t_e_x_t_._c_p_p_:_4_6 │ │ │ │ │ -_S_I_L_L_Y_:_:_D_a_t_a_S_o_u_r_c_e_:_:_g_e_t_S_i_z_e │ │ │ │ │ -virtual size_t getSize() const =0 │ │ │ │ │ -Return the size of the data. │ │ │ │ │ -_S_I_L_L_Y_:_:_D_a_t_a_S_o_u_r_c_e_:_:_g_e_t_D_a_t_a_P_t_r │ │ │ │ │ -virtual const byte * getDataPtr() const =0 │ │ │ │ │ -Get raw access to the image data. │ │ │ │ │ +_S_I_L_L_Y_:_:_M_e_m_o_r_y_D_a_t_a_S_o_u_r_c_e_:_:_M_e_m_o_r_y_D_a_t_a_S_o_u_r_c_e │ │ │ │ │ +MemoryDataSource(const byte *data, size_t size) │ │ │ │ │ +Create a data source from an existing memory area. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_M_e_m_o_r_y_D_a_t_a_S_o_u_r_c_e_._c_p_p_:_4_6 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./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/loaders/SILLYTGAImageContext.cpp Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/src/SILLYImage.cpp Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -40,27 +40,27 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYTGAImageContext.cpp
│ │ │ │ +
SILLYImage.cpp
│ │ │ │
│ │ │ │
│ │ │ │
1/***********************************************************************
│ │ │ │ -
2 filename: SILLYTGAImageContext.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 TGAImageContext 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
│ │ │ │ @@ -80,31 +80,106 @@ │ │ │ │
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"
│ │ │ │ +
34#include "SILLYImage.h"
│ │ │ │
35
│ │ │ │
36#ifndef SILLY_OPT_INLINE
│ │ │ │
37#define inline
│ │ │ │ -
38#include "loaders/SILLYTGAImageContext.icpp"
│ │ │ │ +
38#include "SILLYImage.icpp"
│ │ │ │
39#undef inline
│ │ │ │
40#endif
│ │ │ │ -
41#include <cstring>
│ │ │ │ -
42#include <cstdio>
│ │ │ │ -
43// Start section of namespace SILLY
│ │ │ │ -
44namespace SILLY
│ │ │ │ -
45{
│ │ │ │ -
46
│ │ │ │ +
41#include "SILLYImageLoaderManager.h"
│ │ │ │ +
42
│ │ │ │ +
43
│ │ │ │ +
44// Start section of namespace SILLY
│ │ │ │ +
45namespace SILLY
│ │ │ │ +
46{
│ │ │ │
47
│ │ │ │ -
48
│ │ │ │ -
49} // End section of namespace SILLY
│ │ │ │ -
Simple Image Loading LibrarY namespace.
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
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 };
│ │ │ │ +
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.
│ │ │ │ +
bool loadImageHeader()
Retrieve the information concerning the image object.
│ │ │ │ +
bool loadImageData(PixelFormat resultFormat=PF_RGBA, PixelOrigin origin=PO_TOP_LEFT)
Load the image pixels in memory and store them in resultFormat.
│ │ │ │ +
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 {} │ │ │ │ │ @@ -1,20 +1,19 @@ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ * _b_u_i_l_d │ │ │ │ │ * _r_e_p_r_o_d_u_c_i_b_l_e_-_p_a_t_h │ │ │ │ │ * _s_i_l_l_y_-_0_._1_._0 │ │ │ │ │ * _s_r_c │ │ │ │ │ - * _l_o_a_d_e_r_s │ │ │ │ │ -SILLYTGAImageContext.cpp │ │ │ │ │ +SILLYImage.cpp │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ -2 filename: SILLYTGAImageContext.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 TGAImageContext 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 │ │ │ │ │ @@ -34,28 +33,128 @@ │ │ │ │ │ 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" │ │ │ │ │ +34#include "SILLYImage.h" │ │ │ │ │ 35 │ │ │ │ │ 36#ifndef SILLY_OPT_INLINE │ │ │ │ │ 37#define inline │ │ │ │ │ -38#include "loaders/SILLYTGAImageContext.icpp" │ │ │ │ │ +38#include "SILLYImage.icpp" │ │ │ │ │ 39#undef inline │ │ │ │ │ 40#endif │ │ │ │ │ -41#include │ │ │ │ │ -42#include │ │ │ │ │ -43// Start section of namespace SILLY │ │ │ │ │ -44namespace _S_I_L_L_Y │ │ │ │ │ -45{ │ │ │ │ │ -46 │ │ │ │ │ +41#include "SILLYImageLoaderManager.h" │ │ │ │ │ +42 │ │ │ │ │ +43 │ │ │ │ │ +44// Start section of namespace SILLY │ │ │ │ │ +45namespace _S_I_L_L_Y │ │ │ │ │ +46{ │ │ │ │ │ 47 │ │ │ │ │ -48 │ │ │ │ │ -49} // End section of namespace SILLY │ │ │ │ │ +_4_8_I_m_a_g_e_:_:_I_m_a_g_e(_D_a_t_a_S_o_u_r_c_e& source) │ │ │ │ │ +49 : d_bpp(0), d_pixels(0), d_data(&source), d_imageContext(0), d_imageLoader │ │ │ │ │ +(0) │ │ │ │ │ +50{ │ │ │ │ │ +51} │ │ │ │ │ +52 │ │ │ │ │ +53 │ │ │ │ │ +_5_4bool _I_m_a_g_e_:_:_l_o_a_d_I_m_a_g_e_H_e_a_d_e_r() │ │ │ │ │ +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 │ │ │ │ │ +_6_8bool _I_m_a_g_e_:_:_l_o_a_d_I_m_a_g_e_D_a_t_a(_P_i_x_e_l_F_o_r_m_a_t resultFormat, _P_i_x_e_l_O_r_i_g_i_n 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 }; │ │ │ │ │ +85 │ │ │ │ │ +86 if (! allocate()) │ │ │ │ │ +87 { │ │ │ │ │ +88 return false; │ │ │ │ │ +89 } │ │ │ │ │ +90 d_imageContext->_s_e_t_D_e_s_t_i_n_a_t_i_o_n(d_pixels, _g_e_t_W_i_d_t_h() * _g_e_t_H_e_i_g_h_t() * d_bpp, │ │ │ │ │ +resultFormat); │ │ │ │ │ +91 │ │ │ │ │ +92 if (! d_imageLoader->_l_o_a_d_I_m_a_g_e_D_a_t_a(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 * _g_e_t_W_i_d_t_h() * _g_e_t_H_e_i_g_h_t()]; │ │ │ │ │ +105 return d_pixels != 0; │ │ │ │ │ +106} │ │ │ │ │ +107 │ │ │ │ │ +108} // End section of namespace SILLY │ │ │ │ │ _S_I_L_L_Y │ │ │ │ │ Simple Image Loading LibrarY namespace. │ │ │ │ │ DDeeffiinniittiioonn _S_I_L_L_Y_J_P_G_I_m_a_g_e_C_o_n_t_e_x_t_._c_p_p_:_4_6 │ │ │ │ │ +_S_I_L_L_Y_:_:_P_i_x_e_l_F_o_r_m_a_t │ │ │ │ │ +PixelFormat │ │ │ │ │ +List all pixel format supported. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_B_a_s_e_._h_:_6_0 │ │ │ │ │ +_S_I_L_L_Y_:_:_P_i_x_e_l_O_r_i_g_i_n │ │ │ │ │ +PixelOrigin │ │ │ │ │ +List all pixel origin supported. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_B_a_s_e_._h_:_7_1 │ │ │ │ │ +_S_I_L_L_Y_:_:_D_a_t_a_S_o_u_r_c_e │ │ │ │ │ +This is an abstract class used to provide data to the loader. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_D_a_t_a_S_o_u_r_c_e_._h_:_4_7 │ │ │ │ │ +_S_I_L_L_Y_:_:_I_m_a_g_e_:_:_I_m_a_g_e │ │ │ │ │ +Image(DataSource &data) │ │ │ │ │ +Constructor. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_I_m_a_g_e_._c_p_p_:_4_8 │ │ │ │ │ +_S_I_L_L_Y_:_:_I_m_a_g_e_:_:_l_o_a_d_I_m_a_g_e_H_e_a_d_e_r │ │ │ │ │ +bool loadImageHeader() │ │ │ │ │ +Retrieve the information concerning the image object. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_I_m_a_g_e_._c_p_p_:_5_4 │ │ │ │ │ +_S_I_L_L_Y_:_:_I_m_a_g_e_:_:_l_o_a_d_I_m_a_g_e_D_a_t_a │ │ │ │ │ +bool loadImageData(PixelFormat resultFormat=PF_RGBA, PixelOrigin │ │ │ │ │ +origin=PO_TOP_LEFT) │ │ │ │ │ +Load the image pixels in memory and store them in resultFormat. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_I_m_a_g_e_._c_p_p_:_6_8 │ │ │ │ │ +_S_I_L_L_Y_:_:_I_m_a_g_e_:_:_g_e_t_W_i_d_t_h │ │ │ │ │ +size_t getWidth() const │ │ │ │ │ +Retrieve the width of the image. │ │ │ │ │ +_S_I_L_L_Y_:_:_I_m_a_g_e_:_:_g_e_t_H_e_i_g_h_t │ │ │ │ │ +size_t getHeight() const │ │ │ │ │ +Retrieve the height of the image. │ │ │ │ │ +_S_I_L_L_Y_:_:_I_m_a_g_e_C_o_n_t_e_x_t_:_:_s_e_t_D_e_s_t_i_n_a_t_i_o_n │ │ │ │ │ +void setDestination(byte *pixels, size_t length, PixelFormat format) │ │ │ │ │ +Set the destination of the loading. │ │ │ │ │ +_S_I_L_L_Y_:_:_I_m_a_g_e_L_o_a_d_e_r_:_:_l_o_a_d_I_m_a_g_e_D_a_t_a │ │ │ │ │ +virtual bool loadImageData(PixelOrigin origin, DataSource *data, ImageContext │ │ │ │ │ +*context)=0 │ │ │ │ │ +Parse the pixels data of the image and fill the header struct. │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./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/loaders/SILLYJPGImageContext.cpp Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/src/SILLYDataSource.cpp Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -40,27 +40,27 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYJPGImageContext.cpp
│ │ │ │ +
SILLYDataSource.cpp
│ │ │ │
│ │ │ │
│ │ │ │
1/***********************************************************************
│ │ │ │ -
2 filename: SILLYJPGImageContext.cpp
│ │ │ │ -
3 created: 11 Jun 2006
│ │ │ │ -
4 author: Olivier Delannoy
│ │ │ │ +
2 filename: SILLYDataSource.cpp
│ │ │ │ +
3 created: 10 Jun 2006
│ │ │ │ +
4 author: Olivier Delannoy
│ │ │ │
5
│ │ │ │ -
6 purpose: Definition of the JPGImageContext class methods
│ │ │ │ +
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
│ │ │ │ @@ -80,109 +80,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 "loaders/SILLYJPGImageContext.h"
│ │ │ │ +
34#include "SILLYDataSource.h"
│ │ │ │
35
│ │ │ │
36#ifndef SILLY_OPT_INLINE
│ │ │ │
37#define inline
│ │ │ │ -
38#include "loaders/SILLYJPGImageContext.icpp"
│ │ │ │ +
38#include "SILLYDataSource.icpp"
│ │ │ │
39#undef inline
│ │ │ │ -
40#endif
│ │ │ │ +
40#endif
│ │ │ │
41
│ │ │ │ -
42#include <jpeglib.h>
│ │ │ │ -
43
│ │ │ │ -
44// Start section of namespace SILLY
│ │ │ │ -
│ │ │ │ -
45namespace SILLY
│ │ │ │ -
46{
│ │ │ │ +
42// Start of SILLY namespace section
│ │ │ │ +
43namespace SILLY
│ │ │ │ +
44{
│ │ │ │ +
45
│ │ │ │ +
46} // End of SILLY namespace section
│ │ │ │
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.
│ │ │ │ +
49
│ │ │ │ +
50
│ │ │ │ +
Simple Image Loading LibrarY namespace.
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,20 +1,19 @@ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ * _b_u_i_l_d │ │ │ │ │ * _r_e_p_r_o_d_u_c_i_b_l_e_-_p_a_t_h │ │ │ │ │ * _s_i_l_l_y_-_0_._1_._0 │ │ │ │ │ * _s_r_c │ │ │ │ │ - * _l_o_a_d_e_r_s │ │ │ │ │ -SILLYJPGImageContext.cpp │ │ │ │ │ +SILLYDataSource.cpp │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ -2 filename: SILLYJPGImageContext.cpp │ │ │ │ │ -3 created: 11 Jun 2006 │ │ │ │ │ +2 filename: SILLYDataSource.cpp │ │ │ │ │ +3 created: 10 Jun 2006 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ -6 purpose: Definition of the JPGImageContext class methods │ │ │ │ │ +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 │ │ │ │ │ @@ -34,114 +33,29 @@ │ │ │ │ │ 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/SILLYJPGImageContext.h" │ │ │ │ │ +34#include "SILLYDataSource.h" │ │ │ │ │ 35 │ │ │ │ │ 36#ifndef SILLY_OPT_INLINE │ │ │ │ │ 37#define inline │ │ │ │ │ -38#include "loaders/SILLYJPGImageContext.icpp" │ │ │ │ │ +38#include "SILLYDataSource.icpp" │ │ │ │ │ 39#undef inline │ │ │ │ │ 40#endif │ │ │ │ │ 41 │ │ │ │ │ -42#include │ │ │ │ │ -43 │ │ │ │ │ -44// Start section of namespace SILLY │ │ │ │ │ -_4_5namespace _S_I_L_L_Y │ │ │ │ │ -46{ │ │ │ │ │ +42// Start of SILLY namespace section │ │ │ │ │ +43namespace _S_I_L_L_Y │ │ │ │ │ +44{ │ │ │ │ │ +45 │ │ │ │ │ +46} // End of SILLY namespace section │ │ │ │ │ 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 _J_P_G_I_m_a_g_e_C_o_n_t_e_x_t* jpg = reinterpret_cast<_J_P_G_I_m_a_g_e_C_o_n_t_e_x_t*>(cinfo- │ │ │ │ │ ->client_data); │ │ │ │ │ -57 cinfo->src->next_input_byte = jpg->d_source->_g_e_t_D_a_t_a_P_t_r(); │ │ │ │ │ -58 cinfo->src->bytes_in_buffer = jpg->d_source->_g_e_t_S_i_z_e(); │ │ │ │ │ -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 _J_P_G_I_m_a_g_e_C_o_n_t_e_x_t* jpg = reinterpret_cast<_J_P_G_I_m_a_g_e_C_o_n_t_e_x_t*>(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 : _I_m_a_g_e_C_o_n_t_e_x_t(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 │ │ │ │ │ +49 │ │ │ │ │ +50 │ │ │ │ │ _S_I_L_L_Y │ │ │ │ │ Simple Image Loading LibrarY namespace. │ │ │ │ │ DDeeffiinniittiioonn _S_I_L_L_Y_J_P_G_I_m_a_g_e_C_o_n_t_e_x_t_._c_p_p_:_4_6 │ │ │ │ │ -_S_I_L_L_Y_:_:_J_P_G_I_m_a_g_e_C_o_n_t_e_x_t │ │ │ │ │ -Image Context for JPG image loader. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_J_P_G_I_m_a_g_e_C_o_n_t_e_x_t_._h_:_5_7 │ │ │ │ │ -_S_I_L_L_Y_:_:_D_a_t_a_S_o_u_r_c_e_:_:_g_e_t_S_i_z_e │ │ │ │ │ -virtual size_t getSize() const =0 │ │ │ │ │ -Return the size of the data. │ │ │ │ │ -_S_I_L_L_Y_:_:_D_a_t_a_S_o_u_r_c_e_:_:_g_e_t_D_a_t_a_P_t_r │ │ │ │ │ -virtual const byte * getDataPtr() const =0 │ │ │ │ │ -Get raw access to the image data. │ │ │ │ │ -_S_I_L_L_Y_:_:_I_m_a_g_e_C_o_n_t_e_x_t │ │ │ │ │ -Store the data needed by an ImageLoader object during the parsing of an image. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_I_m_a_g_e_C_o_n_t_e_x_t_._h_:_4_4 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./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/SILLYPNGImageLoader.cpp Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -44,23 +44,23 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYTGAImageLoader.cpp
│ │ │ │ +
SILLYPNGImageLoader.cpp
│ │ │ │
│ │ │ │
│ │ │ │
1/***********************************************************************
│ │ │ │ -
2 filename: SILLYTGAImageLoader.cpp
│ │ │ │ +
2 filename: SILLYPNGImageLoader.cpp
│ │ │ │
3 created: 11 Jun 2006
│ │ │ │ -
4 author: Olivier Delannoy
│ │ │ │ +
4 author: Olivier Delannoy
│ │ │ │
5
│ │ │ │ -
6 purpose: Load TGA Image
│ │ │ │ +
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
│ │ │ │ @@ -78,313 +78,200 @@ │ │ │ │
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/SILLYTGAImageLoader.h"
│ │ │ │ -
35
│ │ │ │ -
36#ifndef SILLY_OPT_INLINE
│ │ │ │ -
37#define inline
│ │ │ │ -
38#include "loaders/SILLYTGAImageLoader.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
│ │ │ │ +
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
│ │ │ │ -
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}
│ │ │ │ +
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}
│ │ │ │
│ │ │ │ -
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}
│ │ │ │ +
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}
│ │ │ │
│ │ │ │ -
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.
│ │ │ │ +
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 {} │ │ │ │ │ @@ -1,20 +1,20 @@ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ * _b_u_i_l_d │ │ │ │ │ * _r_e_p_r_o_d_u_c_i_b_l_e_-_p_a_t_h │ │ │ │ │ * _s_i_l_l_y_-_0_._1_._0 │ │ │ │ │ * _s_r_c │ │ │ │ │ * _l_o_a_d_e_r_s │ │ │ │ │ -SILLYTGAImageLoader.cpp │ │ │ │ │ +SILLYPNGImageLoader.cpp │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ -2 filename: SILLYTGAImageLoader.cpp │ │ │ │ │ +2 filename: SILLYPNGImageLoader.cpp │ │ │ │ │ 3 created: 11 Jun 2006 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ -6 purpose: Load TGA Image │ │ │ │ │ +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 │ │ │ │ │ @@ -32,324 +32,212 @@ │ │ │ │ │ 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 │ │ │ │ │ -32#endif │ │ │ │ │ -33 │ │ │ │ │ -34#include "loaders/SILLYTGAImageLoader.h" │ │ │ │ │ -35 │ │ │ │ │ -36#ifndef SILLY_OPT_INLINE │ │ │ │ │ -37#define inline │ │ │ │ │ -38#include "loaders/SILLYTGAImageLoader.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 _S_I_L_L_Y │ │ │ │ │ +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 _S_I_L_L_Y │ │ │ │ │ +47{ │ │ │ │ │ +48void PNG_read_function(png_structp png_ptr, png_bytep data, png_size_t │ │ │ │ │ +length) │ │ │ │ │ 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 │ │ │ │ │ -_7_4_I_m_a_g_e_C_o_n_t_e_x_t* TGAImageLoader::loadHeader(_P_i_x_e_l_F_o_r_m_a_t& formatSource, │ │ │ │ │ +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 │ │ │ │ │ +_8_8_I_m_a_g_e_C_o_n_t_e_x_t* PNGImageLoader::loadHeader(_P_i_x_e_l_F_o_r_m_a_t& formatSource, │ │ │ │ │ _D_a_t_a_S_o_u_r_c_e* data) │ │ │ │ │ -75{ │ │ │ │ │ -76 byte idLength = data->_g_e_t_D_a_t_a_P_t_r()[0]; │ │ │ │ │ -77 byte colorMapType = data->_g_e_t_D_a_t_a_P_t_r()[1]; │ │ │ │ │ -78 byte imageType = data->_g_e_t_D_a_t_a_P_t_r()[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->_g_e_t_D_a_t_a_P_t_r()[12]; │ │ │ │ │ -92 width = width << 8; │ │ │ │ │ -93 width |= data->_g_e_t_D_a_t_a_P_t_r()[13]; │ │ │ │ │ -94 height = data->_g_e_t_D_a_t_a_P_t_r()[14]; │ │ │ │ │ -95 height = height << 8; │ │ │ │ │ -96 height |= data->_g_e_t_D_a_t_a_P_t_r()[15]; │ │ │ │ │ -97#else │ │ │ │ │ -98 width = data->_g_e_t_D_a_t_a_P_t_r()[13]; │ │ │ │ │ -99 width = width << 8; │ │ │ │ │ -100 width |= data->_g_e_t_D_a_t_a_P_t_r()[12]; │ │ │ │ │ -101 height = data->_g_e_t_D_a_t_a_P_t_r()[15]; │ │ │ │ │ -102 height = height << 8; │ │ │ │ │ -103 height |= data->_g_e_t_D_a_t_a_P_t_r()[14]; │ │ │ │ │ -104#endif │ │ │ │ │ -105 depth = data->_g_e_t_D_a_t_a_P_t_r()[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 _T_G_A_I_m_a_g_e_C_o_n_t_e_x_t* context = new _T_G_A_I_m_a_g_e_C_o_n_t_e_x_t(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 │ │ │ │ │ -_1_3_4bool TGAImageLoader::loadImageData(_P_i_x_e_l_O_r_i_g_i_n origin, _D_a_t_a_S_o_u_r_c_e* data, │ │ │ │ │ -_I_m_a_g_e_C_o_n_t_e_x_t* context) │ │ │ │ │ -135{ │ │ │ │ │ -136 _T_G_A_I_m_a_g_e_C_o_n_t_e_x_t* tga = static_cast<_T_G_A_I_m_a_g_e_C_o_n_t_e_x_t*>(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->_g_e_t_D_a_t_a_P_t_r() + 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 { │ │ │ │ │ +89{ │ │ │ │ │ +90 _P_N_G_I_m_a_g_e_C_o_n_t_e_x_t* png = new _P_N_G_I_m_a_g_e_C_o_n_t_e_x_t(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 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->_s_e_t_N_e_x_t_P_i_x_e_l(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) │ │ │ │ │ +153 │ │ │ │ │ +_1_5_4bool PNGImageLoader::loadImageData(_P_i_x_e_l_O_r_i_g_i_n origin, │ │ │ │ │ +155 _D_a_t_a_S_o_u_r_c_e* data, │ │ │ │ │ +156 _I_m_a_g_e_C_o_n_t_e_x_t* context) │ │ │ │ │ +157{ │ │ │ │ │ +158 _P_N_G_I_m_a_g_e_C_o_n_t_e_x_t* png = static_cast<_P_N_G_I_m_a_g_e_C_o_n_t_e_x_t*>(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 blue = *(input++); │ │ │ │ │ -176 green = *(input++); │ │ │ │ │ -177 red = *(input++); │ │ │ │ │ -178 context->_s_e_t_N_e_x_t_P_i_x_e_l(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) │ │ │ │ │ +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->_s_e_t_N_e_x_t_P_i_x_e_l(red, green, blue, alpha); │ │ │ │ │ +181 } │ │ │ │ │ +182 } │ │ │ │ │ +183 } │ │ │ │ │ +184 else if (png->d_num_channels == 3) │ │ │ │ │ 185 { │ │ │ │ │ -186 blue = *(input++); │ │ │ │ │ -187 green = *(input++); │ │ │ │ │ -188 red = *(input++); │ │ │ │ │ -189 alpha = *(input++); │ │ │ │ │ -190 context->_s_e_t_N_e_x_t_P_i_x_e_l(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->_s_e_t_N_e_x_t_P_i_x_e_l(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->_s_e_t_N_e_x_t_P_i_x_e_l(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->_s_e_t_N_e_x_t_P_i_x_e_l(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->_s_e_t_N_e_x_t_P_i_x_e_l(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->_s_e_t_N_e_x_t_P_i_x_e_l(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->_s_e_t_N_e_x_t_P_i_x_e_l(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->_f_l_i_p_V_e_r_t_i_c_a_l_l_y(); │ │ │ │ │ -310 } │ │ │ │ │ -311 else │ │ │ │ │ -312 { │ │ │ │ │ -313 if (origin == PO_TOP_LEFT) │ │ │ │ │ -314 return tga->_f_l_i_p_V_e_r_t_i_c_a_l_l_y(); │ │ │ │ │ -315 } │ │ │ │ │ -316 return true; │ │ │ │ │ -317} │ │ │ │ │ -318 │ │ │ │ │ -319} // End section of namespace SILLY │ │ │ │ │ +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->_s_e_t_N_e_x_t_P_i_x_e_l(red, green, blue, alpha); │ │ │ │ │ +196 } │ │ │ │ │ +197 } │ │ │ │ │ +198 │ │ │ │ │ +199 } │ │ │ │ │ +200 } │ │ │ │ │ +201 if (origin == PO_BOTTOM_LEFT) │ │ │ │ │ +202 return png->_f_l_i_p_V_e_r_t_i_c_a_l_l_y(); │ │ │ │ │ +203 │ │ │ │ │ +204 return true; │ │ │ │ │ +205} │ │ │ │ │ +206 │ │ │ │ │ +207} // End section of namespace SILLY │ │ │ │ │ _S_I_L_L_Y │ │ │ │ │ Simple Image Loading LibrarY namespace. │ │ │ │ │ DDeeffiinniittiioonn _S_I_L_L_Y_J_P_G_I_m_a_g_e_C_o_n_t_e_x_t_._c_p_p_:_4_6 │ │ │ │ │ _S_I_L_L_Y_:_:_P_i_x_e_l_F_o_r_m_a_t │ │ │ │ │ PixelFormat │ │ │ │ │ List all pixel format supported. │ │ │ │ │ DDeeffiinniittiioonn _S_I_L_L_Y_B_a_s_e_._h_:_6_0 │ │ │ │ │ _S_I_L_L_Y_:_:_P_i_x_e_l_O_r_i_g_i_n │ │ │ │ │ PixelOrigin │ │ │ │ │ List all pixel origin supported. │ │ │ │ │ DDeeffiinniittiioonn _S_I_L_L_Y_B_a_s_e_._h_:_7_1 │ │ │ │ │ -_S_I_L_L_Y_:_:_T_G_A_I_m_a_g_e_C_o_n_t_e_x_t │ │ │ │ │ -Image Context for Targa image. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_T_G_A_I_m_a_g_e_C_o_n_t_e_x_t_._h_:_4_3 │ │ │ │ │ +_S_I_L_L_Y_:_:_P_N_G_I_m_a_g_e_C_o_n_t_e_x_t │ │ │ │ │ +Image Context for PNG Image Loader. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_P_N_G_I_m_a_g_e_C_o_n_t_e_x_t_._h_:_4_6 │ │ │ │ │ _S_I_L_L_Y_:_:_D_a_t_a_S_o_u_r_c_e │ │ │ │ │ This is an abstract class used to provide data to the loader. │ │ │ │ │ DDeeffiinniittiioonn _S_I_L_L_Y_D_a_t_a_S_o_u_r_c_e_._h_:_4_7 │ │ │ │ │ -_S_I_L_L_Y_:_:_D_a_t_a_S_o_u_r_c_e_:_:_g_e_t_D_a_t_a_P_t_r │ │ │ │ │ -virtual const byte * getDataPtr() const =0 │ │ │ │ │ -Get raw access to the image data. │ │ │ │ │ _S_I_L_L_Y_:_:_I_m_a_g_e_C_o_n_t_e_x_t │ │ │ │ │ Store the data needed by an ImageLoader object during the parsing of an image. │ │ │ │ │ DDeeffiinniittiioonn _S_I_L_L_Y_I_m_a_g_e_C_o_n_t_e_x_t_._h_:_4_4 │ │ │ │ │ _S_I_L_L_Y_:_:_I_m_a_g_e_C_o_n_t_e_x_t_:_:_s_e_t_N_e_x_t_P_i_x_e_l │ │ │ │ │ void setNextPixel(byte red, byte green, byte bleu, byte alpha) │ │ │ │ │ Set the next pixel of the image. │ │ │ │ │ _S_I_L_L_Y_:_:_I_m_a_g_e_C_o_n_t_e_x_t_:_:_f_l_i_p_V_e_r_t_i_c_a_l_l_y │ │ │ ├── ./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/SILLYPNGImageLoader.cpp Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/src/loaders/SILLYJPGImageContext.cpp Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -44,23 +44,23 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYPNGImageLoader.cpp
│ │ │ │ +
SILLYJPGImageContext.cpp
│ │ │ │
│ │ │ │
│ │ │ │
1/***********************************************************************
│ │ │ │ -
2 filename: SILLYPNGImageLoader.cpp
│ │ │ │ +
2 filename: SILLYJPGImageContext.cpp
│ │ │ │
3 created: 11 Jun 2006
│ │ │ │ -
4 author: Olivier Delannoy
│ │ │ │ +
4 author: Olivier Delannoy
│ │ │ │
5
│ │ │ │ -
6 purpose: Definition of the PNGImageLoader methods
│ │ │ │ +
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
│ │ │ │ @@ -78,202 +78,111 @@ │ │ │ │
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
│ │ │ │ -
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{
│ │ │ │ +
32#endif
│ │ │ │ +
33
│ │ │ │ +
34#include "loaders/SILLYJPGImageContext.h"
│ │ │ │ +
35
│ │ │ │ +
36#ifndef SILLY_OPT_INLINE
│ │ │ │ +
37#define inline
│ │ │ │ +
38#include "loaders/SILLYJPGImageContext.icpp"
│ │ │ │ +
39#undef inline
│ │ │ │ +
40#endif
│ │ │ │ +
41
│ │ │ │ +
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}
│ │ │ │ -
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}
│ │ │ │ +
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
│ │ │ │
│ │ │ │ -
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.
│ │ │ │ +
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 {} │ │ │ │ │ @@ -1,20 +1,20 @@ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ * _b_u_i_l_d │ │ │ │ │ * _r_e_p_r_o_d_u_c_i_b_l_e_-_p_a_t_h │ │ │ │ │ * _s_i_l_l_y_-_0_._1_._0 │ │ │ │ │ * _s_r_c │ │ │ │ │ * _l_o_a_d_e_r_s │ │ │ │ │ -SILLYPNGImageLoader.cpp │ │ │ │ │ +SILLYJPGImageContext.cpp │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ -2 filename: SILLYPNGImageLoader.cpp │ │ │ │ │ +2 filename: SILLYJPGImageContext.cpp │ │ │ │ │ 3 created: 11 Jun 2006 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ -6 purpose: Definition of the PNGImageLoader methods │ │ │ │ │ +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 │ │ │ │ │ @@ -32,217 +32,116 @@ │ │ │ │ │ 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 │ │ │ │ │ -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 _S_I_L_L_Y │ │ │ │ │ -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{ │ │ │ │ │ +32#endif │ │ │ │ │ +33 │ │ │ │ │ +34#include "loaders/SILLYJPGImageContext.h" │ │ │ │ │ +35 │ │ │ │ │ +36#ifndef SILLY_OPT_INLINE │ │ │ │ │ +37#define inline │ │ │ │ │ +38#include "loaders/SILLYJPGImageContext.icpp" │ │ │ │ │ +39#undef inline │ │ │ │ │ +40#endif │ │ │ │ │ +41 │ │ │ │ │ +42#include │ │ │ │ │ +43 │ │ │ │ │ +44// Start section of namespace SILLY │ │ │ │ │ +_4_5namespace _S_I_L_L_Y │ │ │ │ │ +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 _J_P_G_I_m_a_g_e_C_o_n_t_e_x_t* jpg = reinterpret_cast<_J_P_G_I_m_a_g_e_C_o_n_t_e_x_t*>(cinfo- │ │ │ │ │ +>client_data); │ │ │ │ │ +57 cinfo->src->next_input_byte = jpg->d_source->_g_e_t_D_a_t_a_P_t_r(); │ │ │ │ │ +58 cinfo->src->bytes_in_buffer = jpg->d_source->_g_e_t_S_i_z_e(); │ │ │ │ │ +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 _J_P_G_I_m_a_g_e_C_o_n_t_e_x_t* jpg = reinterpret_cast<_J_P_G_I_m_a_g_e_C_o_n_t_e_x_t*>(cinfo- │ │ │ │ │ +>client_data); │ │ │ │ │ +79 // TODO │ │ │ │ │ +80 longjmp(jpg->setjmp_buffer, 1); │ │ │ │ │ +81 │ │ │ │ │ 82} │ │ │ │ │ -83PNGImageLoader::~PNGImageLoader() │ │ │ │ │ -84{ │ │ │ │ │ -85} │ │ │ │ │ -86 │ │ │ │ │ -87 │ │ │ │ │ -_8_8_I_m_a_g_e_C_o_n_t_e_x_t* PNGImageLoader::loadHeader(_P_i_x_e_l_F_o_r_m_a_t& formatSource, │ │ │ │ │ -_D_a_t_a_S_o_u_r_c_e* data) │ │ │ │ │ -89{ │ │ │ │ │ -90 _P_N_G_I_m_a_g_e_C_o_n_t_e_x_t* png = new _P_N_G_I_m_a_g_e_C_o_n_t_e_x_t(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 │ │ │ │ │ -_1_5_4bool PNGImageLoader::loadImageData(_P_i_x_e_l_O_r_i_g_i_n origin, │ │ │ │ │ -155 _D_a_t_a_S_o_u_r_c_e* data, │ │ │ │ │ -156 _I_m_a_g_e_C_o_n_t_e_x_t* context) │ │ │ │ │ -157{ │ │ │ │ │ -158 _P_N_G_I_m_a_g_e_C_o_n_t_e_x_t* png = static_cast<_P_N_G_I_m_a_g_e_C_o_n_t_e_x_t*>(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->_s_e_t_N_e_x_t_P_i_x_e_l(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->_s_e_t_N_e_x_t_P_i_x_e_l(red, green, blue, alpha); │ │ │ │ │ -196 } │ │ │ │ │ -197 } │ │ │ │ │ -198 │ │ │ │ │ -199 } │ │ │ │ │ -200 } │ │ │ │ │ -201 if (origin == PO_BOTTOM_LEFT) │ │ │ │ │ -202 return png->_f_l_i_p_V_e_r_t_i_c_a_l_l_y(); │ │ │ │ │ -203 │ │ │ │ │ -204 return true; │ │ │ │ │ -205} │ │ │ │ │ -206 │ │ │ │ │ -207} // End section of namespace SILLY │ │ │ │ │ +83 │ │ │ │ │ +84void JPG_emit_message(j_common_ptr cinfo, int msg_level) │ │ │ │ │ +85{ │ │ │ │ │ +86 // Ignore │ │ │ │ │ +87} │ │ │ │ │ +88 │ │ │ │ │ +89 │ │ │ │ │ +90JPGImageContext::JPGImageContext() │ │ │ │ │ +91 : _I_m_a_g_e_C_o_n_t_e_x_t(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 │ │ │ │ │ _S_I_L_L_Y │ │ │ │ │ Simple Image Loading LibrarY namespace. │ │ │ │ │ DDeeffiinniittiioonn _S_I_L_L_Y_J_P_G_I_m_a_g_e_C_o_n_t_e_x_t_._c_p_p_:_4_6 │ │ │ │ │ -_S_I_L_L_Y_:_:_P_i_x_e_l_F_o_r_m_a_t │ │ │ │ │ -PixelFormat │ │ │ │ │ -List all pixel format supported. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_B_a_s_e_._h_:_6_0 │ │ │ │ │ -_S_I_L_L_Y_:_:_P_i_x_e_l_O_r_i_g_i_n │ │ │ │ │ -PixelOrigin │ │ │ │ │ -List all pixel origin supported. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_B_a_s_e_._h_:_7_1 │ │ │ │ │ -_S_I_L_L_Y_:_:_P_N_G_I_m_a_g_e_C_o_n_t_e_x_t │ │ │ │ │ -Image Context for PNG Image Loader. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_P_N_G_I_m_a_g_e_C_o_n_t_e_x_t_._h_:_4_6 │ │ │ │ │ -_S_I_L_L_Y_:_:_D_a_t_a_S_o_u_r_c_e │ │ │ │ │ -This is an abstract class used to provide data to the loader. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_D_a_t_a_S_o_u_r_c_e_._h_:_4_7 │ │ │ │ │ +_S_I_L_L_Y_:_:_J_P_G_I_m_a_g_e_C_o_n_t_e_x_t │ │ │ │ │ +Image Context for JPG image loader. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_J_P_G_I_m_a_g_e_C_o_n_t_e_x_t_._h_:_5_7 │ │ │ │ │ +_S_I_L_L_Y_:_:_D_a_t_a_S_o_u_r_c_e_:_:_g_e_t_S_i_z_e │ │ │ │ │ +virtual size_t getSize() const =0 │ │ │ │ │ +Return the size of the data. │ │ │ │ │ +_S_I_L_L_Y_:_:_D_a_t_a_S_o_u_r_c_e_:_:_g_e_t_D_a_t_a_P_t_r │ │ │ │ │ +virtual const byte * getDataPtr() const =0 │ │ │ │ │ +Get raw access to the image data. │ │ │ │ │ _S_I_L_L_Y_:_:_I_m_a_g_e_C_o_n_t_e_x_t │ │ │ │ │ Store the data needed by an ImageLoader object during the parsing of an image. │ │ │ │ │ DDeeffiinniittiioonn _S_I_L_L_Y_I_m_a_g_e_C_o_n_t_e_x_t_._h_:_4_4 │ │ │ │ │ -_S_I_L_L_Y_:_:_I_m_a_g_e_C_o_n_t_e_x_t_:_:_s_e_t_N_e_x_t_P_i_x_e_l │ │ │ │ │ -void setNextPixel(byte red, byte green, byte bleu, byte alpha) │ │ │ │ │ -Set the next pixel of the image. │ │ │ │ │ -_S_I_L_L_Y_:_:_I_m_a_g_e_C_o_n_t_e_x_t_:_:_f_l_i_p_V_e_r_t_i_c_a_l_l_y │ │ │ │ │ -bool flipVertically() │ │ │ │ │ -Flip pixel ordering. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_I_m_a_g_e_C_o_n_t_e_x_t_._c_p_p_:_4_5 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./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/SILLYJPGImageLoader.cpp Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/src/loaders/SILLYPNGImageContext.cpp Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -44,23 +44,23 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYJPGImageLoader.cpp
│ │ │ │ +
SILLYPNGImageContext.cpp
│ │ │ │
│ │ │ │
│ │ │ │
1/***********************************************************************
│ │ │ │ -
2 filename: SILLYJPGImageLoader.cpp
│ │ │ │ +
2 filename: SILLYPNGImageContext.cpp
│ │ │ │
3 created: 11 Jun 2006
│ │ │ │
4 author: Olivier Delannoy
│ │ │ │
5
│ │ │ │ -
6 purpose: Definition of JPGImageLoader methods
│ │ │ │ +
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
│ │ │ │ @@ -80,150 +80,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/SILLYJPGImageLoader.h"
│ │ │ │ +
34#include "loaders/SILLYPNGImageContext.h"
│ │ │ │
35
│ │ │ │
36#ifndef SILLY_OPT_INLINE
│ │ │ │
37#define inline
│ │ │ │ -
38#include "loaders/SILLYJPGImageLoader.icpp"
│ │ │ │ +
38#include "loaders/SILLYPNGImageContext.icpp"
│ │ │ │
39#undef inline
│ │ │ │
40#endif
│ │ │ │ -
41#include "loaders/SILLYJPGImageContext.h"
│ │ │ │ +
41#include <string.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.
│ │ │ │ +
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.
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,20 +1,20 @@ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ * _b_u_i_l_d │ │ │ │ │ * _r_e_p_r_o_d_u_c_i_b_l_e_-_p_a_t_h │ │ │ │ │ * _s_i_l_l_y_-_0_._1_._0 │ │ │ │ │ * _s_r_c │ │ │ │ │ * _l_o_a_d_e_r_s │ │ │ │ │ -SILLYJPGImageLoader.cpp │ │ │ │ │ +SILLYPNGImageContext.cpp │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ -2 filename: SILLYJPGImageLoader.cpp │ │ │ │ │ +2 filename: SILLYPNGImageContext.cpp │ │ │ │ │ 3 created: 11 Jun 2006 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ -6 purpose: Definition of JPGImageLoader methods │ │ │ │ │ +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 │ │ │ │ │ @@ -34,162 +34,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 │ │ │ │ │ 32#endif │ │ │ │ │ 33 │ │ │ │ │ -34#include "loaders/SILLYJPGImageLoader.h" │ │ │ │ │ +34#include "loaders/SILLYPNGImageContext.h" │ │ │ │ │ 35 │ │ │ │ │ 36#ifndef SILLY_OPT_INLINE │ │ │ │ │ 37#define inline │ │ │ │ │ -38#include "loaders/SILLYJPGImageLoader.icpp" │ │ │ │ │ +38#include "loaders/SILLYPNGImageContext.icpp" │ │ │ │ │ 39#undef inline │ │ │ │ │ 40#endif │ │ │ │ │ -41#include "loaders/SILLYJPGImageContext.h" │ │ │ │ │ +41#include │ │ │ │ │ 42 │ │ │ │ │ 43// Start section of namespace SILLY │ │ │ │ │ 44namespace _S_I_L_L_Y │ │ │ │ │ 45{ │ │ │ │ │ -46JPGImageLoader::JPGImageLoader() │ │ │ │ │ -47 : ImageLoader("JPG Image Loader based on jpeg-6b") │ │ │ │ │ -48{ │ │ │ │ │ -49} │ │ │ │ │ +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 │ │ │ │ │ -51JPGImageLoader::~JPGImageLoader() │ │ │ │ │ -52{ │ │ │ │ │ -53} │ │ │ │ │ -54 │ │ │ │ │ -55 │ │ │ │ │ -_5_6_I_m_a_g_e_C_o_n_t_e_x_t* JPGImageLoader::loadHeader(_P_i_x_e_l_F_o_r_m_a_t& formatSource, │ │ │ │ │ -_D_a_t_a_S_o_u_r_c_e* data) │ │ │ │ │ -57{ │ │ │ │ │ -58 _J_P_G_I_m_a_g_e_C_o_n_t_e_x_t* jpg = new _J_P_G_I_m_a_g_e_C_o_n_t_e_x_t; │ │ │ │ │ -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 │ │ │ │ │ -_9_0bool JPGImageLoader::loadImageData(_P_i_x_e_l_O_r_i_g_i_n origin, │ │ │ │ │ -91 _D_a_t_a_S_o_u_r_c_e* data, │ │ │ │ │ -92 _I_m_a_g_e_C_o_n_t_e_x_t* context) │ │ │ │ │ -93{ │ │ │ │ │ -94 _J_P_G_I_m_a_g_e_C_o_n_t_e_x_t* jpg = static_cast<_J_P_G_I_m_a_g_e_C_o_n_t_e_x_t*>(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->_s_e_t_N_e_x_t_P_i_x_e_l(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->_s_e_t_N_e_x_t_P_i_x_e_l(red, green, blue, alpha); │ │ │ │ │ -142 } │ │ │ │ │ -143 } │ │ │ │ │ -144 } │ │ │ │ │ -145 jpeg_finish_decompress(& jpg->cinfo); │ │ │ │ │ -146 │ │ │ │ │ -147 if (origin == PO_BOTTOM_LEFT) │ │ │ │ │ -148 return jpg->_f_l_i_p_V_e_r_t_i_c_a_l_l_y(); │ │ │ │ │ -149 return true; │ │ │ │ │ -150} │ │ │ │ │ -151 │ │ │ │ │ -152 │ │ │ │ │ -153 │ │ │ │ │ -154 │ │ │ │ │ -155 │ │ │ │ │ -156 │ │ │ │ │ -157} // End section of namespace SILLY │ │ │ │ │ +51 if (d_offset + length > d_data->_g_e_t_S_i_z_e()) │ │ │ │ │ +52 return -1; │ │ │ │ │ +53 memcpy(data, d_data->_g_e_t_D_a_t_a_P_t_r() + 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 │ │ │ │ │ _S_I_L_L_Y │ │ │ │ │ Simple Image Loading LibrarY namespace. │ │ │ │ │ DDeeffiinniittiioonn _S_I_L_L_Y_J_P_G_I_m_a_g_e_C_o_n_t_e_x_t_._c_p_p_:_4_6 │ │ │ │ │ -_S_I_L_L_Y_:_:_P_i_x_e_l_F_o_r_m_a_t │ │ │ │ │ -PixelFormat │ │ │ │ │ -List all pixel format supported. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_B_a_s_e_._h_:_6_0 │ │ │ │ │ -_S_I_L_L_Y_:_:_P_i_x_e_l_O_r_i_g_i_n │ │ │ │ │ -PixelOrigin │ │ │ │ │ -List all pixel origin supported. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_B_a_s_e_._h_:_7_1 │ │ │ │ │ -_S_I_L_L_Y_:_:_J_P_G_I_m_a_g_e_C_o_n_t_e_x_t │ │ │ │ │ -Image Context for JPG image loader. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_J_P_G_I_m_a_g_e_C_o_n_t_e_x_t_._h_:_5_7 │ │ │ │ │ -_S_I_L_L_Y_:_:_D_a_t_a_S_o_u_r_c_e │ │ │ │ │ -This is an abstract class used to provide data to the loader. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_D_a_t_a_S_o_u_r_c_e_._h_:_4_7 │ │ │ │ │ -_S_I_L_L_Y_:_:_I_m_a_g_e_C_o_n_t_e_x_t │ │ │ │ │ -Store the data needed by an ImageLoader object during the parsing of an image. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_I_m_a_g_e_C_o_n_t_e_x_t_._h_:_4_4 │ │ │ │ │ -_S_I_L_L_Y_:_:_I_m_a_g_e_C_o_n_t_e_x_t_:_:_s_e_t_N_e_x_t_P_i_x_e_l │ │ │ │ │ -void setNextPixel(byte red, byte green, byte bleu, byte alpha) │ │ │ │ │ -Set the next pixel of the image. │ │ │ │ │ -_S_I_L_L_Y_:_:_I_m_a_g_e_C_o_n_t_e_x_t_:_:_f_l_i_p_V_e_r_t_i_c_a_l_l_y │ │ │ │ │ -bool flipVertically() │ │ │ │ │ -Flip pixel ordering. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_I_m_a_g_e_C_o_n_t_e_x_t_._c_p_p_:_4_5 │ │ │ │ │ +_S_I_L_L_Y_:_:_D_a_t_a_S_o_u_r_c_e_:_:_g_e_t_S_i_z_e │ │ │ │ │ +virtual size_t getSize() const =0 │ │ │ │ │ +Return the size of the data. │ │ │ │ │ +_S_I_L_L_Y_:_:_D_a_t_a_S_o_u_r_c_e_:_:_g_e_t_D_a_t_a_P_t_r │ │ │ │ │ +virtual const byte * getDataPtr() const =0 │ │ │ │ │ +Get raw access to the image data. │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./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/SILLYMemoryDataSource.cpp Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/src/loaders/SILLYTGAImageLoader.cpp Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -40,27 +40,27 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYMemoryDataSource.cpp
│ │ │ │ +
SILLYTGAImageLoader.cpp
│ │ │ │
│ │ │ │
│ │ │ │
1/***********************************************************************
│ │ │ │ -
2 filename: SILLYMemoryDataSource.cpp
│ │ │ │ -
3 created: 10 Jun 2006
│ │ │ │ +
2 filename: SILLYTGAImageLoader.cpp
│ │ │ │ +
3 created: 11 Jun 2006
│ │ │ │
4 author: Olivier Delannoy
│ │ │ │
5
│ │ │ │ -
6 purpose: SILLYMemoryDataSource definition for the SILLY library
│ │ │ │ +
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
│ │ │ │ @@ -80,40 +80,313 @@ │ │ │ │
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/SILLYTGAImageLoader.h"
│ │ │ │
35
│ │ │ │
36#ifndef SILLY_OPT_INLINE
│ │ │ │
37#define inline
│ │ │ │ -
38#include "SILLYMemoryDataSource.icpp"
│ │ │ │ +
38#include "loaders/SILLYTGAImageLoader.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
│ │ │ │ +
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
│ │ │ │ -
Simple Image Loading LibrarY namespace.
│ │ │ │ -
MemoryDataSource(const byte *data, size_t size)
Create a data source from an existing memory area.
│ │ │ │ +
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.
│ │ │ │ +
void setNextPixel(byte red, byte green, byte bleu, byte alpha)
Set the next pixel of the image.
│ │ │ │ +
bool flipVertically()
Flip pixel ordering.
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,19 +1,20 @@ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ * _b_u_i_l_d │ │ │ │ │ * _r_e_p_r_o_d_u_c_i_b_l_e_-_p_a_t_h │ │ │ │ │ * _s_i_l_l_y_-_0_._1_._0 │ │ │ │ │ * _s_r_c │ │ │ │ │ -SILLYMemoryDataSource.cpp │ │ │ │ │ + * _l_o_a_d_e_r_s │ │ │ │ │ +SILLYTGAImageLoader.cpp │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ -2 filename: SILLYMemoryDataSource.cpp │ │ │ │ │ -3 created: 10 Jun 2006 │ │ │ │ │ +2 filename: SILLYTGAImageLoader.cpp │ │ │ │ │ +3 created: 11 Jun 2006 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ -6 purpose: SILLYMemoryDataSource definition for the SILLY library │ │ │ │ │ +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 │ │ │ │ │ @@ -33,38 +34,327 @@ │ │ │ │ │ 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 "SILLYMemoryDataSource.h" │ │ │ │ │ +34#include "loaders/SILLYTGAImageLoader.h" │ │ │ │ │ 35 │ │ │ │ │ 36#ifndef SILLY_OPT_INLINE │ │ │ │ │ 37#define inline │ │ │ │ │ -38#include "SILLYMemoryDataSource.icpp" │ │ │ │ │ +38#include "loaders/SILLYTGAImageLoader.icpp" │ │ │ │ │ 39#undef inline │ │ │ │ │ 40#endif │ │ │ │ │ -41 │ │ │ │ │ -42// Start of SILLY namespace section │ │ │ │ │ -43namespace _S_I_L_L_Y │ │ │ │ │ -44{ │ │ │ │ │ -45 │ │ │ │ │ -_4_6_M_e_m_o_r_y_D_a_t_a_S_o_u_r_c_e_:_:_M_e_m_o_r_y_D_a_t_a_S_o_u_r_c_e(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 │ │ │ │ │ +41#include "SILLYDataSource.h" │ │ │ │ │ +42#include "loaders/SILLYTGAImageContext.h" │ │ │ │ │ +43 │ │ │ │ │ +44#include │ │ │ │ │ +45#include │ │ │ │ │ +46 │ │ │ │ │ +47// Start section of namespace SILLY │ │ │ │ │ +48namespace _S_I_L_L_Y │ │ │ │ │ +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 │ │ │ │ │ +_7_4_I_m_a_g_e_C_o_n_t_e_x_t* TGAImageLoader::loadHeader(_P_i_x_e_l_F_o_r_m_a_t& formatSource, │ │ │ │ │ +_D_a_t_a_S_o_u_r_c_e* data) │ │ │ │ │ +75{ │ │ │ │ │ +76 byte idLength = data->_g_e_t_D_a_t_a_P_t_r()[0]; │ │ │ │ │ +77 byte colorMapType = data->_g_e_t_D_a_t_a_P_t_r()[1]; │ │ │ │ │ +78 byte imageType = data->_g_e_t_D_a_t_a_P_t_r()[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->_g_e_t_D_a_t_a_P_t_r()[12]; │ │ │ │ │ +92 width = width << 8; │ │ │ │ │ +93 width |= data->_g_e_t_D_a_t_a_P_t_r()[13]; │ │ │ │ │ +94 height = data->_g_e_t_D_a_t_a_P_t_r()[14]; │ │ │ │ │ +95 height = height << 8; │ │ │ │ │ +96 height |= data->_g_e_t_D_a_t_a_P_t_r()[15]; │ │ │ │ │ +97#else │ │ │ │ │ +98 width = data->_g_e_t_D_a_t_a_P_t_r()[13]; │ │ │ │ │ +99 width = width << 8; │ │ │ │ │ +100 width |= data->_g_e_t_D_a_t_a_P_t_r()[12]; │ │ │ │ │ +101 height = data->_g_e_t_D_a_t_a_P_t_r()[15]; │ │ │ │ │ +102 height = height << 8; │ │ │ │ │ +103 height |= data->_g_e_t_D_a_t_a_P_t_r()[14]; │ │ │ │ │ +104#endif │ │ │ │ │ +105 depth = data->_g_e_t_D_a_t_a_P_t_r()[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 _T_G_A_I_m_a_g_e_C_o_n_t_e_x_t* context = new _T_G_A_I_m_a_g_e_C_o_n_t_e_x_t(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 │ │ │ │ │ +_1_3_4bool TGAImageLoader::loadImageData(_P_i_x_e_l_O_r_i_g_i_n origin, _D_a_t_a_S_o_u_r_c_e* data, │ │ │ │ │ +_I_m_a_g_e_C_o_n_t_e_x_t* context) │ │ │ │ │ +135{ │ │ │ │ │ +136 _T_G_A_I_m_a_g_e_C_o_n_t_e_x_t* tga = static_cast<_T_G_A_I_m_a_g_e_C_o_n_t_e_x_t*>(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->_g_e_t_D_a_t_a_P_t_r() + 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->_s_e_t_N_e_x_t_P_i_x_e_l(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->_s_e_t_N_e_x_t_P_i_x_e_l(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->_s_e_t_N_e_x_t_P_i_x_e_l(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->_s_e_t_N_e_x_t_P_i_x_e_l(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->_s_e_t_N_e_x_t_P_i_x_e_l(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->_s_e_t_N_e_x_t_P_i_x_e_l(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->_s_e_t_N_e_x_t_P_i_x_e_l(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->_s_e_t_N_e_x_t_P_i_x_e_l(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->_s_e_t_N_e_x_t_P_i_x_e_l(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->_f_l_i_p_V_e_r_t_i_c_a_l_l_y(); │ │ │ │ │ +310 } │ │ │ │ │ +311 else │ │ │ │ │ +312 { │ │ │ │ │ +313 if (origin == PO_TOP_LEFT) │ │ │ │ │ +314 return tga->_f_l_i_p_V_e_r_t_i_c_a_l_l_y(); │ │ │ │ │ +315 } │ │ │ │ │ +316 return true; │ │ │ │ │ +317} │ │ │ │ │ +318 │ │ │ │ │ +319} // End section of namespace SILLY │ │ │ │ │ _S_I_L_L_Y │ │ │ │ │ Simple Image Loading LibrarY namespace. │ │ │ │ │ DDeeffiinniittiioonn _S_I_L_L_Y_J_P_G_I_m_a_g_e_C_o_n_t_e_x_t_._c_p_p_:_4_6 │ │ │ │ │ -_S_I_L_L_Y_:_:_M_e_m_o_r_y_D_a_t_a_S_o_u_r_c_e_:_:_M_e_m_o_r_y_D_a_t_a_S_o_u_r_c_e │ │ │ │ │ -MemoryDataSource(const byte *data, size_t size) │ │ │ │ │ -Create a data source from an existing memory area. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_M_e_m_o_r_y_D_a_t_a_S_o_u_r_c_e_._c_p_p_:_4_6 │ │ │ │ │ +_S_I_L_L_Y_:_:_P_i_x_e_l_F_o_r_m_a_t │ │ │ │ │ +PixelFormat │ │ │ │ │ +List all pixel format supported. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_B_a_s_e_._h_:_6_0 │ │ │ │ │ +_S_I_L_L_Y_:_:_P_i_x_e_l_O_r_i_g_i_n │ │ │ │ │ +PixelOrigin │ │ │ │ │ +List all pixel origin supported. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_B_a_s_e_._h_:_7_1 │ │ │ │ │ +_S_I_L_L_Y_:_:_T_G_A_I_m_a_g_e_C_o_n_t_e_x_t │ │ │ │ │ +Image Context for Targa image. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_T_G_A_I_m_a_g_e_C_o_n_t_e_x_t_._h_:_4_3 │ │ │ │ │ +_S_I_L_L_Y_:_:_D_a_t_a_S_o_u_r_c_e │ │ │ │ │ +This is an abstract class used to provide data to the loader. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_D_a_t_a_S_o_u_r_c_e_._h_:_4_7 │ │ │ │ │ +_S_I_L_L_Y_:_:_D_a_t_a_S_o_u_r_c_e_:_:_g_e_t_D_a_t_a_P_t_r │ │ │ │ │ +virtual const byte * getDataPtr() const =0 │ │ │ │ │ +Get raw access to the image data. │ │ │ │ │ +_S_I_L_L_Y_:_:_I_m_a_g_e_C_o_n_t_e_x_t │ │ │ │ │ +Store the data needed by an ImageLoader object during the parsing of an image. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_I_m_a_g_e_C_o_n_t_e_x_t_._h_:_4_4 │ │ │ │ │ +_S_I_L_L_Y_:_:_I_m_a_g_e_C_o_n_t_e_x_t_:_:_s_e_t_N_e_x_t_P_i_x_e_l │ │ │ │ │ +void setNextPixel(byte red, byte green, byte bleu, byte alpha) │ │ │ │ │ +Set the next pixel of the image. │ │ │ │ │ +_S_I_L_L_Y_:_:_I_m_a_g_e_C_o_n_t_e_x_t_:_:_f_l_i_p_V_e_r_t_i_c_a_l_l_y │ │ │ │ │ +bool flipVertically() │ │ │ │ │ +Flip pixel ordering. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_I_m_a_g_e_C_o_n_t_e_x_t_._c_p_p_:_4_5 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./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/SILLYImageLoaderManager.cpp Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/src/loaders/SILLYTGAImageContext.cpp Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -40,27 +40,27 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYImageLoaderManager.cpp
│ │ │ │ +
SILLYTGAImageContext.cpp
│ │ │ │
│ │ │ │
│ │ │ │
1/***********************************************************************
│ │ │ │ -
2 filename: ImageLoaderManager.cpp
│ │ │ │ -
3 created: 10 Jun 2006
│ │ │ │ +
2 filename: SILLYTGAImageContext.cpp
│ │ │ │ +
3 created: 11 Jun 2006
│ │ │ │
4 author: Olivier Delannoy
│ │ │ │
5
│ │ │ │ -
6 purpose: Manage the list of existing ImageLoader
│ │ │ │ +
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
│ │ │ │ @@ -80,109 +80,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 "SILLYImageLoaderManager.h"
│ │ │ │ +
34#include "loaders/SILLYTGAImageContext.h"
│ │ │ │
35
│ │ │ │
36#ifndef SILLY_OPT_INLINE
│ │ │ │
37#define inline
│ │ │ │ -
38#include "SILLYImageLoaderManager.icpp"
│ │ │ │ +
38#include "loaders/SILLYTGAImageContext.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#include <cstring>
│ │ │ │ +
42#include <cstdio>
│ │ │ │ +
43// Start section of namespace SILLY
│ │ │ │ +
44namespace SILLY
│ │ │ │ +
45{
│ │ │ │ +
46
│ │ │ │
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} // End section of namespace SILLY
│ │ │ │ +
Simple Image Loading LibrarY namespace.
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,19 +1,20 @@ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ * _b_u_i_l_d │ │ │ │ │ * _r_e_p_r_o_d_u_c_i_b_l_e_-_p_a_t_h │ │ │ │ │ * _s_i_l_l_y_-_0_._1_._0 │ │ │ │ │ * _s_r_c │ │ │ │ │ -SILLYImageLoaderManager.cpp │ │ │ │ │ + * _l_o_a_d_e_r_s │ │ │ │ │ +SILLYTGAImageContext.cpp │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ -2 filename: ImageLoaderManager.cpp │ │ │ │ │ -3 created: 10 Jun 2006 │ │ │ │ │ +2 filename: SILLYTGAImageContext.cpp │ │ │ │ │ +3 created: 11 Jun 2006 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ -6 purpose: Manage the list of existing ImageLoader │ │ │ │ │ +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 │ │ │ │ │ @@ -33,121 +34,28 @@ │ │ │ │ │ 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 "SILLYImageLoaderManager.h" │ │ │ │ │ +34#include "loaders/SILLYTGAImageContext.h" │ │ │ │ │ 35 │ │ │ │ │ 36#ifndef SILLY_OPT_INLINE │ │ │ │ │ 37#define inline │ │ │ │ │ -38#include "SILLYImageLoaderManager.icpp" │ │ │ │ │ +38#include "loaders/SILLYTGAImageContext.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#include │ │ │ │ │ +42#include │ │ │ │ │ +43// Start section of namespace SILLY │ │ │ │ │ +44namespace _S_I_L_L_Y │ │ │ │ │ +45{ │ │ │ │ │ +46 │ │ │ │ │ 47 │ │ │ │ │ -48#ifdef SILLY_HAVE_PNG │ │ │ │ │ -49#include "loaders/SILLYPNGImageLoader.h" │ │ │ │ │ -50#endif │ │ │ │ │ -51 │ │ │ │ │ -52// Start of SILLY namespace section │ │ │ │ │ -53namespace _S_I_L_L_Y │ │ │ │ │ -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 │ │ │ │ │ -_6_2_I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r_:_:_I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r() │ │ │ │ │ -63{ │ │ │ │ │ -64 assert(d_instance == 0); │ │ │ │ │ -65 d_instance = this; │ │ │ │ │ -66 _a_d_d(new _T_G_A_I_m_a_g_e_L_o_a_d_e_r); │ │ │ │ │ -67#ifdef SILLY_HAVE_JPG │ │ │ │ │ -68 _a_d_d(new _J_P_G_I_m_a_g_e_L_o_a_d_e_r); │ │ │ │ │ -69#endif │ │ │ │ │ -70#ifdef SILLY_HAVE_PNG │ │ │ │ │ -71 _a_d_d(new _P_N_G_I_m_a_g_e_L_o_a_d_e_r); │ │ │ │ │ -72#endif │ │ │ │ │ -73// Add other builtins loader here │ │ │ │ │ -74 │ │ │ │ │ -75} │ │ │ │ │ -76 │ │ │ │ │ -_7_7_I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r_:_:_~_I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r() │ │ │ │ │ -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 │ │ │ │ │ -_8_7bool _S_I_L_L_Y_I_n_i_t() │ │ │ │ │ -88{ │ │ │ │ │ -89 if (ImageLoaderManager::getSingletonPtr() == 0) │ │ │ │ │ -90 { │ │ │ │ │ -91 if (!new _I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r) │ │ │ │ │ -92 { │ │ │ │ │ -93 return false; │ │ │ │ │ -94 } │ │ │ │ │ -95 } │ │ │ │ │ -96 ++silly_init_counter; │ │ │ │ │ -97 return true; │ │ │ │ │ -98} │ │ │ │ │ -99 │ │ │ │ │ -_1_0_0void _S_I_L_L_Y_C_l_e_a_n_u_p() │ │ │ │ │ -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} // End section of namespace SILLY │ │ │ │ │ _S_I_L_L_Y │ │ │ │ │ Simple Image Loading LibrarY namespace. │ │ │ │ │ DDeeffiinniittiioonn _S_I_L_L_Y_J_P_G_I_m_a_g_e_C_o_n_t_e_x_t_._c_p_p_:_4_6 │ │ │ │ │ -_S_I_L_L_Y_:_:_S_I_L_L_Y_C_l_e_a_n_u_p │ │ │ │ │ -void SILLYCleanup() │ │ │ │ │ -Cleanup SILLY library internal. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r_._c_p_p_:_1_0_0 │ │ │ │ │ -_S_I_L_L_Y_:_:_S_I_L_L_Y_I_n_i_t │ │ │ │ │ -bool SILLYInit() │ │ │ │ │ -Initialize the SILLY Library. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r_._c_p_p_:_8_7 │ │ │ │ │ -_S_I_L_L_Y_:_:_J_P_G_I_m_a_g_e_L_o_a_d_e_r │ │ │ │ │ -Loader class for JPG Image. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_J_P_G_I_m_a_g_e_L_o_a_d_e_r_._h_:_4_3 │ │ │ │ │ -_S_I_L_L_Y_:_:_P_N_G_I_m_a_g_e_L_o_a_d_e_r │ │ │ │ │ -Loader for PNG Image. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_P_N_G_I_m_a_g_e_L_o_a_d_e_r_._h_:_4_3 │ │ │ │ │ -_S_I_L_L_Y_:_:_T_G_A_I_m_a_g_e_L_o_a_d_e_r │ │ │ │ │ -Loader for Targa image. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_T_G_A_I_m_a_g_e_L_o_a_d_e_r_._h_:_4_4 │ │ │ │ │ -_S_I_L_L_Y_:_:_I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r │ │ │ │ │ -Manage the list of all supported ImageLoader. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r_._h_:_5_7 │ │ │ │ │ -_S_I_L_L_Y_:_:_I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r_:_:_~_I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r │ │ │ │ │ -~ImageLoaderManager() │ │ │ │ │ -Destructor. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r_._c_p_p_:_7_7 │ │ │ │ │ -_S_I_L_L_Y_:_:_I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r_:_:_a_d_d │ │ │ │ │ -void add(ImageLoader *loader) │ │ │ │ │ -Register an ImageLoader object. │ │ │ │ │ -_S_I_L_L_Y_:_:_I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r_:_:_I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r │ │ │ │ │ -ImageLoaderManager() │ │ │ │ │ -Constructor. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r_._c_p_p_:_6_2 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./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/SILLYFileDataSource.cpp Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/src/loaders/SILLYJPGImageLoader.cpp Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -40,27 +40,27 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYFileDataSource.cpp
│ │ │ │ +
SILLYJPGImageLoader.cpp
│ │ │ │
│ │ │ │
│ │ │ │
1/***********************************************************************
│ │ │ │ -
2 filename: SILLYFileDataSource.cpp
│ │ │ │ -
3 created: 20 Jul 2006
│ │ │ │ +
2 filename: SILLYJPGImageLoader.cpp
│ │ │ │ +
3 created: 11 Jun 2006
│ │ │ │
4 author: Olivier Delannoy
│ │ │ │
5
│ │ │ │ -
6 purpose: Implementation of the FileDataSource methods
│ │ │ │ +
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
│ │ │ │ @@ -80,80 +80,150 @@ │ │ │ │
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 "loaders/SILLYJPGImageLoader.h"
│ │ │ │
35
│ │ │ │
36#ifndef SILLY_OPT_INLINE
│ │ │ │
37#define inline
│ │ │ │ -
38#include "SILLYFileDataSource.icpp"
│ │ │ │ +
38#include "loaders/SILLYJPGImageLoader.icpp"
│ │ │ │
39#undef inline
│ │ │ │ -
40#endif
│ │ │ │ -
41#include <stdio.h>
│ │ │ │ -
42// Start section of namespace SILLY
│ │ │ │ -
43namespace SILLY
│ │ │ │ -
44{
│ │ │ │ -
45
│ │ │ │ -
│ │ │ │ -
46FileDataSource::FileDataSource(const char* filename)
│ │ │ │ -
47 : d_error(true), d_bytes(0), d_size(0)
│ │ │ │ +
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 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;
│ │ │ │ +
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}
│ │ │ │ +
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}
│ │ │ │
│ │ │ │ -
84
│ │ │ │ -
85
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
87{
│ │ │ │ -
88 delete [] d_bytes;
│ │ │ │ -
89}
│ │ │ │ +
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}
│ │ │ │
│ │ │ │ -
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.
│ │ │ │ - │ │ │ │ +
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 {} │ │ │ │ │ @@ -1,19 +1,20 @@ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ * _b_u_i_l_d │ │ │ │ │ * _r_e_p_r_o_d_u_c_i_b_l_e_-_p_a_t_h │ │ │ │ │ * _s_i_l_l_y_-_0_._1_._0 │ │ │ │ │ * _s_r_c │ │ │ │ │ -SILLYFileDataSource.cpp │ │ │ │ │ + * _l_o_a_d_e_r_s │ │ │ │ │ +SILLYJPGImageLoader.cpp │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ -2 filename: SILLYFileDataSource.cpp │ │ │ │ │ -3 created: 20 Jul 2006 │ │ │ │ │ +2 filename: SILLYJPGImageLoader.cpp │ │ │ │ │ +3 created: 11 Jun 2006 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ -6 purpose: Implementation of the FileDataSource methods │ │ │ │ │ +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 │ │ │ │ │ @@ -33,79 +34,162 @@ │ │ │ │ │ 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 "SILLYFileDataSource.h" │ │ │ │ │ +34#include "loaders/SILLYJPGImageLoader.h" │ │ │ │ │ 35 │ │ │ │ │ 36#ifndef SILLY_OPT_INLINE │ │ │ │ │ 37#define inline │ │ │ │ │ -38#include "SILLYFileDataSource.icpp" │ │ │ │ │ +38#include "loaders/SILLYJPGImageLoader.icpp" │ │ │ │ │ 39#undef inline │ │ │ │ │ 40#endif │ │ │ │ │ -41#include │ │ │ │ │ -42// Start section of namespace SILLY │ │ │ │ │ -43namespace _S_I_L_L_Y │ │ │ │ │ -44{ │ │ │ │ │ -45 │ │ │ │ │ -_4_6_F_i_l_e_D_a_t_a_S_o_u_r_c_e_:_:_F_i_l_e_D_a_t_a_S_o_u_r_c_e(const char* filename) │ │ │ │ │ -47 : d_error(true), d_bytes(0), d_size(0) │ │ │ │ │ +41#include "loaders/SILLYJPGImageContext.h" │ │ │ │ │ +42 │ │ │ │ │ +43// Start section of namespace SILLY │ │ │ │ │ +44namespace _S_I_L_L_Y │ │ │ │ │ +45{ │ │ │ │ │ +46JPGImageLoader::JPGImageLoader() │ │ │ │ │ +47 : ImageLoader("JPG Image Loader based on jpeg-6b") │ │ │ │ │ 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; │ │ │ │ │ +49} │ │ │ │ │ +50 │ │ │ │ │ +51JPGImageLoader::~JPGImageLoader() │ │ │ │ │ +52{ │ │ │ │ │ +53} │ │ │ │ │ +54 │ │ │ │ │ +55 │ │ │ │ │ +_5_6_I_m_a_g_e_C_o_n_t_e_x_t* JPGImageLoader::loadHeader(_P_i_x_e_l_F_o_r_m_a_t& formatSource, │ │ │ │ │ +_D_a_t_a_S_o_u_r_c_e* data) │ │ │ │ │ +57{ │ │ │ │ │ +58 _J_P_G_I_m_a_g_e_C_o_n_t_e_x_t* jpg = new _J_P_G_I_m_a_g_e_C_o_n_t_e_x_t; │ │ │ │ │ +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} │ │ │ │ │ -84 │ │ │ │ │ +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 │ │ │ │ │ -_8_6_F_i_l_e_D_a_t_a_S_o_u_r_c_e_:_:_~_F_i_l_e_D_a_t_a_S_o_u_r_c_e() │ │ │ │ │ -87{ │ │ │ │ │ -88 delete [] d_bytes; │ │ │ │ │ -89} │ │ │ │ │ -90 │ │ │ │ │ -91 │ │ │ │ │ -92} // End section of namespace SILLY │ │ │ │ │ +86 jpg->setImageSize(); │ │ │ │ │ +87 return jpg; │ │ │ │ │ +88} │ │ │ │ │ +89 │ │ │ │ │ +_9_0bool JPGImageLoader::loadImageData(_P_i_x_e_l_O_r_i_g_i_n origin, │ │ │ │ │ +91 _D_a_t_a_S_o_u_r_c_e* data, │ │ │ │ │ +92 _I_m_a_g_e_C_o_n_t_e_x_t* context) │ │ │ │ │ +93{ │ │ │ │ │ +94 _J_P_G_I_m_a_g_e_C_o_n_t_e_x_t* jpg = static_cast<_J_P_G_I_m_a_g_e_C_o_n_t_e_x_t*>(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->_s_e_t_N_e_x_t_P_i_x_e_l(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->_s_e_t_N_e_x_t_P_i_x_e_l(red, green, blue, alpha); │ │ │ │ │ +142 } │ │ │ │ │ +143 } │ │ │ │ │ +144 } │ │ │ │ │ +145 jpeg_finish_decompress(& jpg->cinfo); │ │ │ │ │ +146 │ │ │ │ │ +147 if (origin == PO_BOTTOM_LEFT) │ │ │ │ │ +148 return jpg->_f_l_i_p_V_e_r_t_i_c_a_l_l_y(); │ │ │ │ │ +149 return true; │ │ │ │ │ +150} │ │ │ │ │ +151 │ │ │ │ │ +152 │ │ │ │ │ +153 │ │ │ │ │ +154 │ │ │ │ │ +155 │ │ │ │ │ +156 │ │ │ │ │ +157} // End section of namespace SILLY │ │ │ │ │ _S_I_L_L_Y │ │ │ │ │ Simple Image Loading LibrarY namespace. │ │ │ │ │ DDeeffiinniittiioonn _S_I_L_L_Y_J_P_G_I_m_a_g_e_C_o_n_t_e_x_t_._c_p_p_:_4_6 │ │ │ │ │ -_S_I_L_L_Y_:_:_F_i_l_e_D_a_t_a_S_o_u_r_c_e_:_:_F_i_l_e_D_a_t_a_S_o_u_r_c_e │ │ │ │ │ -FileDataSource(const char *filename) │ │ │ │ │ -Create a data source from an existing file. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_F_i_l_e_D_a_t_a_S_o_u_r_c_e_._c_p_p_:_4_6 │ │ │ │ │ -_S_I_L_L_Y_:_:_F_i_l_e_D_a_t_a_S_o_u_r_c_e_:_:_~_F_i_l_e_D_a_t_a_S_o_u_r_c_e │ │ │ │ │ -~FileDataSource() │ │ │ │ │ -destructor │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_F_i_l_e_D_a_t_a_S_o_u_r_c_e_._c_p_p_:_8_6 │ │ │ │ │ +_S_I_L_L_Y_:_:_P_i_x_e_l_F_o_r_m_a_t │ │ │ │ │ +PixelFormat │ │ │ │ │ +List all pixel format supported. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_B_a_s_e_._h_:_6_0 │ │ │ │ │ +_S_I_L_L_Y_:_:_P_i_x_e_l_O_r_i_g_i_n │ │ │ │ │ +PixelOrigin │ │ │ │ │ +List all pixel origin supported. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_B_a_s_e_._h_:_7_1 │ │ │ │ │ +_S_I_L_L_Y_:_:_J_P_G_I_m_a_g_e_C_o_n_t_e_x_t │ │ │ │ │ +Image Context for JPG image loader. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_J_P_G_I_m_a_g_e_C_o_n_t_e_x_t_._h_:_5_7 │ │ │ │ │ +_S_I_L_L_Y_:_:_D_a_t_a_S_o_u_r_c_e │ │ │ │ │ +This is an abstract class used to provide data to the loader. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_D_a_t_a_S_o_u_r_c_e_._h_:_4_7 │ │ │ │ │ +_S_I_L_L_Y_:_:_I_m_a_g_e_C_o_n_t_e_x_t │ │ │ │ │ +Store the data needed by an ImageLoader object during the parsing of an image. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_I_m_a_g_e_C_o_n_t_e_x_t_._h_:_4_4 │ │ │ │ │ +_S_I_L_L_Y_:_:_I_m_a_g_e_C_o_n_t_e_x_t_:_:_s_e_t_N_e_x_t_P_i_x_e_l │ │ │ │ │ +void setNextPixel(byte red, byte green, byte bleu, byte alpha) │ │ │ │ │ +Set the next pixel of the image. │ │ │ │ │ +_S_I_L_L_Y_:_:_I_m_a_g_e_C_o_n_t_e_x_t_:_:_f_l_i_p_V_e_r_t_i_c_a_l_l_y │ │ │ │ │ +bool flipVertically() │ │ │ │ │ +Flip pixel ordering. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_I_m_a_g_e_C_o_n_t_e_x_t_._c_p_p_:_4_5 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libsilly-doc/html/a00029_source.html │ │ │ │ @@ -133,15 +133,15 @@ │ │ │ │
79 delete [] tmp;
│ │ │ │
80 return true;
│ │ │ │
81}
│ │ │ │
│ │ │ │
82
│ │ │ │
83
│ │ │ │
84} // End section of namespace SILLY
│ │ │ │ -
Simple Image Loading LibrarY namespace.
│ │ │ │ +
Simple Image Loading LibrarY namespace.
│ │ │ │
bool flipVertically()
Flip pixel ordering.
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./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/SILLYDataSource.cpp Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/src/SILLYImageLoader.cpp Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -44,23 +44,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
│ │ │ │ @@ -80,32 +80,43 @@ │ │ │ │
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 {} │ │ │ │ │ @@ -1,19 +1,19 @@ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ * _b_u_i_l_d │ │ │ │ │ * _r_e_p_r_o_d_u_c_i_b_l_e_-_p_a_t_h │ │ │ │ │ * _s_i_l_l_y_-_0_._1_._0 │ │ │ │ │ * _s_r_c │ │ │ │ │ -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 │ │ │ │ │ @@ -33,29 +33,43 @@ │ │ │ │ │ 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 "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 _S_I_L_L_Y │ │ │ │ │ 44{ │ │ │ │ │ 45 │ │ │ │ │ -46} // End of SILLY namespace section │ │ │ │ │ -47 │ │ │ │ │ -48 │ │ │ │ │ -49 │ │ │ │ │ -50 │ │ │ │ │ +46 │ │ │ │ │ +_4_7void _I_m_a_g_e_L_o_a_d_e_r_:_:_d_e_s_t_r_o_y_C_o_n_t_e_x_t(_I_m_a_g_e_C_o_n_t_e_x_t* context) │ │ │ │ │ +48{ │ │ │ │ │ +49 delete context; │ │ │ │ │ +50} │ │ │ │ │ +51 │ │ │ │ │ +52 │ │ │ │ │ +53} // end of SILLY namespace section │ │ │ │ │ +54 │ │ │ │ │ +55 │ │ │ │ │ +56 │ │ │ │ │ +57 │ │ │ │ │ _S_I_L_L_Y │ │ │ │ │ Simple Image Loading LibrarY namespace. │ │ │ │ │ DDeeffiinniittiioonn _S_I_L_L_Y_J_P_G_I_m_a_g_e_C_o_n_t_e_x_t_._c_p_p_:_4_6 │ │ │ │ │ +_S_I_L_L_Y_:_:_I_m_a_g_e_C_o_n_t_e_x_t │ │ │ │ │ +Store the data needed by an ImageLoader object during the parsing of an image. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_I_m_a_g_e_C_o_n_t_e_x_t_._h_:_4_4 │ │ │ │ │ +_S_I_L_L_Y_:_:_I_m_a_g_e_L_o_a_d_e_r_:_:_d_e_s_t_r_o_y_C_o_n_t_e_x_t │ │ │ │ │ +void destroyContext(ImageContext *context) │ │ │ │ │ +Destroy the image context. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_I_m_a_g_e_L_o_a_d_e_r_._c_p_p_:_4_7 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./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/SILLYImageLoader.cpp Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/src/SILLYFileDataSource.cpp Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -44,23 +44,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
│ │ │ │ @@ -80,43 +80,80 @@ │ │ │ │
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}
│ │ │ │ +
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}
│ │ │ │
│ │ │ │ -
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.
│ │ │ │ +
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 {} │ │ │ │ │ @@ -1,19 +1,19 @@ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ * _b_u_i_l_d │ │ │ │ │ * _r_e_p_r_o_d_u_c_i_b_l_e_-_p_a_t_h │ │ │ │ │ * _s_i_l_l_y_-_0_._1_._0 │ │ │ │ │ * _s_r_c │ │ │ │ │ -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 │ │ │ │ │ @@ -33,43 +33,79 @@ │ │ │ │ │ 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 "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 _S_I_L_L_Y │ │ │ │ │ 44{ │ │ │ │ │ 45 │ │ │ │ │ -46 │ │ │ │ │ -_4_7void _I_m_a_g_e_L_o_a_d_e_r_:_:_d_e_s_t_r_o_y_C_o_n_t_e_x_t(_I_m_a_g_e_C_o_n_t_e_x_t* context) │ │ │ │ │ +_4_6_F_i_l_e_D_a_t_a_S_o_u_r_c_e_:_:_F_i_l_e_D_a_t_a_S_o_u_r_c_e(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 │ │ │ │ │ +_8_6_F_i_l_e_D_a_t_a_S_o_u_r_c_e_:_:_~_F_i_l_e_D_a_t_a_S_o_u_r_c_e() │ │ │ │ │ +87{ │ │ │ │ │ +88 delete [] d_bytes; │ │ │ │ │ +89} │ │ │ │ │ +90 │ │ │ │ │ +91 │ │ │ │ │ +92} // End section of namespace SILLY │ │ │ │ │ _S_I_L_L_Y │ │ │ │ │ Simple Image Loading LibrarY namespace. │ │ │ │ │ DDeeffiinniittiioonn _S_I_L_L_Y_J_P_G_I_m_a_g_e_C_o_n_t_e_x_t_._c_p_p_:_4_6 │ │ │ │ │ -_S_I_L_L_Y_:_:_I_m_a_g_e_C_o_n_t_e_x_t │ │ │ │ │ -Store the data needed by an ImageLoader object during the parsing of an image. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_I_m_a_g_e_C_o_n_t_e_x_t_._h_:_4_4 │ │ │ │ │ -_S_I_L_L_Y_:_:_I_m_a_g_e_L_o_a_d_e_r_:_:_d_e_s_t_r_o_y_C_o_n_t_e_x_t │ │ │ │ │ -void destroyContext(ImageContext *context) │ │ │ │ │ -Destroy the image context. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_I_m_a_g_e_L_o_a_d_e_r_._c_p_p_:_4_7 │ │ │ │ │ +_S_I_L_L_Y_:_:_F_i_l_e_D_a_t_a_S_o_u_r_c_e_:_:_F_i_l_e_D_a_t_a_S_o_u_r_c_e │ │ │ │ │ +FileDataSource(const char *filename) │ │ │ │ │ +Create a data source from an existing file. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_F_i_l_e_D_a_t_a_S_o_u_r_c_e_._c_p_p_:_4_6 │ │ │ │ │ +_S_I_L_L_Y_:_:_F_i_l_e_D_a_t_a_S_o_u_r_c_e_:_:_~_F_i_l_e_D_a_t_a_S_o_u_r_c_e │ │ │ │ │ +~FileDataSource() │ │ │ │ │ +destructor │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_F_i_l_e_D_a_t_a_S_o_u_r_c_e_._c_p_p_:_8_6 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./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/SILLYImage.cpp Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/src/SILLYImageLoaderManager.cpp Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -44,23 +44,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
│ │ │ │ @@ -80,106 +80,109 @@ │ │ │ │
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.
│ │ │ │ -
bool loadImageHeader()
Retrieve the information concerning the image object.
│ │ │ │ -
bool loadImageData(PixelFormat resultFormat=PF_RGBA, PixelOrigin origin=PO_TOP_LEFT)
Load the image pixels in memory and store them in resultFormat.
│ │ │ │ -
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 {} │ │ │ │ │ @@ -1,19 +1,19 @@ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ * _b_u_i_l_d │ │ │ │ │ * _r_e_p_r_o_d_u_c_i_b_l_e_-_p_a_t_h │ │ │ │ │ * _s_i_l_l_y_-_0_._1_._0 │ │ │ │ │ * _s_r_c │ │ │ │ │ -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 │ │ │ │ │ @@ -33,128 +33,121 @@ │ │ │ │ │ 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 "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 _S_I_L_L_Y │ │ │ │ │ -46{ │ │ │ │ │ +44#ifdef SILLY_HAVE_JPG │ │ │ │ │ +45#include "loaders/SILLYJPGImageLoader.h" │ │ │ │ │ +46#endif │ │ │ │ │ 47 │ │ │ │ │ -_4_8_I_m_a_g_e_:_:_I_m_a_g_e(_D_a_t_a_S_o_u_r_c_e& source) │ │ │ │ │ -49 : d_bpp(0), d_pixels(0), d_data(&source), d_imageContext(0), d_imageLoader │ │ │ │ │ -(0) │ │ │ │ │ -50{ │ │ │ │ │ -51} │ │ │ │ │ -52 │ │ │ │ │ -53 │ │ │ │ │ -_5_4bool _I_m_a_g_e_:_:_l_o_a_d_I_m_a_g_e_H_e_a_d_e_r() │ │ │ │ │ -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 │ │ │ │ │ -_6_8bool _I_m_a_g_e_:_:_l_o_a_d_I_m_a_g_e_D_a_t_a(_P_i_x_e_l_F_o_r_m_a_t resultFormat, _P_i_x_e_l_O_r_i_g_i_n 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 _S_I_L_L_Y │ │ │ │ │ +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 │ │ │ │ │ +_6_2_I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r_:_:_I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r() │ │ │ │ │ +63{ │ │ │ │ │ +64 assert(d_instance == 0); │ │ │ │ │ +65 d_instance = this; │ │ │ │ │ +66 _a_d_d(new _T_G_A_I_m_a_g_e_L_o_a_d_e_r); │ │ │ │ │ +67#ifdef SILLY_HAVE_JPG │ │ │ │ │ +68 _a_d_d(new _J_P_G_I_m_a_g_e_L_o_a_d_e_r); │ │ │ │ │ +69#endif │ │ │ │ │ +70#ifdef SILLY_HAVE_PNG │ │ │ │ │ +71 _a_d_d(new _P_N_G_I_m_a_g_e_L_o_a_d_e_r); │ │ │ │ │ +72#endif │ │ │ │ │ +73// Add other builtins loader here │ │ │ │ │ +74 │ │ │ │ │ +75} │ │ │ │ │ +76 │ │ │ │ │ +_7_7_I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r_:_:_~_I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r() │ │ │ │ │ +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->_s_e_t_D_e_s_t_i_n_a_t_i_o_n(d_pixels, _g_e_t_W_i_d_t_h() * _g_e_t_H_e_i_g_h_t() * d_bpp, │ │ │ │ │ -resultFormat); │ │ │ │ │ -91 │ │ │ │ │ -92 if (! d_imageLoader->_l_o_a_d_I_m_a_g_e_D_a_t_a(order, d_data, d_imageContext)) │ │ │ │ │ -93 { │ │ │ │ │ -94 delete [] d_pixels; │ │ │ │ │ -95 return false; │ │ │ │ │ -96 } │ │ │ │ │ +86 │ │ │ │ │ +_8_7bool _S_I_L_L_Y_I_n_i_t() │ │ │ │ │ +88{ │ │ │ │ │ +89 if (ImageLoaderManager::getSingletonPtr() == 0) │ │ │ │ │ +90 { │ │ │ │ │ +91 if (!new _I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r) │ │ │ │ │ +92 { │ │ │ │ │ +93 return false; │ │ │ │ │ +94 } │ │ │ │ │ +95 } │ │ │ │ │ +96 ++silly_init_counter; │ │ │ │ │ 97 return true; │ │ │ │ │ 98} │ │ │ │ │ 99 │ │ │ │ │ -100bool Image::allocate() │ │ │ │ │ +_1_0_0void _S_I_L_L_Y_C_l_e_a_n_u_p() │ │ │ │ │ 101{ │ │ │ │ │ -102 delete [] d_pixels; │ │ │ │ │ -103 d_pixels = 0; │ │ │ │ │ -104 d_pixels = new byte[d_bpp * _g_e_t_W_i_d_t_h() * _g_e_t_H_e_i_g_h_t()]; │ │ │ │ │ -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 │ │ │ │ │ _S_I_L_L_Y │ │ │ │ │ Simple Image Loading LibrarY namespace. │ │ │ │ │ DDeeffiinniittiioonn _S_I_L_L_Y_J_P_G_I_m_a_g_e_C_o_n_t_e_x_t_._c_p_p_:_4_6 │ │ │ │ │ -_S_I_L_L_Y_:_:_P_i_x_e_l_F_o_r_m_a_t │ │ │ │ │ -PixelFormat │ │ │ │ │ -List all pixel format supported. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_B_a_s_e_._h_:_6_0 │ │ │ │ │ -_S_I_L_L_Y_:_:_P_i_x_e_l_O_r_i_g_i_n │ │ │ │ │ -PixelOrigin │ │ │ │ │ -List all pixel origin supported. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_B_a_s_e_._h_:_7_1 │ │ │ │ │ -_S_I_L_L_Y_:_:_D_a_t_a_S_o_u_r_c_e │ │ │ │ │ -This is an abstract class used to provide data to the loader. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_D_a_t_a_S_o_u_r_c_e_._h_:_4_7 │ │ │ │ │ -_S_I_L_L_Y_:_:_I_m_a_g_e_:_:_I_m_a_g_e │ │ │ │ │ -Image(DataSource &data) │ │ │ │ │ +_S_I_L_L_Y_:_:_S_I_L_L_Y_C_l_e_a_n_u_p │ │ │ │ │ +void SILLYCleanup() │ │ │ │ │ +Cleanup SILLY library internal. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r_._c_p_p_:_1_0_0 │ │ │ │ │ +_S_I_L_L_Y_:_:_S_I_L_L_Y_I_n_i_t │ │ │ │ │ +bool SILLYInit() │ │ │ │ │ +Initialize the SILLY Library. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r_._c_p_p_:_8_7 │ │ │ │ │ +_S_I_L_L_Y_:_:_J_P_G_I_m_a_g_e_L_o_a_d_e_r │ │ │ │ │ +Loader class for JPG Image. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_J_P_G_I_m_a_g_e_L_o_a_d_e_r_._h_:_4_3 │ │ │ │ │ +_S_I_L_L_Y_:_:_P_N_G_I_m_a_g_e_L_o_a_d_e_r │ │ │ │ │ +Loader for PNG Image. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_P_N_G_I_m_a_g_e_L_o_a_d_e_r_._h_:_4_3 │ │ │ │ │ +_S_I_L_L_Y_:_:_T_G_A_I_m_a_g_e_L_o_a_d_e_r │ │ │ │ │ +Loader for Targa image. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_T_G_A_I_m_a_g_e_L_o_a_d_e_r_._h_:_4_4 │ │ │ │ │ +_S_I_L_L_Y_:_:_I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r │ │ │ │ │ +Manage the list of all supported ImageLoader. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r_._h_:_5_7 │ │ │ │ │ +_S_I_L_L_Y_:_:_I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r_:_:_~_I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r │ │ │ │ │ +~ImageLoaderManager() │ │ │ │ │ +Destructor. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r_._c_p_p_:_7_7 │ │ │ │ │ +_S_I_L_L_Y_:_:_I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r_:_:_a_d_d │ │ │ │ │ +void add(ImageLoader *loader) │ │ │ │ │ +Register an ImageLoader object. │ │ │ │ │ +_S_I_L_L_Y_:_:_I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r_:_:_I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r │ │ │ │ │ +ImageLoaderManager() │ │ │ │ │ Constructor. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_I_m_a_g_e_._c_p_p_:_4_8 │ │ │ │ │ -_S_I_L_L_Y_:_:_I_m_a_g_e_:_:_l_o_a_d_I_m_a_g_e_H_e_a_d_e_r │ │ │ │ │ -bool loadImageHeader() │ │ │ │ │ -Retrieve the information concerning the image object. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_I_m_a_g_e_._c_p_p_:_5_4 │ │ │ │ │ -_S_I_L_L_Y_:_:_I_m_a_g_e_:_:_l_o_a_d_I_m_a_g_e_D_a_t_a │ │ │ │ │ -bool loadImageData(PixelFormat resultFormat=PF_RGBA, PixelOrigin │ │ │ │ │ -origin=PO_TOP_LEFT) │ │ │ │ │ -Load the image pixels in memory and store them in resultFormat. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_I_m_a_g_e_._c_p_p_:_6_8 │ │ │ │ │ -_S_I_L_L_Y_:_:_I_m_a_g_e_:_:_g_e_t_W_i_d_t_h │ │ │ │ │ -size_t getWidth() const │ │ │ │ │ -Retrieve the width of the image. │ │ │ │ │ -_S_I_L_L_Y_:_:_I_m_a_g_e_:_:_g_e_t_H_e_i_g_h_t │ │ │ │ │ -size_t getHeight() const │ │ │ │ │ -Retrieve the height of the image. │ │ │ │ │ -_S_I_L_L_Y_:_:_I_m_a_g_e_C_o_n_t_e_x_t_:_:_s_e_t_D_e_s_t_i_n_a_t_i_o_n │ │ │ │ │ -void setDestination(byte *pixels, size_t length, PixelFormat format) │ │ │ │ │ -Set the destination of the loading. │ │ │ │ │ -_S_I_L_L_Y_:_:_I_m_a_g_e_L_o_a_d_e_r_:_:_l_o_a_d_I_m_a_g_e_D_a_t_a │ │ │ │ │ -virtual bool loadImageData(PixelOrigin origin, DataSource *data, ImageContext │ │ │ │ │ -*context)=0 │ │ │ │ │ -Parse the pixels data of the image and fill the header struct. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r_._c_p_p_:_6_2 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./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/SILLYImageContext.icpp Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/SILLYMemoryDataSource.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -44,121 +44,84 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYImageContext.icpp
│ │ │ │ +
SILLYMemoryDataSource.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}
│ │ │ │ -
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
│ │ │ │ +
1/***********************************************************************
│ │ │ │ +
2 filename: SILLYMemoryDataSource.h
│ │ │ │ +
3 created: 10 Jun 2006
│ │ │ │ +
4 author: Olivier Delannoy
│ │ │ │ +
5
│ │ │ │ +
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
│ │ │ │ +
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 _SILLYMemoryDataSource_h_
│ │ │ │ +
31#define _SILLYMemoryDataSource_h_
│ │ │ │ +
32#include "SILLYBase.h"
│ │ │ │ +
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 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 {} │ │ │ │ │ @@ -1,19 +1,19 @@ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ * _b_u_i_l_d │ │ │ │ │ * _r_e_p_r_o_d_u_c_i_b_l_e_-_p_a_t_h │ │ │ │ │ * _s_i_l_l_y_-_0_._1_._0 │ │ │ │ │ * _i_n_c_l_u_d_e │ │ │ │ │ -SILLYImageContext.icpp │ │ │ │ │ +SILLYMemoryDataSource.h │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ -2 filename: SILLYImageContext.icpp │ │ │ │ │ +2 filename: SILLYMemoryDataSource.h │ │ │ │ │ 3 created: 10 Jun 2006 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ -6 purpose: Inline definition for ImageContext │ │ │ │ │ +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 │ │ │ │ │ @@ -29,88 +29,55 @@ │ │ │ │ │ 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 │ │ │ │ │ -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; │ │ │ │ │ +30#ifndef _SILLYMemoryDataSource_h_ │ │ │ │ │ +31#define _SILLYMemoryDataSource_h_ │ │ │ │ │ +32#include "SILLYBase.h" │ │ │ │ │ +33#include "SILLYDataSource.h" │ │ │ │ │ +34// Start of section namespace SILLY │ │ │ │ │ +35namespace _S_I_L_L_Y │ │ │ │ │ +36{ │ │ │ │ │ +37 │ │ │ │ │ +_4_8class SILLY_EXPORT _M_e_m_o_r_y_D_a_t_a_S_o_u_r_c_e : public _D_a_t_a_S_o_u_r_c_e │ │ │ │ │ +49{ │ │ │ │ │ +50public: │ │ │ │ │ +63 _M_e_m_o_r_y_D_a_t_a_S_o_u_r_c_e(const byte* data, size_t size); │ │ │ │ │ +64 │ │ │ │ │ +65 │ │ │ │ │ +_6_6 const byte* _g_e_t_D_a_t_a_P_t_r() const; │ │ │ │ │ +67 │ │ │ │ │ +_6_8 size_t _g_e_t_S_i_z_e() const; │ │ │ │ │ +69private: │ │ │ │ │ +70 const byte* d_bytes; │ │ │ │ │ +71 size_t d_size; │ │ │ │ │ +72}; │ │ │ │ │ +73 │ │ │ │ │ +74 │ │ │ │ │ +75} // End of section namespace SILLY │ │ │ │ │ 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 │ │ │ │ │ +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_ │ │ │ │ │ +_S_I_L_L_Y │ │ │ │ │ +Simple Image Loading LibrarY namespace. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_J_P_G_I_m_a_g_e_C_o_n_t_e_x_t_._c_p_p_:_4_6 │ │ │ │ │ +_S_I_L_L_Y_:_:_D_a_t_a_S_o_u_r_c_e │ │ │ │ │ +This is an abstract class used to provide data to the loader. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_D_a_t_a_S_o_u_r_c_e_._h_:_4_7 │ │ │ │ │ +_S_I_L_L_Y_:_:_M_e_m_o_r_y_D_a_t_a_S_o_u_r_c_e │ │ │ │ │ +Load an image from a memory area. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_M_e_m_o_r_y_D_a_t_a_S_o_u_r_c_e_._h_:_4_9 │ │ │ │ │ +_S_I_L_L_Y_:_:_M_e_m_o_r_y_D_a_t_a_S_o_u_r_c_e_:_:_g_e_t_D_a_t_a_P_t_r │ │ │ │ │ +const byte * getDataPtr() const │ │ │ │ │ +Get raw access to the image data. │ │ │ │ │ +_S_I_L_L_Y_:_:_M_e_m_o_r_y_D_a_t_a_S_o_u_r_c_e_:_:_g_e_t_S_i_z_e │ │ │ │ │ +size_t getSize() const │ │ │ │ │ +Return the size of the data. │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./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/SILLYFileDataSource.h Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/SILLYImage.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -44,86 +44,126 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYFileDataSource.h
│ │ │ │ +
SILLYImage.h
│ │ │ │
│ │ │ │
│ │ │ │ -
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/***********************************************************************
│ │ │ │ +
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
│ │ │ │ -
│ │ │ │ -
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};
│ │ │ │ +
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};
│ │ │ │
│ │ │ │ -
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.
│ │ │ │ +
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 {} │ │ │ │ │ @@ -1,87 +1,150 @@ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ * _b_u_i_l_d │ │ │ │ │ * _r_e_p_r_o_d_u_c_i_b_l_e_-_p_a_t_h │ │ │ │ │ * _s_i_l_l_y_-_0_._1_._0 │ │ │ │ │ * _i_n_c_l_u_d_e │ │ │ │ │ -SILLYFileDataSource.h │ │ │ │ │ -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 _S_I_L_L_Y │ │ │ │ │ -36{ │ │ │ │ │ +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#ifndef _SILLYImage_h_ │ │ │ │ │ +32#define _SILLYImage_h_ │ │ │ │ │ +33#include "SILLYBase.h" │ │ │ │ │ +34#include "SILLYImageContext.h" │ │ │ │ │ +35#include "SILLYDataSource.h" │ │ │ │ │ +36#include "SILLYImageLoader.h" │ │ │ │ │ 37 │ │ │ │ │ -_4_8class SILLY_EXPORT _F_i_l_e_D_a_t_a_S_o_u_r_c_e : public _D_a_t_a_S_o_u_r_c_e │ │ │ │ │ -49{ │ │ │ │ │ -50public: │ │ │ │ │ -60 _F_i_l_e_D_a_t_a_S_o_u_r_c_e(const char* filename); │ │ │ │ │ -64 _~_F_i_l_e_D_a_t_a_S_o_u_r_c_e(); │ │ │ │ │ -_7_3 bool _i_s_V_a_l_i_d() const; │ │ │ │ │ -74 │ │ │ │ │ -_7_5 const byte* _g_e_t_D_a_t_a_P_t_r() const; │ │ │ │ │ -_7_6 size_t _g_e_t_S_i_z_e() 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_ │ │ │ │ │ +38// Start of section namespace SILLY │ │ │ │ │ +39namespace _S_I_L_L_Y │ │ │ │ │ +40{ │ │ │ │ │ +41 │ │ │ │ │ +_4_6class SILLY_EXPORT _I_m_a_g_e │ │ │ │ │ +47{ │ │ │ │ │ +48public: │ │ │ │ │ +55 _I_m_a_g_e(_D_a_t_a_S_o_u_r_c_e& data); │ │ │ │ │ +56 │ │ │ │ │ +_6_1 _~_I_m_a_g_e(); │ │ │ │ │ +62 │ │ │ │ │ +_6_7 bool _i_s_V_a_l_i_d() const; │ │ │ │ │ +68 │ │ │ │ │ +69 │ │ │ │ │ +76 bool loadImageHeader(); │ │ │ │ │ +77 │ │ │ │ │ +91 bool loadImageData(_P_i_x_e_l_F_o_r_m_a_t resultFormat = PF_RGBA, _P_i_x_e_l_O_r_i_g_i_n origin = │ │ │ │ │ +PO_TOP_LEFT); │ │ │ │ │ +92 │ │ │ │ │ +_9_7 size_t _g_e_t_W_i_d_t_h() const; │ │ │ │ │ +98 │ │ │ │ │ +_1_0_3 size_t _g_e_t_H_e_i_g_h_t() const; │ │ │ │ │ +104 │ │ │ │ │ +_1_0_9 _P_i_x_e_l_F_o_r_m_a_t _g_e_t_S_o_u_r_c_e_P_i_x_e_l_F_o_r_m_a_t() const; │ │ │ │ │ +110 │ │ │ │ │ +_1_1_5 _P_i_x_e_l_F_o_r_m_a_t _g_e_t_P_i_x_e_l_F_o_r_m_a_t() const; │ │ │ │ │ +116 │ │ │ │ │ +_1_2_0 const byte* _g_e_t_P_i_x_e_l_s_D_a_t_a_P_t_r() const; │ │ │ │ │ +_1_2_5 size_t _g_e_t_P_i_x_e_l_s_D_a_t_a_S_i_z_e() const; │ │ │ │ │ +_1_3_0 const char* _g_e_t_L_o_a_d_e_r_I_d_e_n_t_i_f_i_e_r_S_t_r_i_n_g() const; │ │ │ │ │ +131private: │ │ │ │ │ +132 bool allocate(); │ │ │ │ │ +133 │ │ │ │ │ +134private: │ │ │ │ │ +135 │ │ │ │ │ +136 size_t d_bpp; │ │ │ │ │ +137 _P_i_x_e_l_F_o_r_m_a_t d_pfSource; │ │ │ │ │ +138 byte* d_pixels; │ │ │ │ │ +139 _D_a_t_a_S_o_u_r_c_e* d_data; │ │ │ │ │ +140 _I_m_a_g_e_C_o_n_t_e_x_t* d_imageContext; │ │ │ │ │ +141 _I_m_a_g_e_L_o_a_d_e_r* d_imageLoader; │ │ │ │ │ +142 │ │ │ │ │ +143 // Disabled operation │ │ │ │ │ +144 _I_m_a_g_e(_I_m_a_g_e&); │ │ │ │ │ +145 _I_m_a_g_e& operator=(_I_m_a_g_e&); │ │ │ │ │ +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_ │ │ │ │ │ _S_I_L_L_Y │ │ │ │ │ Simple Image Loading LibrarY namespace. │ │ │ │ │ DDeeffiinniittiioonn _S_I_L_L_Y_J_P_G_I_m_a_g_e_C_o_n_t_e_x_t_._c_p_p_:_4_6 │ │ │ │ │ +_S_I_L_L_Y_:_:_P_i_x_e_l_F_o_r_m_a_t │ │ │ │ │ +PixelFormat │ │ │ │ │ +List all pixel format supported. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_B_a_s_e_._h_:_6_0 │ │ │ │ │ +_S_I_L_L_Y_:_:_P_i_x_e_l_O_r_i_g_i_n │ │ │ │ │ +PixelOrigin │ │ │ │ │ +List all pixel origin supported. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_B_a_s_e_._h_:_7_1 │ │ │ │ │ _S_I_L_L_Y_:_:_D_a_t_a_S_o_u_r_c_e │ │ │ │ │ This is an abstract class used to provide data to the loader. │ │ │ │ │ DDeeffiinniittiioonn _S_I_L_L_Y_D_a_t_a_S_o_u_r_c_e_._h_:_4_7 │ │ │ │ │ -_S_I_L_L_Y_:_:_F_i_l_e_D_a_t_a_S_o_u_r_c_e │ │ │ │ │ -This class allow the loading of an image directly from a file. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_F_i_l_e_D_a_t_a_S_o_u_r_c_e_._h_:_4_9 │ │ │ │ │ -_S_I_L_L_Y_:_:_F_i_l_e_D_a_t_a_S_o_u_r_c_e_:_:_g_e_t_D_a_t_a_P_t_r │ │ │ │ │ -const byte * getDataPtr() const │ │ │ │ │ -Get raw access to the image data. │ │ │ │ │ -_S_I_L_L_Y_:_:_F_i_l_e_D_a_t_a_S_o_u_r_c_e_:_:_i_s_V_a_l_i_d │ │ │ │ │ +_S_I_L_L_Y_:_:_I_m_a_g_e │ │ │ │ │ +Image is the main user class of the library. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_I_m_a_g_e_._h_:_4_7 │ │ │ │ │ +_S_I_L_L_Y_:_:_I_m_a_g_e_:_:_g_e_t_S_o_u_r_c_e_P_i_x_e_l_F_o_r_m_a_t │ │ │ │ │ +PixelFormat getSourcePixelFormat() const │ │ │ │ │ +Retrieve the pixel format used for the image storage. │ │ │ │ │ +_S_I_L_L_Y_:_:_I_m_a_g_e_:_:_g_e_t_L_o_a_d_e_r_I_d_e_n_t_i_f_i_e_r_S_t_r_i_n_g │ │ │ │ │ +const char * getLoaderIdentifierString() const │ │ │ │ │ +Get Image loader identifier string. │ │ │ │ │ +_S_I_L_L_Y_:_:_I_m_a_g_e_:_:_g_e_t_P_i_x_e_l_s_D_a_t_a_P_t_r │ │ │ │ │ +const byte * getPixelsDataPtr() const │ │ │ │ │ +Get a pointer to the pixels data. │ │ │ │ │ +_S_I_L_L_Y_:_:_I_m_a_g_e_:_:_i_s_V_a_l_i_d │ │ │ │ │ bool isValid() const │ │ │ │ │ -Check wether the loading is successfull or not. │ │ │ │ │ -_S_I_L_L_Y_:_:_F_i_l_e_D_a_t_a_S_o_u_r_c_e_:_:_g_e_t_S_i_z_e │ │ │ │ │ -size_t getSize() const │ │ │ │ │ -Return the size of the data. │ │ │ │ │ +Return true if the image is valid after its loading. │ │ │ │ │ +_S_I_L_L_Y_:_:_I_m_a_g_e_:_:_g_e_t_P_i_x_e_l_s_D_a_t_a_S_i_z_e │ │ │ │ │ +size_t getPixelsDataSize() const │ │ │ │ │ +Get the size of the pixel buffer. │ │ │ │ │ +_S_I_L_L_Y_:_:_I_m_a_g_e_:_:_~_I_m_a_g_e │ │ │ │ │ +~Image() │ │ │ │ │ +Destructor. │ │ │ │ │ +_S_I_L_L_Y_:_:_I_m_a_g_e_:_:_g_e_t_W_i_d_t_h │ │ │ │ │ +size_t getWidth() const │ │ │ │ │ +Retrieve the width of the image. │ │ │ │ │ +_S_I_L_L_Y_:_:_I_m_a_g_e_:_:_g_e_t_P_i_x_e_l_F_o_r_m_a_t │ │ │ │ │ +PixelFormat getPixelFormat() const │ │ │ │ │ +Retrieve the pixel format of the resulting image. │ │ │ │ │ +_S_I_L_L_Y_:_:_I_m_a_g_e_:_:_g_e_t_H_e_i_g_h_t │ │ │ │ │ +size_t getHeight() const │ │ │ │ │ +Retrieve the height of the image. │ │ │ │ │ +_S_I_L_L_Y_:_:_I_m_a_g_e_C_o_n_t_e_x_t │ │ │ │ │ +Store the data needed by an ImageLoader object during the parsing of an image. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_I_m_a_g_e_C_o_n_t_e_x_t_._h_:_4_4 │ │ │ │ │ +_S_I_L_L_Y_:_:_I_m_a_g_e_L_o_a_d_e_r │ │ │ │ │ +This is an abstract class that define the interface of all image loader. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_I_m_a_g_e_L_o_a_d_e_r_._h_:_4_7 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./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/SILLYImageLoaderManager.h Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/SILLYFileDataSource.icpp Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -44,112 +44,67 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYImageLoaderManager.h
│ │ │ │ +
SILLYFileDataSource.icpp
│ │ │ │
│ │ │ │
│ │ │ │ -
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;
│ │ │ │ +
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
│ │ │ │ -
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.
│ │ │ │ +
44inline size_t FileDataSource::getSize() const
│ │ │ │ +
45{
│ │ │ │ +
46 return d_size;
│ │ │ │ +
47}
│ │ │ │ +
48
│ │ │ │ +
49} // End of section namespace SILLY
│ │ │ │ +
50
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,19 +1,19 @@ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ * _b_u_i_l_d │ │ │ │ │ * _r_e_p_r_o_d_u_c_i_b_l_e_-_p_a_t_h │ │ │ │ │ * _s_i_l_l_y_-_0_._1_._0 │ │ │ │ │ * _i_n_c_l_u_d_e │ │ │ │ │ -SILLYImageLoaderManager.h │ │ │ │ │ +SILLYFileDataSource.icpp │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ -2 filename: ImageLoaderManager.h │ │ │ │ │ -3 created: 10 Jun 2006 │ │ │ │ │ +2 filename: SILLYFileDataSource.icpp │ │ │ │ │ +3 created: 20 Jul 2006 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ -6 purpose: Manage all available loader │ │ │ │ │ +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 │ │ │ │ │ @@ -29,88 +29,30 @@ │ │ │ │ │ 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 │ │ │ │ │ -34// Start of section namespace SILLY │ │ │ │ │ -35namespace _S_I_L_L_Y │ │ │ │ │ -36{ │ │ │ │ │ -37class ImageLoader; // Forward declaration │ │ │ │ │ -_4_2typedef std::vector _I_m_a_g_e_L_o_a_d_e_r_L_i_s_t; │ │ │ │ │ +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 │ │ │ │ │ -44#if defined(_MSC_VER) │ │ │ │ │ -45 │ │ │ │ │ -46# pragma warning(push) │ │ │ │ │ -47 │ │ │ │ │ -48# pragma warning(disable : 4251) │ │ │ │ │ -49 │ │ │ │ │ -50#endif │ │ │ │ │ -51 │ │ │ │ │ -_5_6class SILLY_EXPORT _I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r │ │ │ │ │ -57{ │ │ │ │ │ -58 │ │ │ │ │ -59public: │ │ │ │ │ -64 _I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r(); │ │ │ │ │ -69 _~_I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r(); │ │ │ │ │ -_7_4 ImageLoaderList::iterator _b_e_g_i_n(); │ │ │ │ │ -_7_9 ImageLoaderList::iterator _e_n_d(); │ │ │ │ │ -_8_6 void _a_d_d(_I_m_a_g_e_L_o_a_d_e_r* loader); │ │ │ │ │ -87 │ │ │ │ │ -88private: │ │ │ │ │ -89 _I_m_a_g_e_L_o_a_d_e_r_L_i_s_t d_loaders; │ │ │ │ │ -90 │ │ │ │ │ -91public: │ │ │ │ │ -92 static _I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r* getSingletonPtr(); │ │ │ │ │ -93 static _I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r& getSingleton(); │ │ │ │ │ -94 │ │ │ │ │ -95private: │ │ │ │ │ -96 static _I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r* d_instance; │ │ │ │ │ -97 │ │ │ │ │ -98 // Disabled operations │ │ │ │ │ -99 _I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r(_I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r&); │ │ │ │ │ -100 _I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r& operator=(_I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r&); │ │ │ │ │ -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_ │ │ │ │ │ -_S_I_L_L_Y │ │ │ │ │ -Simple Image Loading LibrarY namespace. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_J_P_G_I_m_a_g_e_C_o_n_t_e_x_t_._c_p_p_:_4_6 │ │ │ │ │ -_S_I_L_L_Y_:_:_I_m_a_g_e_L_o_a_d_e_r_L_i_s_t │ │ │ │ │ -std::vector< ImageLoader * > ImageLoaderList │ │ │ │ │ -Typename for a collection of image loader. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r_._h_:_4_2 │ │ │ │ │ -_S_I_L_L_Y_:_:_I_m_a_g_e_L_o_a_d_e_r │ │ │ │ │ -This is an abstract class that define the interface of all image loader. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_I_m_a_g_e_L_o_a_d_e_r_._h_:_4_7 │ │ │ │ │ -_S_I_L_L_Y_:_:_I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r │ │ │ │ │ -Manage the list of all supported ImageLoader. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r_._h_:_5_7 │ │ │ │ │ -_S_I_L_L_Y_:_:_I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r_:_:_a_d_d │ │ │ │ │ -void add(ImageLoader *loader) │ │ │ │ │ -Register an ImageLoader object. │ │ │ │ │ -_S_I_L_L_Y_:_:_I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r_:_:_b_e_g_i_n │ │ │ │ │ -ImageLoaderList::iterator begin() │ │ │ │ │ -Get an iterator to the first ImageLoader registered. │ │ │ │ │ -_S_I_L_L_Y_:_:_I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r_:_:_e_n_d │ │ │ │ │ -ImageLoaderList::iterator end() │ │ │ │ │ -Get an iterator to the first not registered ImageLoader. │ │ │ │ │ +44inline size_t FileDataSource::getSize() const │ │ │ │ │ +45{ │ │ │ │ │ +46 return d_size; │ │ │ │ │ +47} │ │ │ │ │ +48 │ │ │ │ │ +49} // End of section namespace SILLY │ │ │ │ │ +50 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./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/loaders/SILLYTGAImageLoader.h Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/SILLYDataSource.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -40,27 +40,27 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYTGAImageLoader.h
│ │ │ │ +
SILLYDataSource.h
│ │ │ │
│ │ │ │
│ │ │ │
1/***********************************************************************
│ │ │ │ -
2 filename: SILLYTGAImageLoader.h
│ │ │ │ -
3 created: 11 Jun 2006
│ │ │ │ -
4 author: Olivier Delannoy
│ │ │ │ +
2 filename: SILLYDataSource.h
│ │ │ │ +
3 created: 10 Jun 2006
│ │ │ │ +
4 author: Olivier Delannoy
│ │ │ │
5
│ │ │ │ -
6 purpose: Declaration of the TGAImageLoader 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
│ │ │ │ @@ -76,54 +76,47 @@ │ │ │ │
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_
│ │ │ │ +
30#ifndef _SILLYDataSource_h_
│ │ │ │ +
31#define _SILLYDataSource_h_
│ │ │ │
32#include "SILLYBase.h"
│ │ │ │ -
33#include "SILLYImageLoader.h"
│ │ │ │ +
33
│ │ │ │
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:
│ │ │ │ -
53
│ │ │ │ -
54};
│ │ │ │ +
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};
│ │ │ │
│ │ │ │ -
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.
│ │ │ │ +
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 {} │ │ │ │ │ @@ -1,20 +1,19 @@ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ * _b_u_i_l_d │ │ │ │ │ * _r_e_p_r_o_d_u_c_i_b_l_e_-_p_a_t_h │ │ │ │ │ * _s_i_l_l_y_-_0_._1_._0 │ │ │ │ │ * _i_n_c_l_u_d_e │ │ │ │ │ - * _l_o_a_d_e_r_s │ │ │ │ │ -SILLYTGAImageLoader.h │ │ │ │ │ +SILLYDataSource.h │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ -2 filename: SILLYTGAImageLoader.h │ │ │ │ │ -3 created: 11 Jun 2006 │ │ │ │ │ +2 filename: SILLYDataSource.h │ │ │ │ │ +3 created: 10 Jun 2006 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ -6 purpose: Declaration of the TGAImageLoader 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 │ │ │ │ │ @@ -30,69 +29,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 _SILLYTGAImageLoader_h_ │ │ │ │ │ -31#define _SILLYTGAImageLoader_h_ │ │ │ │ │ +30#ifndef _SILLYDataSource_h_ │ │ │ │ │ +31#define _SILLYDataSource_h_ │ │ │ │ │ 32#include "SILLYBase.h" │ │ │ │ │ -33#include "SILLYImageLoader.h" │ │ │ │ │ +33 │ │ │ │ │ 34// Start of section namespace SILLY │ │ │ │ │ 35namespace _S_I_L_L_Y │ │ │ │ │ 36{ │ │ │ │ │ -37class TGAImageContext; │ │ │ │ │ -_4_3class _T_G_A_I_m_a_g_e_L_o_a_d_e_r : public _I_m_a_g_e_L_o_a_d_e_r │ │ │ │ │ -44{ │ │ │ │ │ -45public: │ │ │ │ │ -46 _T_G_A_I_m_a_g_e_L_o_a_d_e_r(); │ │ │ │ │ -47 _~_T_G_A_I_m_a_g_e_L_o_a_d_e_r(); │ │ │ │ │ -48 _I_m_a_g_e_C_o_n_t_e_x_t* _l_o_a_d_H_e_a_d_e_r(_P_i_x_e_l_F_o_r_m_a_t& formatSource, _D_a_t_a_S_o_u_r_c_e* data); │ │ │ │ │ -49 bool _l_o_a_d_I_m_a_g_e_D_a_t_a(_P_i_x_e_l_O_r_i_g_i_n origin, │ │ │ │ │ -50 _D_a_t_a_S_o_u_r_c_e* data, │ │ │ │ │ -51 _I_m_a_g_e_C_o_n_t_e_x_t* 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_ │ │ │ │ │ +37 │ │ │ │ │ +_4_6class SILLY_EXPORT _D_a_t_a_S_o_u_r_c_e │ │ │ │ │ +47{ │ │ │ │ │ +48public: │ │ │ │ │ +_5_3 virtual _~_D_a_t_a_S_o_u_r_c_e(); │ │ │ │ │ +_5_8 virtual const byte * _g_e_t_D_a_t_a_P_t_r() const = 0; │ │ │ │ │ +_6_4 byte operator[] (size_t offset) const; │ │ │ │ │ +_6_9 virtual size_t _g_e_t_S_i_z_e() 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_ │ │ │ │ │ _S_I_L_L_Y │ │ │ │ │ Simple Image Loading LibrarY namespace. │ │ │ │ │ DDeeffiinniittiioonn _S_I_L_L_Y_J_P_G_I_m_a_g_e_C_o_n_t_e_x_t_._c_p_p_:_4_6 │ │ │ │ │ -_S_I_L_L_Y_:_:_P_i_x_e_l_F_o_r_m_a_t │ │ │ │ │ -PixelFormat │ │ │ │ │ -List all pixel format supported. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_B_a_s_e_._h_:_6_0 │ │ │ │ │ -_S_I_L_L_Y_:_:_P_i_x_e_l_O_r_i_g_i_n │ │ │ │ │ -PixelOrigin │ │ │ │ │ -List all pixel origin supported. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_B_a_s_e_._h_:_7_1 │ │ │ │ │ -_S_I_L_L_Y_:_:_T_G_A_I_m_a_g_e_L_o_a_d_e_r │ │ │ │ │ -Loader for Targa image. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_T_G_A_I_m_a_g_e_L_o_a_d_e_r_._h_:_4_4 │ │ │ │ │ -_S_I_L_L_Y_:_:_T_G_A_I_m_a_g_e_L_o_a_d_e_r_:_:_l_o_a_d_H_e_a_d_e_r │ │ │ │ │ -ImageContext * loadHeader(PixelFormat &formatSource, DataSource *data) │ │ │ │ │ -Parse the header of the image and fill the header struct. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_T_G_A_I_m_a_g_e_L_o_a_d_e_r_._c_p_p_:_7_4 │ │ │ │ │ -_S_I_L_L_Y_:_:_T_G_A_I_m_a_g_e_L_o_a_d_e_r_:_:_l_o_a_d_I_m_a_g_e_D_a_t_a │ │ │ │ │ -bool loadImageData(PixelOrigin origin, DataSource *data, ImageContext *context) │ │ │ │ │ -Parse the pixels data of the image and fill the header struct. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_T_G_A_I_m_a_g_e_L_o_a_d_e_r_._c_p_p_:_1_3_4 │ │ │ │ │ _S_I_L_L_Y_:_:_D_a_t_a_S_o_u_r_c_e │ │ │ │ │ This is an abstract class used to provide data to the loader. │ │ │ │ │ DDeeffiinniittiioonn _S_I_L_L_Y_D_a_t_a_S_o_u_r_c_e_._h_:_4_7 │ │ │ │ │ -_S_I_L_L_Y_:_:_I_m_a_g_e_C_o_n_t_e_x_t │ │ │ │ │ -Store the data needed by an ImageLoader object during the parsing of an image. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_I_m_a_g_e_C_o_n_t_e_x_t_._h_:_4_4 │ │ │ │ │ -_S_I_L_L_Y_:_:_I_m_a_g_e_L_o_a_d_e_r │ │ │ │ │ -This is an abstract class that define the interface of all image loader. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_I_m_a_g_e_L_o_a_d_e_r_._h_:_4_7 │ │ │ │ │ +_S_I_L_L_Y_:_:_D_a_t_a_S_o_u_r_c_e_:_:_g_e_t_S_i_z_e │ │ │ │ │ +virtual size_t getSize() const =0 │ │ │ │ │ +Return the size of the data. │ │ │ │ │ +_S_I_L_L_Y_:_:_D_a_t_a_S_o_u_r_c_e_:_:_g_e_t_D_a_t_a_P_t_r │ │ │ │ │ +virtual const byte * getDataPtr() const =0 │ │ │ │ │ +Get raw access to the image data. │ │ │ │ │ +_S_I_L_L_Y_:_:_D_a_t_a_S_o_u_r_c_e_:_:_~_D_a_t_a_S_o_u_r_c_e │ │ │ │ │ +virtual ~DataSource() │ │ │ │ │ +Destructor. │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libsilly-doc/html/a00056_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/loaders/SILLYTGAImageLoader.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -44,23 +44,23 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYPNGImageLoader.h
│ │ │ │ +
SILLYTGAImageLoader.h
│ │ │ │
│ │ │ │
│ │ │ │
1/***********************************************************************
│ │ │ │ -
2 filename: SILLYPNGImageLoader.h
│ │ │ │ +
2 filename: SILLYTGAImageLoader.h
│ │ │ │
3 created: 11 Jun 2006
│ │ │ │
4 author: Olivier Delannoy
│ │ │ │
5
│ │ │ │ -
6 purpose: Declaration of the PNGImageLoader 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
│ │ │ │ @@ -76,57 +76,53 @@ │ │ │ │
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 _SILLYTGAImageLoader_h_
│ │ │ │ +
31#define _SILLYTGAImageLoader_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};
│ │ │ │ +
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:
│ │ │ │ +
53
│ │ │ │ +
54};
│ │ │ │
│ │ │ │ -
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.
│ │ │ │ +
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 {} │ │ │ │ │ @@ -1,20 +1,20 @@ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ * _b_u_i_l_d │ │ │ │ │ * _r_e_p_r_o_d_u_c_i_b_l_e_-_p_a_t_h │ │ │ │ │ * _s_i_l_l_y_-_0_._1_._0 │ │ │ │ │ * _i_n_c_l_u_d_e │ │ │ │ │ * _l_o_a_d_e_r_s │ │ │ │ │ -SILLYPNGImageLoader.h │ │ │ │ │ +SILLYTGAImageLoader.h │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ -2 filename: SILLYPNGImageLoader.h │ │ │ │ │ +2 filename: SILLYTGAImageLoader.h │ │ │ │ │ 3 created: 11 Jun 2006 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ -6 purpose: Declaration of the PNGImageLoader 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 │ │ │ │ │ @@ -30,69 +30,65 @@ │ │ │ │ │ 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 _SILLYTGAImageLoader_h_ │ │ │ │ │ +31#define _SILLYTGAImageLoader_h_ │ │ │ │ │ 32#include "SILLYBase.h" │ │ │ │ │ 33#include "SILLYImageLoader.h" │ │ │ │ │ -34#include "SILLYDataSource.h" │ │ │ │ │ -35// Start of section namespace SILLY │ │ │ │ │ -36namespace _S_I_L_L_Y │ │ │ │ │ -37{ │ │ │ │ │ -_4_2class _P_N_G_I_m_a_g_e_L_o_a_d_e_r : public _I_m_a_g_e_L_o_a_d_e_r │ │ │ │ │ -43{ │ │ │ │ │ -44public: │ │ │ │ │ -45 _P_N_G_I_m_a_g_e_L_o_a_d_e_r(); │ │ │ │ │ -46 │ │ │ │ │ -47 _~_P_N_G_I_m_a_g_e_L_o_a_d_e_r(); │ │ │ │ │ -48 │ │ │ │ │ -49 _I_m_a_g_e_C_o_n_t_e_x_t* _l_o_a_d_H_e_a_d_e_r(_P_i_x_e_l_F_o_r_m_a_t& formatSource, _D_a_t_a_S_o_u_r_c_e* data); │ │ │ │ │ -50 │ │ │ │ │ -51 bool _l_o_a_d_I_m_a_g_e_D_a_t_a(_P_i_x_e_l_O_r_i_g_i_n origin, │ │ │ │ │ -52 _D_a_t_a_S_o_u_r_c_e* data, │ │ │ │ │ -53 _I_m_a_g_e_C_o_n_t_e_x_t* context); │ │ │ │ │ -54private: │ │ │ │ │ +34// Start of section namespace SILLY │ │ │ │ │ +35namespace _S_I_L_L_Y │ │ │ │ │ +36{ │ │ │ │ │ +37class TGAImageContext; │ │ │ │ │ +_4_3class _T_G_A_I_m_a_g_e_L_o_a_d_e_r : public _I_m_a_g_e_L_o_a_d_e_r │ │ │ │ │ +44{ │ │ │ │ │ +45public: │ │ │ │ │ +46 _T_G_A_I_m_a_g_e_L_o_a_d_e_r(); │ │ │ │ │ +47 _~_T_G_A_I_m_a_g_e_L_o_a_d_e_r(); │ │ │ │ │ +48 _I_m_a_g_e_C_o_n_t_e_x_t* _l_o_a_d_H_e_a_d_e_r(_P_i_x_e_l_F_o_r_m_a_t& formatSource, _D_a_t_a_S_o_u_r_c_e* data); │ │ │ │ │ +49 bool _l_o_a_d_I_m_a_g_e_D_a_t_a(_P_i_x_e_l_O_r_i_g_i_n origin, │ │ │ │ │ +50 _D_a_t_a_S_o_u_r_c_e* data, │ │ │ │ │ +51 _I_m_a_g_e_C_o_n_t_e_x_t* context); │ │ │ │ │ +52private: │ │ │ │ │ +53 │ │ │ │ │ +54}; │ │ │ │ │ 55 │ │ │ │ │ -56}; │ │ │ │ │ +56} // End of section namespace SILLY │ │ │ │ │ 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_ │ │ │ │ │ +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_ │ │ │ │ │ _S_I_L_L_Y │ │ │ │ │ Simple Image Loading LibrarY namespace. │ │ │ │ │ DDeeffiinniittiioonn _S_I_L_L_Y_J_P_G_I_m_a_g_e_C_o_n_t_e_x_t_._c_p_p_:_4_6 │ │ │ │ │ _S_I_L_L_Y_:_:_P_i_x_e_l_F_o_r_m_a_t │ │ │ │ │ PixelFormat │ │ │ │ │ List all pixel format supported. │ │ │ │ │ DDeeffiinniittiioonn _S_I_L_L_Y_B_a_s_e_._h_:_6_0 │ │ │ │ │ _S_I_L_L_Y_:_:_P_i_x_e_l_O_r_i_g_i_n │ │ │ │ │ PixelOrigin │ │ │ │ │ List all pixel origin supported. │ │ │ │ │ DDeeffiinniittiioonn _S_I_L_L_Y_B_a_s_e_._h_:_7_1 │ │ │ │ │ -_S_I_L_L_Y_:_:_P_N_G_I_m_a_g_e_L_o_a_d_e_r │ │ │ │ │ -Loader for PNG Image. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_P_N_G_I_m_a_g_e_L_o_a_d_e_r_._h_:_4_3 │ │ │ │ │ -_S_I_L_L_Y_:_:_P_N_G_I_m_a_g_e_L_o_a_d_e_r_:_:_l_o_a_d_H_e_a_d_e_r │ │ │ │ │ +_S_I_L_L_Y_:_:_T_G_A_I_m_a_g_e_L_o_a_d_e_r │ │ │ │ │ +Loader for Targa image. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_T_G_A_I_m_a_g_e_L_o_a_d_e_r_._h_:_4_4 │ │ │ │ │ +_S_I_L_L_Y_:_:_T_G_A_I_m_a_g_e_L_o_a_d_e_r_:_:_l_o_a_d_H_e_a_d_e_r │ │ │ │ │ ImageContext * loadHeader(PixelFormat &formatSource, DataSource *data) │ │ │ │ │ Parse the header of the image and fill the header struct. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_P_N_G_I_m_a_g_e_L_o_a_d_e_r_._c_p_p_:_8_8 │ │ │ │ │ -_S_I_L_L_Y_:_:_P_N_G_I_m_a_g_e_L_o_a_d_e_r_:_:_l_o_a_d_I_m_a_g_e_D_a_t_a │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_T_G_A_I_m_a_g_e_L_o_a_d_e_r_._c_p_p_:_7_4 │ │ │ │ │ +_S_I_L_L_Y_:_:_T_G_A_I_m_a_g_e_L_o_a_d_e_r_:_:_l_o_a_d_I_m_a_g_e_D_a_t_a │ │ │ │ │ bool loadImageData(PixelOrigin origin, DataSource *data, ImageContext *context) │ │ │ │ │ Parse the pixels data of the image and fill the header struct. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_P_N_G_I_m_a_g_e_L_o_a_d_e_r_._c_p_p_:_1_5_4 │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_T_G_A_I_m_a_g_e_L_o_a_d_e_r_._c_p_p_:_1_3_4 │ │ │ │ │ _S_I_L_L_Y_:_:_D_a_t_a_S_o_u_r_c_e │ │ │ │ │ This is an abstract class used to provide data to the loader. │ │ │ │ │ DDeeffiinniittiioonn _S_I_L_L_Y_D_a_t_a_S_o_u_r_c_e_._h_:_4_7 │ │ │ │ │ _S_I_L_L_Y_:_:_I_m_a_g_e_C_o_n_t_e_x_t │ │ │ │ │ Store the data needed by an ImageLoader object during the parsing of an image. │ │ │ │ │ DDeeffiinniittiioonn _S_I_L_L_Y_I_m_a_g_e_C_o_n_t_e_x_t_._h_:_4_4 │ │ │ │ │ _S_I_L_L_Y_:_:_I_m_a_g_e_L_o_a_d_e_r │ │ │ ├── ./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/loaders/SILLYPNGImageLoader.icpp Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/loaders/SILLYPNGImageContext.icpp Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -44,23 +44,23 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYPNGImageLoader.icpp
│ │ │ │ +
SILLYPNGImageContext.icpp
│ │ │ │
│ │ │ │
│ │ │ │
1/***********************************************************************
│ │ │ │ -
2 filename: SILLYPNGImageLoader.icpp
│ │ │ │ +
2 filename: SILLYPNGImageContext.icpp
│ │ │ │
3 created: 11 Jun 2006
│ │ │ │
4 author: Olivier Delannoy
│ │ │ │
5
│ │ │ │ -
6 purpose: Inline definition for PNGImageLoader
│ │ │ │ +
6 purpose: Inline definition for 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
│ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,20 +1,20 @@ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ * _b_u_i_l_d │ │ │ │ │ * _r_e_p_r_o_d_u_c_i_b_l_e_-_p_a_t_h │ │ │ │ │ * _s_i_l_l_y_-_0_._1_._0 │ │ │ │ │ * _i_n_c_l_u_d_e │ │ │ │ │ * _l_o_a_d_e_r_s │ │ │ │ │ -SILLYPNGImageLoader.icpp │ │ │ │ │ +SILLYPNGImageContext.icpp │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ -2 filename: SILLYPNGImageLoader.icpp │ │ │ │ │ +2 filename: SILLYPNGImageContext.icpp │ │ │ │ │ 3 created: 11 Jun 2006 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ -6 purpose: Inline definition for PNGImageLoader │ │ │ │ │ +6 purpose: Inline definition for 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 │ │ │ ├── ./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/loaders/SILLYTGAImageContext.icpp Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/loaders/SILLYJPGImageLoader.icpp Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -44,23 +44,23 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYTGAImageContext.icpp
│ │ │ │ +
SILLYJPGImageLoader.icpp
│ │ │ │
│ │ │ │
│ │ │ │
1/***********************************************************************
│ │ │ │ -
2 filename: SILLYTGAImageContext.icpp
│ │ │ │ +
2 filename: SILLYJPGImageLoader.icpp
│ │ │ │
3 created: 11 Jun 2006
│ │ │ │
4 author: Olivier Delannoy
│ │ │ │
5
│ │ │ │ -
6 purpose: Inline definition for TGAImageContext class
│ │ │ │ +
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
│ │ │ │ @@ -80,25 +80,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 {} │ │ │ │ │ @@ -1,20 +1,20 @@ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ * _b_u_i_l_d │ │ │ │ │ * _r_e_p_r_o_d_u_c_i_b_l_e_-_p_a_t_h │ │ │ │ │ * _s_i_l_l_y_-_0_._1_._0 │ │ │ │ │ * _i_n_c_l_u_d_e │ │ │ │ │ * _l_o_a_d_e_r_s │ │ │ │ │ -SILLYTGAImageContext.icpp │ │ │ │ │ +SILLYJPGImageLoader.icpp │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ -2 filename: SILLYTGAImageContext.icpp │ │ │ │ │ +2 filename: SILLYJPGImageLoader.icpp │ │ │ │ │ 3 created: 11 Jun 2006 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ -6 purpose: Inline definition for TGAImageContext class │ │ │ │ │ +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 │ │ │ │ │ @@ -34,20 +34,12 @@ │ │ │ │ │ 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 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./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/loaders/SILLYJPGImageContext.h Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/loaders/SILLYTGAImageLoader.icpp Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -44,94 +44,53 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYJPGImageContext.h
│ │ │ │ +
SILLYTGAImageLoader.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: 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
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,20 +1,20 @@ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ * _b_u_i_l_d │ │ │ │ │ * _r_e_p_r_o_d_u_c_i_b_l_e_-_p_a_t_h │ │ │ │ │ * _s_i_l_l_y_-_0_._1_._0 │ │ │ │ │ * _i_n_c_l_u_d_e │ │ │ │ │ * _l_o_a_d_e_r_s │ │ │ │ │ -SILLYJPGImageContext.h │ │ │ │ │ +SILLYTGAImageLoader.icpp │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ -2 filename: SILLYJPGImageContext.h │ │ │ │ │ +2 filename: SILLYTGAImageLoader.icpp │ │ │ │ │ 3 created: 11 Jun 2006 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ -6 purpose: Declaration of the JPGImageContext 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 │ │ │ │ │ @@ -30,63 +30,16 @@ │ │ │ │ │ 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 │ │ │ │ │ -37#include │ │ │ │ │ -38#include │ │ │ │ │ -39extern "C" │ │ │ │ │ -40{ │ │ │ │ │ -41#include │ │ │ │ │ -42} │ │ │ │ │ -43namespace _S_I_L_L_Y │ │ │ │ │ -44{ │ │ │ │ │ -45 │ │ │ │ │ -_5_6class _J_P_G_I_m_a_g_e_C_o_n_t_e_x_t : public _I_m_a_g_e_C_o_n_t_e_x_t │ │ │ │ │ -57{ │ │ │ │ │ -58public: │ │ │ │ │ -59 _J_P_G_I_m_a_g_e_C_o_n_t_e_x_t(); │ │ │ │ │ -60 _~_J_P_G_I_m_a_g_e_C_o_n_t_e_x_t(); │ │ │ │ │ -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 _D_a_t_a_S_o_u_r_c_e* 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_ │ │ │ │ │ -_S_I_L_L_Y │ │ │ │ │ -Simple Image Loading LibrarY namespace. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_J_P_G_I_m_a_g_e_C_o_n_t_e_x_t_._c_p_p_:_4_6 │ │ │ │ │ -_S_I_L_L_Y_:_:_J_P_G_I_m_a_g_e_C_o_n_t_e_x_t │ │ │ │ │ -Image Context for JPG image loader. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_J_P_G_I_m_a_g_e_C_o_n_t_e_x_t_._h_:_5_7 │ │ │ │ │ -_S_I_L_L_Y_:_:_D_a_t_a_S_o_u_r_c_e │ │ │ │ │ -This is an abstract class used to provide data to the loader. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_D_a_t_a_S_o_u_r_c_e_._h_:_4_7 │ │ │ │ │ -_S_I_L_L_Y_:_:_I_m_a_g_e_C_o_n_t_e_x_t │ │ │ │ │ -Store the data needed by an ImageLoader object during the parsing of an image. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_I_m_a_g_e_C_o_n_t_e_x_t_._h_:_4_4 │ │ │ │ │ +30 │ │ │ │ │ +31// Start of section namespace SILLY │ │ │ │ │ +32namespace SILLY │ │ │ │ │ +33{ │ │ │ │ │ +34 │ │ │ │ │ +35} // End of section namespace SILLY │ │ │ │ │ +36 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./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/loaders/SILLYTGAImageLoader.icpp Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/loaders/SILLYTGAImageContext.icpp Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -44,23 +44,23 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYTGAImageLoader.icpp
│ │ │ │ +
SILLYTGAImageContext.icpp
│ │ │ │
│ │ │ │
│ │ │ │
1/***********************************************************************
│ │ │ │ -
2 filename: SILLYTGAImageLoader.icpp
│ │ │ │ +
2 filename: SILLYTGAImageContext.icpp
│ │ │ │
3 created: 11 Jun 2006
│ │ │ │
4 author: Olivier Delannoy
│ │ │ │
5
│ │ │ │ -
6 purpose: Inline defintion of TGAImageLoader 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
│ │ │ │ @@ -80,17 +80,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{
│ │ │ │ -
34
│ │ │ │ -
35} // End of section namespace SILLY
│ │ │ │ -
36
│ │ │ │ +
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
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,20 +1,20 @@ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ * _b_u_i_l_d │ │ │ │ │ * _r_e_p_r_o_d_u_c_i_b_l_e_-_p_a_t_h │ │ │ │ │ * _s_i_l_l_y_-_0_._1_._0 │ │ │ │ │ * _i_n_c_l_u_d_e │ │ │ │ │ * _l_o_a_d_e_r_s │ │ │ │ │ -SILLYTGAImageLoader.icpp │ │ │ │ │ +SILLYTGAImageContext.icpp │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ -2 filename: SILLYTGAImageLoader.icpp │ │ │ │ │ +2 filename: SILLYTGAImageContext.icpp │ │ │ │ │ 3 created: 11 Jun 2006 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ -6 purpose: Inline defintion of TGAImageLoader 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 │ │ │ │ │ @@ -34,12 +34,20 @@ │ │ │ │ │ 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 │ │ │ │ │ +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 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./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/loaders/SILLYJPGImageLoader.h Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/loaders/SILLYJPGImageContext.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -44,23 +44,23 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYJPGImageLoader.h
│ │ │ │ +
SILLYJPGImageContext.h
│ │ │ │
│ │ │ │
│ │ │ │
1/***********************************************************************
│ │ │ │ -
2 filename: SILLYJPGImageLoader.h
│ │ │ │ +
2 filename: SILLYJPGImageContext.h
│ │ │ │
3 created: 11 Jun 2006
│ │ │ │
4 author: Olivier Delannoy
│ │ │ │
5
│ │ │ │ -
6 purpose: Declaration of the JPGImageLoader 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
│ │ │ │ @@ -76,52 +76,62 @@ │ │ │ │
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"
│ │ │ │ -
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};
│ │ │ │ +
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};
│ │ │ │
│ │ │ │ -
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.
│ │ │ │ +
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 {} │ │ │ │ │ @@ -1,20 +1,20 @@ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ * _b_u_i_l_d │ │ │ │ │ * _r_e_p_r_o_d_u_c_i_b_l_e_-_p_a_t_h │ │ │ │ │ * _s_i_l_l_y_-_0_._1_._0 │ │ │ │ │ * _i_n_c_l_u_d_e │ │ │ │ │ * _l_o_a_d_e_r_s │ │ │ │ │ -SILLYJPGImageLoader.h │ │ │ │ │ +SILLYJPGImageContext.h │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ -2 filename: SILLYJPGImageLoader.h │ │ │ │ │ +2 filename: SILLYJPGImageContext.h │ │ │ │ │ 3 created: 11 Jun 2006 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ -6 purpose: Declaration of the JPGImageLoader 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 │ │ │ │ │ @@ -30,68 +30,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 _SILLYJPGImageLoader_h_ │ │ │ │ │ -31#define _SILLYJPGImageLoader_h_ │ │ │ │ │ +30#ifndef _SILLYJPGImageContext_h_ │ │ │ │ │ +31#define _SILLYJPGImageContext_h_ │ │ │ │ │ 32#include "SILLYBase.h" │ │ │ │ │ -33#include "SILLYImageLoader.h" │ │ │ │ │ -34// Start of section namespace SILLY │ │ │ │ │ -35namespace _S_I_L_L_Y │ │ │ │ │ -36{ │ │ │ │ │ -37 │ │ │ │ │ -_4_2class _J_P_G_I_m_a_g_e_L_o_a_d_e_r : public _I_m_a_g_e_L_o_a_d_e_r │ │ │ │ │ -43{ │ │ │ │ │ -44public: │ │ │ │ │ -45 _J_P_G_I_m_a_g_e_L_o_a_d_e_r(); │ │ │ │ │ -46 _~_J_P_G_I_m_a_g_e_L_o_a_d_e_r(); │ │ │ │ │ -47 _I_m_a_g_e_C_o_n_t_e_x_t* _l_o_a_d_H_e_a_d_e_r(_P_i_x_e_l_F_o_r_m_a_t& header, _D_a_t_a_S_o_u_r_c_e* data); │ │ │ │ │ -48 bool _l_o_a_d_I_m_a_g_e_D_a_t_a(_P_i_x_e_l_O_r_i_g_i_n origin, _D_a_t_a_S_o_u_r_c_e* data, _I_m_a_g_e_C_o_n_t_e_x_t* │ │ │ │ │ -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_ │ │ │ │ │ +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 _S_I_L_L_Y │ │ │ │ │ +44{ │ │ │ │ │ +45 │ │ │ │ │ +_5_6class _J_P_G_I_m_a_g_e_C_o_n_t_e_x_t : public _I_m_a_g_e_C_o_n_t_e_x_t │ │ │ │ │ +57{ │ │ │ │ │ +58public: │ │ │ │ │ +59 _J_P_G_I_m_a_g_e_C_o_n_t_e_x_t(); │ │ │ │ │ +60 _~_J_P_G_I_m_a_g_e_C_o_n_t_e_x_t(); │ │ │ │ │ +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 _D_a_t_a_S_o_u_r_c_e* 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_ │ │ │ │ │ _S_I_L_L_Y │ │ │ │ │ Simple Image Loading LibrarY namespace. │ │ │ │ │ DDeeffiinniittiioonn _S_I_L_L_Y_J_P_G_I_m_a_g_e_C_o_n_t_e_x_t_._c_p_p_:_4_6 │ │ │ │ │ -_S_I_L_L_Y_:_:_P_i_x_e_l_F_o_r_m_a_t │ │ │ │ │ -PixelFormat │ │ │ │ │ -List all pixel format supported. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_B_a_s_e_._h_:_6_0 │ │ │ │ │ -_S_I_L_L_Y_:_:_P_i_x_e_l_O_r_i_g_i_n │ │ │ │ │ -PixelOrigin │ │ │ │ │ -List all pixel origin supported. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_B_a_s_e_._h_:_7_1 │ │ │ │ │ -_S_I_L_L_Y_:_:_J_P_G_I_m_a_g_e_L_o_a_d_e_r │ │ │ │ │ -Loader class for JPG Image. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_J_P_G_I_m_a_g_e_L_o_a_d_e_r_._h_:_4_3 │ │ │ │ │ -_S_I_L_L_Y_:_:_J_P_G_I_m_a_g_e_L_o_a_d_e_r_:_:_l_o_a_d_I_m_a_g_e_D_a_t_a │ │ │ │ │ -bool loadImageData(PixelOrigin origin, DataSource *data, ImageContext *context) │ │ │ │ │ -Parse the pixels data of the image and fill the header struct. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_J_P_G_I_m_a_g_e_L_o_a_d_e_r_._c_p_p_:_9_0 │ │ │ │ │ -_S_I_L_L_Y_:_:_J_P_G_I_m_a_g_e_L_o_a_d_e_r_:_:_l_o_a_d_H_e_a_d_e_r │ │ │ │ │ -ImageContext * loadHeader(PixelFormat &header, DataSource *data) │ │ │ │ │ -Parse the header of the image and fill the header struct. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_J_P_G_I_m_a_g_e_L_o_a_d_e_r_._c_p_p_:_5_6 │ │ │ │ │ +_S_I_L_L_Y_:_:_J_P_G_I_m_a_g_e_C_o_n_t_e_x_t │ │ │ │ │ +Image Context for JPG image loader. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_J_P_G_I_m_a_g_e_C_o_n_t_e_x_t_._h_:_5_7 │ │ │ │ │ _S_I_L_L_Y_:_:_D_a_t_a_S_o_u_r_c_e │ │ │ │ │ This is an abstract class used to provide data to the loader. │ │ │ │ │ DDeeffiinniittiioonn _S_I_L_L_Y_D_a_t_a_S_o_u_r_c_e_._h_:_4_7 │ │ │ │ │ _S_I_L_L_Y_:_:_I_m_a_g_e_C_o_n_t_e_x_t │ │ │ │ │ Store the data needed by an ImageLoader object during the parsing of an image. │ │ │ │ │ DDeeffiinniittiioonn _S_I_L_L_Y_I_m_a_g_e_C_o_n_t_e_x_t_._h_:_4_4 │ │ │ │ │ -_S_I_L_L_Y_:_:_I_m_a_g_e_L_o_a_d_e_r │ │ │ │ │ -This is an abstract class that define the interface of all image loader. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_I_m_a_g_e_L_o_a_d_e_r_._h_:_4_7 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./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/loaders/SILLYPNGImageContext.icpp Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/loaders/SILLYJPGImageLoader.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -44,53 +44,84 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYPNGImageContext.icpp
│ │ │ │ +
SILLYJPGImageLoader.h
│ │ │ │
│ │ │ │
│ │ │ │ -
1/***********************************************************************
│ │ │ │ -
2 filename: SILLYPNGImageContext.icpp
│ │ │ │ -
3 created: 11 Jun 2006
│ │ │ │ -
4 author: Olivier Delannoy
│ │ │ │ -
5
│ │ │ │ -
6 purpose: Inline definition for 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
│ │ │ │ -
31// Start of section namespace SILLY
│ │ │ │ -
32namespace SILLY
│ │ │ │ -
33{
│ │ │ │ -
34
│ │ │ │ -
35} // End of section namespace SILLY
│ │ │ │ -
36
│ │ │ │ +
1/***********************************************************************
│ │ │ │ +
2 filename: SILLYJPGImageLoader.h
│ │ │ │ +
3 created: 11 Jun 2006
│ │ │ │ +
4 author: Olivier Delannoy
│ │ │ │ +
5
│ │ │ │ +
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
│ │ │ │ +
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 _SILLYJPGImageLoader_h_
│ │ │ │ +
31#define _SILLYJPGImageLoader_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.
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,20 +1,20 @@ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ * _b_u_i_l_d │ │ │ │ │ * _r_e_p_r_o_d_u_c_i_b_l_e_-_p_a_t_h │ │ │ │ │ * _s_i_l_l_y_-_0_._1_._0 │ │ │ │ │ * _i_n_c_l_u_d_e │ │ │ │ │ * _l_o_a_d_e_r_s │ │ │ │ │ -SILLYPNGImageContext.icpp │ │ │ │ │ +SILLYJPGImageLoader.h │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ -2 filename: SILLYPNGImageContext.icpp │ │ │ │ │ +2 filename: SILLYJPGImageLoader.h │ │ │ │ │ 3 created: 11 Jun 2006 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ -6 purpose: Inline definition for PNGImageContext class │ │ │ │ │ +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 │ │ │ │ │ @@ -30,16 +30,68 @@ │ │ │ │ │ 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 │ │ │ │ │ +30#ifndef _SILLYJPGImageLoader_h_ │ │ │ │ │ +31#define _SILLYJPGImageLoader_h_ │ │ │ │ │ +32#include "SILLYBase.h" │ │ │ │ │ +33#include "SILLYImageLoader.h" │ │ │ │ │ +34// Start of section namespace SILLY │ │ │ │ │ +35namespace _S_I_L_L_Y │ │ │ │ │ +36{ │ │ │ │ │ +37 │ │ │ │ │ +_4_2class _J_P_G_I_m_a_g_e_L_o_a_d_e_r : public _I_m_a_g_e_L_o_a_d_e_r │ │ │ │ │ +43{ │ │ │ │ │ +44public: │ │ │ │ │ +45 _J_P_G_I_m_a_g_e_L_o_a_d_e_r(); │ │ │ │ │ +46 _~_J_P_G_I_m_a_g_e_L_o_a_d_e_r(); │ │ │ │ │ +47 _I_m_a_g_e_C_o_n_t_e_x_t* _l_o_a_d_H_e_a_d_e_r(_P_i_x_e_l_F_o_r_m_a_t& header, _D_a_t_a_S_o_u_r_c_e* data); │ │ │ │ │ +48 bool _l_o_a_d_I_m_a_g_e_D_a_t_a(_P_i_x_e_l_O_r_i_g_i_n origin, _D_a_t_a_S_o_u_r_c_e* data, _I_m_a_g_e_C_o_n_t_e_x_t* │ │ │ │ │ +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_ │ │ │ │ │ +_S_I_L_L_Y │ │ │ │ │ +Simple Image Loading LibrarY namespace. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_J_P_G_I_m_a_g_e_C_o_n_t_e_x_t_._c_p_p_:_4_6 │ │ │ │ │ +_S_I_L_L_Y_:_:_P_i_x_e_l_F_o_r_m_a_t │ │ │ │ │ +PixelFormat │ │ │ │ │ +List all pixel format supported. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_B_a_s_e_._h_:_6_0 │ │ │ │ │ +_S_I_L_L_Y_:_:_P_i_x_e_l_O_r_i_g_i_n │ │ │ │ │ +PixelOrigin │ │ │ │ │ +List all pixel origin supported. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_B_a_s_e_._h_:_7_1 │ │ │ │ │ +_S_I_L_L_Y_:_:_J_P_G_I_m_a_g_e_L_o_a_d_e_r │ │ │ │ │ +Loader class for JPG Image. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_J_P_G_I_m_a_g_e_L_o_a_d_e_r_._h_:_4_3 │ │ │ │ │ +_S_I_L_L_Y_:_:_J_P_G_I_m_a_g_e_L_o_a_d_e_r_:_:_l_o_a_d_I_m_a_g_e_D_a_t_a │ │ │ │ │ +bool loadImageData(PixelOrigin origin, DataSource *data, ImageContext *context) │ │ │ │ │ +Parse the pixels data of the image and fill the header struct. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_J_P_G_I_m_a_g_e_L_o_a_d_e_r_._c_p_p_:_9_0 │ │ │ │ │ +_S_I_L_L_Y_:_:_J_P_G_I_m_a_g_e_L_o_a_d_e_r_:_:_l_o_a_d_H_e_a_d_e_r │ │ │ │ │ +ImageContext * loadHeader(PixelFormat &header, DataSource *data) │ │ │ │ │ +Parse the header of the image and fill the header struct. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_J_P_G_I_m_a_g_e_L_o_a_d_e_r_._c_p_p_:_5_6 │ │ │ │ │ +_S_I_L_L_Y_:_:_D_a_t_a_S_o_u_r_c_e │ │ │ │ │ +This is an abstract class used to provide data to the loader. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_D_a_t_a_S_o_u_r_c_e_._h_:_4_7 │ │ │ │ │ +_S_I_L_L_Y_:_:_I_m_a_g_e_C_o_n_t_e_x_t │ │ │ │ │ +Store the data needed by an ImageLoader object during the parsing of an image. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_I_m_a_g_e_C_o_n_t_e_x_t_._h_:_4_4 │ │ │ │ │ +_S_I_L_L_Y_:_:_I_m_a_g_e_L_o_a_d_e_r │ │ │ │ │ +This is an abstract class that define the interface of all image loader. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_I_m_a_g_e_L_o_a_d_e_r_._h_:_4_7 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./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.h Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/loaders/SILLYPNGImageLoader.icpp Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -44,84 +44,53 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYTGAImageContext.h
│ │ │ │ +
SILLYPNGImageLoader.icpp
│ │ │ │
│ │ │ │
│ │ │ │ -
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
│ │ │ │ -
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.
│ │ │ │ +
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
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,20 +1,20 @@ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ * _b_u_i_l_d │ │ │ │ │ * _r_e_p_r_o_d_u_c_i_b_l_e_-_p_a_t_h │ │ │ │ │ * _s_i_l_l_y_-_0_._1_._0 │ │ │ │ │ * _i_n_c_l_u_d_e │ │ │ │ │ * _l_o_a_d_e_r_s │ │ │ │ │ -SILLYTGAImageContext.h │ │ │ │ │ +SILLYPNGImageLoader.icpp │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ -2 filename: SILLYTGAImageContext.h │ │ │ │ │ +2 filename: SILLYPNGImageLoader.icpp │ │ │ │ │ 3 created: 11 Jun 2006 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ -6 purpose: Declaration of the TGAImageContext class │ │ │ │ │ +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 │ │ │ │ │ @@ -30,53 +30,16 @@ │ │ │ │ │ 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 _S_I_L_L_Y │ │ │ │ │ -36{ │ │ │ │ │ -_4_2class _T_G_A_I_m_a_g_e_C_o_n_t_e_x_t : public _I_m_a_g_e_C_o_n_t_e_x_t │ │ │ │ │ -43{ │ │ │ │ │ -44public: │ │ │ │ │ -45 _T_G_A_I_m_a_g_e_C_o_n_t_e_x_t(size_t width, size_t height); │ │ │ │ │ -46 _~_T_G_A_I_m_a_g_e_C_o_n_t_e_x_t(); │ │ │ │ │ -47 │ │ │ │ │ -48private: │ │ │ │ │ -49 byte d_idLength; │ │ │ │ │ -50 byte d_imageType; │ │ │ │ │ -51 byte d_depth; │ │ │ │ │ -52 byte d_description; │ │ │ │ │ -53 │ │ │ │ │ -54 friend class _T_G_A_I_m_a_g_e_L_o_a_d_e_r; │ │ │ │ │ -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_ │ │ │ │ │ -_S_I_L_L_Y │ │ │ │ │ -Simple Image Loading LibrarY namespace. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_J_P_G_I_m_a_g_e_C_o_n_t_e_x_t_._c_p_p_:_4_6 │ │ │ │ │ -_S_I_L_L_Y_:_:_T_G_A_I_m_a_g_e_C_o_n_t_e_x_t │ │ │ │ │ -Image Context for Targa image. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_T_G_A_I_m_a_g_e_C_o_n_t_e_x_t_._h_:_4_3 │ │ │ │ │ -_S_I_L_L_Y_:_:_T_G_A_I_m_a_g_e_L_o_a_d_e_r │ │ │ │ │ -Loader for Targa image. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_T_G_A_I_m_a_g_e_L_o_a_d_e_r_._h_:_4_4 │ │ │ │ │ -_S_I_L_L_Y_:_:_I_m_a_g_e_C_o_n_t_e_x_t │ │ │ │ │ -Store the data needed by an ImageLoader object during the parsing of an image. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_I_m_a_g_e_C_o_n_t_e_x_t_._h_:_4_4 │ │ │ │ │ +30 │ │ │ │ │ +31// Start of section namespace SILLY │ │ │ │ │ +32namespace SILLY │ │ │ │ │ +33{ │ │ │ │ │ +34 │ │ │ │ │ +35} // End of section namespace SILLY │ │ │ │ │ +36 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./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/SILLYPNGImageContext.h Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/loaders/SILLYPNGImageLoader.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -44,23 +44,23 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYPNGImageContext.h
│ │ │ │ +
SILLYPNGImageLoader.h
│ │ │ │
│ │ │ │
│ │ │ │
1/***********************************************************************
│ │ │ │ -
2 filename: SILLYPNGImageContext.h
│ │ │ │ +
2 filename: SILLYPNGImageLoader.h
│ │ │ │
3 created: 11 Jun 2006
│ │ │ │
4 author: Olivier Delannoy
│ │ │ │
5
│ │ │ │ -
6 purpose: Declaration of the PNGImageContext 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
│ │ │ │ @@ -76,68 +76,58 @@ │ │ │ │
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_
│ │ │ │ +
30#ifndef _SILLYPNGImageLoader_h_
│ │ │ │ +
31#define _SILLYPNGImageLoader_h_
│ │ │ │
32#include "SILLYBase.h"
│ │ │ │ -
33#include "SILLYImageContext.h"
│ │ │ │ +
33#include "SILLYImageLoader.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:
│ │ │ │ - │ │ │ │ - │ │ │ │ +
35// Start of section namespace SILLY
│ │ │ │ +
36namespace SILLY
│ │ │ │ +
37{
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
43{
│ │ │ │ +
44public:
│ │ │ │ + │ │ │ │ +
46
│ │ │ │ + │ │ │ │ +
48
│ │ │ │ +
49 ImageContext* loadHeader(PixelFormat& formatSource, DataSource* data);
│ │ │ │
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};
│ │ │ │ +
51 bool loadImageData(PixelOrigin origin,
│ │ │ │ +
52 DataSource* data,
│ │ │ │ +
53 ImageContext* context);
│ │ │ │ +
54private:
│ │ │ │ +
55
│ │ │ │ +
56};
│ │ │ │
│ │ │ │ -
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.
│ │ │ │ +
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 {} │ │ │ │ │ @@ -1,20 +1,20 @@ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ * _b_u_i_l_d │ │ │ │ │ * _r_e_p_r_o_d_u_c_i_b_l_e_-_p_a_t_h │ │ │ │ │ * _s_i_l_l_y_-_0_._1_._0 │ │ │ │ │ * _i_n_c_l_u_d_e │ │ │ │ │ * _l_o_a_d_e_r_s │ │ │ │ │ -SILLYPNGImageContext.h │ │ │ │ │ +SILLYPNGImageLoader.h │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ -2 filename: SILLYPNGImageContext.h │ │ │ │ │ +2 filename: SILLYPNGImageLoader.h │ │ │ │ │ 3 created: 11 Jun 2006 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ -6 purpose: Declaration of the PNGImageContext 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 │ │ │ │ │ @@ -30,71 +30,73 @@ │ │ │ │ │ 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_ │ │ │ │ │ +30#ifndef _SILLYPNGImageLoader_h_ │ │ │ │ │ +31#define _SILLYPNGImageLoader_h_ │ │ │ │ │ 32#include "SILLYBase.h" │ │ │ │ │ -33#include "SILLYImageContext.h" │ │ │ │ │ +33#include "SILLYImageLoader.h" │ │ │ │ │ 34#include "SILLYDataSource.h" │ │ │ │ │ -35#include │ │ │ │ │ -36// Start of section namespace SILLY │ │ │ │ │ -37namespace _S_I_L_L_Y │ │ │ │ │ -38{ │ │ │ │ │ -39 │ │ │ │ │ -_4_5class SILLY_EXPORT _P_N_G_I_m_a_g_e_C_o_n_t_e_x_t : public _I_m_a_g_e_C_o_n_t_e_x_t │ │ │ │ │ -46{ │ │ │ │ │ -47public: │ │ │ │ │ -48 _P_N_G_I_m_a_g_e_C_o_n_t_e_x_t(_D_a_t_a_S_o_u_r_c_e* data); │ │ │ │ │ -49 _~_P_N_G_I_m_a_g_e_C_o_n_t_e_x_t(); │ │ │ │ │ +35// Start of section namespace SILLY │ │ │ │ │ +36namespace _S_I_L_L_Y │ │ │ │ │ +37{ │ │ │ │ │ +_4_2class _P_N_G_I_m_a_g_e_L_o_a_d_e_r : public _I_m_a_g_e_L_o_a_d_e_r │ │ │ │ │ +43{ │ │ │ │ │ +44public: │ │ │ │ │ +45 _P_N_G_I_m_a_g_e_L_o_a_d_e_r(); │ │ │ │ │ +46 │ │ │ │ │ +47 _~_P_N_G_I_m_a_g_e_L_o_a_d_e_r(); │ │ │ │ │ +48 │ │ │ │ │ +49 _I_m_a_g_e_C_o_n_t_e_x_t* _l_o_a_d_H_e_a_d_e_r(_P_i_x_e_l_F_o_r_m_a_t& formatSource, _D_a_t_a_S_o_u_r_c_e* data); │ │ │ │ │ 50 │ │ │ │ │ -51 int read(png_bytep data, png_size_t length); │ │ │ │ │ -52 │ │ │ │ │ -53 │ │ │ │ │ -54 │ │ │ │ │ -55private: │ │ │ │ │ -56 void setImageSize(); │ │ │ │ │ +51 bool _l_o_a_d_I_m_a_g_e_D_a_t_a(_P_i_x_e_l_O_r_i_g_i_n origin, │ │ │ │ │ +52 _D_a_t_a_S_o_u_r_c_e* data, │ │ │ │ │ +53 _I_m_a_g_e_C_o_n_t_e_x_t* context); │ │ │ │ │ +54private: │ │ │ │ │ +55 │ │ │ │ │ +56}; │ │ │ │ │ 57 │ │ │ │ │ -58 size_t d_offset; │ │ │ │ │ -59 │ │ │ │ │ -60 _D_a_t_a_S_o_u_r_c_e* d_data; │ │ │ │ │ -61 │ │ │ │ │ -62 png_structp d_png_ptr; │ │ │ │ │ -63 │ │ │ │ │ -64 png_infop d_info_ptr; │ │ │ │ │ +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 size_t d_bit_depth; │ │ │ │ │ -67 size_t d_num_channels; │ │ │ │ │ -68 │ │ │ │ │ -69 │ │ │ │ │ -70 friend class _P_N_G_I_m_a_g_e_L_o_a_d_e_r; │ │ │ │ │ -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_ │ │ │ │ │ +66#endif // end of guard _SILLYPNGImageLoader_h_ │ │ │ │ │ _S_I_L_L_Y │ │ │ │ │ Simple Image Loading LibrarY namespace. │ │ │ │ │ DDeeffiinniittiioonn _S_I_L_L_Y_J_P_G_I_m_a_g_e_C_o_n_t_e_x_t_._c_p_p_:_4_6 │ │ │ │ │ -_S_I_L_L_Y_:_:_P_N_G_I_m_a_g_e_C_o_n_t_e_x_t │ │ │ │ │ -Image Context for PNG Image Loader. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_P_N_G_I_m_a_g_e_C_o_n_t_e_x_t_._h_:_4_6 │ │ │ │ │ +_S_I_L_L_Y_:_:_P_i_x_e_l_F_o_r_m_a_t │ │ │ │ │ +PixelFormat │ │ │ │ │ +List all pixel format supported. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_B_a_s_e_._h_:_6_0 │ │ │ │ │ +_S_I_L_L_Y_:_:_P_i_x_e_l_O_r_i_g_i_n │ │ │ │ │ +PixelOrigin │ │ │ │ │ +List all pixel origin supported. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_B_a_s_e_._h_:_7_1 │ │ │ │ │ _S_I_L_L_Y_:_:_P_N_G_I_m_a_g_e_L_o_a_d_e_r │ │ │ │ │ Loader for PNG Image. │ │ │ │ │ DDeeffiinniittiioonn _S_I_L_L_Y_P_N_G_I_m_a_g_e_L_o_a_d_e_r_._h_:_4_3 │ │ │ │ │ +_S_I_L_L_Y_:_:_P_N_G_I_m_a_g_e_L_o_a_d_e_r_:_:_l_o_a_d_H_e_a_d_e_r │ │ │ │ │ +ImageContext * loadHeader(PixelFormat &formatSource, DataSource *data) │ │ │ │ │ +Parse the header of the image and fill the header struct. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_P_N_G_I_m_a_g_e_L_o_a_d_e_r_._c_p_p_:_8_8 │ │ │ │ │ +_S_I_L_L_Y_:_:_P_N_G_I_m_a_g_e_L_o_a_d_e_r_:_:_l_o_a_d_I_m_a_g_e_D_a_t_a │ │ │ │ │ +bool loadImageData(PixelOrigin origin, DataSource *data, ImageContext *context) │ │ │ │ │ +Parse the pixels data of the image and fill the header struct. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_P_N_G_I_m_a_g_e_L_o_a_d_e_r_._c_p_p_:_1_5_4 │ │ │ │ │ _S_I_L_L_Y_:_:_D_a_t_a_S_o_u_r_c_e │ │ │ │ │ This is an abstract class used to provide data to the loader. │ │ │ │ │ DDeeffiinniittiioonn _S_I_L_L_Y_D_a_t_a_S_o_u_r_c_e_._h_:_4_7 │ │ │ │ │ _S_I_L_L_Y_:_:_I_m_a_g_e_C_o_n_t_e_x_t │ │ │ │ │ Store the data needed by an ImageLoader object during the parsing of an image. │ │ │ │ │ DDeeffiinniittiioonn _S_I_L_L_Y_I_m_a_g_e_C_o_n_t_e_x_t_._h_:_4_4 │ │ │ │ │ +_S_I_L_L_Y_:_:_I_m_a_g_e_L_o_a_d_e_r │ │ │ │ │ +This is an abstract class that define the interface of all image loader. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_I_m_a_g_e_L_o_a_d_e_r_._h_:_4_7 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libsilly-doc/html/a00083_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/SILLYTGAImageContext.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -44,53 +44,84 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYJPGImageLoader.icpp
│ │ │ │ +
SILLYTGAImageContext.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: 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
│ │ │ │ +
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 {} │ │ │ │ │ @@ -1,20 +1,20 @@ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ * _b_u_i_l_d │ │ │ │ │ * _r_e_p_r_o_d_u_c_i_b_l_e_-_p_a_t_h │ │ │ │ │ * _s_i_l_l_y_-_0_._1_._0 │ │ │ │ │ * _i_n_c_l_u_d_e │ │ │ │ │ * _l_o_a_d_e_r_s │ │ │ │ │ -SILLYJPGImageLoader.icpp │ │ │ │ │ +SILLYTGAImageContext.h │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ -2 filename: SILLYJPGImageLoader.icpp │ │ │ │ │ +2 filename: SILLYTGAImageContext.h │ │ │ │ │ 3 created: 11 Jun 2006 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ -6 purpose: Inline definition of JPGImageLoader class │ │ │ │ │ +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 │ │ │ │ │ @@ -30,16 +30,53 @@ │ │ │ │ │ 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 │ │ │ │ │ +30#ifndef _SILLYTGAImageContext_h_ │ │ │ │ │ +31#define _SILLYTGAImageContext_h_ │ │ │ │ │ +32#include "SILLYBase.h" │ │ │ │ │ +33#include "SILLYImageContext.h" │ │ │ │ │ +34// Start of section namespace SILLY │ │ │ │ │ +35namespace _S_I_L_L_Y │ │ │ │ │ +36{ │ │ │ │ │ +_4_2class _T_G_A_I_m_a_g_e_C_o_n_t_e_x_t : public _I_m_a_g_e_C_o_n_t_e_x_t │ │ │ │ │ +43{ │ │ │ │ │ +44public: │ │ │ │ │ +45 _T_G_A_I_m_a_g_e_C_o_n_t_e_x_t(size_t width, size_t height); │ │ │ │ │ +46 _~_T_G_A_I_m_a_g_e_C_o_n_t_e_x_t(); │ │ │ │ │ +47 │ │ │ │ │ +48private: │ │ │ │ │ +49 byte d_idLength; │ │ │ │ │ +50 byte d_imageType; │ │ │ │ │ +51 byte d_depth; │ │ │ │ │ +52 byte d_description; │ │ │ │ │ +53 │ │ │ │ │ +54 friend class _T_G_A_I_m_a_g_e_L_o_a_d_e_r; │ │ │ │ │ +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_ │ │ │ │ │ +_S_I_L_L_Y │ │ │ │ │ +Simple Image Loading LibrarY namespace. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_J_P_G_I_m_a_g_e_C_o_n_t_e_x_t_._c_p_p_:_4_6 │ │ │ │ │ +_S_I_L_L_Y_:_:_T_G_A_I_m_a_g_e_C_o_n_t_e_x_t │ │ │ │ │ +Image Context for Targa image. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_T_G_A_I_m_a_g_e_C_o_n_t_e_x_t_._h_:_4_3 │ │ │ │ │ +_S_I_L_L_Y_:_:_T_G_A_I_m_a_g_e_L_o_a_d_e_r │ │ │ │ │ +Loader for Targa image. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_T_G_A_I_m_a_g_e_L_o_a_d_e_r_._h_:_4_4 │ │ │ │ │ +_S_I_L_L_Y_:_:_I_m_a_g_e_C_o_n_t_e_x_t │ │ │ │ │ +Store the data needed by an ImageLoader object during the parsing of an image. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_I_m_a_g_e_C_o_n_t_e_x_t_._h_:_4_4 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./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/SILLYImageContext.h Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/loaders/SILLYPNGImageContext.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -40,27 +40,27 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYImageContext.h
│ │ │ │ +
SILLYPNGImageContext.h
│ │ │ │
│ │ │ │
│ │ │ │
1/***********************************************************************
│ │ │ │ -
2 filename: SILLYImageContext.h
│ │ │ │ -
3 created: 10 Jun 2006
│ │ │ │ +
2 filename: SILLYPNGImageContext.h
│ │ │ │ +
3 created: 11 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: 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
│ │ │ │ @@ -76,74 +76,68 @@ │ │ │ │
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_
│ │ │ │ +
30#ifndef _SILLYPNGImageContext_h_
│ │ │ │ +
31#define _SILLYPNGImageContext_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);
│ │ │ │ +
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
│ │ │ │ -
62 void setNextPixel(byte red, byte green, byte bleu, byte alpha);
│ │ │ │ +
58 size_t d_offset;
│ │ │ │ +
59
│ │ │ │ +
60 DataSource* d_data;
│ │ │ │ +
61
│ │ │ │ +
62 png_structp d_png_ptr;
│ │ │ │
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};
│ │ │ │ +
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};
│ │ │ │
│ │ │ │ -
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.
│ │ │ │ +
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 {} │ │ │ │ │ @@ -1,20 +1,20 @@ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ * _b_u_i_l_d │ │ │ │ │ * _r_e_p_r_o_d_u_c_i_b_l_e_-_p_a_t_h │ │ │ │ │ * _s_i_l_l_y_-_0_._1_._0 │ │ │ │ │ * _i_n_c_l_u_d_e │ │ │ │ │ -SILLYImageContext.h │ │ │ │ │ + * _l_o_a_d_e_r_s │ │ │ │ │ +SILLYPNGImageContext.h │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ -2 filename: SILLYImageContext.h │ │ │ │ │ -3 created: 10 Jun 2006 │ │ │ │ │ +2 filename: SILLYPNGImageContext.h │ │ │ │ │ +3 created: 11 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: 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 │ │ │ │ │ @@ -30,82 +30,71 @@ │ │ │ │ │ 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_ │ │ │ │ │ +30#ifndef _SILLYPNGImageContext_h_ │ │ │ │ │ +31#define _SILLYPNGImageContext_h_ │ │ │ │ │ 32#include "SILLYBase.h" │ │ │ │ │ -33 │ │ │ │ │ -34// Start of section namespace SILLY │ │ │ │ │ -35namespace _S_I_L_L_Y │ │ │ │ │ -36{ │ │ │ │ │ -37 │ │ │ │ │ -_4_3class SILLY_EXPORT _I_m_a_g_e_C_o_n_t_e_x_t │ │ │ │ │ -44{ │ │ │ │ │ -45public: │ │ │ │ │ -_5_0 virtual _~_I_m_a_g_e_C_o_n_t_e_x_t(); │ │ │ │ │ -51 │ │ │ │ │ -_5_6 void _s_e_t_D_e_s_t_i_n_a_t_i_o_n(byte* pixels, size_t length, _P_i_x_e_l_F_o_r_m_a_t format); │ │ │ │ │ +33#include "SILLYImageContext.h" │ │ │ │ │ +34#include "SILLYDataSource.h" │ │ │ │ │ +35#include │ │ │ │ │ +36// Start of section namespace SILLY │ │ │ │ │ +37namespace _S_I_L_L_Y │ │ │ │ │ +38{ │ │ │ │ │ +39 │ │ │ │ │ +_4_5class SILLY_EXPORT _P_N_G_I_m_a_g_e_C_o_n_t_e_x_t : public _I_m_a_g_e_C_o_n_t_e_x_t │ │ │ │ │ +46{ │ │ │ │ │ +47public: │ │ │ │ │ +48 _P_N_G_I_m_a_g_e_C_o_n_t_e_x_t(_D_a_t_a_S_o_u_r_c_e* data); │ │ │ │ │ +49 _~_P_N_G_I_m_a_g_e_C_o_n_t_e_x_t(); │ │ │ │ │ +50 │ │ │ │ │ +51 int read(png_bytep data, png_size_t length); │ │ │ │ │ +52 │ │ │ │ │ +53 │ │ │ │ │ +54 │ │ │ │ │ +55private: │ │ │ │ │ +56 void setImageSize(); │ │ │ │ │ 57 │ │ │ │ │ -_6_2 void _s_e_t_N_e_x_t_P_i_x_e_l(byte red, byte green, byte bleu, byte alpha); │ │ │ │ │ +58 size_t d_offset; │ │ │ │ │ +59 │ │ │ │ │ +60 _D_a_t_a_S_o_u_r_c_e* d_data; │ │ │ │ │ +61 │ │ │ │ │ +62 png_structp d_png_ptr; │ │ │ │ │ 63 │ │ │ │ │ -64 size_t getWidth() const; │ │ │ │ │ -65 size_t getHeight() const; │ │ │ │ │ -66 _P_i_x_e_l_F_o_r_m_a_t getPixelFormat() const; │ │ │ │ │ -67 │ │ │ │ │ -74 bool flipVertically(); │ │ │ │ │ -75 protected: │ │ │ │ │ -76 void setWidth(size_t width); │ │ │ │ │ -77 │ │ │ │ │ -78 void setHeight(size_t height); │ │ │ │ │ -79 │ │ │ │ │ -_8_8 _I_m_a_g_e_C_o_n_t_e_x_t(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 _P_i_x_e_l_F_o_r_m_a_t d_format; │ │ │ │ │ -97 │ │ │ │ │ -98 // Disabled operation │ │ │ │ │ -99 _I_m_a_g_e_C_o_n_t_e_x_t(_I_m_a_g_e_C_o_n_t_e_x_t&); │ │ │ │ │ -100 _I_m_a_g_e_C_o_n_t_e_x_t& operator=(_I_m_a_g_e_C_o_n_t_e_x_t&); │ │ │ │ │ -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_ │ │ │ │ │ +64 png_infop d_info_ptr; │ │ │ │ │ +65 │ │ │ │ │ +66 size_t d_bit_depth; │ │ │ │ │ +67 size_t d_num_channels; │ │ │ │ │ +68 │ │ │ │ │ +69 │ │ │ │ │ +70 friend class _P_N_G_I_m_a_g_e_L_o_a_d_e_r; │ │ │ │ │ +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_ │ │ │ │ │ _S_I_L_L_Y │ │ │ │ │ Simple Image Loading LibrarY namespace. │ │ │ │ │ DDeeffiinniittiioonn _S_I_L_L_Y_J_P_G_I_m_a_g_e_C_o_n_t_e_x_t_._c_p_p_:_4_6 │ │ │ │ │ -_S_I_L_L_Y_:_:_P_i_x_e_l_F_o_r_m_a_t │ │ │ │ │ -PixelFormat │ │ │ │ │ -List all pixel format supported. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_B_a_s_e_._h_:_6_0 │ │ │ │ │ +_S_I_L_L_Y_:_:_P_N_G_I_m_a_g_e_C_o_n_t_e_x_t │ │ │ │ │ +Image Context for PNG Image Loader. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_P_N_G_I_m_a_g_e_C_o_n_t_e_x_t_._h_:_4_6 │ │ │ │ │ +_S_I_L_L_Y_:_:_P_N_G_I_m_a_g_e_L_o_a_d_e_r │ │ │ │ │ +Loader for PNG Image. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_P_N_G_I_m_a_g_e_L_o_a_d_e_r_._h_:_4_3 │ │ │ │ │ +_S_I_L_L_Y_:_:_D_a_t_a_S_o_u_r_c_e │ │ │ │ │ +This is an abstract class used to provide data to the loader. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_D_a_t_a_S_o_u_r_c_e_._h_:_4_7 │ │ │ │ │ _S_I_L_L_Y_:_:_I_m_a_g_e_C_o_n_t_e_x_t │ │ │ │ │ Store the data needed by an ImageLoader object during the parsing of an image. │ │ │ │ │ DDeeffiinniittiioonn _S_I_L_L_Y_I_m_a_g_e_C_o_n_t_e_x_t_._h_:_4_4 │ │ │ │ │ -_S_I_L_L_Y_:_:_I_m_a_g_e_C_o_n_t_e_x_t_:_:_s_e_t_N_e_x_t_P_i_x_e_l │ │ │ │ │ -void setNextPixel(byte red, byte green, byte bleu, byte alpha) │ │ │ │ │ -Set the next pixel of the image. │ │ │ │ │ -_S_I_L_L_Y_:_:_I_m_a_g_e_C_o_n_t_e_x_t_:_:_s_e_t_D_e_s_t_i_n_a_t_i_o_n │ │ │ │ │ -void setDestination(byte *pixels, size_t length, PixelFormat format) │ │ │ │ │ -Set the destination of the loading. │ │ │ │ │ -_S_I_L_L_Y_:_:_I_m_a_g_e_C_o_n_t_e_x_t_:_:_I_m_a_g_e_C_o_n_t_e_x_t │ │ │ │ │ -ImageContext(size_t width, size_t height) │ │ │ │ │ -Constructor. │ │ │ │ │ -_S_I_L_L_Y_:_:_I_m_a_g_e_C_o_n_t_e_x_t_:_:_~_I_m_a_g_e_C_o_n_t_e_x_t │ │ │ │ │ -virtual ~ImageContext() │ │ │ │ │ -Destructor. │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./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/SILLYFileDataSource.icpp Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/SILLYImageContext.icpp Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -44,23 +44,23 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYFileDataSource.icpp
│ │ │ │ +
SILLYImageContext.icpp
│ │ │ │
│ │ │ │
│ │ │ │
1/***********************************************************************
│ │ │ │ -
2 filename: SILLYFileDataSource.icpp
│ │ │ │ -
3 created: 20 Jul 2006
│ │ │ │ +
2 filename: SILLYImageContext.icpp
│ │ │ │ +
3 created: 10 Jun 2006
│ │ │ │
4 author: Olivier Delannoy
│ │ │ │
5
│ │ │ │ -
6 purpose: Inline function definition for the FileDataSource 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
│ │ │ │ @@ -80,31 +80,85 @@ │ │ │ │
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
│ │ │ │ +
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
│ │ │ │ +
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 {} │ │ │ │ │ @@ -1,19 +1,19 @@ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ * _b_u_i_l_d │ │ │ │ │ * _r_e_p_r_o_d_u_c_i_b_l_e_-_p_a_t_h │ │ │ │ │ * _s_i_l_l_y_-_0_._1_._0 │ │ │ │ │ * _i_n_c_l_u_d_e │ │ │ │ │ -SILLYFileDataSource.icpp │ │ │ │ │ +SILLYImageContext.icpp │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ -2 filename: SILLYFileDataSource.icpp │ │ │ │ │ -3 created: 20 Jul 2006 │ │ │ │ │ +2 filename: SILLYImageContext.icpp │ │ │ │ │ +3 created: 10 Jun 2006 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ -6 purpose: Inline function definition for the FileDataSource 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 │ │ │ │ │ @@ -33,26 +33,84 @@ │ │ │ │ │ 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 │ │ │ │ │ +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 │ │ │ │ │ +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 _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./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/SILLYMemoryDataSource.h Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/SILLYFileDataSource.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -44,23 +44,23 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYMemoryDataSource.h
│ │ │ │ +
SILLYFileDataSource.h
│ │ │ │
│ │ │ │
│ │ │ │
1/***********************************************************************
│ │ │ │ -
2 filename: SILLYMemoryDataSource.h
│ │ │ │ -
3 created: 10 Jun 2006
│ │ │ │ -
4 author: Olivier Delannoy
│ │ │ │ +
2 filename: SILLYFileDataSource.h
│ │ │ │ +
3 created: 20 Jul 2006
│ │ │ │ +
4 author: Olivier Delannoy
│ │ │ │
5
│ │ │ │ -
6 purpose: SILLYMemoryDataSource declaration for the SILLY library
│ │ │ │ +
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
│ │ │ │ @@ -76,52 +76,54 @@ │ │ │ │
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_
│ │ │ │ +
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 MemoryDataSource : public DataSource
│ │ │ │ +
48class SILLY_EXPORT FileDataSource : 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};
│ │ │ │ +
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};
│ │ │ │
│ │ │ │ -
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.
│ │ │ │ +
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 {} │ │ │ │ │ @@ -1,19 +1,19 @@ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ * _b_u_i_l_d │ │ │ │ │ * _r_e_p_r_o_d_u_c_i_b_l_e_-_p_a_t_h │ │ │ │ │ * _s_i_l_l_y_-_0_._1_._0 │ │ │ │ │ * _i_n_c_l_u_d_e │ │ │ │ │ -SILLYMemoryDataSource.h │ │ │ │ │ +SILLYFileDataSource.h │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ -2 filename: SILLYMemoryDataSource.h │ │ │ │ │ -3 created: 10 Jun 2006 │ │ │ │ │ +2 filename: SILLYFileDataSource.h │ │ │ │ │ +3 created: 20 Jul 2006 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ -6 purpose: SILLYMemoryDataSource declaration for the SILLY library │ │ │ │ │ +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 │ │ │ │ │ @@ -29,55 +29,59 @@ │ │ │ │ │ 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_ │ │ │ │ │ +30#ifndef _SILLYFileDataSource_h_ │ │ │ │ │ +31#define _SILLYFileDataSource_h_ │ │ │ │ │ 32#include "SILLYBase.h" │ │ │ │ │ 33#include "SILLYDataSource.h" │ │ │ │ │ 34// Start of section namespace SILLY │ │ │ │ │ 35namespace _S_I_L_L_Y │ │ │ │ │ 36{ │ │ │ │ │ 37 │ │ │ │ │ -_4_8class SILLY_EXPORT _M_e_m_o_r_y_D_a_t_a_S_o_u_r_c_e : public _D_a_t_a_S_o_u_r_c_e │ │ │ │ │ +_4_8class SILLY_EXPORT _F_i_l_e_D_a_t_a_S_o_u_r_c_e : public _D_a_t_a_S_o_u_r_c_e │ │ │ │ │ 49{ │ │ │ │ │ 50public: │ │ │ │ │ -63 _M_e_m_o_r_y_D_a_t_a_S_o_u_r_c_e(const byte* data, size_t size); │ │ │ │ │ -64 │ │ │ │ │ -65 │ │ │ │ │ -_6_6 const byte* _g_e_t_D_a_t_a_P_t_r() const; │ │ │ │ │ -67 │ │ │ │ │ -_6_8 size_t _g_e_t_S_i_z_e() const; │ │ │ │ │ -69private: │ │ │ │ │ -70 const byte* d_bytes; │ │ │ │ │ -71 size_t d_size; │ │ │ │ │ -72}; │ │ │ │ │ -73 │ │ │ │ │ +60 _F_i_l_e_D_a_t_a_S_o_u_r_c_e(const char* filename); │ │ │ │ │ +64 _~_F_i_l_e_D_a_t_a_S_o_u_r_c_e(); │ │ │ │ │ +_7_3 bool _i_s_V_a_l_i_d() const; │ │ │ │ │ 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_ │ │ │ │ │ +_7_5 const byte* _g_e_t_D_a_t_a_P_t_r() const; │ │ │ │ │ +_7_6 size_t _g_e_t_S_i_z_e() 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_ │ │ │ │ │ _S_I_L_L_Y │ │ │ │ │ Simple Image Loading LibrarY namespace. │ │ │ │ │ DDeeffiinniittiioonn _S_I_L_L_Y_J_P_G_I_m_a_g_e_C_o_n_t_e_x_t_._c_p_p_:_4_6 │ │ │ │ │ _S_I_L_L_Y_:_:_D_a_t_a_S_o_u_r_c_e │ │ │ │ │ This is an abstract class used to provide data to the loader. │ │ │ │ │ DDeeffiinniittiioonn _S_I_L_L_Y_D_a_t_a_S_o_u_r_c_e_._h_:_4_7 │ │ │ │ │ -_S_I_L_L_Y_:_:_M_e_m_o_r_y_D_a_t_a_S_o_u_r_c_e │ │ │ │ │ -Load an image from a memory area. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_M_e_m_o_r_y_D_a_t_a_S_o_u_r_c_e_._h_:_4_9 │ │ │ │ │ -_S_I_L_L_Y_:_:_M_e_m_o_r_y_D_a_t_a_S_o_u_r_c_e_:_:_g_e_t_D_a_t_a_P_t_r │ │ │ │ │ +_S_I_L_L_Y_:_:_F_i_l_e_D_a_t_a_S_o_u_r_c_e │ │ │ │ │ +This class allow the loading of an image directly from a file. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_F_i_l_e_D_a_t_a_S_o_u_r_c_e_._h_:_4_9 │ │ │ │ │ +_S_I_L_L_Y_:_:_F_i_l_e_D_a_t_a_S_o_u_r_c_e_:_:_g_e_t_D_a_t_a_P_t_r │ │ │ │ │ const byte * getDataPtr() const │ │ │ │ │ Get raw access to the image data. │ │ │ │ │ -_S_I_L_L_Y_:_:_M_e_m_o_r_y_D_a_t_a_S_o_u_r_c_e_:_:_g_e_t_S_i_z_e │ │ │ │ │ +_S_I_L_L_Y_:_:_F_i_l_e_D_a_t_a_S_o_u_r_c_e_:_:_i_s_V_a_l_i_d │ │ │ │ │ +bool isValid() const │ │ │ │ │ +Check wether the loading is successfull or not. │ │ │ │ │ +_S_I_L_L_Y_:_:_F_i_l_e_D_a_t_a_S_o_u_r_c_e_:_:_g_e_t_S_i_z_e │ │ │ │ │ size_t getSize() const │ │ │ │ │ Return the size of the data. │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./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/SILLYDataSource.icpp Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/SILLYOptions.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -44,62 +44,56 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYDataSource.icpp
│ │ │ │ +
SILLYOptions.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/* 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 {} │ │ │ │ │ @@ -1,54 +1,47 @@ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ * _b_u_i_l_d │ │ │ │ │ * _r_e_p_r_o_d_u_c_i_b_l_e_-_p_a_t_h │ │ │ │ │ * _s_i_l_l_y_-_0_._1_._0 │ │ │ │ │ * _i_n_c_l_u_d_e │ │ │ │ │ -SILLYDataSource.icpp │ │ │ │ │ -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 │ │ │ │ │ +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 ***************************************************************************/ │ │ │ │ │ +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 _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./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/SILLYImage.h Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/SILLYImageContext.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -44,126 +44,106 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYImage.h
│ │ │ │ +
SILLYImageContext.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#ifndef _SILLYImage_h_
│ │ │ │ -
32#define _SILLYImage_h_
│ │ │ │ -
33#include "SILLYBase.h"
│ │ │ │ -
34#include "SILLYImageContext.h"
│ │ │ │ -
35#include "SILLYDataSource.h"
│ │ │ │ -
36#include "SILLYImageLoader.h"
│ │ │ │ +
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
│ │ │ │ -
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};
│ │ │ │ +
│ │ │ │ +
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};
│ │ │ │
│ │ │ │ -
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.
│ │ │ │ +
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 {} │ │ │ │ │ @@ -1,150 +1,111 @@ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ * _b_u_i_l_d │ │ │ │ │ * _r_e_p_r_o_d_u_c_i_b_l_e_-_p_a_t_h │ │ │ │ │ * _s_i_l_l_y_-_0_._1_._0 │ │ │ │ │ * _i_n_c_l_u_d_e │ │ │ │ │ -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#ifndef _SILLYImage_h_ │ │ │ │ │ -32#define _SILLYImage_h_ │ │ │ │ │ -33#include "SILLYBase.h" │ │ │ │ │ -34#include "SILLYImageContext.h" │ │ │ │ │ -35#include "SILLYDataSource.h" │ │ │ │ │ -36#include "SILLYImageLoader.h" │ │ │ │ │ +SILLYImageContext.h │ │ │ │ │ +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 _S_I_L_L_Y │ │ │ │ │ +36{ │ │ │ │ │ 37 │ │ │ │ │ -38// Start of section namespace SILLY │ │ │ │ │ -39namespace _S_I_L_L_Y │ │ │ │ │ -40{ │ │ │ │ │ -41 │ │ │ │ │ -_4_6class SILLY_EXPORT _I_m_a_g_e │ │ │ │ │ -47{ │ │ │ │ │ -48public: │ │ │ │ │ -55 _I_m_a_g_e(_D_a_t_a_S_o_u_r_c_e& data); │ │ │ │ │ -56 │ │ │ │ │ -_6_1 _~_I_m_a_g_e(); │ │ │ │ │ -62 │ │ │ │ │ -_6_7 bool _i_s_V_a_l_i_d() const; │ │ │ │ │ -68 │ │ │ │ │ -69 │ │ │ │ │ -76 bool loadImageHeader(); │ │ │ │ │ +_4_3class SILLY_EXPORT _I_m_a_g_e_C_o_n_t_e_x_t │ │ │ │ │ +44{ │ │ │ │ │ +45public: │ │ │ │ │ +_5_0 virtual _~_I_m_a_g_e_C_o_n_t_e_x_t(); │ │ │ │ │ +51 │ │ │ │ │ +_5_6 void _s_e_t_D_e_s_t_i_n_a_t_i_o_n(byte* pixels, size_t length, _P_i_x_e_l_F_o_r_m_a_t format); │ │ │ │ │ +57 │ │ │ │ │ +_6_2 void _s_e_t_N_e_x_t_P_i_x_e_l(byte red, byte green, byte bleu, byte alpha); │ │ │ │ │ +63 │ │ │ │ │ +64 size_t getWidth() const; │ │ │ │ │ +65 size_t getHeight() const; │ │ │ │ │ +66 _P_i_x_e_l_F_o_r_m_a_t getPixelFormat() const; │ │ │ │ │ +67 │ │ │ │ │ +74 bool flipVertically(); │ │ │ │ │ +75 protected: │ │ │ │ │ +76 void setWidth(size_t width); │ │ │ │ │ 77 │ │ │ │ │ -91 bool loadImageData(_P_i_x_e_l_F_o_r_m_a_t resultFormat = PF_RGBA, _P_i_x_e_l_O_r_i_g_i_n origin = │ │ │ │ │ -PO_TOP_LEFT); │ │ │ │ │ -92 │ │ │ │ │ -_9_7 size_t _g_e_t_W_i_d_t_h() const; │ │ │ │ │ -98 │ │ │ │ │ -_1_0_3 size_t _g_e_t_H_e_i_g_h_t() const; │ │ │ │ │ -104 │ │ │ │ │ -_1_0_9 _P_i_x_e_l_F_o_r_m_a_t _g_e_t_S_o_u_r_c_e_P_i_x_e_l_F_o_r_m_a_t() const; │ │ │ │ │ +78 void setHeight(size_t height); │ │ │ │ │ +79 │ │ │ │ │ +_8_8 _I_m_a_g_e_C_o_n_t_e_x_t(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 _P_i_x_e_l_F_o_r_m_a_t d_format; │ │ │ │ │ +97 │ │ │ │ │ +98 // Disabled operation │ │ │ │ │ +99 _I_m_a_g_e_C_o_n_t_e_x_t(_I_m_a_g_e_C_o_n_t_e_x_t&); │ │ │ │ │ +100 _I_m_a_g_e_C_o_n_t_e_x_t& operator=(_I_m_a_g_e_C_o_n_t_e_x_t&); │ │ │ │ │ +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 │ │ │ │ │ -_1_1_5 _P_i_x_e_l_F_o_r_m_a_t _g_e_t_P_i_x_e_l_F_o_r_m_a_t() const; │ │ │ │ │ -116 │ │ │ │ │ -_1_2_0 const byte* _g_e_t_P_i_x_e_l_s_D_a_t_a_P_t_r() const; │ │ │ │ │ -_1_2_5 size_t _g_e_t_P_i_x_e_l_s_D_a_t_a_S_i_z_e() const; │ │ │ │ │ -_1_3_0 const char* _g_e_t_L_o_a_d_e_r_I_d_e_n_t_i_f_i_e_r_S_t_r_i_n_g() const; │ │ │ │ │ -131private: │ │ │ │ │ -132 bool allocate(); │ │ │ │ │ -133 │ │ │ │ │ -134private: │ │ │ │ │ -135 │ │ │ │ │ -136 size_t d_bpp; │ │ │ │ │ -137 _P_i_x_e_l_F_o_r_m_a_t d_pfSource; │ │ │ │ │ -138 byte* d_pixels; │ │ │ │ │ -139 _D_a_t_a_S_o_u_r_c_e* d_data; │ │ │ │ │ -140 _I_m_a_g_e_C_o_n_t_e_x_t* d_imageContext; │ │ │ │ │ -141 _I_m_a_g_e_L_o_a_d_e_r* d_imageLoader; │ │ │ │ │ -142 │ │ │ │ │ -143 // Disabled operation │ │ │ │ │ -144 _I_m_a_g_e(_I_m_a_g_e&); │ │ │ │ │ -145 _I_m_a_g_e& operator=(_I_m_a_g_e&); │ │ │ │ │ -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_ │ │ │ │ │ +111#endif // end of guard _SILLYImageContext_h_ │ │ │ │ │ _S_I_L_L_Y │ │ │ │ │ Simple Image Loading LibrarY namespace. │ │ │ │ │ DDeeffiinniittiioonn _S_I_L_L_Y_J_P_G_I_m_a_g_e_C_o_n_t_e_x_t_._c_p_p_:_4_6 │ │ │ │ │ _S_I_L_L_Y_:_:_P_i_x_e_l_F_o_r_m_a_t │ │ │ │ │ PixelFormat │ │ │ │ │ List all pixel format supported. │ │ │ │ │ DDeeffiinniittiioonn _S_I_L_L_Y_B_a_s_e_._h_:_6_0 │ │ │ │ │ -_S_I_L_L_Y_:_:_P_i_x_e_l_O_r_i_g_i_n │ │ │ │ │ -PixelOrigin │ │ │ │ │ -List all pixel origin supported. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_B_a_s_e_._h_:_7_1 │ │ │ │ │ -_S_I_L_L_Y_:_:_D_a_t_a_S_o_u_r_c_e │ │ │ │ │ -This is an abstract class used to provide data to the loader. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_D_a_t_a_S_o_u_r_c_e_._h_:_4_7 │ │ │ │ │ -_S_I_L_L_Y_:_:_I_m_a_g_e │ │ │ │ │ -Image is the main user class of the library. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_I_m_a_g_e_._h_:_4_7 │ │ │ │ │ -_S_I_L_L_Y_:_:_I_m_a_g_e_:_:_g_e_t_S_o_u_r_c_e_P_i_x_e_l_F_o_r_m_a_t │ │ │ │ │ -PixelFormat getSourcePixelFormat() const │ │ │ │ │ -Retrieve the pixel format used for the image storage. │ │ │ │ │ -_S_I_L_L_Y_:_:_I_m_a_g_e_:_:_g_e_t_L_o_a_d_e_r_I_d_e_n_t_i_f_i_e_r_S_t_r_i_n_g │ │ │ │ │ -const char * getLoaderIdentifierString() const │ │ │ │ │ -Get Image loader identifier string. │ │ │ │ │ -_S_I_L_L_Y_:_:_I_m_a_g_e_:_:_g_e_t_P_i_x_e_l_s_D_a_t_a_P_t_r │ │ │ │ │ -const byte * getPixelsDataPtr() const │ │ │ │ │ -Get a pointer to the pixels data. │ │ │ │ │ -_S_I_L_L_Y_:_:_I_m_a_g_e_:_:_i_s_V_a_l_i_d │ │ │ │ │ -bool isValid() const │ │ │ │ │ -Return true if the image is valid after its loading. │ │ │ │ │ -_S_I_L_L_Y_:_:_I_m_a_g_e_:_:_g_e_t_P_i_x_e_l_s_D_a_t_a_S_i_z_e │ │ │ │ │ -size_t getPixelsDataSize() const │ │ │ │ │ -Get the size of the pixel buffer. │ │ │ │ │ -_S_I_L_L_Y_:_:_I_m_a_g_e_:_:_~_I_m_a_g_e │ │ │ │ │ -~Image() │ │ │ │ │ -Destructor. │ │ │ │ │ -_S_I_L_L_Y_:_:_I_m_a_g_e_:_:_g_e_t_W_i_d_t_h │ │ │ │ │ -size_t getWidth() const │ │ │ │ │ -Retrieve the width of the image. │ │ │ │ │ -_S_I_L_L_Y_:_:_I_m_a_g_e_:_:_g_e_t_P_i_x_e_l_F_o_r_m_a_t │ │ │ │ │ -PixelFormat getPixelFormat() const │ │ │ │ │ -Retrieve the pixel format of the resulting image. │ │ │ │ │ -_S_I_L_L_Y_:_:_I_m_a_g_e_:_:_g_e_t_H_e_i_g_h_t │ │ │ │ │ -size_t getHeight() const │ │ │ │ │ -Retrieve the height of the image. │ │ │ │ │ _S_I_L_L_Y_:_:_I_m_a_g_e_C_o_n_t_e_x_t │ │ │ │ │ Store the data needed by an ImageLoader object during the parsing of an image. │ │ │ │ │ DDeeffiinniittiioonn _S_I_L_L_Y_I_m_a_g_e_C_o_n_t_e_x_t_._h_:_4_4 │ │ │ │ │ -_S_I_L_L_Y_:_:_I_m_a_g_e_L_o_a_d_e_r │ │ │ │ │ -This is an abstract class that define the interface of all image loader. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_I_m_a_g_e_L_o_a_d_e_r_._h_:_4_7 │ │ │ │ │ +_S_I_L_L_Y_:_:_I_m_a_g_e_C_o_n_t_e_x_t_:_:_s_e_t_N_e_x_t_P_i_x_e_l │ │ │ │ │ +void setNextPixel(byte red, byte green, byte bleu, byte alpha) │ │ │ │ │ +Set the next pixel of the image. │ │ │ │ │ +_S_I_L_L_Y_:_:_I_m_a_g_e_C_o_n_t_e_x_t_:_:_s_e_t_D_e_s_t_i_n_a_t_i_o_n │ │ │ │ │ +void setDestination(byte *pixels, size_t length, PixelFormat format) │ │ │ │ │ +Set the destination of the loading. │ │ │ │ │ +_S_I_L_L_Y_:_:_I_m_a_g_e_C_o_n_t_e_x_t_:_:_I_m_a_g_e_C_o_n_t_e_x_t │ │ │ │ │ +ImageContext(size_t width, size_t height) │ │ │ │ │ +Constructor. │ │ │ │ │ +_S_I_L_L_Y_:_:_I_m_a_g_e_C_o_n_t_e_x_t_:_:_~_I_m_a_g_e_C_o_n_t_e_x_t │ │ │ │ │ +virtual ~ImageContext() │ │ │ │ │ +Destructor. │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./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/SILLYImageLoader.icpp Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/SILLYImageLoaderManager.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -44,64 +44,112 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYImageLoader.icpp
│ │ │ │ +
SILLYImageLoaderManager.h
│ │ │ │
│ │ │ │
│ │ │ │ -
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)
│ │ │ │ +
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}
│ │ │ │ -
38inline ImageLoader::~ImageLoader()
│ │ │ │ -
39{
│ │ │ │ -
40}
│ │ │ │ -
41inline const char* ImageLoader::getIdentifierString() const
│ │ │ │ -
42{
│ │ │ │ -
43 return d_name;
│ │ │ │ -
44}
│ │ │ │ +
37class ImageLoader; // Forward declaration
│ │ │ │ +
42typedef std::vector<ImageLoader*> ImageLoaderList;
│ │ │ │ +
43
│ │ │ │ +
44#if defined(_MSC_VER)
│ │ │ │
45
│ │ │ │ -
46} // End of section namespace SILLY
│ │ │ │ +
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.
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,19 +1,19 @@ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ * _b_u_i_l_d │ │ │ │ │ * _r_e_p_r_o_d_u_c_i_b_l_e_-_p_a_t_h │ │ │ │ │ * _s_i_l_l_y_-_0_._1_._0 │ │ │ │ │ * _i_n_c_l_u_d_e │ │ │ │ │ -SILLYImageLoader.icpp │ │ │ │ │ +SILLYImageLoaderManager.h │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ -2 filename: ImageLoader.icpp │ │ │ │ │ +2 filename: ImageLoaderManager.h │ │ │ │ │ 3 created: 10 Jun 2006 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ -6 purpose: Inline function definition for ImageLoader 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 │ │ │ │ │ @@ -29,27 +29,88 @@ │ │ │ │ │ 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) │ │ │ │ │ +30#ifndef _SILLYImageLoaderManager_h_ │ │ │ │ │ +31#define _SILLYImageLoaderManager_h_ │ │ │ │ │ +32#include "SILLYBase.h" │ │ │ │ │ +33#include │ │ │ │ │ +34// Start of section namespace SILLY │ │ │ │ │ +35namespace _S_I_L_L_Y │ │ │ │ │ 36{ │ │ │ │ │ -37} │ │ │ │ │ -38inline ImageLoader::~ImageLoader() │ │ │ │ │ -39{ │ │ │ │ │ -40} │ │ │ │ │ -41inline const char* ImageLoader::getIdentifierString() const │ │ │ │ │ -42{ │ │ │ │ │ -43 return d_name; │ │ │ │ │ -44} │ │ │ │ │ +37class ImageLoader; // Forward declaration │ │ │ │ │ +_4_2typedef std::vector _I_m_a_g_e_L_o_a_d_e_r_L_i_s_t; │ │ │ │ │ +43 │ │ │ │ │ +44#if defined(_MSC_VER) │ │ │ │ │ 45 │ │ │ │ │ -46} // End of section namespace SILLY │ │ │ │ │ +46# pragma warning(push) │ │ │ │ │ 47 │ │ │ │ │ +48# pragma warning(disable : 4251) │ │ │ │ │ +49 │ │ │ │ │ +50#endif │ │ │ │ │ +51 │ │ │ │ │ +_5_6class SILLY_EXPORT _I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r │ │ │ │ │ +57{ │ │ │ │ │ +58 │ │ │ │ │ +59public: │ │ │ │ │ +64 _I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r(); │ │ │ │ │ +69 _~_I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r(); │ │ │ │ │ +_7_4 ImageLoaderList::iterator _b_e_g_i_n(); │ │ │ │ │ +_7_9 ImageLoaderList::iterator _e_n_d(); │ │ │ │ │ +_8_6 void _a_d_d(_I_m_a_g_e_L_o_a_d_e_r* loader); │ │ │ │ │ +87 │ │ │ │ │ +88private: │ │ │ │ │ +89 _I_m_a_g_e_L_o_a_d_e_r_L_i_s_t d_loaders; │ │ │ │ │ +90 │ │ │ │ │ +91public: │ │ │ │ │ +92 static _I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r* getSingletonPtr(); │ │ │ │ │ +93 static _I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r& getSingleton(); │ │ │ │ │ +94 │ │ │ │ │ +95private: │ │ │ │ │ +96 static _I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r* d_instance; │ │ │ │ │ +97 │ │ │ │ │ +98 // Disabled operations │ │ │ │ │ +99 _I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r(_I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r&); │ │ │ │ │ +100 _I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r& operator=(_I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r&); │ │ │ │ │ +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_ │ │ │ │ │ +_S_I_L_L_Y │ │ │ │ │ +Simple Image Loading LibrarY namespace. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_J_P_G_I_m_a_g_e_C_o_n_t_e_x_t_._c_p_p_:_4_6 │ │ │ │ │ +_S_I_L_L_Y_:_:_I_m_a_g_e_L_o_a_d_e_r_L_i_s_t │ │ │ │ │ +std::vector< ImageLoader * > ImageLoaderList │ │ │ │ │ +Typename for a collection of image loader. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r_._h_:_4_2 │ │ │ │ │ +_S_I_L_L_Y_:_:_I_m_a_g_e_L_o_a_d_e_r │ │ │ │ │ +This is an abstract class that define the interface of all image loader. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_I_m_a_g_e_L_o_a_d_e_r_._h_:_4_7 │ │ │ │ │ +_S_I_L_L_Y_:_:_I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r │ │ │ │ │ +Manage the list of all supported ImageLoader. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r_._h_:_5_7 │ │ │ │ │ +_S_I_L_L_Y_:_:_I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r_:_:_a_d_d │ │ │ │ │ +void add(ImageLoader *loader) │ │ │ │ │ +Register an ImageLoader object. │ │ │ │ │ +_S_I_L_L_Y_:_:_I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r_:_:_b_e_g_i_n │ │ │ │ │ +ImageLoaderList::iterator begin() │ │ │ │ │ +Get an iterator to the first ImageLoader registered. │ │ │ │ │ +_S_I_L_L_Y_:_:_I_m_a_g_e_L_o_a_d_e_r_M_a_n_a_g_e_r_:_:_e_n_d │ │ │ │ │ +ImageLoaderList::iterator end() │ │ │ │ │ +Get an iterator to the first not registered ImageLoader. │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libsilly-doc/html/a00104_source.html │ │ │ │ @@ -116,19 +116,19 @@ │ │ │ │
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.
│ │ │ │ +
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.
│ │ │ │
│ │ │ ├── ./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/SILLY.h Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/SILLYImage.icpp Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -44,67 +44,101 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLY.h
│ │ │ │ +
SILLYImage.icpp
│ │ │ │
│ │ │ │
│ │ │ │ -
1/***********************************************************************
│ │ │ │ -
2 filename: SILLY.h
│ │ │ │ -
3 created: 10 Jun 2006
│ │ │ │ -
4 author: Olivier Delannoy
│ │ │ │ -
5
│ │ │ │ -
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
│ │ │ │ -
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 _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.
│ │ │ │ +
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
│ │ │ │ +
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}
│ │ │ │ +
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 {} │ │ │ │ │ @@ -1,19 +1,19 @@ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ * _b_u_i_l_d │ │ │ │ │ * _r_e_p_r_o_d_u_c_i_b_l_e_-_p_a_t_h │ │ │ │ │ * _s_i_l_l_y_-_0_._1_._0 │ │ │ │ │ * _i_n_c_l_u_d_e │ │ │ │ │ -SILLY.h │ │ │ │ │ +SILLYImage.icpp │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ -2 filename: SILLY.h │ │ │ │ │ +2 filename: SILLYImage.icpp │ │ │ │ │ 3 created: 10 Jun 2006 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ -6 purpose: Master include for the SILLY library │ │ │ │ │ +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 │ │ │ │ │ @@ -29,32 +29,64 @@ │ │ │ │ │ 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 _S_I_L_L_Y │ │ │ │ │ -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_ │ │ │ │ │ -_S_I_L_L_Y │ │ │ │ │ -Simple Image Loading LibrarY namespace. │ │ │ │ │ -DDeeffiinniittiioonn _S_I_L_L_Y_J_P_G_I_m_a_g_e_C_o_n_t_e_x_t_._c_p_p_:_4_6 │ │ │ │ │ +30 │ │ │ │ │ +31// Start of section namespace SILLY │ │ │ │ │ +32namespace SILLY │ │ │ │ │ +33{ │ │ │ │ │ +34 │ │ │ │ │ +35inline bool Image::isValid() const │ │ │ │ │ +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} │ │ │ │ │ +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 _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./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/SILLYDataSource.h Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/SILLYBase.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -44,23 +44,23 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYDataSource.h
│ │ │ │ +
SILLYBase.h
│ │ │ │
│ │ │ │
│ │ │ │
1/***********************************************************************
│ │ │ │ -
2 filename: SILLYDataSource.h
│ │ │ │ -
3 created: 10 Jun 2006
│ │ │ │ -
4 author: Olivier Delannoy
│ │ │ │ +
2 filename: SILLYBase.h
│ │ │ │ +
3 created: 2006/06/10
│ │ │ │ +
4 author: Olivier Delannoy
│ │ │ │
5
│ │ │ │ -
6 purpose: SILLY::DataSource declaration 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
│ │ │ │ @@ -76,47 +76,71 @@ │ │ │ │
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};
│ │ │ │ +
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
│ │ │ │ -
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.
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
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 {} │ │ │ │ │ @@ -1,19 +1,19 @@ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ * _b_u_i_l_d │ │ │ │ │ * _r_e_p_r_o_d_u_c_i_b_l_e_-_p_a_t_h │ │ │ │ │ * _s_i_l_l_y_-_0_._1_._0 │ │ │ │ │ * _i_n_c_l_u_d_e │ │ │ │ │ -SILLYDataSource.h │ │ │ │ │ +SILLYBase.h │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ -2 filename: SILLYDataSource.h │ │ │ │ │ -3 created: 10 Jun 2006 │ │ │ │ │ +2 filename: SILLYBase.h │ │ │ │ │ +3 created: 2006/06/10 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ -6 purpose: SILLY::DataSource declaration 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 │ │ │ │ │ @@ -29,50 +29,81 @@ │ │ │ │ │ 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 _S_I_L_L_Y │ │ │ │ │ -36{ │ │ │ │ │ -37 │ │ │ │ │ -_4_6class SILLY_EXPORT _D_a_t_a_S_o_u_r_c_e │ │ │ │ │ -47{ │ │ │ │ │ -48public: │ │ │ │ │ -_5_3 virtual _~_D_a_t_a_S_o_u_r_c_e(); │ │ │ │ │ -_5_8 virtual const byte * _g_e_t_D_a_t_a_P_t_r() const = 0; │ │ │ │ │ -_6_4 byte operator[] (size_t offset) const; │ │ │ │ │ -_6_9 virtual size_t _g_e_t_S_i_z_e() 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_ │ │ │ │ │ +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 _S_I_L_L_Y │ │ │ │ │ +53{ │ │ │ │ │ +54 │ │ │ │ │ +_5_9enum _P_i_x_e_l_F_o_r_m_a_t │ │ │ │ │ +60{ │ │ │ │ │ +61 PF_A1B5G5R5, // │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -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/SILLY.h Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -44,56 +44,67 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYOptions.h
│ │ │ │ +
SILLY.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 ***************************************************************************/
│ │ │ │ -
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
│ │ │ │ +
1/***********************************************************************
│ │ │ │ +
2 filename: SILLY.h
│ │ │ │ +
3 created: 10 Jun 2006
│ │ │ │ +
4 author: Olivier Delannoy
│ │ │ │ +
5
│ │ │ │ +
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
│ │ │ │ +
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 _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 {} │ │ │ │ │ @@ -1,47 +1,60 @@ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ * _b_u_i_l_d │ │ │ │ │ * _r_e_p_r_o_d_u_c_i_b_l_e_-_p_a_t_h │ │ │ │ │ * _s_i_l_l_y_-_0_._1_._0 │ │ │ │ │ * _i_n_c_l_u_d_e │ │ │ │ │ -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 ***************************************************************************/ │ │ │ │ │ -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 │ │ │ │ │ +SILLY.h │ │ │ │ │ +1/*********************************************************************** │ │ │ │ │ +2 filename: SILLY.h │ │ │ │ │ +3 created: 10 Jun 2006 │ │ │ │ │ +4 author: Olivier Delannoy │ │ │ │ │ +5 │ │ │ │ │ +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 │ │ │ │ │ +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 _SILLY_h_ │ │ │ │ │ +31#define _SILLY_h_ │ │ │ │ │ +109namespace _S_I_L_L_Y │ │ │ │ │ +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_ │ │ │ │ │ +_S_I_L_L_Y │ │ │ │ │ +Simple Image Loading LibrarY namespace. │ │ │ │ │ +DDeeffiinniittiioonn _S_I_L_L_Y_J_P_G_I_m_a_g_e_C_o_n_t_e_x_t_._c_p_p_:_4_6 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./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/SILLYImage.icpp Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/SILLYImageLoaderManager.icpp Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -44,23 +44,23 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYImage.icpp
│ │ │ │ +
SILLYImageLoaderManager.icpp
│ │ │ │
│ │ │ │
│ │ │ │
1/***********************************************************************
│ │ │ │ -
2 filename: SILLYImage.icpp
│ │ │ │ +
2 filename: SILLYImageLoaderManager.icpp
│ │ │ │
3 created: 10 Jun 2006
│ │ │ │
4 author: Olivier Delannoy
│ │ │ │
5
│ │ │ │ -
6 purpose: Inline definition of the image class
│ │ │ │ +
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
│ │ │ │ @@ -80,65 +80,43 @@ │ │ │ │
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
│ │ │ │ -
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}
│ │ │ │ -
49
│ │ │ │ -
50inline PixelFormat Image::getSourcePixelFormat() const
│ │ │ │ -
51{
│ │ │ │ -
52 return d_pfSource;
│ │ │ │ +
34inline ImageLoaderList::iterator ImageLoaderManager::begin()
│ │ │ │ +
35{
│ │ │ │ +
36 return d_loaders.begin();
│ │ │ │ +
37}
│ │ │ │ +
38
│ │ │ │ +
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 PixelFormat Image::getPixelFormat() const
│ │ │ │ +
55inline void ImageLoaderManager::add(ImageLoader* loader)
│ │ │ │
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
│ │ │ │ +
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
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,19 +1,19 @@ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ * _b_u_i_l_d │ │ │ │ │ * _r_e_p_r_o_d_u_c_i_b_l_e_-_p_a_t_h │ │ │ │ │ * _s_i_l_l_y_-_0_._1_._0 │ │ │ │ │ * _i_n_c_l_u_d_e │ │ │ │ │ -SILLYImage.icpp │ │ │ │ │ +SILLYImageLoaderManager.icpp │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ -2 filename: SILLYImage.icpp │ │ │ │ │ +2 filename: SILLYImageLoaderManager.icpp │ │ │ │ │ 3 created: 10 Jun 2006 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ -6 purpose: Inline definition of the image class │ │ │ │ │ +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 │ │ │ │ │ @@ -33,60 +33,38 @@ │ │ │ │ │ 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 │ │ │ │ │ -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} │ │ │ │ │ -49 │ │ │ │ │ -50inline PixelFormat Image::getSourcePixelFormat() const │ │ │ │ │ -51{ │ │ │ │ │ -52 return d_pfSource; │ │ │ │ │ +34inline ImageLoaderList::iterator ImageLoaderManager::begin() │ │ │ │ │ +35{ │ │ │ │ │ +36 return d_loaders.begin(); │ │ │ │ │ +37} │ │ │ │ │ +38 │ │ │ │ │ +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 PixelFormat Image::getPixelFormat() const │ │ │ │ │ +55inline void ImageLoaderManager::add(ImageLoader* loader) │ │ │ │ │ 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 │ │ │ │ │ +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 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./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/SILLYImageLoaderManager.icpp Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/SILLYDataSource.icpp Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -44,23 +44,23 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYImageLoaderManager.icpp
│ │ │ │ +
SILLYDataSource.icpp
│ │ │ │
│ │ │ │
│ │ │ │
1/***********************************************************************
│ │ │ │ -
2 filename: SILLYImageLoaderManager.icpp
│ │ │ │ +
2 filename: SILLYDataSource.icpp
│ │ │ │
3 created: 10 Jun 2006
│ │ │ │ -
4 author: Olivier Delannoy
│ │ │ │ +
4 author: ode@dalfy.dalfy.dyndns.org
│ │ │ │
5
│ │ │ │ -
6 purpose: Inline definition for ImageLoaderManager class
│ │ │ │ +
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
│ │ │ │ @@ -80,43 +80,26 @@ │ │ │ │
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()
│ │ │ │ +
34inline DataSource::~DataSource()
│ │ │ │
35{
│ │ │ │ -
36 return d_loaders.begin();
│ │ │ │ -
37}
│ │ │ │ -
38
│ │ │ │ -
39inline ImageLoaderList::iterator ImageLoaderManager::end()
│ │ │ │ -
40{
│ │ │ │ -
41 return d_loaders.end();
│ │ │ │ +
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
│ │ │ │ -
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
│ │ │ │ +
44} // End of section namespace SILLY
│ │ │ │ +
45
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,19 +1,19 @@ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ * _b_u_i_l_d │ │ │ │ │ * _r_e_p_r_o_d_u_c_i_b_l_e_-_p_a_t_h │ │ │ │ │ * _s_i_l_l_y_-_0_._1_._0 │ │ │ │ │ * _i_n_c_l_u_d_e │ │ │ │ │ -SILLYImageLoaderManager.icpp │ │ │ │ │ +SILLYDataSource.icpp │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ -2 filename: SILLYImageLoaderManager.icpp │ │ │ │ │ +2 filename: SILLYDataSource.icpp │ │ │ │ │ 3 created: 10 Jun 2006 │ │ │ │ │ -4 author: Olivier Delannoy │ │ │ │ │ +4 author: ode@dalfy.dalfy.dyndns.org │ │ │ │ │ 5 │ │ │ │ │ -6 purpose: Inline definition for ImageLoaderManager class │ │ │ │ │ +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 │ │ │ │ │ @@ -33,38 +33,22 @@ │ │ │ │ │ 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() │ │ │ │ │ +34inline DataSource::~DataSource() │ │ │ │ │ 35{ │ │ │ │ │ -36 return d_loaders.begin(); │ │ │ │ │ -37} │ │ │ │ │ -38 │ │ │ │ │ -39inline ImageLoaderList::iterator ImageLoaderManager::end() │ │ │ │ │ -40{ │ │ │ │ │ -41 return d_loaders.end(); │ │ │ │ │ +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 │ │ │ │ │ -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 │ │ │ │ │ +44} // End of section namespace SILLY │ │ │ │ │ +45 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./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/SILLYBase.h Source File │ │ │ │ +Simple Image Loading LibrarY: /build/reproducible-path/silly-0.1.0/include/SILLYImageLoader.icpp Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ @@ -44,103 +44,64 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
SILLYBase.h
│ │ │ │ +
SILLYImageLoader.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
│ │ │ │ -
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
│ │ │ │ +
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}
│ │ │ │ +
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 {} │ │ │ │ │ @@ -1,19 +1,19 @@ │ │ │ │ │ Simple Image Loading LibrarY 0.1.0 │ │ │ │ │ * _b_u_i_l_d │ │ │ │ │ * _r_e_p_r_o_d_u_c_i_b_l_e_-_p_a_t_h │ │ │ │ │ * _s_i_l_l_y_-_0_._1_._0 │ │ │ │ │ * _i_n_c_l_u_d_e │ │ │ │ │ -SILLYBase.h │ │ │ │ │ +SILLYImageLoader.icpp │ │ │ │ │ 1/*********************************************************************** │ │ │ │ │ -2 filename: SILLYBase.h │ │ │ │ │ -3 created: 2006/06/10 │ │ │ │ │ +2 filename: ImageLoader.icpp │ │ │ │ │ +3 created: 10 Jun 2006 │ │ │ │ │ 4 author: Olivier Delannoy │ │ │ │ │ 5 │ │ │ │ │ -6 purpose: Common header for the SILLY library │ │ │ │ │ +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 │ │ │ │ │ @@ -29,81 +29,27 @@ │ │ │ │ │ 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 │ │ │ │ │ -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 _S_I_L_L_Y │ │ │ │ │ -53{ │ │ │ │ │ -54 │ │ │ │ │ -_5_9enum _P_i_x_e_l_F_o_r_m_a_t │ │ │ │ │ -60{ │ │ │ │ │ -61 PF_A1B5G5R5, //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.

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

Image Context for JPG image loader. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <SILLYJPGImageContext.h>

│ │ │ │ +

#include <SILLYJPGImageContext.h>

│ │ │ │
│ │ │ │ Inheritance diagram for JPGImageContext:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -135,15 +135,15 @@ │ │ │ │   │ │ │ │ │ │ │ │

Detailed Description

│ │ │ │

Image Context for JPG image loader.

│ │ │ │

Most of the code of this loader is taken from Corona and adapted to our image loading framework

│ │ │ │

Multiple loading is not handle yet.

│ │ │ │ │ │ │ │ -

Definition at line 56 of file SILLYJPGImageContext.h.

│ │ │ │ +

Definition at line 56 of file SILLYJPGImageContext.h.

│ │ │ │

Constructor & Destructor Documentation

│ │ │ │ │ │ │ │

◆ JPGImageContext()

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ @@ -152,15 +152,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
()
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 90 of file SILLYJPGImageContext.cpp.

│ │ │ │ +

Definition at line 90 of file SILLYJPGImageContext.cpp.

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

◆ ~JPGImageContext()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -171,15 +171,15 @@ │ │ │ │ ( │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 109 of file SILLYJPGImageContext.cpp.

│ │ │ │ +

Definition at line 109 of file SILLYJPGImageContext.cpp.

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

Member Function Documentation

│ │ │ │ │ │ │ │

◆ flipVertically()

│ │ │ │ │ │ │ │ @@ -221,15 +221,15 @@ │ │ │ │ ( │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 115 of file SILLYJPGImageContext.cpp.

│ │ │ │ +

Definition at line 115 of file SILLYJPGImageContext.cpp.

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

Member Data Documentation

│ │ │ │ │ │ │ │

◆ cinfo

│ │ │ │ │ │ │ │ @@ -238,15 +238,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
jpeg_decompress_struct cinfo
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 66 of file SILLYJPGImageContext.h.

│ │ │ │ +

Definition at line 66 of file SILLYJPGImageContext.h.

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

◆ d_error_mgr

│ │ │ │ │ │ │ │
│ │ │ │ @@ -254,15 +254,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
jpeg_error_mgr d_error_mgr
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 68 of file SILLYJPGImageContext.h.

│ │ │ │ +

Definition at line 68 of file SILLYJPGImageContext.h.

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

◆ d_source

│ │ │ │ │ │ │ │
│ │ │ │ @@ -270,15 +270,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
DataSource* d_source
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 70 of file SILLYJPGImageContext.h.

│ │ │ │ +

Definition at line 70 of file SILLYJPGImageContext.h.

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

◆ setjmp_buffer

│ │ │ │ │ │ │ │
│ │ │ │ @@ -286,15 +286,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
jmp_buf setjmp_buffer
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 69 of file SILLYJPGImageContext.h.

│ │ │ │ +

Definition at line 69 of file SILLYJPGImageContext.h.

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

◆ src_mgr

│ │ │ │ │ │ │ │
│ │ │ │ @@ -302,21 +302,21 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
jpeg_source_mgr src_mgr
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 65 of file SILLYJPGImageContext.h.

│ │ │ │ +

Definition at line 65 of file SILLYJPGImageContext.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following files: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libsilly-doc/html/a00949.html │ │ │ │ @@ -49,15 +49,15 @@ │ │ │ │
JPGImageLoader Class Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Loader class for JPG Image. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <SILLYJPGImageLoader.h>

│ │ │ │ +

#include <SILLYJPGImageLoader.h>

│ │ │ │
│ │ │ │ Inheritance diagram for JPGImageLoader:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -90,15 +90,15 @@ │ │ │ │ bool loadImageData (PixelOrigin origin, DataSource *data, ImageContext *context) │ │ │ │  Parse the pixels data of the image and fill the header struct.
│ │ │ │   │ │ │ │ │ │ │ │

Detailed Description

│ │ │ │

Loader class for JPG Image.

│ │ │ │ │ │ │ │ -

Definition at line 42 of file SILLYJPGImageLoader.h.

│ │ │ │ +

Definition at line 42 of file SILLYJPGImageLoader.h.

│ │ │ │

Constructor & Destructor Documentation

│ │ │ │ │ │ │ │

◆ JPGImageLoader()

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ @@ -107,15 +107,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
()
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 46 of file SILLYJPGImageLoader.cpp.

│ │ │ │ +

Definition at line 46 of file SILLYJPGImageLoader.cpp.

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

◆ ~JPGImageLoader()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -126,15 +126,15 @@ │ │ │ │ ( │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 51 of file SILLYJPGImageLoader.cpp.

│ │ │ │ +

Definition at line 51 of file SILLYJPGImageLoader.cpp.

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

Member Function Documentation

│ │ │ │ │ │ │ │

◆ destroyContext()

│ │ │ │ │ │ │ │ @@ -163,15 +163,15 @@ │ │ │ │
Parameters
│ │ │ │ │ │ │ │ │ │ │ │
contexta pointer to the context
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 47 of file SILLYImageLoader.cpp.

│ │ │ │ +

Definition at line 47 of file SILLYImageLoader.cpp.

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

◆ loadHeader()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -213,15 +213,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
Returns
Context for the rest of the parsing or 0 if an error occured
│ │ │ │ │ │ │ │

Implements ImageLoader.

│ │ │ │ │ │ │ │ -

Definition at line 56 of file SILLYJPGImageLoader.cpp.

│ │ │ │ +

Definition at line 56 of file SILLYJPGImageLoader.cpp.

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

◆ loadImageData()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -270,21 +270,21 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
Returns
true on success false on error
│ │ │ │ │ │ │ │

Implements ImageLoader.

│ │ │ │ │ │ │ │ -

Definition at line 90 of file SILLYJPGImageLoader.cpp.

│ │ │ │ +

Definition at line 90 of file SILLYJPGImageLoader.cpp.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following files: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libsilly-doc/html/a00953.html │ │ │ │ @@ -51,15 +51,15 @@ │ │ │ │
PNGImageContext Class Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Image Context for PNG Image Loader. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <SILLYPNGImageContext.h>

│ │ │ │ +

#include <SILLYPNGImageContext.h>

│ │ │ │
│ │ │ │ Inheritance diagram for PNGImageContext:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -117,15 +117,15 @@ │ │ │ │ Friends │ │ │ │ class PNGImageLoader │ │ │ │   │ │ │ │ │ │ │ │

Detailed Description

│ │ │ │

Image Context for PNG Image Loader.

│ │ │ │ │ │ │ │ -

Definition at line 45 of file SILLYPNGImageContext.h.

│ │ │ │ +

Definition at line 45 of file SILLYPNGImageContext.h.

│ │ │ │

Constructor & Destructor Documentation

│ │ │ │ │ │ │ │

◆ PNGImageContext()

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ @@ -135,15 +135,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
DataSourcedata)
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 59 of file SILLYPNGImageContext.cpp.

│ │ │ │ +

Definition at line 59 of file SILLYPNGImageContext.cpp.

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

◆ ~PNGImageContext()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -154,15 +154,15 @@ │ │ │ │ ( │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 65 of file SILLYPNGImageContext.cpp.

│ │ │ │ +

Definition at line 65 of file SILLYPNGImageContext.cpp.

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

Member Function Documentation

│ │ │ │ │ │ │ │

◆ flipVertically()

│ │ │ │ │ │ │ │ @@ -215,15 +215,15 @@ │ │ │ │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 46 of file SILLYPNGImageContext.cpp.

│ │ │ │ +

Definition at line 46 of file SILLYPNGImageContext.cpp.

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

Friends And Related Symbol Documentation

│ │ │ │ │ │ │ │

◆ PNGImageLoader

│ │ │ │ │ │ │ │ @@ -240,21 +240,21 @@ │ │ │ │ │ │ │ │ │ │ │ │ friend │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 70 of file SILLYPNGImageContext.h.

│ │ │ │ +

Definition at line 70 of file SILLYPNGImageContext.h.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following files: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libsilly-doc/html/a00957.html │ │ │ │ @@ -49,15 +49,15 @@ │ │ │ │
PNGImageLoader Class Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Loader for PNG Image. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <SILLYPNGImageLoader.h>

│ │ │ │ +

#include <SILLYPNGImageLoader.h>

│ │ │ │
│ │ │ │ Inheritance diagram for PNGImageLoader:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -90,15 +90,15 @@ │ │ │ │ bool loadImageData (PixelOrigin origin, DataSource *data, ImageContext *context) │ │ │ │  Parse the pixels data of the image and fill the header struct.
│ │ │ │   │ │ │ │ │ │ │ │

Detailed Description

│ │ │ │

Loader for PNG Image.

│ │ │ │ │ │ │ │ -

Definition at line 42 of file SILLYPNGImageLoader.h.

│ │ │ │ +

Definition at line 42 of file SILLYPNGImageLoader.h.

│ │ │ │

Constructor & Destructor Documentation

│ │ │ │ │ │ │ │

◆ PNGImageLoader()

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ @@ -107,15 +107,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
()
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 79 of file SILLYPNGImageLoader.cpp.

│ │ │ │ +

Definition at line 79 of file SILLYPNGImageLoader.cpp.

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

◆ ~PNGImageLoader()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -126,15 +126,15 @@ │ │ │ │ ( │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 83 of file SILLYPNGImageLoader.cpp.

│ │ │ │ +

Definition at line 83 of file SILLYPNGImageLoader.cpp.

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

Member Function Documentation

│ │ │ │ │ │ │ │

◆ destroyContext()

│ │ │ │ │ │ │ │ @@ -163,15 +163,15 @@ │ │ │ │
Parameters
│ │ │ │ │ │ │ │ │ │ │ │
contexta pointer to the context
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 47 of file SILLYImageLoader.cpp.

│ │ │ │ +

Definition at line 47 of file SILLYImageLoader.cpp.

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

◆ loadHeader()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -213,15 +213,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
Returns
Context for the rest of the parsing or 0 if an error occured
│ │ │ │ │ │ │ │

Implements ImageLoader.

│ │ │ │ │ │ │ │ -

Definition at line 88 of file SILLYPNGImageLoader.cpp.

│ │ │ │ +

Definition at line 88 of file SILLYPNGImageLoader.cpp.

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

◆ loadImageData()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -270,21 +270,21 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
Returns
true on success false on error
│ │ │ │ │ │ │ │

Implements ImageLoader.

│ │ │ │ │ │ │ │ -

Definition at line 154 of file SILLYPNGImageLoader.cpp.

│ │ │ │ +

Definition at line 154 of file SILLYPNGImageLoader.cpp.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following files: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libsilly-doc/html/a00961.html │ │ │ │ @@ -51,15 +51,15 @@ │ │ │ │
TGAImageContext Class Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Image Context for Targa image. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <SILLYTGAImageContext.h>

│ │ │ │ +

#include <SILLYTGAImageContext.h>

│ │ │ │
│ │ │ │ Inheritance diagram for TGAImageContext:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -116,15 +116,15 @@ │ │ │ │ Friends │ │ │ │ class TGAImageLoader │ │ │ │   │ │ │ │ │ │ │ │

Detailed Description

│ │ │ │

Image Context for Targa image.

│ │ │ │ │ │ │ │ -

Definition at line 42 of file SILLYTGAImageContext.h.

│ │ │ │ +

Definition at line 42 of file SILLYTGAImageContext.h.

│ │ │ │

Member Function Documentation

│ │ │ │ │ │ │ │

◆ flipVertically()

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ @@ -169,20 +169,20 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ friend
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 54 of file SILLYTGAImageContext.h.

│ │ │ │ +

Definition at line 54 of file SILLYTGAImageContext.h.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libsilly-doc/html/a00965.html │ │ │ │ @@ -49,15 +49,15 @@ │ │ │ │
TGAImageLoader Class Reference
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

Loader for Targa image. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <SILLYTGAImageLoader.h>

│ │ │ │ +

#include <SILLYTGAImageLoader.h>

│ │ │ │
│ │ │ │ Inheritance diagram for TGAImageLoader:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -90,15 +90,15 @@ │ │ │ │ bool loadImageData (PixelOrigin origin, DataSource *data, ImageContext *context) │ │ │ │  Parse the pixels data of the image and fill the header struct.
│ │ │ │   │ │ │ │ │ │ │ │

Detailed Description

│ │ │ │

Loader for Targa image.

│ │ │ │ │ │ │ │ -

Definition at line 43 of file SILLYTGAImageLoader.h.

│ │ │ │ +

Definition at line 43 of file SILLYTGAImageLoader.h.

│ │ │ │

Constructor & Destructor Documentation

│ │ │ │ │ │ │ │

◆ TGAImageLoader()

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ @@ -107,15 +107,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
()
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 51 of file SILLYTGAImageLoader.cpp.

│ │ │ │ +

Definition at line 51 of file SILLYTGAImageLoader.cpp.

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

◆ ~TGAImageLoader()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -126,15 +126,15 @@ │ │ │ │ ( │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 56 of file SILLYTGAImageLoader.cpp.

│ │ │ │ +

Definition at line 56 of file SILLYTGAImageLoader.cpp.

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

Member Function Documentation

│ │ │ │ │ │ │ │

◆ destroyContext()

│ │ │ │ │ │ │ │ @@ -163,15 +163,15 @@ │ │ │ │
Parameters
│ │ │ │ │ │ │ │ │ │ │ │
contexta pointer to the context
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Definition at line 47 of file SILLYImageLoader.cpp.

│ │ │ │ +

Definition at line 47 of file SILLYImageLoader.cpp.

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

◆ loadHeader()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -213,15 +213,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
Returns
Context for the rest of the parsing or 0 if an error occured
│ │ │ │ │ │ │ │

Implements ImageLoader.

│ │ │ │ │ │ │ │ -

Definition at line 74 of file SILLYTGAImageLoader.cpp.

│ │ │ │ +

Definition at line 74 of file SILLYTGAImageLoader.cpp.

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

◆ loadImageData()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -270,21 +270,21 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
Returns
true on success false on error
│ │ │ │ │ │ │ │

Implements ImageLoader.

│ │ │ │ │ │ │ │ -

Definition at line 134 of file SILLYTGAImageLoader.cpp.

│ │ │ │ +

Definition at line 134 of file SILLYTGAImageLoader.cpp.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following files: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libsilly-doc/html/a00969.html │ │ │ │ @@ -49,15 +49,15 @@ │ │ │ │
DataSource Class Referenceabstract
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

This is an abstract class used to provide data to the loader. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <SILLYDataSource.h>

│ │ │ │ +

#include <SILLYDataSource.h>

│ │ │ │
│ │ │ │ Inheritance diagram for DataSource:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -84,15 +84,15 @@ │ │ │ │  Destructor.
│ │ │ │   │ │ │ │ │ │ │ │

Detailed Description

│ │ │ │

This is an abstract class used to provide data to the loader.

│ │ │ │

This class defines abstract data loading operation required for the library.

│ │ │ │ │ │ │ │ -

Definition at line 46 of file SILLYDataSource.h.

│ │ │ │ +

Definition at line 46 of file SILLYDataSource.h.

│ │ │ │

Member Function Documentation

│ │ │ │ │ │ │ │

◆ getDataPtr()

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ @@ -145,15 +145,15 @@ │ │ │ │

Return the size of the data.

│ │ │ │ │ │ │ │

Implemented in FileDataSource, and MemoryDataSource.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
The documentation for this class was generated from the following file:
    │ │ │ │ -
  • /build/reproducible-path/silly-0.1.0/include/SILLYDataSource.h
  • │ │ │ │ +
  • /build/reproducible-path/silly-0.1.0/include/SILLYDataSource.h
  • │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libsilly-doc/html/a00973.html │ │ │ │ @@ -49,15 +49,15 @@ │ │ │ │
FileDataSource Class Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

This class allow the loading of an image directly from a file. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <SILLYFileDataSource.h>

│ │ │ │ +

#include <SILLYFileDataSource.h>

│ │ │ │
│ │ │ │ Inheritance diagram for FileDataSource:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -97,15 +97,15 @@ │ │ │ │
│ │ │ │ │ │ │ │
 destructor
 
│ │ │ │

Detailed Description

│ │ │ │

This class allow the loading of an image directly from a file.

│ │ │ │

This class provides the services required to load an from a file. The loading is done once at initialization. We wanted to avoid exception. This is why user must check whether the object is valid or not after creation.

│ │ │ │ │ │ │ │ -

Definition at line 48 of file SILLYFileDataSource.h.

│ │ │ │ +

Definition at line 48 of file SILLYFileDataSource.h.

│ │ │ │

Constructor & Destructor Documentation

│ │ │ │ │ │ │ │

◆ FileDataSource()

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ @@ -124,15 +124,15 @@ │ │ │ │
Parameters
│ │ │ │
│ │ │ │ │ │ │ │
filenamethe name of the file containing the data
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 46 of file SILLYFileDataSource.cpp.

│ │ │ │ +

Definition at line 46 of file SILLYFileDataSource.cpp.

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

◆ ~FileDataSource()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -145,15 +145,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

destructor

│ │ │ │ │ │ │ │ -

Definition at line 86 of file SILLYFileDataSource.cpp.

│ │ │ │ +

Definition at line 86 of file SILLYFileDataSource.cpp.

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

Member Function Documentation

│ │ │ │ │ │ │ │

◆ getDataPtr()

│ │ │ │ │ │ │ │ @@ -230,16 +230,16 @@ │ │ │ │

Check wether the loading is successfull or not.

│ │ │ │

One must call this function after creating this object in order to be sure the loading was successfull.

│ │ │ │
Returns
true if the loading is successfull.
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following files: │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libsilly-doc/html/a00977.html │ │ │ │ @@ -49,15 +49,15 @@ │ │ │ │
Image Class Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Image is the main user class of the library. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <SILLYImage.h>

│ │ │ │ +

#include <SILLYImage.h>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -102,15 +102,15 @@ │ │ │ │   │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Public Member Functions

│ │ │ │ size_t getHeight () const
 Retrieve the height of the image.
 
~Image ()
 Destructor.
 
│ │ │ │

Detailed Description

│ │ │ │

Image is the main user class of the library.

│ │ │ │ │ │ │ │ -

Definition at line 46 of file SILLYImage.h.

│ │ │ │ +

Definition at line 46 of file SILLYImage.h.

│ │ │ │

Constructor & Destructor Documentation

│ │ │ │ │ │ │ │

◆ Image()

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ @@ -128,15 +128,15 @@ │ │ │ │
Parameters
│ │ │ │
│ │ │ │ │ │ │ │
datathe raw input containing the image
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 48 of file SILLYImage.cpp.

│ │ │ │ +

Definition at line 48 of file SILLYImage.cpp.

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

Member Function Documentation

│ │ │ │ │ │ │ │

◆ loadImageData()

│ │ │ │ │ │ │ │ @@ -170,15 +170,15 @@ │ │ │ │ originexpected origin position for the pixels │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
Returns
true on success false if an error occured
│ │ │ │
Note
this function can be called several time if the pixel format are different the format is reloaded
│ │ │ │ │ │ │ │ -

Definition at line 68 of file SILLYImage.cpp.

│ │ │ │ +

Definition at line 68 of file SILLYImage.cpp.

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

◆ loadImageHeader()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -192,21 +192,21 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Retrieve the information concerning the image object.

│ │ │ │
Returns
true on success
│ │ │ │ │ │ │ │ -

Definition at line 54 of file SILLYImage.cpp.

│ │ │ │ +

Definition at line 54 of file SILLYImage.cpp.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following files:
    │ │ │ │ -
  • /build/reproducible-path/silly-0.1.0/include/SILLYImage.h
  • │ │ │ │ -
  • /build/reproducible-path/silly-0.1.0/src/SILLYImage.cpp
  • │ │ │ │ +
  • /build/reproducible-path/silly-0.1.0/include/SILLYImage.h
  • │ │ │ │ +
  • /build/reproducible-path/silly-0.1.0/src/SILLYImage.cpp
  • │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libsilly-doc/html/a00981.html │ │ │ │ @@ -50,15 +50,15 @@ │ │ │ │
ImageContext Class Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Store the data needed by an ImageLoader object during the parsing of an image. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <SILLYImageContext.h>

│ │ │ │ +

#include <SILLYImageContext.h>

│ │ │ │
│ │ │ │ Inheritance diagram for ImageContext:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -108,15 +108,15 @@ │ │ │ │ │ │ │ │ void setWidth (size_t width) │ │ │ │   │ │ │ │ │ │ │ │

Detailed Description

│ │ │ │

Store the data needed by an ImageLoader object during the parsing of an image.

│ │ │ │ │ │ │ │ -

Definition at line 43 of file SILLYImageContext.h.

│ │ │ │ +

Definition at line 43 of file SILLYImageContext.h.

│ │ │ │

Constructor & Destructor Documentation

│ │ │ │ │ │ │ │

◆ ImageContext()

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ @@ -179,15 +179,15 @@ │ │ │ │
Returns
true on success false otherwise
│ │ │ │ │ │ │ │

Definition at line 45 of file SILLYImageContext.cpp.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
The documentation for this class was generated from the following files: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libsilly-doc/html/a00985.html │ │ │ │ @@ -123,15 +123,15 @@ │ │ │ │
Parameters
│ │ │ │
│ │ │ │ │ │ │ │
contexta pointer to the context
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 47 of file SILLYImageLoader.cpp.

│ │ │ │ +

Definition at line 47 of file SILLYImageLoader.cpp.

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

◆ loadHeader()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -232,15 +232,15 @@ │ │ │ │ │ │ │ │

Implemented in JPGImageLoader, PNGImageLoader, and TGAImageLoader.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following files: │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libsilly-doc/html/a00989.html │ │ │ │ @@ -50,15 +50,15 @@ │ │ │ │
ImageLoaderManager Class Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Manage the list of all supported ImageLoader. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <SILLYImageLoaderManager.h>

│ │ │ │ +

#include <SILLYImageLoaderManager.h>

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

│ │ │ │ Public Member Functions

void add (ImageLoader *loader)
 Register an ImageLoader object.
 
│ │ │ │ @@ -84,15 +84,15 @@ │ │ │ │
│ │ │ │ static ImageLoaderManagergetSingletonPtr ()
 
│ │ │ │

Detailed Description

│ │ │ │

Manage the list of all supported ImageLoader.

│ │ │ │ │ │ │ │ -

Definition at line 56 of file SILLYImageLoaderManager.h.

│ │ │ │ +

Definition at line 56 of file SILLYImageLoaderManager.h.

│ │ │ │

Constructor & Destructor Documentation

│ │ │ │ │ │ │ │

◆ ImageLoaderManager()

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ @@ -103,15 +103,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

Constructor.

│ │ │ │ │ │ │ │ -

Definition at line 62 of file SILLYImageLoaderManager.cpp.

│ │ │ │ +

Definition at line 62 of file SILLYImageLoaderManager.cpp.

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

◆ ~ImageLoaderManager()

│ │ │ │ │ │ │ │
│ │ │ │ @@ -124,15 +124,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Destructor.

│ │ │ │ │ │ │ │ -

Definition at line 77 of file SILLYImageLoaderManager.cpp.

│ │ │ │ +

Definition at line 77 of file SILLYImageLoaderManager.cpp.

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

Member Function Documentation

│ │ │ │ │ │ │ │

◆ add()

│ │ │ │ │ │ │ │ @@ -156,16 +156,16 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
The documentation for this class was generated from the following files: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libsilly-doc/html/a00993.html │ │ │ │ @@ -49,15 +49,15 @@ │ │ │ │
MemoryDataSource Class Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Load an image from a memory area. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <SILLYMemoryDataSource.h>

│ │ │ │ +

#include <SILLYMemoryDataSource.h>

│ │ │ │
│ │ │ │ Inheritance diagram for MemoryDataSource:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -91,15 +91,15 @@ │ │ │ │  Retieve the byte at offset.
│ │ │ │   │ │ │ │ │ │ │ │

Detailed Description

│ │ │ │

Load an image from a memory area.

│ │ │ │

This class provides the services required to load an image from a byte array. The object does not change the memory area and does no take owner chip of the data.

│ │ │ │ │ │ │ │ -

Definition at line 48 of file SILLYMemoryDataSource.h.

│ │ │ │ +

Definition at line 48 of file SILLYMemoryDataSource.h.

│ │ │ │

Constructor & Destructor Documentation

│ │ │ │ │ │ │ │

◆ MemoryDataSource()

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ @@ -129,15 +129,15 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │
dataa byte array of size size
sizethe size of data
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

Definition at line 46 of file SILLYMemoryDataSource.cpp.

│ │ │ │ +

Definition at line 46 of file SILLYMemoryDataSource.cpp.

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

Member Function Documentation

│ │ │ │ │ │ │ │

◆ getDataPtr()

│ │ │ │ │ │ │ │ @@ -193,16 +193,16 @@ │ │ │ │

Return the size of the data.

│ │ │ │ │ │ │ │

Implements DataSource.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following files: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libsilly-doc/html/dir_0d87e2e7ddaae8a2a8572c0afc59fe0d.html │ │ │ │ @@ -60,47 +60,47 @@ │ │ │ │

│ │ │ │ Directories

│ │ │ │  loaders │ │ │ │   │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Files

 SILLY.h
 SILLY.h
 
 SILLYBase.h
 SILLYBase.h
 
 SILLYDataSource.h
 SILLYDataSource.h
 
 SILLYDataSource.icpp
 SILLYDataSource.icpp
 
 SILLYFileDataSource.h
 SILLYFileDataSource.h
 
 SILLYFileDataSource.icpp
 SILLYFileDataSource.icpp
 
 SILLYImage.h
 SILLYImage.h
 
 SILLYImage.icpp
 SILLYImage.icpp
 
 SILLYImageContext.h
 SILLYImageContext.h
 
 SILLYImageContext.icpp
 SILLYImageContext.icpp
 
 SILLYImageLoader.h
 
 SILLYImageLoader.icpp
 SILLYImageLoader.icpp
 
 SILLYImageLoaderManager.h
 SILLYImageLoaderManager.h
 
 SILLYImageLoaderManager.icpp
 SILLYImageLoaderManager.icpp
 
 SILLYMemoryDataSource.h
 SILLYMemoryDataSource.h
 
 SILLYMemoryDataSource.icpp
 
 SILLYOptions.h
 SILLYOptions.h
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libsilly-doc/html/dir_7b011f4828cd5682692dd5e7c066fc3b.html │ │ │ │ @@ -54,25 +54,25 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Files

 SILLYJPGImageContext.cpp
 SILLYJPGImageContext.cpp
 
 SILLYJPGImageLoader.cpp
 SILLYJPGImageLoader.cpp
 
 SILLYPNGImageContext.cpp
 SILLYPNGImageContext.cpp
 
 SILLYPNGImageLoader.cpp
 SILLYPNGImageLoader.cpp
 
 SILLYTGAImageContext.cpp
 SILLYTGAImageContext.cpp
 
 SILLYTGAImageLoader.cpp
 SILLYTGAImageLoader.cpp
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libsilly-doc/html/dir_7b53bc9a32849689d682eb098e891de5.html │ │ │ │ @@ -60,27 +60,27 @@ │ │ │ │

│ │ │ │ Directories

│ │ │ │  loaders │ │ │ │   │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Files

 SILLYDataSource.cpp
 SILLYDataSource.cpp
 
 SILLYFileDataSource.cpp
 SILLYFileDataSource.cpp
 
 SILLYImage.cpp
 SILLYImage.cpp
 
 SILLYImageContext.cpp
 
 SILLYImageLoader.cpp
 SILLYImageLoader.cpp
 
 SILLYImageLoaderManager.cpp
 SILLYImageLoaderManager.cpp
 
 SILLYMemoryDataSource.cpp
 SILLYMemoryDataSource.cpp
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libsilly-doc/html/dir_7cea72c962538e8359f822070f2512f7.html │ │ │ │ @@ -54,37 +54,37 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Files

 SILLYJPGImageContext.h
 SILLYJPGImageContext.h
 
 SILLYJPGImageContext.icpp
 
 SILLYJPGImageLoader.h
 SILLYJPGImageLoader.h
 
 SILLYJPGImageLoader.icpp
 SILLYJPGImageLoader.icpp
 
 SILLYPNGImageContext.h
 SILLYPNGImageContext.h
 
 SILLYPNGImageContext.icpp
 SILLYPNGImageContext.icpp
 
 SILLYPNGImageLoader.h
 SILLYPNGImageLoader.h
 
 SILLYPNGImageLoader.icpp
 SILLYPNGImageLoader.icpp
 
 SILLYTGAImageContext.h
 SILLYTGAImageContext.h
 
 SILLYTGAImageContext.icpp
 SILLYTGAImageContext.icpp
 
 SILLYTGAImageLoader.h
 SILLYTGAImageLoader.h
 
 SILLYTGAImageLoader.icpp
 SILLYTGAImageLoader.icpp
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libsilly-doc/html/files.html │ │ │ │ @@ -45,58 +45,58 @@ │ │ │ │
Here is a list of all documented files with brief descriptions:
│ │ │ │
[detail level 123456]
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │
  build
  reproducible-path
  silly-0.1.0
  include
  loaders
 SILLYJPGImageContext.h
 SILLYJPGImageContext.h
 SILLYJPGImageContext.icpp
 SILLYJPGImageLoader.h
 SILLYJPGImageLoader.icpp
 SILLYPNGImageContext.h
 SILLYPNGImageContext.icpp
 SILLYPNGImageLoader.h
 SILLYPNGImageLoader.icpp
 SILLYTGAImageContext.h
 SILLYTGAImageContext.icpp
 SILLYTGAImageLoader.h
 SILLYTGAImageLoader.icpp
 SILLY.h
 SILLYBase.h
 SILLYDataSource.h
 SILLYDataSource.icpp
 SILLYFileDataSource.h
 SILLYFileDataSource.icpp
 SILLYImage.h
 SILLYImage.icpp
 SILLYImageContext.h
 SILLYImageContext.icpp
 SILLYJPGImageLoader.h
 SILLYJPGImageLoader.icpp
 SILLYPNGImageContext.h
 SILLYPNGImageContext.icpp
 SILLYPNGImageLoader.h
 SILLYPNGImageLoader.icpp
 SILLYTGAImageContext.h
 SILLYTGAImageContext.icpp
 SILLYTGAImageLoader.h
 SILLYTGAImageLoader.icpp
 SILLY.h
 SILLYBase.h
 SILLYDataSource.h
 SILLYDataSource.icpp
 SILLYFileDataSource.h
 SILLYFileDataSource.icpp
 SILLYImage.h
 SILLYImage.icpp
 SILLYImageContext.h
 SILLYImageContext.icpp
 SILLYImageLoader.h
 SILLYImageLoader.icpp
 SILLYImageLoaderManager.h
 SILLYImageLoaderManager.icpp
 SILLYMemoryDataSource.h
 SILLYImageLoader.icpp
 SILLYImageLoaderManager.h
 SILLYImageLoaderManager.icpp
 SILLYMemoryDataSource.h
 SILLYMemoryDataSource.icpp
 SILLYOptions.h
 SILLYOptions.h
  src
  loaders
 SILLYJPGImageContext.cpp
 SILLYJPGImageLoader.cpp
 SILLYPNGImageContext.cpp
 SILLYPNGImageLoader.cpp
 SILLYTGAImageContext.cpp
 SILLYTGAImageLoader.cpp
 SILLYDataSource.cpp
 SILLYFileDataSource.cpp
 SILLYImage.cpp
 SILLYJPGImageContext.cpp
 SILLYJPGImageLoader.cpp
 SILLYPNGImageContext.cpp
 SILLYPNGImageLoader.cpp
 SILLYTGAImageContext.cpp
 SILLYTGAImageLoader.cpp
 SILLYDataSource.cpp
 SILLYFileDataSource.cpp
 SILLYImage.cpp
 SILLYImageContext.cpp
 SILLYImageLoader.cpp
 SILLYImageLoaderManager.cpp
 SILLYMemoryDataSource.cpp
 SILLYImageLoader.cpp
 SILLYImageLoaderManager.cpp
 SILLYMemoryDataSource.cpp
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libsilly-doc/html/index.html │ │ │ │ @@ -90,19 +90,19 @@ │ │ │ │
}
│ │ │ │
// Return a pointer to a byte array containing the
│ │ │ │
// pixels stored as RGBA
│ │ │ │
img.getPixelsDataPtr();
│ │ │ │
// Get the size of the pixel array
│ │ │ │
img.getPixelsDataSize();
│ │ │ │
SILLY::SILLYCleanup(); // Free all memory used by the library
│ │ │ │ -
unsigned char byte
Typename for a byte.
Definition SILLYBase.h:80
│ │ │ │ -
void SILLYCleanup()
Cleanup SILLY library internal.
│ │ │ │ -
bool SILLYInit()
Initialize the SILLY Library.
│ │ │ │ -
Image is the main user class of the library.
Definition SILLYImage.h:47
│ │ │ │ -
Load an image from a memory area.
│ │ │ │ +
unsigned char byte
Typename for a byte.
Definition SILLYBase.h:80
│ │ │ │ +
void SILLYCleanup()
Cleanup SILLY library internal.
│ │ │ │ +
bool SILLYInit()
Initialize the SILLY Library.
│ │ │ │ +
Image is the main user class of the library.
Definition SILLYImage.h:47
│ │ │ │ +
Load an image from a memory area.
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │