Renders shapes into images.
More...
#include <EBGeometry_Render.hpp>
|
| | Renderer (const Settings< T > &a_settings=Settings< T >()) noexcept |
| | Renderer with given settings.
|
| |
| Settings< T > & | settings () noexcept |
| | The settings.
|
| |
| const Settings< T > & | settings () const noexcept |
| | The settings.
|
| |
| template<class S > |
| Stats | render (const S &a_shape, const Camera< T > &a_camera, Image &a_image) const |
| | Render a shape on the host, on Settings::m_threads threads.
|
| |
| template<class S > |
| Stats | render (const S &a_shape, const Camera< T > &a_camera, Image &a_image, const std::atomic< bool > &a_cancel, std::atomic< uint32_t > *a_rowsDone=nullptr) const |
| | Render a shape on the host, stopping early when asked to (for an interactive viewer).
|
| |
| template<class S > |
| Stats | renderOnDevice (const S &a_deviceShape, const Camera< T > &a_camera, Image &a_image) const |
| | Render a shape through GPU::parallelFor(): in kernels in a CUDA or HIP build, in a host loop otherwise.
|
| |
| template<class S > |
| Stats | renderOnDevice (const S &a_deviceShape, const Camera< T > &a_camera, Image &a_image, const std::atomic< bool > &a_cancel, std::atomic< uint32_t > *a_rowsDone=nullptr) const |
| | Render a shape through GPU::parallelFor(), stopping early when asked to.
|
| |
| template<class S > |
| HitT< T > | pick (const S &a_shape, const Camera< T > &a_camera, T a_column, T a_row) const |
| | What the camera sees at a point of the image: the crossing of the ray through it with the shape, cut by the section plane as the render cuts it, so that it names what a render draws there.
|
| |
template<class T>
class EBGeometry::Render::Renderer< T >
Renders shapes into images.
Holds the settings; the shape and camera are given to each render. Use render() for a shape the host can evaluate and renderOnDevice() for a device view of one (see Tape::rebasedView()).
- Template Parameters
-
| T | Floating-point precision. |
◆ Renderer()
Renderer with given settings.
- Parameters
-
◆ pick()
template<class T >
template<class S >
What the camera sees at a point of the image: the crossing of the ray through it with the shape, cut by the section plane as the render cuts it, so that it names what a render draws there.
For picking in a viewer: HitT::m_primitive names the primitive (a tape's leaf, a mesh's face), and the point and normal where the ray meets it. The ray is the one through the point (a_column, a_row) of an image of the settings' size, with (0, 0) the top left corner of the top left pixel; a pixel's center is at half-integers. On the host.
- Template Parameters
-
| S | Shape type (see isShape). |
- Parameters
-
| [in] | a_shape | Shape. |
| [in] | a_camera | Camera. |
| [in] | a_column | Distance from the image's left edge, in pixels. |
| [in] | a_row | Distance from its top edge, in pixels. |
- Returns
- The crossing, or a miss.
◆ render() [1/2]
template<class T >
template<class S >
Render a shape on the host, on Settings::m_threads threads.
- Template Parameters
-
| S | Shape type (see isShape). |
- Parameters
-
| [in] | a_shape | Shape. |
| [in] | a_camera | Camera. |
| [out] | a_image | The image, resized to the settings' size. |
- Returns
- What the render saw.
◆ render() [2/2]
template<class T >
template<class S >
Render a shape on the host, stopping early when asked to (for an interactive viewer).
As render(const S&, const Camera<T>&, Image&), but every thread checks a_cancel before each row, and the render returns soon after it is set, with Stats::m_complete false and the rows not reached left black. a_rowsDone, if given, counts the finished rows as they finish, so another thread can show the progress.
- Template Parameters
-
| S | Shape type (see isShape). |
- Parameters
-
| [in] | a_shape | Shape. |
| [in] | a_camera | Camera. |
| [out] | a_image | The image, resized to the settings' size. |
| [in] | a_cancel | Set (from another thread) to stop the render. |
| [out] | a_rowsDone | Finished rows, or null. |
- Returns
- What the render saw.
◆ renderOnDevice() [1/2]
template<class T >
template<class S >
Render a shape through GPU::parallelFor(): in kernels in a CUDA or HIP build, in a host loop otherwise.
The image is rendered in bands of rows, one launch each, into one buffer in device memory, which is copied back once at the end.
- Template Parameters
-
| S | Shape type (see isShape). |
- Parameters
-
| [in] | a_deviceShape | The shape, as a view valid on the device. |
| [in] | a_camera | Camera. |
| [out] | a_image | The image, resized to the settings' size. |
- Returns
- What the render saw.
◆ renderOnDevice() [2/2]
template<class T >
template<class S >
| Stats EBGeometry::Render::Renderer< T >::renderOnDevice |
( |
const S & |
a_deviceShape, |
|
|
const Camera< T > & |
a_camera, |
|
|
Image & |
a_image, |
|
|
const std::atomic< bool > & |
a_cancel, |
|
|
std::atomic< uint32_t > * |
a_rowsDone = nullptr |
|
) |
| const |
|
inline |
Render a shape through GPU::parallelFor(), stopping early when asked to.
As renderOnDevice(const S&, const Camera<T>&, Image&), with a_cancel checked between the bands: the render returns after the band under way when it is set, with Stats::m_complete false. a_rowsDone, if given, counts the finished rows.
- Template Parameters
-
| S | Shape type (see isShape). |
- Parameters
-
| [in] | a_deviceShape | The shape, as a view valid on the device. |
| [in] | a_camera | Camera. |
| [out] | a_image | The image, resized to the settings' size. |
| [in] | a_cancel | Set (from another thread) to stop the render. |
| [out] | a_rowsDone | Finished rows, or null. |
- Returns
- What the render saw.
◆ settings() [1/2]
The settings.
- Returns
- The settings.
◆ settings() [2/2]
The settings.
- Returns
- The settings, to change.
The documentation for this class was generated from the following file: