/*  Picasso96.h -- include File
 *  (C) Copyright 1996 Alexander Kneer & Tobias Abt
 *  All Rights Reserved.
 */
/************************************************************************/
#ifndef LIBRARIES_PICASSO96_H
#define LIBRARIES_PICASSO96_H
/************************************************************************/
/* includes
 */
#ifndef EXEC_TYPES_H
#include <exec/types.h>
#endif

#ifndef EXEC_NODES_H
#include <exec/nodes.h>
#endif

#ifndef UTILITY_TAGITEM_H
#include <utility/tagitem.h>
#endif

/************************************************************************/
/* This is the name of the library
 */
#define P96NAME "Picasso96API.library"

/************************************************************************/
/* Types for RGBFormat used
 */
typedef enum {
	RGBFB_NONE,				/* no valid RGB format (should not happen) */
	RGBFB_CLUT,				/* palette mode, set colors when opening screen using
									tags or use SetRGB32/LoadRGB32(...) */
	RGBFB_R8G8B8,			/* TrueColor RGB (8 bit each) */
	RGBFB_B8G8R8,			/* TrueColor BGR (8 bit each) */
	RGBFB_R5G6B5PC,		/* HiColor16 (5 bit R, 6 bit G, 5 bit B),
									format: gggbbbbbrrrrrggg */
	RGBFB_R5G5B5PC,		/* HiColor15 (5 bit each), format: gggbbbbb0rrrrrgg */
	RGBFB_A8R8G8B8,		/* 4 Byte TrueColor ARGB (A unused alpha channel) */
	RGBFB_A8B8G8R8,		/* 4 Byte TrueColor ABGR (A unused alpha channel) */
	RGBFB_R8G8B8A8,		/* 4 Byte TrueColor RGBA (A unused alpha channel) */
	RGBFB_B8G8R8A8,		/* 4 Byte TrueColor BGRA (A unused alpha channel) */
	RGBFB_R5G6B5,			/* HiColor16 (5 bit R, 6 bit G, 5 bit B),
									format: rrrrrggggggbbbbb */
	RGBFB_R5G5B5,			/* HiColor15 (5 bit each), format: 0rrrrrgggggbbbbb */
	RGBFB_B5G6R5PC,		/* HiColor16 (5 bit R, 6 bit G, 5 bit B),
									format: gggrrrrrbbbbbggg */
	RGBFB_B5G5R5PC,		/* HiColor15 (5 bit each), format: gggrrrrr0bbbbbbgg */

	/* By now, the following formats are for use with a hardware window only
		(bitmap operations may be implemented incompletely) */

	RGBFB_Y4U2V2,			/* 2 Byte TrueColor YUV (CCIR recommendation CCIR601).
									Each two-pixel unit is stored as one longword
									containing luminance (Y) for each of the two pixels,
									and chrominance (U,V) for alternate pixels.
									The missing chrominance values are generated by
									interpolation. (Y1-U0-Y0-V0) */
	RGBFB_Y4U1V1,			/* 1 Byte TrueColor ACCUPAK. Four adjacent pixels form
									a packet of 5 bits Y (luminance) each pixel and 6 bits
									U and V (chrominance) shared by the four pixels */
									
	RGBFB_MaxFormats
	} RGBFTYPE;

#define RGBFF_NONE				(1<<RGBFB_NONE)
#define RGBFF_CLUT				(1<<RGBFB_CLUT)
#define RGBFF_R8G8B8				(1<<RGBFB_R8G8B8)
#define RGBFF_B8G8R8				(1<<RGBFB_B8G8R8)
#define RGBFF_R5G6B5PC			(1<<RGBFB_R5G6B5PC)
#define RGBFF_R5G5B5PC			(1<<RGBFB_R5G5B5PC)
#define RGBFF_A8R8G8B8			(1<<RGBFB_A8R8G8B8)
#define RGBFF_A8B8G8R8			(1<<RGBFB_A8B8G8R8)
#define RGBFF_R8G8B8A8			(1<<RGBFB_R8G8B8A8)
#define RGBFF_B8G8R8A8			(1<<RGBFB_B8G8R8A8)
#define RGBFF_R5G6B5				(1<<RGBFB_R5G6B5)
#define RGBFF_R5G5B5				(1<<RGBFB_R5G5B5)
#define RGBFF_B5G6R5PC			(1<<RGBFB_B5G6R5PC)
#define RGBFF_B5G5R5PC			(1<<RGBFB_B5G5R5PC)
#define RGBFF_Y4U2V2				(1<<RGBFB_Y4U2V2)
#define RGBFF_Y4U1V1				(1<<RGBFB_Y4U1V1)

