Initial import of Scalos. To decrease size I have
[AROS-Contrib.git] / scalos / include / inline / scalosgfx.h
blobe7da64d68c4cb83dbbc19a3a778a98dbe11a02f4
1 #ifndef _INLINE_SCALOSGFX_H
2 #define _INLINE_SCALOSGFX_H
4 #ifndef CLIB_SCALOSGFX_PROTOS_H
5 #define CLIB_SCALOSGFX_PROTOS_H
6 #endif
8 #ifndef __INLINE_MACROS_H
9 #include <inline/macros.h>
10 #endif
12 #ifndef INTUITION_CLASSUSR_H
13 #include <intuition/classusr.h>
14 #endif
15 #ifndef SCALOS_SCALOS_H
16 #include <scalos/scalos.h>
17 #endif
18 #ifndef GRAPHICS_GFX_H
19 #include <graphics/gfx.h>
20 #endif
21 #ifndef SCALOS_SCALOSGFX_H
22 #include <scalos/scalosgfx.h>
23 #endif
25 #ifndef SCALOSGFX_BASE_NAME
26 #define SCALOSGFX_BASE_NAME ScalosGfxBase
27 #endif
29 #define ScalosGfxCreateEmptySAC() \
30 LP0(0x1e, struct ScalosBitMapAndColor *, ScalosGfxCreateEmptySAC, \
31 , SCALOSGFX_BASE_NAME)
33 #define ScalosGfxCreateSAC(width, height, depth, friendBM, tagList) \
34 LP5(0x24, struct ScalosBitMapAndColor *, ScalosGfxCreateSAC, ULONG, width, d0, ULONG, height, d1, ULONG, depth, d2, struct BitMap *, friendBM, a0, struct TagItem *, tagList, a1, \
35 , SCALOSGFX_BASE_NAME)
37 #ifndef NO_INLINE_STDARG
38 #define ScalosGfxCreateSACTags(width, height, depth, friendBM, tags...) \
39 ({ULONG _tags[] = {tags}; ScalosGfxCreateSAC((width), (height), (depth), (friendBM), (struct TagItem *) _tags);})
40 #endif
42 #define ScalosGfxFreeSAC(sac) \
43 LP1NR(0x2a, ScalosGfxFreeSAC, struct ScalosBitMapAndColor *, sac, a0, \
44 , SCALOSGFX_BASE_NAME)
46 #define ScalosGfxCreateARGB(width, height, tagList) \
47 LP3(0x30, struct gfxARGB *, ScalosGfxCreateARGB, ULONG, width, d0, ULONG, height, d1, struct TagItem *, tagList, a0, \
48 , SCALOSGFX_BASE_NAME)
50 #ifndef NO_INLINE_STDARG
51 #define ScalosGfxCreateARGBTags(width, height, tags...) \
52 ({ULONG _tags[] = {tags}; ScalosGfxCreateARGB((width), (height), (struct TagItem *) _tags);})
53 #endif
55 #define ScalosGfxFreeARGB(argb) \
56 LP1NR(0x36, ScalosGfxFreeARGB, struct gfxARGB **, argb, a0, \
57 , SCALOSGFX_BASE_NAME)
59 #define ScalosGfxARGBSetAlpha(src, alpha) \
60 LP2NR(0x3c, ScalosGfxARGBSetAlpha, struct ARGBHeader *, src, a0, ULONG, alpha, d0, \
61 , SCALOSGFX_BASE_NAME)
63 #define ScalosGfxARGBSetAlphaMask(argbh, maskPlane) \
64 LP2NR(0x42, ScalosGfxARGBSetAlphaMask, struct ARGBHeader *, argbh, a0, PLANEPTR, maskPlane, a1, \
65 , SCALOSGFX_BASE_NAME)
67 #define ScalosGfxCreateARGBFromBitMap(bm, width, height, numberOfColors, colorTable, maskPlane) \
68 LP6(0x48, struct gfxARGB *, ScalosGfxCreateARGBFromBitMap, struct BitMap *, bm, a0, ULONG, width, d0, ULONG, height, d1, ULONG, numberOfColors, d2, const ULONG *, colorTable, a1, PLANEPTR, maskPlane, a2, \
69 , SCALOSGFX_BASE_NAME)
71 #define ScalosGfxFillARGBFromBitMap(argbh, srcBM, maskPlane) \
72 LP3NR(0x4e, ScalosGfxFillARGBFromBitMap, struct ARGBHeader *, argbh, a0, struct BitMap *, srcBM, a1, PLANEPTR, maskPlane, a2, \
73 , SCALOSGFX_BASE_NAME)
75 #define ScalosGfxWriteARGBToBitMap(argbh, bm, numberOfColors, colorTable) \
76 LP4NR(0x54, ScalosGfxWriteARGBToBitMap, struct ARGBHeader *, argbh, a0, struct BitMap *, bm, a1, ULONG, numberOfColors, d0, const ULONG *, colorTable, a2, \
77 , SCALOSGFX_BASE_NAME)
79 #define ScalosGfxMedianCut(argbh, depth, tagList) \
80 LP3(0x5a, struct ScalosBitMapAndColor *, ScalosGfxMedianCut, struct ARGBHeader *, argbh, a0, ULONG, depth, d0, struct TagItem *, tagList, a1, \
81 , SCALOSGFX_BASE_NAME)
83 #ifndef NO_INLINE_STDARG
84 #define ScalosGfxMedianCutTags(argbh, depth, tags...) \
85 ({ULONG _tags[] = {tags}; ScalosGfxMedianCut((argbh), (depth), (struct TagItem *) _tags);})
86 #endif
88 #define ScalosGfxScaleARGBArray(src, destWidth, destHeight, tagList) \
89 LP4(0x60, struct gfxARGB *, ScalosGfxScaleARGBArray, const struct ARGBHeader *, src, a0, ULONG *, destWidth, a1, ULONG *, destHeight, a2, struct TagItem *, tagList, a3, \
90 , SCALOSGFX_BASE_NAME)
92 #ifndef NO_INLINE_STDARG
93 #define ScalosGfxScaleARGBArrayTags(src, destWidth, destHeight, tags...) \
94 ({ULONG _tags[] = {tags}; ScalosGfxScaleARGBArray((src), (destWidth), (destHeight), (struct TagItem *) _tags);})
95 #endif
97 #define ScalosGfxScaleBitMap(sbma, tagList) \
98 LP2(0x66, struct BitMap *, ScalosGfxScaleBitMap, struct ScaleBitMapArg *, sbma, a0, struct TagItem *, tagList, a1, \
99 , SCALOSGFX_BASE_NAME)
101 #ifndef NO_INLINE_STDARG
102 #define ScalosGfxScaleBitMapTags(sbma, tags...) \
103 ({ULONG _tags[] = {tags}; ScalosGfxScaleBitMap((sbma), (struct TagItem *) _tags);})
104 #endif
106 #define ScalosGfxCalculateScaleAspect(sourceWidth, sourceHeight, destWidth, destHeight) \
107 LP4NR(0x6c, ScalosGfxCalculateScaleAspect, ULONG, sourceWidth, d0, ULONG, sourceHeight, d1, ULONG *, destWidth, a0, ULONG *, destHeight, a1, \
108 , SCALOSGFX_BASE_NAME)
110 #define ScalosGfxBlitARGB(destARGB, srcARGB, destLeft, destTop, srcLeft, srcTop, width, height) \
111 LP8NR(0x72, ScalosGfxBlitARGB, struct ARGBHeader *, destARGB, a0, const struct ARGBHeader *, srcARGB, a1, LONG, destLeft, d0, LONG, destTop, d1, LONG, srcLeft, d2, LONG, srcTop, d3, LONG, width, d4, LONG, height, d5, \
112 , SCALOSGFX_BASE_NAME)
114 #define ScalosGfxFillRectARGB(destARGB, fillARGB, left, top, width, height) \
115 LP6NR(0x78, ScalosGfxFillRectARGB, struct ARGBHeader *, destARGB, a0, const struct gfxARGB *, fillARGB, a1, LONG, left, d0, LONG, top, d1, LONG, width, d2, LONG, height, d3, \
116 , SCALOSGFX_BASE_NAME)
118 #define ScalosGfxSetARGB(destARGB, fillARGB) \
119 LP2NR(0x7e, ScalosGfxSetARGB, struct ARGBHeader *, destARGB, a0, const struct gfxARGB *, fillARGB, a1, \
120 , SCALOSGFX_BASE_NAME)
122 #define ScalosGfxNewColorMap(sac, colorMap, colorEntries) \
123 LP3(0x84, BOOL, ScalosGfxNewColorMap, struct ScalosBitMapAndColor *, sac, a0, const ULONG *, colorMap, a1, ULONG, colorEntries, d0, \
124 , SCALOSGFX_BASE_NAME)
126 #define ScalosGfxARGBRectMult(rp, numerator, denominator, xMin, yMin, xMax, yMax) \
127 LP7NR(0x8a, ScalosGfxARGBRectMult, struct RastPort *, rp, a0, const struct gfxARGB *, numerator, a1, const struct gfxARGB *, denominator, a2, LONG, xMin, d0, LONG, yMin, d1, LONG, xMax, d2, LONG, yMax, d3, \
128 , SCALOSGFX_BASE_NAME)
130 #define ScalosGfxBlitARGBAlpha(rp, srcH, destLeft, destTop, srcLeft, srcTop, width, height) \
131 LP8NR(0x90, ScalosGfxBlitARGBAlpha, struct RastPort *, rp, a0, const struct ARGBHeader *, srcH, a1, ULONG, destLeft, d0, ULONG, destTop, d1, ULONG, srcLeft, d2, ULONG, srcTop, d3, ULONG, width, d4, ULONG, height, d5, \
132 , SCALOSGFX_BASE_NAME)
134 #define ScalosGfxBlitARGBAlphaTagList(rp, srcH, destLeft, destTop, srcSize, tagList) \
135 LP6NR(0x96, ScalosGfxBlitARGBAlphaTagList, struct RastPort *, rp, a0, const struct ARGBHeader *, srcH, a1, ULONG, destLeft, d0, ULONG, destTop, d1, const struct IBox *, srcSize, a3, struct TagItem *, tagList, a2, \
136 , SCALOSGFX_BASE_NAME)
138 #ifndef NO_INLINE_STDARG
139 #define ScalosGfxBlitARGBAlphaTags(rp, srcH, destLeft, destTop, srcSize, tags...) \
140 ({ULONG _tags[] = {tags}; ScalosGfxBlitARGBAlphaTagList((rp), (srcH), (destLeft), (destTop), (srcSize), (struct TagItem *) _tags);})
141 #endif
143 #define ScalosGfxBlitIcon(rpBackground, rpIcon, left, top, width, height, tagList) \
144 LP7NR(0x9c, ScalosGfxBlitIcon, struct RastPort *, rpBackground, a0, struct RastPort *, rpIcon, a1, ULONG, left, d0, ULONG, top, d1, ULONG, width, d2, ULONG, height, d3, struct TagItem *, tagList, a2, \
145 , SCALOSGFX_BASE_NAME)
147 #ifndef NO_INLINE_STDARG
148 #define ScalosGfxBlitIconTags(rpBackground, rpIcon, left, top, width, height, tags...) \
149 ({ULONG _tags[] = {tags}; ScalosGfxBlitIcon((rpBackground), (rpIcon), (left), (top), (width), (height), (struct TagItem *) _tags);})
150 #endif
152 #define ScalosGfxDrawGradient(dest, left, top, width, height, start, stop, gradType) \
153 LP8(0xa2, BOOL, ScalosGfxDrawGradient, struct ARGBHeader *, dest, a0, LONG, left, d0, LONG, top, d1, LONG, width, d2, LONG, height, d3, struct gfxARGB *, start, a1, struct gfxARGB *, stop, a2, ULONG, gradType, d4, \
154 , SCALOSGFX_BASE_NAME)
156 #define ScalosGfxDrawGradientRastPort(rp, left, top, width, height, start, stop, gradType) \
157 LP8(0xa8, BOOL, ScalosGfxDrawGradientRastPort, struct RastPort *, rp, a0, LONG, left, d0, LONG, top, d1, LONG, width, d2, LONG, height, d3, struct gfxARGB *, start, a1, struct gfxARGB *, stop, a2, ULONG, gradType, d4, \
158 , SCALOSGFX_BASE_NAME)
160 #define ScalosGfxDrawLine(dest, fromX, fromY, toX, toY, lineColor) \
161 LP6NR(0xae, ScalosGfxDrawLine, struct ARGBHeader *, dest, a0, LONG, fromX, d0, LONG, fromY, d1, LONG, toX, d2, LONG, toY, d3, const struct gfxARGB *, lineColor, a1, \
162 , SCALOSGFX_BASE_NAME)
164 #define ScalosGfxDrawLineRastPort(rp, fromX, fromY, toX, toY, lineColor) \
165 LP6NR(0xb4, ScalosGfxDrawLineRastPort, struct RastPort *, rp, a0, LONG, fromX, d0, LONG, fromY, d1, LONG, toX, d2, LONG, toY, d3, const struct gfxARGB *, lineColor, a1, \
166 , SCALOSGFX_BASE_NAME)
168 #define ScalosGfxDrawEllipse(dest, xCenter, yCenter, radiusX, radiusy, segment, color1, color2) \
169 LP8NR(0xba, ScalosGfxDrawEllipse, struct ARGBHeader *, dest, a0, LONG, xCenter, d0, LONG, yCenter, d1, LONG, radiusX, d2, LONG, radiusy, d3, LONG, segment, d4, const struct gfxARGB *, color1, a1, const struct gfxARGB *, color2, a2, \
170 , SCALOSGFX_BASE_NAME)
172 #define ScalosGfxDrawEllipseRastPort(rp, xCenter, yCenter, radiusX, radiusy, segment, color1, color2) \
173 LP8NR(0xc0, ScalosGfxDrawEllipseRastPort, struct RastPort *, rp, a0, LONG, xCenter, d0, LONG, yCenter, d1, LONG, radiusX, d2, LONG, radiusy, d3, LONG, segment, d4, const struct gfxARGB *, color1, a1, const struct gfxARGB *, color2, a2, \
174 , SCALOSGFX_BASE_NAME)
176 #endif /* _INLINE_SCALOSGFX_H */