Review: API Change to ColorSpace.GPUAllocation


Jeremy Selan <jeremy...@...>
 

No one has objected, so I'll roll this into the master branch.

-- Jeremy

On Nov 16, 11:43 am, Jeremy Selan <jeremy...@...> wrote:
This updates the API for setting the ColorSpace GPU allocation hint.
(The allocation is used to determine how a particular lattice is best
sampled using a fixed domain lut on the GPU).  Previously all
allocations were configured with 2 fixed arguments (min, max):

Prior:
Uniform:    x mapped from  [min, max] to [0,1]
Log2         log2(x) mapped from [min, max] to [0,1]

Now, allocations can be configured with a variable number of
arguments. (The definition of which is allocation specific).  This is
useful as it allows for (optionally) more sophisticated allocations on
the GPU.   The first allocation to take advantage of this is "LG2",
which adds a linear offset value as the 3rd variable:

Log2         log2(x+offset) mapped from [min, max] to [0,1]

Using a small, positive offset allows a log allocation to represent
the value 0.0 precisely, which is useful in some configurations.

This update also names GpuAllocation -> Allocation, as what it
represents is not GPU specific. (GPU is the use case, rather than the
description of what the data is).

Commits:
3f12fca8bf0aff910a4989b855d711ab609b61f9
e780e5d21333aca75de25403dd56852da17a7517
d17a6530982b86b5ef51601aae97a76e1c2da59d

-- Jeremy


Jeremy Selan <jeremy...@...>
 

This updates the API for setting the ColorSpace GPU allocation hint.
(The allocation is used to determine how a particular lattice is best
sampled using a fixed domain lut on the GPU). Previously all
allocations were configured with 2 fixed arguments (min, max):

Prior:
Uniform: x mapped from [min, max] to [0,1]
Log2 log2(x) mapped from [min, max] to [0,1]

Now, allocations can be configured with a variable number of
arguments. (The definition of which is allocation specific). This is
useful as it allows for (optionally) more sophisticated allocations on
the GPU. The first allocation to take advantage of this is "LG2",
which adds a linear offset value as the 3rd variable:

Log2 log2(x+offset) mapped from [min, max] to [0,1]

Using a small, positive offset allows a log allocation to represent
the value 0.0 precisely, which is useful in some configurations.

This update also names GpuAllocation -> Allocation, as what it
represents is not GPU specific. (GPU is the use case, rather than the
description of what the data is).

Commits:
3f12fca8bf0aff910a4989b855d711ab609b61f9
e780e5d21333aca75de25403dd56852da17a7517
d17a6530982b86b5ef51601aae97a76e1c2da59d

-- Jeremy