% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/conversions.R
\name{as.cimg}
\alias{as.cimg}
\alias{as.cimg.numeric}
\alias{as.cimg.logical}
\alias{as.cimg.double}
\alias{as.cimg.cimg}
\alias{as.cimg.vector}
\alias{as.cimg.matrix}
\title{Convert to cimg object}
\usage{
as.cimg(obj, ...)

\method{as.cimg}{numeric}(obj, ...)

\method{as.cimg}{logical}(obj, ...)

\method{as.cimg}{double}(obj, ...)

\method{as.cimg}{cimg}(obj, ...)

\method{as.cimg}{vector}(obj, x = NA, y = NA, z = NA, cc = NA, dim = NULL, ...)

\method{as.cimg}{matrix}(obj, ...)
}
\arguments{
\item{obj}{an object}

\item{...}{optional arguments}

\item{x}{width}

\item{y}{height}

\item{z}{depth}

\item{cc}{spectrum}

\item{dim}{a vector of dimensions (optional, use instead of xyzcc)}
}
\description{
Imager implements various converters that turn your data into cimg objects. If you convert from a vector (which only has a length, and no dimension), either specify dimensions explicitly or some guesswork will be involved. See examples for clarifications.
}
\section{Methods (by class)}{
\itemize{
\item \code{as.cimg(numeric)}: convert numeric

\item \code{as.cimg(logical)}: convert logical

\item \code{as.cimg(double)}: convert double

\item \code{as.cimg(cimg)}: return object

\item \code{as.cimg(vector)}: convert vector

\item \code{as.cimg(matrix)}: Convert to matrix

}}
\examples{
as.cimg(1:100,x=10,y=10) #10x10, grayscale image
as.cimg(rep(1:100,3),x=10,y=10,cc=3) #10x10 RGB
as.cimg(1:100,dim=c(10,10,1,1))
as.cimg(1:100) #Guesses dimensions, warning is issued
as.cimg(rep(1:100,3)) #Guesses dimensions, warning is issued
}
\seealso{
as.cimg.array, as.cimg.function, as.cimg.data.frame
}
\author{
Simon Barthelme
}
