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.
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