| Home | Libraries | People | FAQ | More

## Class image_sampler

boost::compute::image_sampler — An OpenCL image sampler object.

## Synopsis

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

    class image_sampler {
    public:

      enum addressing_mode { none = CL_ADDRESS_NONE,
                             clamp_to_edge = CL_ADDRESS_CLAMP_TO_EDGE,
                             clamp = CL_ADDRESS_CLAMP, repeat = CL_ADDRESS_REPEAT };

      enum filter_mode { nearest = CL_FILTER_NEAREST, linear = CL_FILTER_LINEAR };

      // public member functions
      image_sampler();
      image_sampler(const context &, bool, cl_addressing_mode, cl_filter_mode);
      explicit image_sampler(cl_sampler, bool = true);
      image_sampler(const image_sampler &);
      image_sampler & operator=(const image_sampler &);
      image_sampler(image_sampler &&) noexcept;
      image_sampler & operator=(image_sampler &&) noexcept;
      ~image_sampler();
      cl_sampler & get() const;
      context get_context() const;
      template<typename T> T get_info(cl_sampler_info) const;
      template<int Enum> unspecified get_info() const;
      bool operator==(const image_sampler &) const;
      bool operator!=(const image_sampler &) const;
      operator cl_sampler() const;
    };

## Description

See Also: image2d, image_format

### `image_sampler` public member functions

1.     image_sampler();

2.     image_sampler(const context & context, bool normalized_coords,
                     cl_addressing_mode addressing_mode, cl_filter_mode filter_mode);

3.     explicit image_sampler(cl_sampler sampler, bool retain = true);

4.     image_sampler(const image_sampler & other);

   Creates a new image sampler object as a copy of `other`.

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

   Copies the image sampler object from `other` to `*this`.

6.     image_sampler(image_sampler && other) noexcept;

7.     image_sampler & operator=(image_sampler && other) noexcept;

8.     ~image_sampler();

   Destroys the image sampler object.

9.     cl_sampler & get() const;

   Returns the underlying `cl_sampler` object.

10.     context get_context() const;

    Returns the context for the image sampler object.

11.     template<typename T> T get_info(cl_sampler_info info) const;

    Returns information about the sampler.

    See the documentation for

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

13.     bool operator==(const image_sampler & other) const;

    Returns `true` if the sampler is the same at `other`.

14.     bool operator!=(const image_sampler & other) const;

    Returns `true` if the sampler is different from `other`.

15.     operator cl_sampler() const;