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::Id Height
Definition: Texture2D.h:195
vtkm::Float32 Floor(vtkm::Float32 x)
Definition: Math.h:2230
#define VTKM_EXEC
Definition: ExportMacros.h:51
Groups connected points that have the same field value.
Definition: Atomic.h:19
ColorType GetColorAtCoords(vtkm::Id x, vtkm::Id y) const
Definition: Texture2D.h:166
vtkm::Float32 Clamp(vtkm::Float32 x, vtkm::Float32 lo, vtkm::Float32 hi)
Definition: Math.h:1827
TextureWrapMode WrapMode
Definition: Texture2D.h:239
#define VTKM_ASSERT(condition)
Definition: Assert.h:43
TextureDataHandle Data
Definition: Texture2D.h:237
void SetFilterMode(TextureFilterMode filterMode)
Definition: Texture2D.h:77
vtkm::Int32 IdComponent
Base type to use to index small lists.
Definition: Types.h:194
vtkm::Id Width
Definition: Texture2D.h:194
TextureFilterMode GetFilterMode() const
Definition: Texture2D.h:74
TextureWrapMode
Definition: Texture2D.h:28
TextureWrapMode GetWrapMode() const
Definition: Texture2D.h:80
typename vtkm::cont::ArrayHandle< vtkm::UInt8 > TextureDataHandle
Definition: Texture2D.h:38
vtkm::Vec< vtkm::Float32, NumComponents > ColorType
Definition: Texture2D.h:39
Texture2D(vtkm::Id width, vtkm::Id height, const TextureDataHandle &data)
Definition: Texture2D.h:57
#define UV_BOUNDS_CHECK(u, v, NoneType)
Definition: Texture2D.h:43
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
Texture2DSamplerExecutionObject()
Definition: Texture2D.h:97
Texture2DSamplerExecutionObject< Device > PrepareForExecution(Device, vtkm::cont::Token &token) const
Definition: Texture2D.h:226
Texture2DSampler()
Definition: Texture2D.h:205
TextureFilterMode
Definition: Texture2D.h:22
vtkm::Float32 Round(vtkm::Float32 x)
Definition: Math.h:2291
vtkm::Id Width
Definition: Texture2D.h:243
#define VTKM_CONT
Definition: ExportMacros.h:57
vtkm::Int64 Id
Base type to use to index arrays.
Definition: Types.h:227
TextureDataHandle Data
Definition: Texture2D.h:245
void GetNextCoords(vtkm::Id x, vtkm::Id y, vtkm::Id &xn, vtkm::Id &yn) const
Definition: Texture2D.h:178
void SetWrapMode(TextureWrapMode wrapMode)
Definition: Texture2D.h:83
Texture2DSamplerExecutionObject(vtkm::Id width, vtkm::Id height, const TextureDataHandle &data, TextureFilterMode filterMode, TextureWrapMode wrapMode, vtkm::cont::Token &token)
Definition: Texture2D.h:104
TextureWrapMode WrapMode
Definition: Texture2D.h:198
bool IsValid() const
Definition: Texture2D.h:71
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:357
TextureFilterMode FilterMode
Definition: Texture2D.h:246
vtkm::Id Height
Definition: Texture2D.h:236
typename TextureDataHandle::ReadPortalType TextureExecPortal
Definition: Texture2D.h:94
float Float32
Base type to use for 32-bit floating-point numbers.
Definition: Types.h:157
Definition: Texture2D.h:201
Texture2DSampler GetExecObjectFactory() const
Definition: Texture2D.h:85
Texture2DSampler(vtkm::Id width, vtkm::Id height, const TextureDataHandle &data, TextureFilterMode filterMode, TextureWrapMode wrapMode)
Definition: Texture2D.h:212
TextureFilterMode FilterMode
Definition: Texture2D.h:238
ColorType GetLinearFilteredColor(vtkm::Float32 u, vtkm::Float32 v) const
Definition: Texture2D.h:146
Definition: Texture2D.h:35
vtkm::Id Width
Definition: Texture2D.h:235
TextureFilterMode FilterMode
Definition: Texture2D.h:197
ColorType GetNearestNeighbourFilteredColor(vtkm::Float32 u, vtkm::Float32 v) const
Definition: Texture2D.h:138
ColorType GetColor(vtkm::Float32 u, vtkm::Float32 v) const
Definition: Texture2D.h:119
Texture2D()
Definition: Texture2D.h:50
vtkm::Id Height
Definition: Texture2D.h:244
TextureExecPortal Data
Definition: Texture2D.h:196