/************************************************************************/
/* Attributes for p96GetBitMapAttr
 */
enum {
	P96BMA_WIDTH,
	P96BMA_HEIGHT,
	P96BMA_DEPTH,
	P96BMA_MEMORY,
	P96BMA_BYTESPERROW,
	P96BMA_BYTESPERPIXEL,
	P96BMA_BITSPERPIXEL,
	P96BMA_RGBFORMAT,
	P96BMA_ISP96
};

/************************************************************************/
/* Attributes for p96GetModeIDAttr
 */
enum {
	P96IDA_WIDTH,
	P96IDA_HEIGHT,
	P96IDA_DEPTH,
	P96IDA_BYTESPERPIXEL,
	P96IDA_BITSPERPIXEL,
	P96IDA_RGBFORMAT,
	P96IDA_ISP96,
	P96IDA_BOARDNUMBER,
	P96IDA_STDBYTESPERROW
};

/************************************************************************/
/* Tags for p96BestModeIDTagList
 */
#define P96BIDTAG_Dummy					(TAG_USER + 96)

#define P96BIDTAG_FormatsAllowed		(P96BIDTAG_Dummy + 0x0001)
#define P96BIDTAG_FormatsForbidden	(P96BIDTAG_Dummy + 0x0002)
#define P96BIDTAG_NominalWidth		(P96BIDTAG_Dummy + 0x0003)
#define P96BIDTAG_NominalHeight		(P96BIDTAG_Dummy + 0x0004)
#define P96BIDTAG_Depth					(P96BIDTAG_Dummy + 0x0005)

/************************************************************************/
/* Tags for p96RequestModeIDTagList
 */

#define P96MA_Dummy						(TAG_USER + 0x10000 + 96)

#define P96MA_MinWidth					(P96MA_Dummy + 0x0001)
#define P96MA_MinHeight					(P96MA_Dummy + 0x0002)
#define P96MA_MinDepth					(P96MA_Dummy + 0x0003)
#define P96MA_MaxWidth					(P96MA_Dummy + 0x0004)
#define P96MA_MaxHeight					(P96MA_Dummy + 0x0005)
#define P96MA_MaxDepth					(P96MA_Dummy + 0x0006)
#define P96MA_DisplayID					(P96MA_Dummy + 0x0007)
#define P96MA_FormatsAllowed			(P96MA_Dummy + 0x0008)
#define P96MA_FormatsForbidden		(P96MA_Dummy + 0x0009)
#define P96MA_WindowTitle				(P96MA_Dummy + 0x000a)
#define P96MA_OKText						(P96MA_Dummy + 0x000b)
#define P96MA_CancelText				(P96MA_Dummy + 0x000c)
#define P96MA_Window						(P96MA_Dummy + 0x000d)
#define P96MA_PubScreenName			(P96MA_Dummy + 0x000e)
#define P96MA_Screen						(P96MA_Dummy + 0x000f)

/************************************************************************/
/* Tags for p96OpenScreenTagList
 */

