Autodoc corrections, additions.
[cake.git] / rom / graphics / getbitmapattr.c
blob2ae6e61db03bc7aaa7d44943aabb28412da87ed6
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Get an attribute from a bitmap.
6 Lang: english
7 */
8 #include "graphics_intern.h"
9 #include "gfxfuncsupport.h"
10 #include <graphics/rastport.h>
12 /*****************************************************************************
14 NAME */
15 #include <exec/types.h>
16 #include <graphics/gfx.h>
17 #include <proto/graphics.h>
19 AROS_LH2(IPTR, GetBitMapAttr,
21 /* SYNOPSIS */
22 AROS_LHA(struct BitMap *, bitmap, A0),
23 AROS_LHA(ULONG , attribute, D1),
25 /* LOCATION */
26 struct GfxBase *, GfxBase, 160, Graphics)
28 /* FUNCTION
29 Returns a specific information about a bitmap. Do not access the
30 bitmap directly!
32 INPUTS
33 bitmap - The BitMap structure to get information about.
34 attribute - Number of the attribute to get. See <graphics/gfx.h> for
35 possible values.
37 RESULT
38 The information you requested. If you asked for an unknown attribute,
39 0 or NULL is returned.
41 NOTES
43 EXAMPLE
45 BUGS
47 SEE ALSO
48 AllocBitMap()
50 INTERNALS
52 HISTORY
53 29-10-95 digulla automatically created from
54 graphics_lib.fd and clib/graphics_protos.h
56 *****************************************************************************/
58 AROS_LIBFUNC_INIT
60 IPTR retval;
62 switch(attribute)
64 case BMA_HEIGHT:
65 retval = (IPTR)bitmap->Rows;
66 break;
68 case BMA_WIDTH:
69 /* must return width in pixel! */
70 retval = (IPTR)(bitmap->BytesPerRow * 8);
71 break;
73 case BMA_DEPTH:
74 if (IS_HIDD_BM(bitmap))
76 retval = (IPTR)HIDD_BM_REALDEPTH(bitmap);
78 else
80 retval = (IPTR)bitmap->Depth;
82 break;
84 case BMA_FLAGS:
85 retval = (IPTR)(bitmap->Flags & (BMF_DISPLAYABLE |
86 BMF_INTERLEAVED |
87 BMF_STANDARD));
88 break;
90 default:
91 retval = 0;
92 break;
95 return retval;
97 AROS_LIBFUNC_EXIT
99 } /* GetBitMapAttr */