grub2: bring back build of aros-side grub2 tools
[AROS.git] / rom / graphics / getrgb4.c
blob79ffdad661d51f31113cbab44c8b6204331ca8e8
1 /*
2 Copyright © 1995-2012, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Graphics function GetRGB4()
6 Lang: english
7 */
8 #include <graphics/view.h>
9 #include "graphics_intern.h"
11 /*****************************************************************************
13 NAME */
14 #include <proto/graphics.h>
16 AROS_LH2(ULONG, GetRGB4,
18 /* SYNOPSIS */
19 AROS_LHA(struct ColorMap *, colormap, A0),
20 AROS_LHA(LONG , entry , D0),
22 /* LOCATION */
23 struct GfxBase *, GfxBase, 97, Graphics)
25 /* FUNCTION
26 Read a value from the ColorMap. Use this function, as the colormap
27 is subject to change.
29 INPUTS
30 colormap - pointer to ColorMap structure
31 entry - index into colormap
33 RESULT
34 -1 : if no valid entry. (index too high)
35 other : UWORD RGB value, 4 bits per electron gun, right justified
37 NOTES
39 EXAMPLE
41 BUGS
43 SEE ALSO
44 GetColorMap(), FreeColorMap(), SetRGB4(), LoadRGB4(), graphics/view.h
46 INTERNALS
47 This function depends on the structure of ColorMap->ColorTable.
49 HISTORY
51 *****************************************************************************/
53 AROS_LIBFUNC_INIT
55 UWORD * CT;
57 /* anything invalid? */
58 if ( (NULL == colormap) || (entry >= colormap->Count) )
59 return -1L;
61 /* All we're currently doing is read the entry and return it. */
62 CT = colormap->ColorTable;
63 return CT[entry];
65 AROS_LIBFUNC_EXIT
67 } /* GetRGB4 */