//============================================================================ // Copyright (c) Kitware, Inc. // All rights reserved. // See LICENSE.txt for details. // // This software is distributed WITHOUT ANY WARRANTY; without even // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR // PURPOSE. See the above copyright notice for more information. //============================================================================ #ifndef vtk_m_rendering_TextRendererBatcher_h #define vtk_m_rendering_TextRendererBatcher_h #include #include #include #include #include #include namespace vtkm { namespace rendering { class VTKM_RENDERING_EXPORT TextRendererBatcher { public: using FontTextureType = vtkm::rendering::Canvas::FontTextureType; using ScreenCoordsType = vtkm::Id4; using TextureCoordsType = vtkm::Vec4f_32; using ColorType = vtkm::Vec4f_32; using ScreenCoordsArrayHandle = vtkm::cont::ArrayHandle; using TextureCoordsArrayHandle = vtkm::cont::ArrayHandle; using ColorsArrayHandle = vtkm::cont::ArrayHandle; using DepthsArrayHandle = vtkm::cont::ArrayHandle; /* VTKM_CONT TextRendererBatcher(); */ VTKM_CONT TextRendererBatcher(const vtkm::rendering::Canvas::FontTextureType& fontTexture); VTKM_CONT void BatchText(const ScreenCoordsArrayHandle& screenCoords, const TextureCoordsArrayHandle& textureCoords, const vtkm::rendering::Color& color, const vtkm::Float32& depth); void Render(const vtkm::rendering::Canvas* canvas) const; private: vtkm::rendering::Canvas::FontTextureType FontTexture; std::vector ScreenCoords; std::vector TextureCoords; std::vector Colors; std::vector Depths; }; } } // namespace vtkm::rendering #endif // vtk_m_rendering_TextRendererBatcher_h