Location: Main > Module Types > View Module Type

Image Module

Engine Module Type StringImage
Module Type UsageMultiple Type

Description

Image Modules enable the Drag[en]gine to load an image from a file or to save an image to a file. Image modules are Multiple Type Modules hence you can install more than one Image module at the same time. Launchers typically search missing Image modules for you so you have only those installed that your games really use.

Module Developer Informations

Image resources store a pixel based image. Images can have any dimension larger than 1 and various color formats. Supported are 1, 2, 3 and 4 component images as well as 8-bit, 16-bit and 32-bit color depth. Images have a depth and therefore can be 3-dimensional. A 3D-image is stored as a sequence of 2-dimensional images of the same size and color format.

Image modules contain in contrary to other resource loader module three functions. This is since the engine has to allocate memory for the image while constructing a new Image resource. For this first the InitLoadImage function is called. The Image module has to stores the required informations about the image dimension and color format in a deBaseImageInfo which the module creates itself. The engine then creates the Image resource and passes it finally to the LoadImage function. During the two calls the file pointer is not changed hence you can read on from where you left off in the InitLoadImage function. Most of image files are composed in a way that the image data follows the image header hence after reading the header you are already in the right position to read the image data. For saving there is only one function since all informations are present already.



See the following classes to get started with Image modules:




Note: The definition of the Image resource may change in the future to provide support for more image types.