[Package Index | Mudlib Index | Effect Index]

File /obj/handlers/image.c

Images can be used to efficiently store per-room area information. Two current uses are for height maps (ie, third coordinate) and exit maps (eg, a maze). Along a row represents W-E (left to right), and along a column represents N-S (top to bottom). (0,0) in the image corresponds to the northwestern-most room of the area.

Currently, the only supported image type is RAW.

Includes

This class includes the following files /include/image.h

Method index

Public Functions

These are functions that everyone can access.

load_image
varargs class IMAGE_INFO load_image(string image_file,
                                    int rle)

This method reads in the given image file, and returns a two-dimensional array of integers representing the data in the file. The 'rle' flag is currently unused; in the future, it will be used to return the array in a "run-length encoded" format, where each group of identical elements in a row will be represented as a count/value pair. This may be more efficient for large arrays with sparse data.

Parameters:
image_file - the pathname of the file containing the image

Returns:
a 2-D array of ints, representing the image