Learn R Programming

oro.dicom (version 0.3.7)

JpegComponentInfo: Constructor for JPEG Component Information

Description

The lossless JPEG code in C from Cornell includes "typedef struct JpegComponentInfo" consisting of 4 variables of class "short". In R, these are represented as raw vectors of length 2.

Usage

JpegComponentInfo(componentID, componentIndex,
                  hSampFactor, vSampFactor)

Arguments

componentID
identifier for this component (0..255)
componentIndex
index in SOF or cPter->compInfo[] (see "jpeg.h" in the LJPG C code).
hSampFactor,vSampFactor
horizontal and verticalsampling factors

Value

  • A list with 4 components matching the arguments of this constructor function, each being a raw vector of length 2. The input arguments must either be of class raw or capable of coersion via as.raw.

Details

Constructor function for an object of class JpegComponentInfo. For details, see Huang and Smith (1994).

References

Kongji Huang and Brian Smith (1994) "Lossless JPEG Codec", v. 1.0 ftp://ftp.cs.cornell.edu/pub/multimed/ljpg.tar.Z

See Also

as.raw

Examples

Run this code
jpegCI <- JpegComponentInfo(1, 2, 3, 4)

jpegCI. <- list(componentID=as.raw(1), componentIndex=as.raw(2),
                hSampFactor=as.raw(3), vSampFactor=as.raw(4))
class(jpegCI.) <- 'JpegComponentInfo'

stopifnot(
all.equal(jpegCI, jpegCI.)
)

Run the code above in your browser using DataLab