Skip to content

Commit 80e0f29

Browse files
committed
Cosmetic changes to README, add .gitignore
Fixed some typos in tinyexr.h.
1 parent 4dbd05a commit 80e0f29

File tree

3 files changed

+65
-68
lines changed

3 files changed

+65
-68
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
output.exr
2+
test_tinyexr

README.md

+52-57
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@
1010

1111
[![Coverity Scan Build Status](https://scan.coverity.com/projects/5827/badge.svg)](https://scan.coverity.com/projects/5827)
1212

13-
`tinyexr` is a small, single header-only library to load and save OpenEXR(.exr) images.
14-
`tinyexr` is written in portable C++(no library dependency except for STL), thus `tinyexr` is good to embed into your application.
13+
`tinyexr` is a small, single header-only library to load and save OpenEXR (.exr) images.
14+
`tinyexr` is written in portable C++ (no library dependency except for STL), thus `tinyexr` is good to embed into your application.
1515
To use `tinyexr`, simply copy `tinyexr.h` into your project.
1616

1717
Current status of `tinyexr` is:
1818

1919
- OpenEXR v1 image
2020
- [x] Scanline format
2121
- [ ] Tiled format
22-
- [x] Tile format with no LoD(load).
23-
- [ ] Tile format with LoD(load).
24-
- [ ] Tile format with no LoD(save).
25-
- [ ] Tile format with LoD(save).
22+
- [x] Tile format with no LoD (load).
23+
- [ ] Tile format with LoD (load).
24+
- [ ] Tile format with no LoD (save).
25+
- [ ] Tile format with LoD (save).
2626
- [x] Custom attributes
2727
- OpenEXR v2 image
2828
- [ ] Multipart format
@@ -38,19 +38,19 @@ Current status of `tinyexr` is:
3838
- [x] ZIP
3939
- [x] ZIPS
4040
- [x] PIZ
41-
- [x] ZFP(tinyexr extension)
41+
- [x] ZFP (tinyexr extension)
4242
- [ ] B44?
4343
- [ ] B44A?
4444
- [ ] PIX24?
4545
- Line order.
46-
- [x] Increasing, decreasing(load)
46+
- [x] Increasing, decreasing (load)
4747
- [ ] Random?
48-
- [ ] Increasing, decreasing(save)
49-
- Pixel format(UINT, FLOAT).
50-
- [x] UINT, FLOAT(load)
51-
- [x] UINT, FLOAT(deep load)
52-
- [x] UINT, FLOAT(save)
53-
- [ ] UINT, FLOAT(deep save)
48+
- [ ] Increasing, decreasing (save)
49+
- Pixel format (UINT, FLOAT).
50+
- [x] UINT, FLOAT (load)
51+
- [x] UINT, FLOAT (deep load)
52+
- [x] UINT, FLOAT (save)
53+
- [ ] UINT, FLOAT (deep save)
5454
- Support for big endian machine.
5555
- [x] Loading scanline image
5656
- [x] Saving scanline image
@@ -67,23 +67,23 @@ Current status of `tinyexr` is:
6767
- [ ] OpenMP multi-threading in deep image loading.
6868
- [ ] OpenMP multi-threading in deep image saving.
6969
* C interface.
70-
* You can easily write language bindings(e.g. golang)
70+
* You can easily write language bindings (e.g. golang)
7171

7272
# Use case
7373

74-
## New TinyEXR(v0.9.5+)
74+
## New TinyEXR (v0.9.5+)
7575

7676
* Godot. Multi-platform 2D and 3D game engine https://godotengine.org/
7777
* Filament. PBR engine. https://github.com/google/filament
7878
* PyEXR. Loading OpenEXR (.exr) images using Python. https://github.com/ialhashim/PyEXR
7979
* The-Forge. The Forge Cross-Platform Rendering Framework PC, Linux, Ray Tracing, macOS / iOS, Android, XBOX, PS4 https://github.com/ConfettiFX/The-Forge
8080
* Your project here!
8181

82-
## Older TinyEXR(v0.9.0)
82+
## Older TinyEXR (v0.9.0)
8383

8484
* mallie https://github.com/lighttransport/mallie
8585
* Cinder 0.9.0 https://libcinder.org/notes/v0.9.0
86-
* Piccante(develop branch) http://piccantelib.net/
86+
* Piccante (develop branch) http://piccantelib.net/
8787
* Your project here!
8888

8989
## Examples
@@ -93,7 +93,7 @@ Current status of `tinyexr` is:
9393
* [examples/exr2rgbe/](examples/exr2rgbe) EXR to .hdr converter
9494
* [examples/ldr2exr/](examples/exr2rgbe) LDR to EXR converter
9595
* [examples/exr2ldr/](examples/exr2ldr) EXR to LDR converter
96-
* [examples/cube2longlat/](examples/cube2longlat) Cubemap to longlat(equirectangler) converter
96+
* [examples/cube2longlat/](examples/cube2longlat) Cubemap to longlat (equirectangler) converter
9797

9898
## Experimental
9999

@@ -103,7 +103,7 @@ Current status of `tinyexr` is:
103103

104104
NOTE: **API is still subject to change**. See the source code for details.
105105

106-
Include `tinyexr.h` with `TINYEXR_IMPLEMENTATION` flag(do this only for **one** .cc file).
106+
Include `tinyexr.h` with `TINYEXR_IMPLEMENTATION` flag (do this only for **one** .cc file).
107107

108108
```cpp
109109
//Please include your own zlib-compatible API header before
@@ -116,11 +116,11 @@ Include `tinyexr.h` with `TINYEXR_IMPLEMENTATION` flag(do this only for **one**
116116

117117
### Compile flags
118118

119-
* `TINYEXR_USE_MINIZ` Use embedded miniz(default = 1). Please include `zlib.h` header(before `tinyexr.h`) if you disable miniz support.
120-
* `TINYEXR_USE_PIZ` Enable PIZ compression support(default = 1)
121-
* `TINYEXR_USE_ZFP` Enable ZFP compression supoort(TinyEXR extension, default = 0)
122-
* `TINYEXR_USE_THREAD` Enable threaded loading using C++11 thread(Requires C++11 compiler. default = 0)
123-
* `TINYEXR_USE_OPENMP` Enable OpenMP threading support(default = 1 if `_OPENMP` is defined)
119+
* `TINYEXR_USE_MINIZ` Use embedded miniz (default = 1). Please include `zlib.h` header (before `tinyexr.h`) if you disable miniz support.
120+
* `TINYEXR_USE_PIZ` Enable PIZ compression support (default = 1)
121+
* `TINYEXR_USE_ZFP` Enable ZFP compression supoort (TinyEXR extension, default = 0)
122+
* `TINYEXR_USE_THREAD` Enable threaded loading using C++11 thread (Requires C++11 compiler, default = 0)
123+
* `TINYEXR_USE_OPENMP` Enable OpenMP threading support (default = 1 if `_OPENMP` is defined)
124124
* Use `TINYEXR_USE_OPENMP=0` to force disable OpenMP code path even if OpenMP is available/enabled in the compiler.
125125

126126
### Quickly reading RGB(A) EXR file.
@@ -141,16 +141,16 @@ Include `tinyexr.h` with `TINYEXR_IMPLEMENTATION` flag(do this only for **one**
141141
}
142142
} else {
143143
...
144-
free(out); // relase memory of image data
144+
free(out); // release memory of image data
145145
}
146146

147147
```
148148
149149
### Reading layered RGB(A) EXR file.
150150
151-
If you want to read EXR image with layer info(Channel has a name with delimiter `.`), please use LoadEXRWithLayer` API.
151+
If you want to read EXR image with layer info (channel has a name with delimiter `.`), please use `LoadEXRWithLayer` API.
152152
153-
You need to know layer name in advance(e.g. through `EXRLayers` API).
153+
You need to know layer name in advance (e.g. through `EXRLayers` API).
154154
155155
```cpp
156156
const char* input = ...;
@@ -170,7 +170,7 @@ You need to know layer name in advance(e.g. through `EXRLayers` API).
170170
}
171171
} else {
172172
...
173-
free(out); // relase memory of image data
173+
free(out); // release memory of image data
174174
}
175175
176176
```
@@ -381,7 +381,7 @@ See `example/deepview` for actual usage.
381381
382382
int ret = LoadDeepEXR(&deepImage, input, &err);
383383
384-
// acccess to each sample in the deep pixel.
384+
// access to each sample in the deep pixel.
385385
for (int y = 0; y < deepImage.height; y++) {
386386
int sampleNum = deepImage.offset_table[y][deepImage.width-1];
387387
for (int x = 0; x < deepImage.width-1; x++) {
@@ -406,18 +406,13 @@ See `example/deepview` for actual usage.
406406

407407
![DeepViewExample](https://github.com/syoyo/tinyexr/blob/master/examples/deepview/deepview_screencast.gif?raw=true)
408408

409-
## Defines
410-
411-
* TINYEXR_USE_MINIZ Set `1`(default) to use embedded miniz compression. If you want zlib or custom zlib compatible library, set `0` and link zlib library.
412-
* TINYEXR_USE_ZFP Set `1` to use ZFP compression.
413-
414409
## TinyEXR extension
415410

416411
### ZFP
417412

418413
#### NOTE
419414

420-
TinyEXR adds ZFP compression as an experimemtal support(Linux and MacOSX only).
415+
TinyEXR adds ZFP compression as an experimemtal support (Linux and MacOSX only).
421416

422417
ZFP only supports FLOAT format pixel, and its image width and height must be the multiple of 4, since ZFP compresses pixels with 4x4 pixel block.
423418

@@ -474,35 +469,35 @@ Contribution is welcome!
474469
- [ ] B44A?
475470
- [ ] PIX24?
476471
- [ ] Custom attributes
477-
- [x] Normal image(EXR 1.x)
478-
- [ ] Deep image(EXR 2.x)
479-
- [ ] JavaScript library(experimental. using Emscripten)
472+
- [x] Normal image (EXR 1.x)
473+
- [ ] Deep image (EXR 2.x)
474+
- [ ] JavaScript library (experimental, using Emscripten)
480475
- [x] LoadEXRFromMemory
481476
- [ ] SaveMultiChannelEXR
482477
- [ ] Deep image save/load
483478
- [ ] Write from/to memory buffer.
484479
- [ ] Deep image save/load
485480
- [ ] Tile format.
486-
- [x] Tile format with no LoD(load).
487-
- [ ] Tile format with LoD(load).
488-
- [ ] Tile format with no LoD(save).
489-
- [ ] Tile format with LoD(save).
481+
- [x] Tile format with no LoD (load).
482+
- [ ] Tile format with LoD (load).
483+
- [ ] Tile format with no LoD (save).
484+
- [ ] Tile format with LoD (save).
490485
- [ ] Support for custom compression type.
491-
- [x] zfp compression(Not in OpenEXR spec, though)
486+
- [x] zfp compression (Not in OpenEXR spec, though)
492487
- [ ] zstd?
493488
- [x] Multi-channel.
494-
- [ ] Multi-part(EXR2.0)
489+
- [ ] Multi-part (EXR2.0)
495490
- [x] Load multi-part image
496491
- [ ] Load multi-part deep image
497492
- [ ] Line order.
498-
- [x] Increasing, decreasing(load)
493+
- [x] Increasing, decreasing (load)
499494
- [ ] Random?
500-
- [ ] Increasing, decreasing(save)
501-
- [ ] Pixel format(UINT, FLOAT).
502-
- [x] UINT, FLOAT(load)
503-
- [x] UINT, FLOAT(deep load)
504-
- [x] UINT, FLOAT(save)
505-
- [ ] UINT, FLOAT(deep save)
495+
- [ ] Increasing, decreasing (save)
496+
- [ ] Pixel format (UINT, FLOAT).
497+
- [x] UINT, FLOAT (load)
498+
- [x] UINT, FLOAT (deep load)
499+
- [x] UINT, FLOAT (save)
500+
- [ ] UINT, FLOAT (deep save)
506501
- [ ] Support for big endian machine.
507502
- [ ] Loading multi-part channel EXR
508503
- [ ] Saving multi-part channel EXR
@@ -535,11 +530,11 @@ Contribution is welcome!
535530

536531
## Author(s)
537532

538-
Syoyo Fujita(syoyo@lighttransport.com)
533+
Syoyo Fujita (syoyo@lighttransport.com)
539534

540535
## Contributor(s)
541536

542-
* Matt Ebb (http://mattebb.com) : deep image example. Thanks!
543-
* Matt Pharr (http://pharr.org/matt/) : Testing tinyexr with OpenEXR(IlmImf). Thanks!
544-
* Andrew Bell (https://github.com/andrewfb) & Richard Eakin (https://github.com/richardeakin) : Improving TinyEXR API. Thanks!
545-
* Mike Wong (https://github.com/mwkm) : ZIPS compression support in loading. Thanks!
537+
* Matt Ebb (http://mattebb.com): deep image example. Thanks!
538+
* Matt Pharr (http://pharr.org/matt/): Testing tinyexr with OpenEXR(IlmImf). Thanks!
539+
* Andrew Bell (https://github.com/andrewfb) & Richard Eakin (https://github.com/richardeakin): Improving TinyEXR API. Thanks!
540+
* Mike Wong (https://github.com/mwkm): ZIPS compression support in loading. Thanks!

tinyexr.h

+11-11
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ typedef struct _DeepImage {
287287
extern int LoadEXR(float **out_rgba, int *width, int *height,
288288
const char *filename, const char **err);
289289

290-
// Loads single-frame OpenEXR image by specifing layer name. Assume EXR image contains A(single channel
290+
// Loads single-frame OpenEXR image by specifying layer name. Assume EXR image contains A(single channel
291291
// alpha) or RGB(A) channels.
292292
// Application must free image data as returned by `out_rgba`
293293
// Result image format is: float x RGBA x width x hight
@@ -302,7 +302,7 @@ extern int LoadEXRWithLayer(float **out_rgba, int *width, int *height,
302302
//
303303
// @param[out] layer_names List of layer names. Application must free memory after using this.
304304
// @param[out] num_layers The number of layers
305-
// @param[out] err Error string(wll be filled when the function returns error code). Free it using FreeEXRErrorMessage after using this value.
305+
// @param[out] err Error string(will be filled when the function returns error code). Free it using FreeEXRErrorMessage after using this value.
306306
//
307307
// @return TINYEXR_SUCCEES upon success.
308308
//
@@ -497,8 +497,8 @@ extern int LoadEXRFromMemory(float **out_rgba, int *width, int *height,
497497
#endif // TINYEXR_H_
498498

499499
#ifdef TINYEXR_IMPLEMENTATION
500-
#ifndef TINYEXR_IMPLEMENTATION_DEIFNED
501-
#define TINYEXR_IMPLEMENTATION_DEIFNED
500+
#ifndef TINYEXR_IMPLEMENTATION_DEFINED
501+
#define TINYEXR_IMPLEMENTATION_DEFINED
502502

503503
#include <algorithm>
504504
#include <cassert>
@@ -619,7 +619,7 @@ namespace miniz {
619619
- Critical fix for the MZ_ZIP_FLAG_DO_NOT_SORT_CENTRAL_DIRECTORY bug
620620
(thanks kahmyong.moon@hp.com) which could cause locate files to not find
621621
files. This bug
622-
would only have occured in earlier versions if you explicitly used this
622+
would only have occurred in earlier versions if you explicitly used this
623623
flag, OR if you used mz_zip_extract_archive_file_to_heap() or
624624
mz_zip_add_mem_to_archive_file_in_place()
625625
(which used this flag). If you can't switch to v1.15 but want to fix
@@ -7712,7 +7712,7 @@ static int rleCompress(int inLength, const char in[], signed char out[]) {
77127712

77137713
if (runEnd - runStart >= MIN_RUN_LENGTH) {
77147714
//
7715-
// Compressable run
7715+
// Compressible run
77167716
//
77177717

77187718
*outWrite++ = static_cast<char>(runEnd - runStart) - 1;
@@ -8056,7 +8056,7 @@ static void wav2Encode(
80568056
int p2 = 2; // == 1 << (level+1)
80578057

80588058
//
8059-
// Hierachical loop on smaller dimension n
8059+
// Hierarchical loop on smaller dimension n
80608060
//
80618061

80628062
while (p2 <= n) {
@@ -9582,7 +9582,7 @@ static bool DecompressZfp(float *dst, int dst_width, int dst_num_lines,
95829582
zfp = zfp_stream_open(NULL);
95839583

95849584
if (param.type == TINYEXR_ZFP_COMPRESSIONTYPE_RATE) {
9585-
zfp_stream_set_rate(zfp, param.rate, zfp_type_float, /* dimention */ 2,
9585+
zfp_stream_set_rate(zfp, param.rate, zfp_type_float, /* dimension */ 2,
95869586
/* write random access */ 0);
95879587
} else if (param.type == TINYEXR_ZFP_COMPRESSIONTYPE_PRECISION) {
95889588
zfp_stream_set_precision(zfp, param.precision, zfp_type_float);
@@ -10798,7 +10798,7 @@ static void ConvertHeader(EXRHeader *exr_header, const HeaderInfo &info) {
1079810798
memcpy(exr_header->custom_attributes[i].type, info.attributes[i].type,
1079910799
256);
1080010800
exr_header->custom_attributes[i].size = info.attributes[i].size;
10801-
// Just copy poiner
10801+
// Just copy pointer
1080210802
exr_header->custom_attributes[i].value = info.attributes[i].value;
1080310803
}
1080410804

@@ -12225,7 +12225,7 @@ size_t SaveEXRImageToMemory(const EXRImage *exr_image,
1222512225
}
1222612226
#endif
1222712227

12228-
// TOOD(LTE): C++11 thread
12228+
// TODO(LTE): C++11 thread
1222912229

1223012230
// Use signed int since some OpenMP compiler doesn't allow unsigned type for
1223112231
// `parallel for`
@@ -13582,5 +13582,5 @@ int SaveEXR(const float *data, int width, int height, int components,
1358213582
#pragma clang diagnostic pop
1358313583
#endif
1358413584

13585-
#endif // TINYEXR_IMPLEMENTATION_DEIFNED
13585+
#endif // TINYEXR_IMPLEMENTATION_DEFINED
1358613586
#endif // TINYEXR_IMPLEMENTATION

0 commit comments

Comments
 (0)