Commit Graph

13 Commits

Author SHA1 Message Date
Ben Doherty
cf91e42847 Switch ASSERT macros to new stream API (#7881) 2024-05-24 20:46:34 +00:00
Philip Rideout
b60518caa5 Add libs/ktxreader, rename some things to prep for KTX2.
Changes:

- Remove the strange header-only variant of libs/image
- Rename KtxBundle => Ktx1Bundle
- Move image/KtxUtility => ktxreader/Ktx1Reader
- Add unit test for Ktx1Reader and test stub for KTX2.

Notes:

- Ktx1Bundle does not depend on Filament and is used by cmgen
  and mipgen to generate KTX files.

- Ktx1Reader has a dependency on Filament and should therefore live in
  a separate library, which it now does.
2022-04-06 10:56:37 -07:00
Benjamin Doherty
d1ab68ebfa Fix KTX image test on Windows 2019-11-07 09:15:07 -08:00
Ben Doherty
cc4e9db81b Fix spherical harmonics parsing (#1370) 2019-07-02 12:54:52 -07:00
Philip Rideout
5a5b6720b0 Add distance field generator to libimage.
This adds some new functions to libimage for computing distance fields
and coordinate fields. This runs on the CPU but uses an efficient
algorithm. This will initially be leveraged by the baking pipeline to
dilate charts, but could be useful in other applications.
2019-05-21 20:21:41 -07:00
prideout
5ee359cf40 Move math namespace to fix #746. 2019-02-07 09:23:07 -08:00
Philip Rideout
fc7b5872a0 Add metadata support to KtxBundle.
The KTX spec allows for arbitrary key-value pairs, we are interested in
using this to stash spherical harmonics coefficients.
2018-09-25 11:53:48 -07:00
Philip Rideout
e4b60e47cb Introduce KtxBundle to libimage and add unit test.
KtxBundle is basically an in-memory representation of a KTX file.
Our primary motivation for introducing this class is to have a
structured container for block-compressed textures.

Note that this class is defined in libimage rather than libimageio.
There are several reasons for this:

1. The texel data in a KtxBundle is not meant to be decoded by the CPU.
2. It has no dependendencies on any libraries (stb_image tinyexr etc).
3. We wish to use it with WebGL, which needs to avoid using imageio.
2018-09-14 16:55:05 -07:00
Philip Rideout
e45e7b256d Introduce mipgen frontend. (#120)
* Introduce mipgen frontend.

For now this is fairly simple although it does let you choose a filter.
Another cool feature is that an HTML file is generated which makes it
easy to review the generated miplevels.

This does not expose the Boundary enum to users because it has not yet
been implemented in the core Image library.

* Fix up mipgen per code review.
2018-08-21 17:54:27 -07:00
Philip Rideout
07e4db795f Remove lots of reinterpret_cast. (#112)
* Remove lots of reinterpret_cast.

* Improve terseness with auto.
2018-08-17 12:01:32 -07:00
Philip Rideout
5a027ca5a2 Replace deprecated color xform funcs. (#96) 2018-08-14 15:19:40 -07:00
Philip Rideout
b5b90b83f8 Add test_cmgen and promote the "updateOrCompare" function. (#95) 2018-08-14 13:47:31 -07:00
Philip Rideout
1f380a6ec6 Introduce new image library, Phase I. (#80)
* Overhaul the image library, Phase I.

The preps for our upcoming mipgen command line tool by adding filtering
capabilities and unit tests for a new LinearImage class, which will
subsume Image (deprecated).

Filament's new image library is composed of three components:

- LinearImage....simple 3D tensor of floats
- ImageOps.......free functions for simple transforms
- ImageSampler...high quality filtering

The old Image class was a simple untyped data blob and is now
deprecated. The new LinearImage class is always float32, and always
stores pixels in packed scanline order. This makes it easier to
implement image-based algorithms because they can be agnostic of the
underlying format.

Remaining refactorings:
- Phase  II will migrate imageio to LinearImage
- Phase III will migrate all downstream tools to LinearImage
- Phase  IV will remove old the Image class

* Image library code review feedback.
2018-08-13 10:39:57 -07:00