Loading...
Searching...
No Matches
dataSourceAttributeColorSpace.h
1//
2// Copyright 2023 Pixar
3//
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
5// with the following modification; you may not use this file except in
6// compliance with the Apache License and the following modification to it:
7// Section 6. Trademarks. is deleted and replaced with:
8//
9// 6. Trademarks. This License does not grant permission to use the trade
10// names, trademarks, service marks, or product names of the Licensor
11// and its affiliates, except as required to comply with Section 4(c) of
12// the License and to reproduce the content of the NOTICE file.
13//
14// You may obtain a copy of the Apache License at
15//
16// http://www.apache.org/licenses/LICENSE-2.0
17//
18// Unless required by applicable law or agreed to in writing, software
19// distributed under the Apache License with the above modification is
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21// KIND, either express or implied. See the Apache License for the specific
22// language governing permissions and limitations under the Apache License.
23//
24#ifndef PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_ATTRIBUTE_COLORSPACE_H
25#define PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_ATTRIBUTE_COLORSPACE_H
26
27#include "pxr/usd/usd/attribute.h"
28#include "pxr/usdImaging/usdImaging/api.h"
29#include "pxr/imaging/hd/dataSource.h"
30#include "pxr/imaging/hd/dataSourceTypeDefs.h"
31
32PXR_NAMESPACE_OPEN_SCOPE
33
39{
40public:
41
42 HD_DECLARE_DATASOURCE(UsdImagingDataSourceAttributeColorSpace);
43
46 VtValue GetValue(HdSampledDataSource::Time shutterOffset) override
47 {
48 return VtValue(GetTypedValue(shutterOffset));
49 }
50
54 TfToken GetTypedValue(HdSampledDataSource::Time shutterOffset) override
55 {
56 TF_UNUSED(shutterOffset);
57 return _usdAttr.GetColorSpace();
58 }
59
64 HdSampledDataSource::Time startTime,
65 HdSampledDataSource::Time endTime,
66 std::vector<HdSampledDataSource::Time> *outSampleTimes) override
67 {
68 TF_UNUSED(startTime);
69 TF_UNUSED(endTime);
70 return false;
71 }
72
73private:
74
79
80private:
81 UsdAttribute _usdAttr;
82};
83
84
85PXR_NAMESPACE_CLOSE_SCOPE
86
87#endif // PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_ATTRIBUTE_COLORSPACE_H
A datasource representing a concretely-typed sampled value.
Definition: dataSource.h:210
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:88
Scenegraph object for authoring and retrieving numeric, string, and array valued data,...
Definition: attribute.h:176
USD_API TfToken GetColorSpace() const
Gets the color space in which the attribute is authored.
A data source that represents the metadata on a USD Attribute.
TfToken GetTypedValue(HdSampledDataSource::Time shutterOffset) override
Returns the extracted TfToken value of the color space metadata on the attribute.
bool GetContributingSampleTimesForInterval(HdSampledDataSource::Time startTime, HdSampledDataSource::Time endTime, std::vector< HdSampledDataSource::Time > *outSampleTimes) override
Returns false since we do not expect the color space value to vary over time.
VtValue GetValue(HdSampledDataSource::Time shutterOffset) override
Returns the VtValue of the colorspace for the attribute.
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Definition: value.h:164
#define TF_UNUSED(x)
Stops compiler from producing unused argument or variable warnings.
Definition: tf.h:185