2 Copyright © 2013-2014, The AROS Development Team. All rights reserved.
6 #include <proto/cybergraphics.h>
8 #include <hidd/graphics.h>
9 #include <cybergraphx/cybergraphics.h>
10 #include <exec/types.h>
12 #include "cybergraphics_intern.h"
15 #include <aros/debug.h>
17 // function is used for both brighen and darken
18 void ProcessPixelArrayBrightnessFunc(struct RastPort
*opRast
, struct Rectangle
*opRect
, LONG value
, struct Library
*CyberGfxBase
)
20 D(bug("[Cgfx] %s(%d)\n", __PRETTY_FUNCTION__
, value
));
24 LONG alpha
, red
, green
, blue
;
26 if (GetBitMapAttr(opRast
->BitMap
, BMA_DEPTH
) < 15)
28 bug("[Cgfx] %s not possible for bitmap depth < 15\n", __PRETTY_FUNCTION__
);
32 for(x
= opRect
->MinX
; x
<= opRect
->MaxX
; x
++)
34 for (y
= opRect
->MinY
; y
<= opRect
->MaxY
; y
++)
36 color
= ReadRGBPixel(opRast
, x
, y
);
38 alpha
= (color
& 0xff);
39 red
= (color
& 0xff00) >> 8;
40 green
= (color
& 0xff0000) >> 16;
41 blue
= (color
& 0xff000000) >> 24;
43 D(bug("[Cgfx] %s x %d y %d old: alpha %d red %d green %d blue %d", __PRETTY_FUNCTION__
, x
, y
, alpha
, red
, green
, blue
));
62 D(bug(" new: alpha %d red %d green %d blue %d\n", alpha
, red
, green
, blue
));
64 color
= alpha
| (red
<< 8) | (green
<< 16) | (blue
<< 24);
66 WriteRGBPixel(opRast
, x
, y
, color
);