More changes to hide Imath: new half.h, improve vecparam.h #3406
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Another round to hide Imath externally to OIIO public headers as well
as speed up our own builds.
Remove the external reference to Imath::M44f from color.h, and instead
use M44fParam.
The
<OpenImageIO/Imath.h>
includes the most commonly used Imathheaders including half.h. But this is unnecessarily expensive (and
presumptuous about wanting other Imath types as well as fmt.h) if
you just need to know about
half
. So we create a new<OpenImageIO/half.h>
that only includes what you need forhalf
(as before, with logic to handle the changing location of the half.h
header depending on whether you're using Imath 3.x or OpenEXR 2.x).
Several files that included Imath.h, but in reality only needed half
all along, change to including OpenImageIO/half.h.
simd.h leans more on vecparam.h and other template trickery to
reduce exposure of methods that only work in the presence of Imath
headers, and make fewer use cases that would care whether the Imath
headers are included before or after simd.h (which is less
controllable for unity builds).
Vec3Param gains a
cast<V>()
templated method that allows easycasting to foreign vector types even if Imath headers are not
included prior to vecparam.h being included (which is less
controllable for unity builds).