\name{rip.pad}
\alias{rip.pad}
\title{Add a border to a \code{"rip"} object}
\usage{
rip.pad(x, pad,
        offset = round((pad - dim(x))/2),
        value = 0,
        top = offset[1],
        left = offset[2],
        bottom = pad[1] - nrow(x) - top,
        right = pad[2] - ncol(x) - left,
        borderType = c("constant", "replicate", "reflect", "wrap", "reflect_101")
)
}
\arguments{
  \item{x}{rip object (or an object that can be coerced to one).}

  \item{pad}{Desired size of the output image. Must not be smaller
    than the size of \code{x}.}

  \item{offset}{Starting position of the top-left corner of \code{x}
    in the new image. By default, the padding is added
    symmetrically on all sides.}

  \item{value}{A constant to be used for \code{borderType =
      "constant"}.}

  \item{top}{border size at top direction}

  \item{left}{border size at left direction}

  \item{bottom}{border size at bottom direction}

  \item{right}{border size at right direction}

  \item{borderType}{border type}
}
\value{
  A padded \code{"rip"} object.
}
\description{
  Wrapper for OpenCV function \code{copyMakeBorder}.
}
\details{
  Adds a border (padding) around an image. Various kinds of border
  types are supported; the names are suggestive, but see OpenCV
  documentation for precise details. The \code{pad} and
  \code{offset} arguments are provided for convenience, and
  overridden by \code{top}, \code{left}, etc.
}
\author{
  Kaustav Nandy
}
