Learn R Programming

AmigaFFH (version 0.4.3)

rawToIFFChunk: Coerce raw data to an IFFChunk class object

Description

Coerce raw data, as it would be stored in the Interchange File Format (IFF), and convert it into an IFFChunk class object.

Usage

# S4 method for raw
rawToIFFChunk(x)

Value

Returns an IFFChunk class object based on x.

Arguments

x

A vector of raw data that needs to be converted into a IFFChunk class object.

Author

Pepijn de Vries

Details

This method should work for all IFF chunk types that are implemented in this package (see IFFChunk-method for details). For non-implemented chunks this method may work properly as long as the chunks are nested inside a FORM type container chunk. This method is provided for your convenience, but it is recommended to import IFFChunk methods using the read.iff function. Use as.raw to achieve the inverse of this method.

See Also

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

Other raw.operations: as.AmigaBasic(), as.raw.AmigaBasic(), colourToAmigaRaw(), packBitmap(), rawToAmigaBasicBMAP(), rawToAmigaBasicShape(), rawToAmigaBasic(), rawToAmigaBitmapFontSet(), rawToAmigaBitmapFont(), rawToAmigaIcon(), rawToHWSprite(), rawToSysConfig(), simpleAmigaIcon()

Examples

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

## Coerce it to raw data:
example.raw <- as.raw(example.iff)

## Coerce raw data to IFF chunk:
example.iff.new <- rawToIFFChunk(example.raw)

## These conversions were non-destructive:
identical(example.iff, example.iff.new)
}

Run the code above in your browser using DataLab