#define P96SA_Dummy						(TAG_USER + 0x20000 + 96)
#define P96SA_Left						(P96SA_Dummy + 0x0001)
#define P96SA_Top							(P96SA_Dummy + 0x0002)
#define P96SA_Width						(P96SA_Dummy + 0x0003)
#define P96SA_Height						(P96SA_Dummy + 0x0004)
#define P96SA_Depth						(P96SA_Dummy + 0x0005)
#define P96SA_DetailPen					(P96SA_Dummy + 0x0006)
#define P96SA_BlockPen					(P96SA_Dummy + 0x0007)
#define P96SA_Title						(P96SA_Dummy + 0x0008)
#define P96SA_Colors						(P96SA_Dummy + 0x0009)
#define P96SA_ErrorCode					(P96SA_Dummy + 0x000a)
#define P96SA_Font						(P96SA_Dummy + 0x000b)
#define P96SA_SysFont					(P96SA_Dummy + 0x000c)
#define P96SA_Type						(P96SA_Dummy + 0x000d)
#define P96SA_BitMap						(P96SA_Dummy + 0x000e)
#define P96SA_PubName					(P96SA_Dummy + 0x000f)
#define P96SA_PubSig						(P96SA_Dummy + 0x0010)
#define P96SA_PubTask					(P96SA_Dummy + 0x0011)
#define P96SA_DisplayID					(P96SA_Dummy + 0x0012)
#define P96SA_DClip						(P96SA_Dummy + 0x0013)
#define P96SA_ShowTitle					(P96SA_Dummy + 0x0014)
#define P96SA_Behind						(P96SA_Dummy + 0x0015)
#define P96SA_Quiet						(P96SA_Dummy + 0x0016)
#define P96SA_AutoScroll				(P96SA_Dummy + 0x0017)
#define P96SA_Pens						(P96SA_Dummy + 0x0018)
#define P96SA_SharePens					(P96SA_Dummy + 0x0019)
#define P96SA_BackFill					(P96SA_Dummy + 0x001a)
#define P96SA_Colors32					(P96SA_Dummy + 0x001b)
#define P96SA_VideoControl				(P96SA_Dummy + 0x001c)
#define P96SA_RGBFormat					(P96SA_Dummy + 0x001d)
#define P96SA_NoSprite					(P96SA_Dummy + 0x001e)
#define P96SA_NoMemory					(P96SA_Dummy + 0x001f)
#define P96SA_RenderFunc				(P96SA_Dummy + 0x0020)
#define P96SA_SaveFunc					(P96SA_Dummy + 0x0021)
#define P96SA_UserData					(P96SA_Dummy + 0x0022)
#define P96SA_Alignment					(P96SA_Dummy + 0x0023)
#define P96SA_FixedScreen				(P96SA_Dummy + 0x0024)
#define P96SA_Exclusive					(P96SA_Dummy + 0x0025)

/************************************************************************/
/* 
 */

#define	MODENAMELENGTH	48

struct P96Mode {
	struct Node	Node;
	char			Description[MODENAMELENGTH];
	UWORD			Width;
	UWORD			Height;
	UWORD			Depth;
	ULONG			DisplayID;
};

/************************************************************************/
/* Structure to describe graphics data
 */

struct RenderInfo {
	APTR			Memory;
	WORD			BytesPerRow;
	WORD			pad;
	RGBFTYPE		RGBFormat;
};

/************************************************************************/
/* Structure for p96WriteTrueColorData() and p96ReadTrueColorData()
 */

struct TrueColorInfo {
	ULONG	PixelDistance, BytesPerRow;
	UBYTE	*RedData, *GreenData, *BlueData;
};

/************************************************************************/
/* Tags for PIPs
 */

#define P96PIP_Dummy				(TAG_USER + 0x30000 + 96)
#define P96PIP_SourceFormat	(P96PIP_Dummy+1)	/* RGBFTYPE (I) */
#define P96PIP_SourceBitMap	(P96PIP_Dummy+2)	/* struct BitMap * (G) */
#define P96PIP_SourceRPort		(P96PIP_Dummy+3)	/* struct RastPort * (G) */
#define P96PIP_SourceWidth		(P96PIP_Dummy+4)	/* ULONG (I) */
#define P96PIP_SourceHeight	(P96PIP_Dummy+5)	/* ULONG (I) */

/************************************************************************/
#endif
/************************************************************************/
