                          PI Image Extern Modules
                              An Introduction

Introduction
============

This document provides a brief introduction to the process of
construction PI Image Extern Modules.

For a complete description of the procedures, please contact us to

Menti Possibili snc
Pietro Polsinelli
Via Di Vittorio, 56
50015 Grassina (Firenze)
Italy


What's PI Extern Modules ?
==========================

PI Extern Modules are a new way to enjoy PI Image.
Now, you can build up your own procedures to control PI.

If you run the demo program named "ExampleMod", from PI Image obviously, you
will see "Hello, World!" in the middle of the screen.

Well, have you understood ? An Extern Module is simply a procedure
that use PI Image to create new functions.
Think: new loaders, new savers, new effects with a little effort!

What do you need to know to write an extern module ?
You must know only C programming.
You can find a complete demo example in this disk (named
"PIToolkit/Source/ExampleMod.c"). This demo is written using Lattice C 5.10.


What's PARAMETERS_PI ?
======================

This is a complete list of "paramPI.h".
Let's see it together!

#ifndef PARAMETERS_PI
#define PARAMETERS_PI

/*
**      $Filename: paramPI.h $
**      $Release : 1.0 $
**
**
**
**      © Copyright 1992 Menti Possibili®, snc.
**      All Rights Reserved.
*/

#define CHIPSIZE        512L
#define FASTSIZE        2048L

/*
The CHIPSIZE and FASTSIZE are the lenghts of two little memory buffers.
The first (pointed by "tmpchipbuf") is placed in chip memory and the
other is in fast memory (pointed by "tmpfastbuf").
You can use these buffers for storing information or other.
*/

#define MOD_MAGIC       6812345L

/*
MOD_MAGIC is a magic number to retrieve information. Don't modify it.
*/

#define MOD_LOADER      0x00000001L
#define MOD_SAVER       0x00000002L
#define MOD_FX          0x00000004L

/*
MOD_LOADER, MOD_SAVER & MOD_FX are the module type.
PI Image recognize only these types, but you can make so many
types of extern modules as you want.
*/

struct Parameters_PI
        {
        LONG                    magic;          /* magic number */
        struct Window           *mainwindow;
        struct Window           *tbwindow;
        struct RastPort         *targetrp;
        struct Preferences      *prefsbuf;
        struct IODRPReq         *ioreq;
        struct MsgPort          *msgport;
        UBYTE                   *tmpchipbuf;    /* CHIPSIZE byte chip mem */
        UBYTE                   *tmpfastbuf;    /* FASTSIZE byte fast mem */
        LONG                    pad[4];         /* future */
        };

/*
mainwindow      pointer to PI Image main window (where you can find the
                on screen image)
tbwindow        pointer to PI Image toolbox
targetrp        pointer to PI Image buffer rastport. This normally contains
                a copy of the main image. But you can use it to store image
                and other operations.
                It's important that you make a copy of the main image to the
                buffer when your application ends.
prefsbuf        pointer to PI Image Preferences buffer.
ioreq           pointer to a IoDRPReq. You can use it to print.
msgport         pointer to a MsgPort. PI Image use it when printing.
tmpchipbuf      pointer to a little chip memory buffer.
tmpchipbuf      pointer to a little fast memory buffer.
*/

struct HeaderModule_PI
        {
        LONG                            magic;
        LONG                            type;
        char                            name[22];
        char                            copyright[22];
        LONG                            pad[4];  /* future */
        };

/*
this structure is used to make *.modPI files.
*/

#endif  /* PARAMETERS_PI */


Ok ? Have you understood ? Yes, we hope.
With these parameters your can make very nice applications.
Menti Possibili granted free use.

If you want to enter in the "Certificate User Applications" (charge free)
you must send us your application with a brief description.
We test it and return to you a PI Image Certificated Application.

We hope that you will like it. We wait for your suggestions.

Good luck and have fun with PI Image!


                                                        Pietro Polsinelli
                                                        Products Enhancement
                                                        Menti Possibili snc
