-
Notifications
You must be signed in to change notification settings - Fork 31
/
ImageInterface.hh
77 lines (64 loc) · 2 KB
/
ImageInterface.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
//----------------------------------*-C++-*----------------------------------//
// Copyright 2024 UT-Battelle, LLC, and other Celeritas developers.
// See the top-level COPYRIGHT file for details.
// SPDX-License-Identifier: (Apache-2.0 OR MIT)
//---------------------------------------------------------------------------//
//! \file geocel/rasterize/ImageInterface.hh
//---------------------------------------------------------------------------//
#pragma once
#include <memory>
#include "corecel/Macros.hh"
#include "corecel/Types.hh"
#include "corecel/cont/Span.hh"
namespace celeritas
{
class ImageParams;
//---------------------------------------------------------------------------//
/*!
* Access data from an image.
*
* Images currently are arrays of integer pixels.
*/
class ImageInterface
{
public:
//!@{
//! \name Type aliases
using int_type = int;
using SpanInt = Span<int_type>;
using SPConstParams = std::shared_ptr<ImageParams const>;
//!@}
public:
//! Default virtual destructor
virtual ~ImageInterface() = default;
//! Access image properties
virtual SPConstParams const& params() const = 0;
//! Copy the image to the host
virtual void copy_to_host(SpanInt) const = 0;
protected:
ImageInterface() = default;
CELER_DEFAULT_COPY_MOVE(ImageInterface);
};
// Forward-declare image, see Image.hh
template<MemSpace M>
class Image;
//---------------------------------------------------------------------------//
/*!
* Generate one or more images from a geometry.
*/
class ImagerInterface
{
public:
//! Default virtual destructor
virtual ~ImagerInterface() = default;
//!@{
//! Raytrace an image on host or device
virtual void operator()(Image<MemSpace::host>*) = 0;
virtual void operator()(Image<MemSpace::device>*) = 0;
//!@}
protected:
ImagerInterface() = default;
CELER_DEFAULT_COPY_MOVE(ImagerInterface);
};
//---------------------------------------------------------------------------//
} // namespace celeritas