Skip to content

Commit e582397

Browse files
committed
bin.5
Signed-off-by: Cary Phillips <cary@ilm.com>
1 parent 5da45cc commit e582397

4 files changed

Lines changed: 20 additions & 14 deletions

File tree

.github/workflows/website.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
runs-on: ${{ matrix.os }}
4747
strategy:
4848
matrix:
49-
os: [ubuntu-20.04, macos-latest, windows-latest]
49+
os: [ubuntu-latest, macos-latest, windows-latest]
5050

5151
env:
5252
# doxygen 1.10 causes sphinx to fail, so pin to 1.9 for now.

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,13 @@ complete details, but to get started, the "Hello, world" [`exrwriter.cpp`](https
6969
main()
7070
{
7171
try {
72-
int width = 500;
73-
int height = 250;
72+
int width = 50;
73+
int height = 25;
7474
7575
Imf::Array2D<Imf::Rgba> pixels(height, width);
7676
for (int y=0; y<height; y++)
7777
{
78-
float c = (y/10 % 2 == 0) ? 1.0 : 0.0;
78+
float c = (y/5 % 2 == 0) ? 1.0 : 0.0;
7979
for (int x=0; x<width; x++)
8080
pixels[y][x] = Imf::Rgba(c,c,c);
8181
}
@@ -90,8 +90,8 @@ complete details, but to get started, the "Hello, world" [`exrwriter.cpp`](https
9090
return 0;
9191
}
9292

93-
This creates an image 500 pixels wide and 250 pixels high with
94-
horizontal stripes 10 pixels high:
93+
This creates an image 50 pixels wide and 25 pixels high with
94+
horizontal stripes 5 pixels high:
9595

9696
![stripes](website/images/stripes.png)
9797

website/HelloWorld.rst

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,18 @@ Write an Image
1515
==============
1616

1717
This example :download:`exrwriter.cpp <src/exrwriter/exrwriter.cpp>`
18-
program writes a simple ``hello.exr`` file of an image of 10x10 pixels with
19-
values that are a ramp in green and blue:
18+
program writes a simple image ``stripes.exr``:
2019

2120
.. literalinclude:: src/exrwriter/exrwriter.cpp
2221

23-
And the :download:`CMakeLists.txt <src/exrwriter/CMakeLists.txt>` file to build:
22+
This creates an image 50 pixels wide and 25 pixels high with
23+
horizontal stripes 5 pixels high:
24+
25+
.. image:: images/stripes.png
26+
:align: center
27+
28+
The :download:`CMakeLists.txt <src/exrwriter/CMakeLists.txt>` file to
29+
build is:
2430

2531
.. literalinclude:: src/exrwriter/CMakeLists.txt
2632

website/src/exrwriter/exrwriter.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,23 @@
55
int
66
main()
77
{
8-
int width = 500;
9-
int height = 250;
8+
int width = 50;
9+
int height = 25;
1010

1111
Imf::Array2D<Imf::Rgba> pixels(height, width);
1212
for (int y=0; y<height; y++)
1313
{
14-
float c = (y/10 % 2 == 0) ? 1.0 : 0.0;
14+
float c = (y/5 % 2 == 0) ? 1.0 : 0.0;
1515
for (int x=0; x<width; x++)
1616
pixels[y][x] = Imf::Rgba(c,c,c);
1717
}
1818

1919
try {
20-
Imf::RgbaOutputFile file ("hello.exr", width, height, Imf::WRITE_RGBA);
20+
Imf::RgbaOutputFile file ("stripes.exr", width, height, Imf::WRITE_RGBA);
2121
file.setFrameBuffer (&pixels[0][0], 1, width);
2222
file.writePixels (height);
2323
} catch (const std::exception &e) {
24-
std::cerr << "error writing image file hello.exr:" << e.what() << std::endl;
24+
std::cerr << "error writing image file stripes.exr:" << e.what() << std::endl;
2525
return 1;
2626
}
2727
return 0;

0 commit comments

Comments
 (0)