getIFFChunk | R Documentation |
IFFChunk()
s can be nested in a tree-like structure. Use this method
to get a specific chunk with a specific label.
## S4 method for signature 'IFFChunk,character,integer'
getIFFChunk(x, chunk.path, chunk.number)
## S4 method for signature 'IFFChunk,character,missing'
getIFFChunk(x, chunk.path, chunk.number)
## S4 replacement method for signature 'IFFChunk,character,missing,IFFChunk'
getIFFChunk(x, chunk.path, chunk.number = NULL) <- value
## S4 replacement method for signature 'IFFChunk,character,integer,IFFChunk'
getIFFChunk(x, chunk.path, chunk.number = NULL) <- value
x |
An |
chunk.path |
A |
chunk.number |
A |
value |
An |
IFFChunk
objects have 4 character
identifiers, indicating what type
of chunk you are dealing with. These chunks can be nested inside of each other.
Use this method to extract specific chunks by referring to there respective
identifiers. The identifiers are shown when calling print
on an
IFFChunk()
. If a specified path doesn't exist, this method throws a
‘subscript out of range’ error.
Returns an IFFChunk()
object nested inside x
at the
specified path. Or in case of the replace method the original chunk x
is
returned with the target chunk replaced by value
.
Pepijn de Vries
Other iff.operations:
IFFChunk-class
,
WaveToIFF()
,
as.raster.AmigaBasicShape()
,
interpretIFFChunk()
,
rasterToIFF()
,
rawToIFFChunk()
,
read.iff()
,
write.iff()
## Not run:
## load an IFF file
example.iff <- read.iff(system.file("ilbm8lores.iff", package = "AmigaFFH"))
## Get the BMHD (bitmap header) from the ILBM (interleaved bitmap) chunk:
bmhd <- getIFFChunk(example.iff, c("ILBM", "BMHD"))
## This is essentially doing the same thing, but we now explicitly
## tell the method to get the first element for each specified label:
bmhd <- getIFFChunk(example.iff, c("ILBM", "BMHD"), c(1L, 1L))
## Let's modify the bitmap header and replace it in the parent IFF chunk.
bmhd.itpt <- interpretIFFChunk(bmhd)
## Let's disable the masking, the bitmap will no longer be transparent:
bmhd.itpt$Masking <- "mskNone"
bmhd <- IFFChunk(bmhd.itpt)
## Now replace the header from the original iff with the modified header:
getIFFChunk(example.iff, c("ILBM", "BMHD")) <- bmhd
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.