Go to the documentation of this file.
11 #ifndef vtk_m_rendering_Texture2D_h
12 #define vtk_m_rendering_Texture2D_h
34 template <vtkm::IdComponent NumComponents>
41 class Texture2DSampler;
43 #define UV_BOUNDS_CHECK(u, v, NoneType) \
44 if (u < 0.0f || u > 1.0f || v < 0.0f || v > 1.0f) \
67 this->
Data.DeepCopyFrom(data);
90 template <
typename Device>
112 ,
Data(data.PrepareForInput(Device(), token))
162 return (c1 * uOpposite + c2 * uRatio) * vOpposite + (c3 * uOpposite + c4 * uRatio) * vRatio;
172 color[i] =
Data.Get(idx + i) / 255.0f;
183 xn = (x + 1) <
Width ? (x + 1) : x;
184 yn = (y + 1) <
Height ? (y + 1) : y;
188 xn = (x + 1) %
Width;
225 template <
typename Device>
252 #endif // vtk_m_rendering_Texture2D_h
VTKM_EXEC ColorType GetLinearFilteredColor(vtkm::Float32 u, vtkm::Float32 v) const
Definition: Texture2D.h:146
vtkm::Id Height
Definition: Texture2D.h:195
VTKM_CONT void SetFilterMode(TextureFilterMode filterMode)
Definition: Texture2D.h:77
#define VTKM_EXEC
Definition: ExportMacros.h:51
VTKM_CONT Texture2D()
Definition: Texture2D.h:50
Groups connected points that have the same field value.
Definition: Atomic.h:19
VTKM_EXEC_CONT vtkm::Float32 Round(vtkm::Float32 x)
Round x to the nearest integral value.
Definition: Math.h:2263
TextureWrapMode WrapMode
Definition: Texture2D.h:239
#define VTKM_ASSERT(condition)
Definition: Assert.h:43
VTKM_CONT Texture2DSampler GetExecObjectFactory() const
Definition: Texture2D.h:85
TextureDataHandle Data
Definition: Texture2D.h:237
vtkm::Int32 IdComponent
Represents a component ID (index of component in a vector).
Definition: Types.h:168
vtkm::Id Width
Definition: Texture2D.h:194
VTKM_CONT Texture2DSamplerExecutionObject(vtkm::Id width, vtkm::Id height, const TextureDataHandle &data, TextureFilterMode filterMode, TextureWrapMode wrapMode, vtkm::cont::Token &token)
Definition: Texture2D.h:104
TextureWrapMode
Definition: Texture2D.h:28
VTKM_CONT Texture2DSampler(vtkm::Id width, vtkm::Id height, const TextureDataHandle &data, TextureFilterMode filterMode, TextureWrapMode wrapMode)
Definition: Texture2D.h:212
typename vtkm::cont::ArrayHandle< vtkm::UInt8 > TextureDataHandle
Definition: Texture2D.h:38
VTKM_EXEC_CONT vtkm::Float32 Clamp(vtkm::Float32 x, vtkm::Float32 lo, vtkm::Float32 hi)
Clamp x to the given range.
Definition: Math.h:1815
vtkm::Vec< vtkm::Float32, NumComponents > ColorType
Definition: Texture2D.h:39
vtkm::Int32 Id
Represents an ID (index into arrays).
Definition: Types.h:191
#define UV_BOUNDS_CHECK(u, v, NoneType)
Definition: Texture2D.h:43
VTKM_EXEC_CONT vtkm::Float32 Floor(vtkm::Float32 x)
Round x to the largest integer value not greater than x.
Definition: Math.h:2204
Definition: Texture2D.h:91
A token to hold the scope of an ArrayHandle or other object.
Definition: Token.h:35
TextureWrapMode WrapMode
Definition: Texture2D.h:247
VTKM_CONT TextureWrapMode GetWrapMode() const
Definition: Texture2D.h:80
TextureFilterMode
Definition: Texture2D.h:22
vtkm::Id Width
Definition: Texture2D.h:243
#define VTKM_CONT
Definition: ExportMacros.h:57
VTKM_CONT Texture2DSamplerExecutionObject< Device > PrepareForExecution(Device, vtkm::cont::Token &token) const
Definition: Texture2D.h:226
VTKM_CONT Texture2D(vtkm::Id width, vtkm::Id height, const TextureDataHandle &data)
Definition: Texture2D.h:57
TextureDataHandle Data
Definition: Texture2D.h:245
VTKM_EXEC ColorType GetNearestNeighbourFilteredColor(vtkm::Float32 u, vtkm::Float32 v) const
Definition: Texture2D.h:138
VTKM_CONT Texture2DSamplerExecutionObject()
Definition: Texture2D.h:97
VTKM_EXEC void GetNextCoords(vtkm::Id x, vtkm::Id y, vtkm::Id &xn, vtkm::Id &yn) const
Definition: Texture2D.h:178
VTKM_EXEC ColorType GetColorAtCoords(vtkm::Id x, vtkm::Id y) const
Definition: Texture2D.h:166
VTKM_CONT void SetWrapMode(TextureWrapMode wrapMode)
Definition: Texture2D.h:83
TextureWrapMode WrapMode
Definition: Texture2D.h:198
Base ExecutionObjectBase for execution objects to inherit from so that you can use an arbitrary objec...
Definition: ExecutionObjectBase.h:31
A short fixed-length array.
Definition: Types.h:767
TextureFilterMode FilterMode
Definition: Texture2D.h:246
vtkm::Id Height
Definition: Texture2D.h:236
typename TextureDataHandle::ReadPortalType TextureExecPortal
Definition: Texture2D.h:94
float Float32
Definition: Types.h:154
Definition: Texture2D.h:201
VTKM_EXEC ColorType GetColor(vtkm::Float32 u, vtkm::Float32 v) const
Definition: Texture2D.h:119
TextureFilterMode FilterMode
Definition: Texture2D.h:238
VTKM_CONT TextureFilterMode GetFilterMode() const
Definition: Texture2D.h:74
Definition: Texture2D.h:35
vtkm::Id Width
Definition: Texture2D.h:235
TextureFilterMode FilterMode
Definition: Texture2D.h:197
VTKM_CONT Texture2DSampler()
Definition: Texture2D.h:205
vtkm::Id Height
Definition: Texture2D.h:244
TextureExecPortal Data
Definition: Texture2D.h:196
VTKM_CONT bool IsValid() const
Definition: Texture2D.h:71