Skip to content

Commit c17f26d

Browse files
authored
Merge pull request #433 from RayTracing/stb-comments
STB comments
2 parents 2bbe4a4 + 2e2e35c commit c17f26d

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

books/RayTracingInOneWeekend.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,8 @@
171171
If it doesn’t, then you probably just have some newlines or something similar that is confusing the
172172
image reader.
173173

174-
If you want to produce more image types than PPM, I am a fan of `stb_image.h` available on github.
174+
If you want to produce more image types than PPM, I am a fan of `stb_image.h`, a header-only image
175+
library available on GitHub at https://github.com/nothings/stb.
175176

176177

177178
Adding a Progress Indicator

books/RayTracingTheNextWeek.html

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1735,11 +1735,12 @@
17351735
Storing Texture Image Data
17361736
---------------------------
17371737
Now we also need to create a texture class that holds an image. I am going to use my favorite image
1738-
utility `stb_image`. It reads in an image into a big array of unsigned char. These are just packed
1739-
RGBs that each range 0..255 for black to fully-on.
1738+
utility [stb_image][]. It reads in an image into a big array of unsigned char. These are just
1739+
packed RGBs that each range 0..255 (black to full white). The `image_texture` class uses the
1740+
resulting image data.
17401741

17411742
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++
1742-
#include "texture.h"
1743+
#include "rtweekend.h"
17431744

17441745
class image_texture : public texture {
17451746
public:
@@ -1776,11 +1777,12 @@
17761777
int nx, ny;
17771778
};
17781779
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1779-
[Listing [img-texture]: <kbd>[surface_texture.h]</kbd> Image texture class]
1780+
[Listing [img-texture]: <kbd>[texture.h]</kbd> Image texture class]
17801781

17811782
<div class='together'>
1782-
The representation of a packed array in that order is pretty standard. Thankfully, the `stb_image`
1783-
package makes that super simple -- just include the header `rtw_stb_image.h` in `main.h`:
1783+
The representation of a packed array in that order is pretty standard. Thankfully, the
1784+
[stb_image][] package makes that super simple -- just include the header `rtw_stb_image.h` (found in
1785+
the project source code at `src/common/rtw_stb_image.h`) in `main.h`:
17841786

17851787
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++
17861788
#include "rtw_stb_image.h"
@@ -2966,8 +2968,9 @@
29662968

29672969

29682970
[acknowledgments]: #acknowledgments
2969-
[Limnu]: https://limnu.com/
2970-
[Markdeep]: https://casual-effects/markdeep/
2971+
[Limnu]: https://limnu.com/
2972+
[Markdeep]: https://casual-effects/markdeep/
2973+
[stb_image]: https://github.com/nothings/stb
29712974

29722975

29732976
<!-- Markdeep: https://casual-effects.com/markdeep/ -->

0 commit comments

Comments
 (0)