channels-methods | R Documentation |
Functions for manipulation and extraction of colors from
channel-based pixmap formats. Methods for generic addChannels
adds the
color channels of a colored pixmap and returns a grey version. Methods
for generic getChannels
return numeric matrices or arrays
containing the specified channels.
addChannels(object, coef = NULL)
getChannels(object, colors = "all")
object |
Object of class |
coef |
Coefficients for the color channels, a numeric vercot with
as many elements as there are color channels in the pixmap. The
default for RGB is |
colors |
Character vector naming the color channels that shall be
extracted. The default of |
Friedrich Leisch
x <- pixmapRGB(rep(1:5, 3), nrow=4)
plot(x)
print(x)
getChannels(x)
getChannels(x, colors=c("red", "green"))
y = addChannels(x)
plot(y)
print(y)
## extract only the red channel
y = addChannels(x, coef=c(1,0,0))
plot(y)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.