DATAMANIP commands


PROGRAM NAME

kimportraw - Low level import of raw (binary) data

DESCRIPTION

kimportraw can be used to read raw binary data and import it to a data segment. If the second input file is supplied, Add-to Object, the new data will be appended onto that object. Otherwise, an new object is created. The data is stored in the Destination segment specified.

The source architecture, data type information, and data dimensions and structure must be known to permit the data to be imported correctly.

The -skip argument can be used to cause the specified number of bytes to be skipped before reading the data that will eventually end up in the output object. This is handy for skipping over a header or other information in a raw data file to get to the actual data.

The index order of the data is assumed to be WHDTE.

Access to the raw input is done using a special input mode (obtained by setting the KOBJ_RAW flag when the input file is opened) that forces the data to be interpreted in raw mode. This means that even if the data is actually in one of the supported formats, that fact will be ignored. This potentially lets you read the headers and other goodies and store them as data in the output object.

If the destination of the raw data is specified to be the comment attribute of the output object, the raw data will be accessed as KUBYTE regardless of the setting of the -type argument. The number of characters given by the product of the sizes of the dimensions will be read in and appended to the comment attribute in the output object. Only those characters up to the first NULL in the data will actually end up in the comment since the comment is required to be a NULL terminated string.

REQUIRED ARGUMENTS

-i1
type: infile
desc: raw (binary) input
-o
type: outfile
desc: output object

OPTIONAL ARGUMENTS

-i2
type: infile
desc: Object to which the new data should be added
default: {none}
-arch
type: list
desc: data source architecture
default: 1 "Local"
-type
type: list
desc: data type of raw data
default: 3 "Unsigned Byte"
-wsize
type: integer
desc: Size of width dimension
default: 1
bounds: value > 0
-hsize
type: integer
desc: Size of height dimension
default: 1
bounds: value > 0
-dsize
type: integer
desc: Size of depth dimension
default: 1
bounds: value > 0
-tsize
type: integer
desc: Size of time dimension
default: 1
bounds: value > 0
-esize
type: integer
desc: Size of elements dimension
default: 1
bounds: value > 0
-skip
type: integer
desc: skip this number of bytes before reading
default: 0
bounds: value >= 0
-segment
type: list
desc: destination for incoming data
default: 1 "Value"
-color
type: list
desc: color space model for data
default: 1 "None"

EXAMPLES

The following example shows how one might read a raw data file generated by a
frame grabber. Here, we will assume that the data is a 512 col by 480 row
unsigned byte color (RGB) image, with a 1024 byte header. We will assume that
the color data is stored with the whole R plane, then the whole G plane, then
the whole B plane.
  % kimportraw -o khoros.rgb -i1 framegrab.rgb -type 3 -wsize 512 -hsize 480 -esize 3 -segment 1 -skip 1024 -color RGB

SEE ALSO

kimportasc(1), kformats(1), kcomment(1), kcolorspace(1)

RESTRICTIONS

The data is assumed to be stored in the raw file with a WHDTE index order. It would be nice to be able to directly handle mulitply interleaved data, but specifiying how that is to be done in 5D is a mess.

REFERENCES

COPYRIGHT

Copyright (C) 1993 - 1997, Khoral Research, Inc. ("KRI") All rights reserved.