|
HDK
|
#include <colorSpaceAPI.h>
Inheritance diagram for UsdColorSpaceAPI::ColorSpaceHashCache:Public Member Functions | |
| ColorSpaceHashCache ()=default | |
| ~ColorSpaceHashCache ()=default | |
| TfToken | Find (const SdfPath &prim) override |
| void | Insert (const SdfPath &prim, const TfToken &colorSpace) override |
Public Member Functions inherited from UsdColorSpaceAPI::ColorSpaceCache | |
| ColorSpaceCache ()=default | |
| virtual | ~ColorSpaceCache ()=default |
Protected Attributes | |
| TfHashMap< SdfPath, TfToken, SdfPath::Hash > | _cache |
| TfBigRWMutex | _mutex |
This is a simple example of a color space cache implementation. An application can use this cache to avoid redundant color space lookups, but may substitute its own cache implementation if desired. This implementation does not track changes to the color space properties, so it is the application's responsibility to clear or update the cache when necessary.
A more sophisticated cache implementation might also be intelligent about caching locally defined color spaces and their computed GfColorSpaces. It might also be aware of changes to the scene hierarchy and update the cache accordingly.
As it is, this simple cache will be efficient in a typical scene using built in color spaces. It uses TfBigRWMutex to enable many-reader single-writer thread safety; however this example does not provide a guarantee of thread-efficiency for any given cache access pattern.
Definition at line 269 of file colorSpaceAPI.h.
|
default |
|
default |
Implements UsdColorSpaceAPI::ColorSpaceCache.
Definition at line 277 of file colorSpaceAPI.h.
|
inlineoverridevirtual |
Implements UsdColorSpaceAPI::ColorSpaceCache.
Definition at line 286 of file colorSpaceAPI.h.
|
protected |
Definition at line 271 of file colorSpaceAPI.h.
|
mutableprotected |
Definition at line 272 of file colorSpaceAPI.h.