Class image_object

| Home | Libraries | People | FAQ | More

## Class image_object

boost::compute::image_object — Base-class for image objects.

## Synopsis

    // In header: <boost/compute/image/image_object.hpp>

    class image_object : public boost::compute::memory_object {
    public:
      // construct/copy/destruct
      image_object();
      explicit image_object(cl_mem, bool = true);
      image_object(const image_object &);
      image_object(image_object &&) noexcept;
      image_object & operator=(const image_object &);
      ~image_object();

      // public member functions
      template<typename T> T get_image_info(cl_mem_info) const;
      image_format format() const;
      size_t width() const;
      size_t height() const;
      size_t depth() const;

      // public static functions
      static std::vector< image_format >
      get_supported_formats(const context &, cl_mem_object_type,
                            cl_mem_flags = read_write);
      static bool is_supported_format(const image_format &, const context &,
                                      cl_mem_object_type,
                                      cl_mem_flags = read_write);
    };

## Description

The image_object class is the base-class for image objects on compute devices.

See Also:

image1d, image2d, image3d

### `image_object` public construct/copy/destruct

1.     image_object();

2.     explicit image_object(cl_mem mem, bool retain = true);

3.     image_object(const image_object & other);

4.     image_object(image_object && other) noexcept;

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

6.     ~image_object();

   Destroys the image object.

### `image_object` public member functions

1.     template<typename T> T get_image_info(cl_mem_info info) const;

   Returns information about the image object.

   See the documentation for clGetImageInfo() for more information.

2.     image_format format() const;

   Returns the format for the image.

3.     size_t width() const;

   Returns the width of the image.

4.     size_t height() const;

   Returns the height of the image.

   For 1D images, this function will return `1`.

5.     size_t depth() const;

   Returns the depth of the image.

   For 1D and 2D images, this function will return `1`.

### `image_object` public static functions

1.     static std::vector< image_format >
       get_supported_formats(const context & context, cl_mem_object_type type,
                             cl_mem_flags flags = read_write);

   Returns the supported image formats for the `type` in `context`.

   See the documentation for clGetSupportedImageFormats() for more information.

2.     static bool is_supported_format(const image_format & format,
                                       const context & context,
                                       cl_mem_object_type type,
                                       cl_mem_flags flags = read_write);

   Returns `true` if `format` is a supported image format for `type` in `context` with `flags`.