The Datatypes system is one very important aspect of what makes the Amiga Operating System stand out from more typical operating systems. This built-in feature of the AmigaOS gives Amiga Mosaic easily implemented and user-extensible image and sound handling features.
Datatypes provides the following benefits to application programmers:
The Datatypes library is included in Release 3.0 of the Amiga Operating System. The library is the core of an OS-level object-oriented data handling system. It provides application programmers with the functionality for handling data in an abstract, object-oriented, and consistent way. The details of handling various data standards are hidden from the programmer. Instead of manipulating data directly, application programmers deal only with the functions and structures of the Datatypes library. The library handles the complexities of understanding and decoding various data storage formats. It uses special drivers placed in a system directory in order to recognize, decode and manipulate data. The application using the data needs to know very little about the data in order to use it effectively. The Datatypes system converts the data into a standard internal format for consumption by the application program.
What this means to application programmers is that they do not need to become experts on every data format they wish their application to support. Once the basics of the Datatypes interface is understood and implemented in the application, the programmer can move on to more important matters, such as what to do with data, rather than how to access and, if necessary, decode it.
The Datatypes system is built on the Amiga's boopsi (Basic Object-Oriented Programming System for Intuition) facility. As such, Datatypes is an object-oriented system itself. There are different classes and sub-classes of data, as well as attributes of a data object, and methods which can be performed on an object.
Datatypes includes two object classes important to Amiga Mosaic: the picture and sound classes. Sub-classes provided with the operating system are ILBM and 8SVX, the Amiga's standard image and sound formats. An application program written to utilize the Datatypes system can pass an ILBM (Inter-leaved Bitmap) image file to the library, and by looking up the object's attributes, immediately know the structure of the image (its dimensions, palette, etc). The application can then perform a method on the object to convert it to a format displayable on the application's screen, or manipulate it in many other ways. The programmer need not know anything about the format of the image in order to manipulate it.
The most important aspect of the Datatypes system, however, is its extensibility. Additional classes may be added to the Datatypes system by obtaining or writing a new driver and placing it in the system's object classes directory. This is where the real magic of the Datatypes system becomes apparent. Many new sub-class drivers have been developed and released into the public domain. Among these are Picture classes for GIF, JPEG, and Pict formats, and a Sound class for the Sun AU format. Install these, and instantly any application which uses the Datatypes library will recognize and be able to decode and manipulate these formats. No code needs to be recompiled. Indeed, an application need not even be restarted in order to take advantage of the new data formats.
Amiga Mosaic was written with the Datatypes system as its primary inlined image handler. Where other versions of Mosaic require a GIF decoder and XBM decoder to be built into the program, Amiga Mosaic simply uses a few functions of the Datatypes library to decode its images. The obvious advantage of this is that image decoding code can be left completely out of Amiga Mosaic. Once a user installs GIF and XBM class decoders on their system, Amiga Mosaic will be able to display these formats as inlined images and match the functionality of most other Mosaic variants. Once the user installs a JPEG datatype driver, Amiga Mosaic is capable of displaying inlined JPEGs, something no other Mosaic can do. Expandability is in the hands of the user; there are many different datatype drivers (for example, PICT, PCX, MacPaint, BMP, etc.), and the user decides which to install. Of course, most new Amiga applications are written to take advantage of the Datatypes system. If the user installs a JPEG driver in order to view inlined JPEGs with Amiga Mosaic, all the other Datatypes-ready applications would then be able to use the JPEG format as well.