...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
boost::compute::image1d — An OpenCL 1D image object.
// In header: <boost/compute/image/image1d.hpp> class image1d : public boost::compute::image_object { public: // construct/copy/destruct image1d(); image1d(const context &, size_t, const image_format &, cl_mem_flags = read_write, void * = 0); image1d(const image1d &); image1d(image1d &&) noexcept; image1d & operator=(const image1d &); image1d & operator=(image1d &&) noexcept; ~image1d(); // public member functions extents< 1 > size() const; extents< 1 > origin() const; template<typename T> T get_info(cl_image_info) const; template<int Enum> unspecified get_info() const; image1d clone(command_queue &) const; // public static functions static std::vector< image_format > get_supported_formats(const context &, cl_mem_flags = read_write); static bool is_supported_format(const image_format &, const context &, cl_mem_flags = read_write); };
Warning | |
---|---|
This method is only available if the OpenCL version is 1.2 or later. |
See Also:
image1d
public
construct/copy/destructimage1d();Creates a null
image1d
object. image1d(const context & context, size_t image_width, const image_format & format, cl_mem_flags flags = read_write, void * host_ptr = 0);
Creates a new image1d
object.
See the documentation for
image1d(const image1d & other);Creates a new
image1d
as a copy of other
. image1d(image1d && other) noexcept;Move-constructs a new image object from
other
. image1d & operator=(const image1d & other);Copies the
image1d
from other
. image1d & operator=(image1d && other) noexcept;Move-assigns the image from
other
to *this
. ~image1d();Destroys the
image1d
object. image1d
public member functionsextents< 1 > size() const;Returns the size (width) of the image.
extents< 1 > origin() const;Returns the origin of the image (
0
). template<typename T> T get_info(cl_image_info info) const;
Returns information about the image.
See the documentation for
template<int Enum> unspecified get_info() const;This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
image1d clone(command_queue & queue) const;
Creates a new image with a copy of the data in *this
. Uses queue
to perform the copy operation.
image1d
public static functionsstatic std::vector< image_format > get_supported_formats(const context & context, cl_mem_flags flags = read_write);
Returns the supported image formats for the context.
See the documentation for
static bool is_supported_format(const image_format & format, const context & context, cl_mem_flags flags = read_write);
Returns true
if format
is a supported 1D image format for context
.