This document is for a version of USD that is under development. See this page for the current release.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
textureIdentifier.h
1//
2// Copyright 2020 Pixar
3//
4// Licensed under the terms set forth in the LICENSE.txt file available at
5// https://openusd.org/license.
6//
7#ifndef PXR_IMAGING_HD_ST_TEXTURE_IDENTIFIER_H
8#define PXR_IMAGING_HD_ST_TEXTURE_IDENTIFIER_H
9
10#include "pxr/pxr.h"
11#include "pxr/imaging/hdSt/api.h"
12
13#include "pxr/base/tf/token.h"
14
15#include <memory>
16
17PXR_NAMESPACE_OPEN_SCOPE
18
20
31{
32public:
33 using ID = size_t;
34
35 HDST_API
37
40 HDST_API
41 explicit HdStTextureIdentifier(const TfToken &filePath);
42
46 HDST_API
48 const TfToken &filePath,
49 std::unique_ptr<const HdStSubtextureIdentifier> &&subtextureId);
50
51 HDST_API
53
54 HDST_API
55 HdStTextureIdentifier &operator=(HdStTextureIdentifier &&textureId);
56
57 HDST_API
58 HdStTextureIdentifier &operator=(const HdStTextureIdentifier &textureId);
59
60 HDST_API
62
65 const TfToken &GetFilePath() const {
66 return _filePath;
67 }
68
76 return _subtextureId.get();
77 }
78
79 HDST_API
80 bool operator==(const HdStTextureIdentifier &other) const;
81 HDST_API
82 bool operator!=(const HdStTextureIdentifier &other) const;
83
84private:
85 TfToken _filePath;
86 std::unique_ptr<const HdStSubtextureIdentifier> _subtextureId;
87};
88
89HDST_API
90size_t hash_value(const HdStTextureIdentifier &);
91
92PXR_NAMESPACE_CLOSE_SCOPE
93
94#endif
Base class for additional information to identify a texture in a file that can contain several textur...
Class to identify a texture file or a texture within the texture file (e.g., a frame in a movie).
HDST_API HdStTextureIdentifier(const TfToken &filePath, std::unique_ptr< const HdStSubtextureIdentifier > &&subtextureId)
C'tor for files that can contain more than one texture (e.g., frames in a movie, grids in a VDB file)...
const HdStSubtextureIdentifier * GetSubtextureIdentifier() const
Get additional information identifying a texture in a file that can contain more than one texture (e....
HDST_API HdStTextureIdentifier(const TfToken &filePath)
C'tor for files that can contain only one texture.
const TfToken & GetFilePath() const
Get file path of texture file.
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:71
size_t hash_value(const half h)
Overload hash_value for half.
Definition: half.h:28
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...