1 /* Picasso96.h -- include File
2 * (C) Copyright 1996-98 Alexander Kneer & Tobias Abt
5 /************************************************************************/
6 #ifndef LIBRARIES_PICASSO96_H
7 #define LIBRARIES_PICASSO96_H
8 /************************************************************************/
12 #include <exec/types.h>
16 #include <exec/nodes.h>
19 #ifndef UTILITY_TAGITEM_H
20 #include <utility/tagitem.h>
23 /************************************************************************/
24 /* This is the name of the library
26 #define P96NAME "Picasso96API.library"
28 /************************************************************************/
29 /* Types for RGBFormat used
32 RGBFB_NONE
, /* no valid RGB format (should not happen) */
33 RGBFB_CLUT
, /* palette mode, set colors when opening screen using
34 tags or use SetRGB32/LoadRGB32(...) */
35 RGBFB_R8G8B8
, /* TrueColor RGB (8 bit each) */
36 RGBFB_B8G8R8
, /* TrueColor BGR (8 bit each) */
37 RGBFB_R5G6B5PC
, /* HiColor16 (5 bit R, 6 bit G, 5 bit B),
38 format: gggbbbbbrrrrrggg */
39 RGBFB_R5G5B5PC
, /* HiColor15 (5 bit each), format: gggbbbbb0rrrrrgg */
40 RGBFB_A8R8G8B8
, /* 4 Byte TrueColor ARGB (A unused alpha channel) */
41 RGBFB_A8B8G8R8
, /* 4 Byte TrueColor ABGR (A unused alpha channel) */
42 RGBFB_R8G8B8A8
, /* 4 Byte TrueColor RGBA (A unused alpha channel) */
43 RGBFB_B8G8R8A8
, /* 4 Byte TrueColor BGRA (A unused alpha channel) */
44 RGBFB_R5G6B5
, /* HiColor16 (5 bit R, 6 bit G, 5 bit B),
45 format: rrrrrggggggbbbbb */
46 RGBFB_R5G5B5
, /* HiColor15 (5 bit each), format: 0rrrrrgggggbbbbb */
47 RGBFB_B5G6R5PC
, /* HiColor16 (5 bit R, 6 bit G, 5 bit B),
48 format: gggrrrrrbbbbbggg */
49 RGBFB_B5G5R5PC
, /* HiColor15 (5 bit each), format: gggrrrrr0bbbbbbgg */
51 /* By now, the following formats are for use with a hardware window only
52 (bitmap operations may be implemented incompletely) */
54 RGBFB_Y4U2V2
, /* 2 Byte TrueColor YUV (CCIR recommendation CCIR601).
55 Each two-pixel unit is stored as one longword
56 containing luminance (Y) for each of the two pixels,
57 and chrominance (U,V) for alternate pixels.
58 The missing chrominance values are generated by
59 interpolation. (Y1-U0-Y0-V0) */
60 RGBFB_Y4U1V1
, /* 1 Byte TrueColor ACCUPAK. Four adjacent pixels form
61 a packet of 5 bits Y (luminance) each pixel and 6 bits
62 U and V (chrominance) shared by the four pixels */
67 #define RGBFF_NONE (1<<RGBFB_NONE)
68 #define RGBFF_CLUT (1<<RGBFB_CLUT)
69 #define RGBFF_R8G8B8 (1<<RGBFB_R8G8B8)
70 #define RGBFF_B8G8R8 (1<<RGBFB_B8G8R8)
71 #define RGBFF_R5G6B5PC (1<<RGBFB_R5G6B5PC)
72 #define RGBFF_R5G5B5PC (1<<RGBFB_R5G5B5PC)
73 #define RGBFF_A8R8G8B8 (1<<RGBFB_A8R8G8B8)
74 #define RGBFF_A8B8G8R8 (1<<RGBFB_A8B8G8R8)
75 #define RGBFF_R8G8B8A8 (1<<RGBFB_R8G8B8A8)
76 #define RGBFF_B8G8R8A8 (1<<RGBFB_B8G8R8A8)
77 #define RGBFF_R5G6B5 (1<<RGBFB_R5G6B5)
78 #define RGBFF_R5G5B5 (1<<RGBFB_R5G5B5)
79 #define RGBFF_B5G6R5PC (1<<RGBFB_B5G6R5PC)
80 #define RGBFF_B5G5R5PC (1<<RGBFB_B5G5R5PC)
81 #define RGBFF_Y4U2V2 (1<<RGBFB_Y4U2V2)
82 #define RGBFF_Y4U1V1 (1<<RGBFB_Y4U1V1)
84 #define RGBFF_HICOLOR (RGBFF_R5G6B5PC|RGBFF_R5G5B5PC|RGBFF_R5G6B5|RGBFF_R5G5B5|RGBFF_B5G6R5PC|RGBFF_B5G5R5PC)
85 #define RGBFF_TRUECOLOR (RGBFF_R8G8B8|RGBFF_B8G8R8)
86 #define RGBFF_TRUEALPHA (RGBFF_A8R8G8B8|RGBFF_A8B8G8R8|RGBFF_R8G8B8A8|RGBFF_B8G8R8A8)
88 /************************************************************************/
89 /* Flags for p96AllocBitMap
91 #define BMF_USERPRIVATE (0x8000) /* private user bitmap that will never
92 be put to a board, but may be used as a temporary render buffer and accessed
93 with OS blit functions, too. Bitmaps allocated with this flag do not need to
96 /************************************************************************/
97 /* Attributes for p96GetBitMapAttr
105 P96BMA_BYTESPERPIXEL
,
112 P96BMA_BOARDMEMIOBASE
115 /************************************************************************/
116 /* Attributes for p96GetModeIDAttr
122 P96IDA_BYTESPERPIXEL
,
127 P96IDA_STDBYTESPERROW
,
129 P96IDA_COMPATIBLEFORMATS
,
130 P96IDA_VIDEOCOMPATIBLE
,
131 P96IDA_PABLOIVCOMPATIBLE
,
132 P96IDA_PALOMAIVCOMPATIBLE
135 /************************************************************************/
136 /* Tags for p96BestModeIDTagList
138 #define P96BIDTAG_Dummy (TAG_USER + 96)
140 #define P96BIDTAG_FormatsAllowed (P96BIDTAG_Dummy + 0x0001)
141 #define P96BIDTAG_FormatsForbidden (P96BIDTAG_Dummy + 0x0002)
142 #define P96BIDTAG_NominalWidth (P96BIDTAG_Dummy + 0x0003)
143 #define P96BIDTAG_NominalHeight (P96BIDTAG_Dummy + 0x0004)
144 #define P96BIDTAG_Depth (P96BIDTAG_Dummy + 0x0005)
145 #define P96BIDTAG_VideoCompatible (P96BIDTAG_Dummy + 0x0006)
146 #define P96BIDTAG_PabloIVCompatible (P96BIDTAG_Dummy + 0x0007)
147 #define P96BIDTAG_PalomaIVCompatible (P96BIDTAG_Dummy + 0x0008)
149 /************************************************************************/
150 /* Tags for p96RequestModeIDTagList
153 #define P96MA_Dummy (TAG_USER + 0x10000 + 96)
155 #define P96MA_MinWidth (P96MA_Dummy + 0x0001)
156 #define P96MA_MinHeight (P96MA_Dummy + 0x0002)
157 #define P96MA_MinDepth (P96MA_Dummy + 0x0003)
158 #define P96MA_MaxWidth (P96MA_Dummy + 0x0004)
159 #define P96MA_MaxHeight (P96MA_Dummy + 0x0005)
160 #define P96MA_MaxDepth (P96MA_Dummy + 0x0006)
161 #define P96MA_DisplayID (P96MA_Dummy + 0x0007)
162 #define P96MA_FormatsAllowed (P96MA_Dummy + 0x0008)
163 #define P96MA_FormatsForbidden (P96MA_Dummy + 0x0009)
164 #define P96MA_WindowTitle (P96MA_Dummy + 0x000a)
165 #define P96MA_OKText (P96MA_Dummy + 0x000b)
166 #define P96MA_CancelText (P96MA_Dummy + 0x000c)
167 #define P96MA_Window (P96MA_Dummy + 0x000d)
168 #define P96MA_PubScreenName (P96MA_Dummy + 0x000e)
169 #define P96MA_Screen (P96MA_Dummy + 0x000f)
170 #define P96MA_VideoCompatible (P96MA_Dummy + 0x0010)
171 #define P96MA_PabloIVCompatible (P96MA_Dummy + 0x0011)
172 #define P96MA_PalomaIVCompatible (P96MA_Dummy + 0x0012)
174 /************************************************************************/
175 /* Tags for p96OpenScreenTagList
178 #define P96SA_Dummy (TAG_USER + 0x20000 + 96)
179 #define P96SA_Left (P96SA_Dummy + 0x0001)
180 #define P96SA_Top (P96SA_Dummy + 0x0002)
181 #define P96SA_Width (P96SA_Dummy + 0x0003)
182 #define P96SA_Height (P96SA_Dummy + 0x0004)
183 #define P96SA_Depth (P96SA_Dummy + 0x0005)
184 #define P96SA_DetailPen (P96SA_Dummy + 0x0006)
185 #define P96SA_BlockPen (P96SA_Dummy + 0x0007)
186 #define P96SA_Title (P96SA_Dummy + 0x0008)
187 #define P96SA_Colors (P96SA_Dummy + 0x0009)
188 #define P96SA_ErrorCode (P96SA_Dummy + 0x000a)
189 #define P96SA_Font (P96SA_Dummy + 0x000b)
190 #define P96SA_SysFont (P96SA_Dummy + 0x000c)
191 #define P96SA_Type (P96SA_Dummy + 0x000d)
192 #define P96SA_BitMap (P96SA_Dummy + 0x000e)
193 #define P96SA_PubName (P96SA_Dummy + 0x000f)
194 #define P96SA_PubSig (P96SA_Dummy + 0x0010)
195 #define P96SA_PubTask (P96SA_Dummy + 0x0011)
196 #define P96SA_DisplayID (P96SA_Dummy + 0x0012)
197 #define P96SA_DClip (P96SA_Dummy + 0x0013)
198 #define P96SA_ShowTitle (P96SA_Dummy + 0x0014)
199 #define P96SA_Behind (P96SA_Dummy + 0x0015)
200 #define P96SA_Quiet (P96SA_Dummy + 0x0016)
201 #define P96SA_AutoScroll (P96SA_Dummy + 0x0017)
202 #define P96SA_Pens (P96SA_Dummy + 0x0018)
203 #define P96SA_SharePens (P96SA_Dummy + 0x0019)
204 #define P96SA_BackFill (P96SA_Dummy + 0x001a)
205 #define P96SA_Colors32 (P96SA_Dummy + 0x001b)
206 #define P96SA_VideoControl (P96SA_Dummy + 0x001c)
207 #define P96SA_RGBFormat (P96SA_Dummy + 0x001d)
208 #define P96SA_NoSprite (P96SA_Dummy + 0x001e)
209 #define P96SA_NoMemory (P96SA_Dummy + 0x001f)
210 #define P96SA_RenderFunc (P96SA_Dummy + 0x0020)
211 #define P96SA_SaveFunc (P96SA_Dummy + 0x0021)
212 #define P96SA_UserData (P96SA_Dummy + 0x0022)
213 #define P96SA_Alignment (P96SA_Dummy + 0x0023)
214 #define P96SA_FixedScreen (P96SA_Dummy + 0x0024)
215 #define P96SA_Exclusive (P96SA_Dummy + 0x0025)
216 #define P96SA_ConstantBytesPerRow (P96SA_Dummy + 0x0026)
218 /************************************************************************/
222 #define MODENAMELENGTH 48
226 char Description
[MODENAMELENGTH
];
233 /************************************************************************/
234 /* Structure to describe graphics data
236 * short description of the entries:
237 * Memory: pointer to graphics data
238 * BytesPerRow: distance in bytes between one pixel and its neighbour up
240 * pad: private, not used.
241 * RGBFormat: RGBFormat of the data.
251 /************************************************************************/
252 /* Structure for p96WriteTrueColorData() and p96ReadTrueColorData()
254 * short description of the entries:
255 * PixelDistance: distance in bytes between the red (must be the same as
256 * for the green or blue) component of one pixel and its
257 * next neighbour to the left or right.
258 * BytesPerRow: distance in bytes between the red (must be the same as
259 * for the green or blue) component of one pixel and its
260 * next neighbour up or down.
261 * RedData: pointer to the red component of the upper left pixel.
262 * GreenData, BlueData: the same as above.
264 * examples (for an array width of 640 pixels):
265 * a) separate arrays for each color:
266 * { 1, 640, red, green, blue };
267 * b) plain 24 bit RGB data:
268 * { 3, 640*3, array, array+1, array+2 };
269 * c) 24 bit data, arranged as ARGB:
270 * { 4, 640*4, array+1, array+2, array+3 };
273 struct TrueColorInfo
{
274 ULONG PixelDistance
, BytesPerRow
;
275 UBYTE
*RedData
, *GreenData
, *BlueData
;
278 /************************************************************************/
282 #define P96PIP_Dummy (TAG_USER + 0x30000 + 96)
283 #define P96PIP_SourceFormat (P96PIP_Dummy+1) /* RGBFTYPE (I) */
284 #define P96PIP_SourceBitMap (P96PIP_Dummy+2) /* struct BitMap * (G) */
285 #define P96PIP_SourceRPort (P96PIP_Dummy+3) /* struct RastPort * (G) */
286 #define P96PIP_SourceWidth (P96PIP_Dummy+4) /* ULONG (I) */
287 #define P96PIP_SourceHeight (P96PIP_Dummy+5) /* ULONG (I) */
288 #define P96PIP_Type (P96PIP_Dummy+6) /* ULONG (I) default: PIPT_MemoryWindow */
289 #define P96PIP_ErrorCode (P96PIP_Dummy+7) /* LONG* (I) */
290 #define P96PIP_Brightness (P96PIP_Dummy+8) /* ULONG (IGS) default: 0 */
291 #define P96PIP_Left (P96PIP_Dummy+9) /* ULONG (I) default: 0 */
292 #define P96PIP_Top (P96PIP_Dummy+10) /* ULONG (I) default: 0 */
293 #define P96PIP_Width (P96PIP_Dummy+11) /* ULONG (I) default: inner width of window */
294 #define P96PIP_Height (P96PIP_Dummy+12) /* ULONG (I) default: inner height of window */
295 #define P96PIP_Relativity (P96PIP_Dummy+13) /* ULONG (I) default: PIPRel_Width|PIPRel_Height */
296 #define P96PIP_Colors (P96PIP_Dummy+14) /* struct ColorSpec * (IS)
297 * ti_Data is an array of struct ColorSpec,
298 * terminated by ColorIndex = -1. Specifies
299 * initial screen palette colors.
300 * Also see P96PIP_Colors32.
301 * This only works with CLUT PIPs on non-CLUT
302 * screens. For CLUT PIPs on CLUT screens the
303 * PIP colors share the screen palette.
305 #define P96PIP_Colors32 (P96PIP_Dummy+15) /* ULONG* (IS)
306 * Tag to set the palette colors at 32 bits-per-gun.
307 * ti_Data is a pointer * to a table to be passed to
308 * the graphics.library/LoadRGB32() function.
309 * This format supports both runs of color
310 * registers and sparse registers. See the
311 * autodoc for that function for full details.
312 * Any color set here has precedence over
313 * the same register set by P96PIP_Colors.
314 * This only works with CLUT PIPs on non-CLUT
315 * screens. For CLUT PIPs on CLUT screens the
316 * PIP colors share the screen palette.
318 #define P96PIP_NoMemory (P96PIP_Dummy+16)
319 #define P96PIP_RenderFunc (P96PIP_Dummy+17)
320 #define P96PIP_SaveFunc (P96PIP_Dummy+18)
321 #define P96PIP_UserData (P96PIP_Dummy+19)
322 #define P96PIP_Alignment (P96PIP_Dummy+20)
323 #define P96PIP_ConstantBytesPerRow (P96PIP_Dummy+21)
324 #define P96PIP_AllowCropping (P96PIP_Dummy+22)
325 #define P96PIP_InitialIntScaling (P96PIP_Dummy+23)
328 PIPT_MemoryWindow
, /* default */
333 #define P96PIPT_MemoryWindow PIPT_MemoryWindow
334 #define P96PIPT_VideoWindow PIPT_VideoWindow
336 #define PIPRel_Right 1 /* P96PIP_Left is relative to the right side (negative value) */
337 #define PIPRel_Bottom 2 /* P96PIP_Top is relative to the bottom (negative value) */
338 #define PIPRel_Width 4 /* P96PIP_Width is amount of pixels not used by PIP at the
339 right side of the window (negative value) */
340 #define PIPRel_Height 8 /* P96PIP_Height is amount of pixels not used by PIP at the
341 window bottom (negative value) */
343 #define PIPERR_NOMEMORY (1) /* couldn't get normal memory */
344 #define PIPERR_ATTACHFAIL (2) /* Failed to attach to a screen */
345 #define PIPERR_NOTAVAILABLE (3) /* PIP not available for other reason */
346 #define PIPERR_OUTOFPENS (4) /* couldn't get a free pen for occlusion */
347 #define PIPERR_BADDIMENSIONS (5) /* type, width, height or format invalid */
348 #define PIPERR_NOWINDOW (6) /* couldn't open window */
349 #define PIPERR_BADALIGNMENT (7) /* specified alignment is not ok */
350 #define PIPERR_CROPPED (8) /* pip would be cropped, but isn't allowed to */
351 /************************************************************************/
352 /* Tags for P96GetRTGDataTagList
355 #define P96RD_Dummy (TAG_USER + 0x40000 + 96)
356 #define P96RD_NumberOfBoards (P96RD_Dummy+1)
358 /************************************************************************/
359 /* Tags for P96GetBoardDataTagList
362 #define P96BD_Dummy (TAG_USER + 0x50000 + 96)
363 #define P96BD_BoardName (P96BD_Dummy+1)
364 #define P96BD_ChipName (P96BD_Dummy+2)
365 #define P96BD_TotalMemory (P96BD_Dummy+4)
366 #define P96BD_FreeMemory (P96BD_Dummy+5)
367 #define P96BD_LargestFreeMemory (P96BD_Dummy+6)
368 #define P96BD_MonitorSwitch (P96BD_Dummy+7)
369 #define P96BD_RGBFormats (P96BD_Dummy+8)
370 #define P96BD_MemoryClock (P96BD_Dummy+9)
372 /************************************************************************/
374 /************************************************************************/