home *** CD-ROM | disk | FTP | other *** search
- #ifndef IMAGEPROCESS_H
- #define IMAGEPROCESS_H
-
- /*
- ** $VER: imageprocess.h 1.0 (30.6.2000)
- **
- ** Public structures and defintions for imageprocess.library.
- **
- ** © Paul Huxham
- */
-
- #ifndef EXEC_TYPES_H
- #include "exec/types.h"
- #endif
-
- #ifndef UTILITY_TAGITEM_H
- #include <utility/tagitem.h>
- #endif
-
- #ifndef IMAGEGENERIC_H
- #include <imageio/imagegeneric.h>
- #endif
-
- /*========================================================================*/
- /* Imageprocess handle */
- struct ImageProcessHandle
- {
- ULONG private;
- };
-
- /*========================================================================*/
- /* Process types */
- enum
- {
- IMP_Process_Scale = 1,
- IMP_Process_Balance,
- IMP_Process_AutoGamma,
- IMP_Process_Negative,
- IMP_Process_Rotate,
- IMP_Process_Crop,
- IMP_Process_SwapColourSpace,
- };
-
- /*========================================================================*/
- /* imageprocess.library scale types */
- enum
- {
- IPSCALE_FAST = 0,
- IPSCALE_NORMAL,
- IPSCALE_BEST,
- };
-
- /*========================================================================*/
- /* imageprocess.library auto gamma types */
- #define GAMMA_BEST 0
- #define GAMMA_FAST 1
-
- /*========================================================================*/
- /* Public callback hooks called during processing */
-
- /* The progress hook is called once for each scanline in the image.
- d0 contains a ULONG with the current scanline number (1-n).
- d1 contains a ULONG with the total number of scanlines.
- a0 contains the userdata
-
- If the hook returns a non NULL value, the processing will be aborted.
- */
-
- typedef ULONG (*IMPP_HOOK)( ULONG, ULONG, void * );
- typedef __asm ULONG (*IMPP_HOOK_PROTO)( register __d0 ULONG, register __d1 ULONG, register __a0 void * );
-
- /* The render hook is called once for each processed scanline in the image.
- a0 contains a UBYTE pointer to the scanline data
- d0 contains a ULONG with the scanline number of this data (1 being
- first scanline)
- d1 contains a ULONG with the number of bytes in this row
- a1 contains the userdata
-
- If the hook returns a non NULL value, the processing will be aborted.
- */
-
- typedef ULONG (*IMPR_HOOK)( void *, ULONG, ULONG, void * );
- typedef __asm ULONG (*IMPR_HOOK_PROTO)( register __a0 void *, register __d0 ULONG, register __d1 ULONG, register __a1 void * );
-
- /*========================================================================*/
- /* Imageprocess tagbase */
- #define IMP_TB ( TAG_USER + 0x80000 )
-
- /* Imageprocess tags requiring V1.0 */
- #define IMP_SourceImageIOHandle IMP_TB + 1 /* Pointer to valid source imageio.library handle (struct ImageHandle *) */
- #define IMP_SourceBuffer IMP_TB + 2 /* Source buffer (UBYTE *) */
- #define IMP_SourceWidth IMP_TB + 3 /* Width of image in pixels (ULONG) */
- #define IMP_SourceHeight IMP_TB + 4 /* Height of image in pixels (ULONG) */
- #define IMP_SourceBytesPerPixel IMP_TB + 5 /* Bytes per pixel (ULONG) */
- #define IMP_SourceColourSpace IMP_TB + 6 /* Type of colour space (ULONG) */
-
- #define IMP_MemoryPool IMP_TB + 7 /* Pointer to memory pool to allocate memory on */
-
- #define IMP_Buffer IMP_TB + 10 /* New destination buffer (if created one) (UBYTE **) */
- #define IMP_BufferSize IMP_TB + 11 /* Size of destination buffer in bytes (ULONG *) */
- #define IMP_Width IMP_TB + 12 /* Final width of image in pixels (ULONG *) */
- #define IMP_Height IMP_TB + 13 /* Final height of image in pixels (ULONG *) */
- #define IMP_BytesPerPixel IMP_TB + 14 /* Bytes per pixel (ULONG *) */
- #define IMP_ColourSpace IMP_TB + 15 /* Colour space (ULONG *) */
-
- #define IMP_ProcessInline IMP_TB + 16 /* Process the buffer inline, dont allocate a new buffer (BOOL) */
-
- #define IMP_ProcessLines IMP_TB + 20 /* How many scanlines to process between calls to callback hooks, defaults to 1 (ULONG) (NOT IMPLEMENTED) */
- #define IMP_ProgressHook IMP_TB + 21 /* Pointer to a function to display progress status (NOT IMPLEMENTED) */
- #define IMP_ProgressUserData IMP_TB + 22 /* Pointer to user data (void *) (NOT IMPLEMENTED) */
- #define IMP_RenderHook IMP_TB + 23 /* Pointer to a function to render scan lines (NOT IMPLEMENTED) */
- #define IMP_RenderUserData IMP_TB + 24 /* Pointer to user data (void *) (NOT IMPLEMENTED) */
-
- /* Scale */
- #define IMP_ScaleNum IMP_TB + 30 /* Numerator for scaling, defaults to 1 (ULONG) */
- #define IMP_ScaleDenom IMP_TB + 31 /* Denomenator for scaling (ULONG) */
- #define IMP_ScaledWidth IMP_TB + 32 /* Width of scaled image in pixels (ULONG *) */
- #define IMP_ScaledHeight IMP_TB + 33 /* Height of scaled image in pixels (ULONG *) */
- #define IMP_ScaleMaintainAspect IMP_TB + 34 /* Maintain aspect ratio when scaling (BOOL) */
- #define IMP_ScaleType IMP_TB + 35 /* Defined above (ULONG) */
-
- /* Swap colour space */
- #define IMP_NewColourSpace IMP_TB + 40 /* Type of colour space to make the dest (ULONG) */
-
- /* Auto gamma correction */
- #define IMP_GammaMode IMP_TB + 45 /* Mode of gamma correction (ULONG) */
-
- /*========================================================================*/
- /* Defined error return codes */
- #define IMPERR_NONE 0 /* No error */
- #define IMPERR_NOMEMORY 1 /* Insufficient memory */
- #define IMPERR_NOHANDLE 2 /* No imageprocess handle */
- #define IMPERR_NOIMAGEIOHANDLE 3 /* No imageio source handle */
- #define IMPERR_NOBUFFER 4 /* No image buffer */
- #define IMPERR_MISSINGTARGET 5 /* Missing target variable pointer */
- #define IMPERR_BADSCALESIZE 6 /* Out of range scaling parameters */
- #define IMPERR_INCOMPATTAGS 7 /* Incompatible tags */
- #define IMPERR_CANTPROCESS 8 /* Cant process buffer */
- #define IMPERR_INLINE 9 /* Buffer mode is inline */
- #define IMPERR_MISSINGPARAM 10 /* Buffer parameter missing in alloc */
- #define IMPERR_UNSUPPORTEDCS 11 /* Unsupported colour space */
-
- #endif /* IMAGEPROCESS_H */
-