home *** CD-ROM | disk | FTP | other *** search
- Programming information for paintmode files
- ===========================================
-
- Copyright © Almathera Systems Ltd 1994. All Rights Reserved.
-
- All programming examples and documentation is proprietary
- and may only be used to create paintmode files for use
- with the Photogenics program.
-
- Any other use of this documentation and source is strictly
- prohibited. It may not be reproduced or copied without
- written authorisation from Almathera.
-
- Permission is hereby given to allow free or commercial
- distribution of paintmode files for Photogenics written using
- this code. Almathera encourages the free distribution
- of paintmode files for use with Photogenics.
-
- (ie. If you write a paintmode, you can do whatever you want with
- it!)
-
- Paintmode files may not be distributed for use with any other
- Amiga software.
-
- (ie. You can't reverse engineer our system and build your
- own image-processor around our files)
-
- ---------------------------------------------------
- If you have any problems developing add-on files for
- Photogenics, then please contact:
-
- Jolyon Ralph or Keith Smith on (UK) 0181 687 0040
- during office hours, or email to:
-
- jralph@cix.compulink.co.uk
-
- We'll be happy to help out where we can.
-
- If you've come up with an excellent idea for a paintmode but
- can't program it yourself, then let us know and we might
- have a go ourselves, or call our BBS, someone may
- have already written one!
-
- -----------------------------------------------------
-
- What is a paintmode file? - Jolyon Ralph (21/11/94)
- ===================================================
- A paintmode is, like the GIO files, a standard system library.
- Unlike GIOs, the core code used for photogenics is an assembler
- routine (it should not be written in any other language). It
- is possible to write everything else in C or another language and
- link in the assembler, although all our examples are pure assembler.
-
- The examples provided are writen for Hisoft Devpac 3.0 assembler,
- but do not use any special features and should quite easily
- convert for use with any other assembler.
-
- Each library contains three functions
-
- PaintInfo - This returns information about the paintmode
- PaintAddr - This returns the address of the actual assembler code
- PaintOptions - This sets optional values for the loader
-
- See the examples for further information:
- ----------------------------------------
-
- paintmode/PaintInfo paintmode/PaintInfo
-
- NAME
- PaintInfo -- Return information about paint mode
-
- SYNOPSIS
- Information = PaintInfo()
-
- ULONG PaintInfo( void );
- D0
-
- FUNCTION
- This routine returns flags relevent to the operation of the Paint
- mode.
-
- INPUTS
-
- RESULTS
- Information: The flags returned by the function.
-
- Valid flags returned are: (see paintmodes.i)
-
- PAINT_COLOUR -
- The mode uses the currently selected colour (eg Paint, Tint, etc.)
-
- PAINT_SECONDARY -
- The mode requires a secondary buffer (eg RubThru)
-
- PAINT_BUFFERALL -
- If your paint mode refers to other pixels on the image you
- will have to buffer the image. This requires Undo and the
- paintmode will not work with Undo disabled.
-
- PAINT_NOOPTIONS -
- This loader does not have any user-settable options.
-
- NOTES
-
- It can also be used to identify a paint mode (as opposed to a
- gio etc.) by checking the high word returned matches
- the key
-
- result=PaintInfo();
- if((result&0xffff0000)!=PAINT_KEY) Error("Not a paint mode!");
-
- SEE ALSO
-
- BUGS
-
- paintmode/PaintAddr paintmode/PaintAddr
-
- NAME
- PaintAddr - Get the address of the paint mode assember code
-
- SYNOPSIS
- addr = PaintAddr()
-
- APTR PaintAddr( void )
- D0
-
- FUNCTION
- This returns the address of the assembler code needed to operate
- the paint mode. The assembler code should be imbedded into the
- library. See the entry below for the assembler hook.
-
- INPUTS
-
- RESULTS
- The address of the assembler hook.
-
- NOTES
-
- SEE ALSO
-
- BUGS
-
- paintmode/PaintOptions paintmode/PaintOptions
-
- NAME
- PaintOptions - Set options for paint mode
-
- SYNOPSIS
-
- Changed = PaintOptions(pgsbase, buffer)
-
- BOOL PaintOptions(struct PgsBase *,struct PhotoBuff *)
- D0 A0 A1
-
- FUNCTION
- Brings up a requester if necessary and sets internal values for the
- paint mode.
-
- INPUTS
- pgsbase - open library pointer to the pgs.library
- buffer - pointer to the current active buffer
-
- RESULTS
- If any change to the preferences was made changed is TRUE, else
- false
-
- NOTES
- If no preferences are needed, the code should be:
-
- moveq #0,d0 ; set changed to false
- rts
-
- SEE ALSO
-
- BUGS
-
- paintmode/_assembler hook paintmode/_assembler hook
-
- NAME
- _assembler hook - The actual painting routine
-
- SYNOPSIS
- Cannot be called directly from library.
-
- (addr = PaintAddr)
- move.l addr,a6
- jsr (a6)
-
- FUNCTION
- Paints one pixel. Called in a loop for the entire area to be
- drawn. Transparency, alpha channels, etc. are handled seperately.
-
- INPUTS
- d1 - Current pixel red value
- d2 - Current pixel green value
- d3 - Current pixel blue value
- a5 - Current PhotoInfo structure (see photogenics.i)
-
- important values to reference from a5
-
- PHI_x(a5) - current X position of pixel
- PHI_y(a5) - current Y position of pixel
- PHI_red(a5) - current colour red component
- PHI_green(a5) - current colour green component
- PHI_blue(a5) - current colour blue component
- PHI_width(a5) - width of current picture
- PHI_height(a5) - height of current picture
-
- a3 - PgsBase
-
- RESULTS
- d4 - New pixel red value
- d5 - New pixel green value
- d6 - New pixel blue value
-
- NOTES
- Do NOT trash D1,d2,d3 or ANY address register.
-
- These *must* be written in assembler for speed.
-
- SEE ALSO
- paintmode/PaintAddr
-
-
-
-