Learn R Programming

AmigaFFH (version 0.4.3)

interpretIFFChunk: Interpret an IFFChunk object

Description

IFFChunks represent the structure of the Interchange File Format well, but the iformation is stored as raw data. This method tries to interpret and translate the information into a more comprehensive format.

Usage

# S4 method for IFFChunk
interpretIFFChunk(x, ...)

Value

If x is interpretable by this package an S3 class object of IFF.ANY is returned. The content of the returned object will depend on the type of IFFChunk provided for x. The result can for instance be a raster image (as.raster), a list of audio Waves, a character string or a named list.

Arguments

x

An IFFChunk object which needs to be interpreted.

...

Currently ignored.

Author

Pepijn de Vries

Details

Interchange File Format chunks can hold any kind of information (images, audio, (formatted) text, etc.). This method will try to convert this information into something useful. Information may get lost in the translation, so be careful when converting back to an IFFChunk-class object using IFFChunk-method.

An error is thrown when the IFFChunk object is currently not interpretable by this package. See IFFChunk-method for an overview of currently supported IFF chunks. This list may increase while this package matures.

See Also

Other iff.operations: IFFChunk-class, WaveToIFF(), as.raster.AmigaBasicShape(), getIFFChunk(), rasterToIFF(), rawToIFFChunk(), read.iff(), write.iff()

Examples

Run this code
if (FALSE) {
## load an IFF file
example.iff <- read.iff(system.file("ilbm8lores.iff", package = "AmigaFFH"))

## in this case, the file is a FORM container with a bitmap image, and a
## list with a raster object is returned when interpreted:
example.itpt <- interpretIFFChunk(example.iff)
class(example.itpt)
typeof(example.itpt)
class(example.itpt[[1]])

## Let's extraxt the bitmap header from the main chunk:
bmhd <- getIFFChunk(example.iff, c("ILBM", "BMHD"))

## When interpreted, a named list is returned with (meta-)information
## on the bitmap image:
bmhd.itpt <- interpretIFFChunk(bmhd)
class(bmhd.itpt)
typeof(bmhd.itpt)
print(bmhd.itpt)
}

Run the code above in your browser using DataLab