2 Copyright © 1995-2015, The AROS Development Team. All rights reserved.
6 #ifndef CYBERGRAPHICS_INTERN_H
7 #define CYBERGRAPHICS_INTERN_H
9 #ifndef EXEC_LIBRARIES_H
10 # include <exec/libraries.h>
14 # include <exec/lists.h>
18 # include <dos/bptr.h>
21 #ifndef AROS_LIBCALL_H
22 # include <aros/libcall.h>
25 #ifndef GRAPHICS_RASTPORT_H
26 # include <graphics/rastport.h>
29 #ifndef UTILITY_TAGITEM_H
30 # include <utility/tagitem.h>
33 #ifndef GRAPHICS_VIEW_H
34 # include <graphics/view.h>
37 #ifndef PROTO_GRAPHICS_H
38 # include <proto/graphics.h>
45 struct Library libnode
;
47 struct SignalSemaphore pixbuf_sema
;
50 OOP_AttrBase hiddBitMapAttrBase
;
51 OOP_AttrBase hiddGCAttrBase
;
52 OOP_AttrBase hiddSyncAttrBase
;
53 OOP_AttrBase hiddPixFmtAttrBase
;
54 OOP_AttrBase hiddGfxAttrBase
;
56 /* baseclasses for CreateObject */
60 /* Grayscale palette for RECTFMT_GREY8 */
64 #define GetCGFXBase(base) ((struct IntCGFXBase *)base)
66 #define __IHidd_BitMap GetCGFXBase(CyberGfxBase)->hiddBitMapAttrBase
67 #define __IHidd_GC GetCGFXBase(CyberGfxBase)->hiddGCAttrBase
68 #define __IHidd_Sync GetCGFXBase(CyberGfxBase)->hiddSyncAttrBase
69 #define __IHidd_PixFmt GetCGFXBase(CyberGfxBase)->hiddPixFmtAttrBase
70 #define __IHidd_Gfx GetCGFXBase(CyberGfxBase)->hiddGfxAttrBase
72 /* Pixelbuffer, the same as in graphics.library */
74 #define NUMPIX 4096 /* Not that much room to spare */
79 #define PIXELBUF_SIZE (NUMPIX * 4)
81 #define LOCK_PIXBUF ObtainSemaphore(&CyberGfxBase->pixbuf_sema);
82 #define ULOCK_PIXBUF ReleaseSemaphore(&CyberGfxBase->pixbuf_sema);
84 /* Bitmap processing */
86 #define XCOORD_TO_BYTEIDX( x ) (( x ) >> 3)
88 #define COORD_TO_BYTEIDX(x, y, bytes_per_row) \
89 ( ( ((LONG)(y)) * (bytes_per_row)) + XCOORD_TO_BYTEIDX(x))
91 #define CHUNKY8_COORD_TO_BYTEIDX(x, y, bytes_per_row) \
92 ( ( ((LONG)(y)) * (bytes_per_row)) + (x) )
94 #define XCOORD_TO_MASK(x) (128L >> ((x) & 0x07))
96 #endif /* CYBERGRAPHICS_INTERN_H */