if (FALSE) {
## load an IFF file
example.iff <- read.iff(system.file("ilbm8lores.iff", package = "AmigaFFH"))
## The file contains an interleaved bitmap image that can be
## converted into a raster:
example.raster <- as.raster(example.iff)
## the raster can be plotted:
plot(example.raster)
## note that the IFFChunk can also be plotted directly:
plot(example.iff)
## Hardware sprites can also be converted into raster images.
## Let's generate a 16x16 sprite with a random bitmap:
spr <- new("hardwareSprite",
VStop = 16,
bitmap = as.raw(sample.int(255, 64, replace = TRUE)))
## now convert it into a raster image.
## as the background colour is not specified for hardware
## sprite, we can optionally provide it here.
spr.raster <- as.raster(spr, background = "green")
## AmigaBasicShape objects can also be converted into rasters:
ball <- read.AmigaBasicShape(system.file("ball.shp", package = "AmigaFFH"))
ball.rst <- as.raster(ball)
}
Run the code above in your browser using DataLab