Description Usage Arguments Author(s) Examples
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.
1 2 | 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
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | 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)
|
Warning message:
In rep(cellres, length = 2) : 'x' is NULL so the result will be NULL
Pixmap image
Type : pixmapRGB
Size : 4x4
Resolution : 1x1
Bounding box : 0 0 4 4
, , red
[,1] [,2] [,3] [,4]
[1,] 0.00 1.00 0.75 0.50
[2,] 0.25 0.00 1.00 0.75
[3,] 0.50 0.25 0.00 1.00
[4,] 0.75 0.50 0.25 0.00
, , green
[,1] [,2] [,3] [,4]
[1,] 0.25 0.00 1.00 0.75
[2,] 0.50 0.25 0.00 1.00
[3,] 0.75 0.50 0.25 0.00
[4,] 1.00 0.75 0.50 0.25
, , blue
[,1] [,2] [,3] [,4]
[1,] 0.50 0.25 0.00 1.00
[2,] 0.75 0.50 0.25 0.00
[3,] 1.00 0.75 0.50 0.25
[4,] 0.00 1.00 0.75 0.50
, , red
[,1] [,2] [,3] [,4]
[1,] 0.00 1.00 0.75 0.50
[2,] 0.25 0.00 1.00 0.75
[3,] 0.50 0.25 0.00 1.00
[4,] 0.75 0.50 0.25 0.00
, , green
[,1] [,2] [,3] [,4]
[1,] 0.25 0.00 1.00 0.75
[2,] 0.50 0.25 0.00 1.00
[3,] 0.75 0.50 0.25 0.00
[4,] 1.00 0.75 0.50 0.25
Pixmap image
Type : pixmapGrey
Size : 4x4
Resolution : 1x1
Bounding box : 0 0 4 4
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.