Skip to content

Commit 3336f41

Browse files
authored
Merge pull request #138 from schmouk/dev
Dev - cpp14 v.0.1 ready
2 parents bfd79b5 + 9cab6f8 commit 3336f41

File tree

178 files changed

+13016
-30
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

178 files changed

+13016
-30
lines changed

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,15 @@
3636
*.vcxproj
3737
*.vcxproj.*
3838
*.sln
39+
x84
40+
Release
41+
Debug
3942

4043
# External Documentaion
4144
docs
45+
46+
# This project specifics
47+
archive
48+
cpp-bmp-loader
49+
create_ba_files
50+
tests

README.md

Lines changed: 75 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,88 @@
11
# CppBMPLoader
22
An exhaustive BMP Loader, MIT-licensed, implemented for c++14 and c++20
33

4+
This BMP loader library decodes **Windows** BMP files encoded according to
5+
BMP format versions 1 up to 5, as well as the specific *OS/2 1.x* and *OS/2
6+
2.x* BMP (*BitMaP*) and BA (*Bitmap multi images Array*) file formats.
7+
8+
It nevertheless currently does not decode JPEG and PNG encoded images that
9+
are embedded in BMP files, nor does it decode images embedding Windows
10+
color profiles.
411

512
## Genesis of this project
6-
The genesis of this project is the initial creation of the **OGLFW** library,
7-
an object overlay of the **GLFW** library, and the need to associate it with
8-
a library for loading images under the **MIT license** or from the public
9-
domain, free of rights, to associate them with icons provided in OGLFW.
10-
11-
## No way to find such a library - Alternative
12-
Being unable to find such a library under this type of license, a solution
13-
was to let users of the original **OGLFW** library load the images themselves
14-
using the external library of their choice, even if not under the MIT license.
15-
16-
Another solution was to propose an `Icon` class with a virtual image loading
17-
method not implemented in this base class. This second solution allowed users
18-
to derive their own classes from this Icon base class and to implement the
19-
image loading method corresponding to the format of the images to be loaded
20-
(possibly using already existing but less permissively licensed libraries).
21-
To this end, and as an example of implementation, a `BMPIcon` derived class
22-
has been provided in the **OGLFW** library. Its implementation had to rely on
23-
an external library which allows the loading of **BMP** images. Unfortunately,
24-
no library met the required licensing criteria or, when unlicensed or under
25-
**MIT** license, did not allow decoding of all cases of BMP image encoding.
13+
The genesis of this project is the initial creation of another library that
14+
needed to be associated with an external library for loading BMP images under
15+
the **MIT license** or from the public domain, free of rights, to associate
16+
them with icons.
17+
18+
Unfortunately, no such library has been found under this type of license that
19+
would provide for the decoding of **all** the different standardized formats of
20+
BMP images.
2621

2722
## CppBMPLoader is the implemented solution
2823
The **CppBMPLoader** library therefore fills this gap by offering the only
2924
loading of **BMP** images in all the forms that this image format allows and
3025
under the permissive MIT license. It will also meet many other needs when one
31-
sees the quantity of questions asked on this subject on the Internet and the
32-
number of BMPLoader libraries already existing but apparently incomplete that
26+
sees the number of questions asked on this topic on the Internet and the
27+
number of BMPLoader libraries already existing, but apparently incomplete, that
3328
can be found on *GitHub*, programmed in c++ or in other programming languages.
3429

3530
## c++14 and c++20 versions
36-
Initially, two versions of the library are offered, one responding to standard
37-
c++14 of the programming language and the other responding to standard c++20
38-
and offering more advanced programming concepts (e.g. programmed in the form
39-
of c++ modules).
40-
41-
## Notice
42-
Notice: by April and May 2024, this original library **OGLFW** is still under
43-
development.
31+
Initially, two versions of the library are offerred, one responding to standard
32+
c++14 and the other responding to standard c++20 (offering more advanced
33+
programming concepts, e.g. *ranges* and *views* or STL extensions).
34+
35+
Notice: by November 2024, the c++20 version of the library is not yet released.
36+
37+
## Notice (1/2)
38+
The c++14 standard version of **CppBMPLoader** does not use any c++14
39+
specificities but only c++11 ones. It has been compiled and validated with
40+
a c++14 compiler but should as well be compilable with a c++11 compiler.
41+
42+
## Notice (2/2)
43+
All released code has been validated. For this purpose, we used the great
44+
[**BMP Suite Image List**](https://entropymine.com/jason/bmpsuite/bmpsuite/html/bmpsuite.html)
45+
provided by Jason Summers - see also
46+
[https://entropymine.com/jason/bmpsuite/](https://entropymine.com/jason/bmpsuite/)
47+
and we augmented it with images we created by our own for the version 1 of Windows
48+
BMP format (lacking in Jason's suite) and with OS/2 **BA** files that we either
49+
created from scratch or downloaded from the Web, extracted from some original
50+
ISO images of OS/2.
51+
52+
53+
# Documentation
54+
The API of **CppBMPLoader** is documented in [documentation.md](./documentation.doc).
55+
This API is exactly the same for both the c++14 and the c++20 implementations of
56+
the library.
57+
58+
Shortly speeking, this API offers a templated class BMPImage<> for the loading
59+
of BMP images content and classes and functions to extract and load all images
60+
from a **BA** file or just the one of them that best fits dimensions, colors
61+
and/or resolutions criterias.
62+
63+
Many error cases and warnings are detected by **CppBMPLoader**. Errors are always
64+
fatal. Execution stops on any encountered error. Warnings do not stop your
65+
application and are accumulated along the processing of BMP and BA files. You
66+
get access to the error code and to a list of warning codes as well to the
67+
associated messages at will, since they are attached to the faulty BMP images.
68+
69+
70+
# Reading the code
71+
For those of you who are the most motivated for deeply diving into this
72+
library code, please notice that no implementation documentation is provided
73+
for **CppBMPLoader**.
74+
75+
The design decision made for its first implementation, a.k.a. cpp-14, has been
76+
to factorize as much code as possible. This was a tremendous decision when at
77+
bugs fixing time: each bug had to be fixed in one and only one place. This was
78+
also a very deceptive decision about the final readability of the code. So, you
79+
should avoid to have a first look at this code. Prefer to go into the c++20
80+
implementation of **CppBMPLoader** instead to have a far easier reading of it.
81+
There, we've preferred to duplicate the already debugged code, to provide a
82+
clear class for each type of object and for each format version that is
83+
internally managed by the library.
84+
85+
Meanwhile, experienced c++ developers should get no trouble in understanding
86+
the directories tree structure and the code itself as well, which is
87+
commented everywhere it seemed to be useful.
88+
See directories **cpp-14** or **cpp-20** and enjoy!

0 commit comments

Comments
 (0)