MCPcopy Create free account
hub / github.com/OpenKinect/libfreenect2 / Image1D

Class Image1D

include/internal/CL/cl.hpp:3638–3722  ·  view source on GitHub ↗

! \brief Class interface for 1D Image Memory objects. * * See Memory for details about copy semantics, etc. * * \see Memory */

Source from the content-addressed store, hash-verified

3636 * \see Memory
3637 */
3638class Image1D : public Image
3639{
3640public:
3641 /*! \brief Constructs a 1D Image in a specified context.
3642 *
3643 * Wraps clCreateImage().
3644 */
3645 Image1D(
3646 const Context& context,
3647 cl_mem_flags flags,
3648 ImageFormat format,
3649 ::size_t width,
3650 void* host_ptr = NULL,
3651 cl_int* err = NULL)
3652 {
3653 cl_int error;
3654 cl_image_desc desc =
3655 {
3656 CL_MEM_OBJECT_IMAGE1D,
3657 width,
3658 0, 0, 0, 0, 0, 0, 0, 0
3659 };
3660 object_ = ::clCreateImage(
3661 context(),
3662 flags,
3663 &format,
3664 &desc,
3665 host_ptr,
3666 &error);
3667
3668 detail::errHandler(error, __CREATE_IMAGE_ERR);
3669 if (err != NULL) {
3670 *err = error;
3671 }
3672 }
3673
3674 //! \brief Default constructor - initializes to NULL.
3675 Image1D() { }
3676
3677 /*! \brief Constructor from cl_mem - takes ownership.
3678 *
3679 * See Memory for further details.
3680 */
3681 __CL_EXPLICIT_CONSTRUCTORS Image1D(const cl_mem& image1D) : Image(image1D) { }
3682
3683 /*! \brief Assignment from cl_mem - performs shallow copy.
3684 *
3685 * See Memory for further details.
3686 */
3687 Image1D& operator = (const cl_mem& rhs)
3688 {
3689 Image::operator=(rhs);
3690 return *this;
3691 }
3692
3693 /*! \brief Copy constructor to forward copy to the superclass correctly.
3694 * Required for MSVC.
3695 */

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected