Routines (alphabetical) > Routines: R > READ_SRF

# READ_SRF

The READ_SRF procedure reads the contents of a Sun rasterfile and returns the image and color table vectors (if present) in the form of IDL variables.

READ_SRF only handles 1-, 8-, 24-, and 32-bit rasterfiles of type `RT_OLD` and `RT_STANDARD`. See the file `/usr/include/rasterfile.h` for the structure of Sun rasterfiles.

This routine is written in the IDL language. Its source code can be found in the file `read_srf.pro` in the `lib` subdirectory of the IDL distribution.

Note: To find information about a potential SRF file before trying to read its data, use the QUERY_SRF function.

## Examples

To open and read the Sun rasterfile named `sun.srf` in the current directory, store the image in the variable `image1`, and store the color vectors in the variables `R`, `G`, and `B`, enter:

READ_SRF, 'sun.srf', image1, R, G, B

To load the new color table and display the image, enter:

TVLCT, R, G, B

TV, image1

## Syntax

READ_SRF, Filename, Image [, R, G, B]

## Arguments

### Filename

A scalar string containing the name of the rasterfile to read.

### Image

A named variable that will contain the 2-D byte array (image).

### R, G, B

Named variables that will contain the Red, Green, and Blue color vectors, if the rasterfile contains colormaps.

## Keywords

None

## Version History

Original | Introduced

## See Also

WRITE_SRF, QUERY_SRF