void Parameter::check_defined() const { user_assert(defined()) << "Parameter is undefined\n"; }
void Parameter::check_is_buffer() const { check_defined(); user_assert(contents.ptr->is_buffer) << "Parameter " << name() << " is not a Buffer\n"; }
void Parameter::check_dim_ok(int dim) const { user_assert(dim >= 0 && dim < dimensions()) << "Dimension " << dim << " is not in the range [0, " << dimensions() - 1 << "]\n"; }
void ImageBase::set_min(int m0, int m1, int m2, int m3) { user_assert(defined()) << "set_min of undefined Image\n"; buffer.set_min(m0, m1, m2, m3); // Move the origin prepare_for_direct_pixel_access(); }
Expr OutputImageParam::top() const { user_assert(dimensions() > 1) << "Can't ask for the top of a zero- or one-dimensional image\n"; return min(1); }
Expr OutputImageParam::bottom() const { user_assert(dimensions() > 1) << "Can't ask for the bottom of a zero- or one-dimensional image\n"; return Internal::Add::make(min(1), Internal::Sub::make(extent(1), 1)); }
Expr OutputImageParam::right() const { user_assert(dimensions() > 0) << "Can't ask for the right of a zero-dimensional image\n"; return Internal::Add::make(min(0), Internal::Sub::make(extent(0), 1)); }
Expr OutputImageParam::left() const { user_assert(dimensions() > 0) << "Can't ask for the left of a zero-dimensional image\n"; return min(0); }
Expr OutputImageParam::channels() const { user_assert(dimensions() > 2) << "Can't ask for the channels of an image with fewer than three dimensions\n"; return extent(2); }
Expr OutputImageParam::height() const { user_assert(dimensions() > 1) << "Can't ask for the height of a zero or one-dimensional image\n"; return extent(1); }
Expr OutputImageParam::width() const { user_assert(dimensions() > 0) << "Can't ask for the width of a zero-dimensional image\n"; return extent(0); }