Class image1d

| Home | Libraries | People | FAQ | More

## Class image1d

boost::compute::image1d — An OpenCL 1D image object.

## Synopsis

    // 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);
    };

## Description

| Warning
This method is only available if the OpenCL version is 1.2 or later.

See Also:

image_format, image2d

### `image1d` public construct/copy/destruct

1.     image1d();

   Creates a null `image1d` object.

2.     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 clCreateImage() for more information.

3.     image1d(const image1d & other);

   Creates a new `image1d` as a copy of `other`.

4.     image1d(image1d && other) noexcept;

   Move-constructs a new image object from `other`.

5.     image1d & operator=(const image1d & other);

   Copies the `image1d` from `other`.

6.     image1d & operator=(image1d && other) noexcept;

   Move-assigns the image from `other` to `*this`.

7.     ~image1d();

   Destroys the `image1d` object.

### `image1d` public member functions

1.     extents< 1 > size() const;

   Returns the size (width) of the image.

2.     extents< 1 > origin() const;

   Returns the origin of the image (`0`).

3.     template<typename T> T get_info(cl_image_info info) const;

   Returns information about the image.

   See the documentation for clGetImageInfo() for more information.

4.     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.

5.     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 functions

1.     static 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 clGetSupportedImageFormats() for more information.

2.     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`.