xref: /haiku/docs/develop/servers/app_server/ServerBitmap.rst (revision a5061ecec55353a5f394759473f1fd6df04890da)
1*a5061eceSAdrien DestuguesServerBitmap class
2*a5061eceSAdrien Destugues##################
3*a5061eceSAdrien Destugues
4*a5061eceSAdrien DestuguesServerBitmaps are the server side counterpart to BBitmap. Note that they
5*a5061eceSAdrien Destuguesare not allocated like other objects - the BitmapManager handles all
6*a5061eceSAdrien Destuguesallocation and deletion tasks.
7*a5061eceSAdrien Destugues
8*a5061eceSAdrien DestuguesMember Functions
9*a5061eceSAdrien Destugues================
10*a5061eceSAdrien Destugues
11*a5061eceSAdrien DestuguesServerBitmap(BRect r, color_space cspace, int32 flags, int32 bytesperrow=-1, screen_id screen=B_MAIN_SCREEN_ID)
12*a5061eceSAdrien Destugues---------------------------------------------------------------------------------------------------------------
13*a5061eceSAdrien Destugues
14*a5061eceSAdrien Destugues1. Call \_HandleSpace()
15*a5061eceSAdrien Destugues2. Call \_HandleFlags()
16*a5061eceSAdrien Destugues3. Initialize remaining data members to parameters or safe values
17*a5061eceSAdrien Destugues
18*a5061eceSAdrien Destugues~ServerBitmap(void)
19*a5061eceSAdrien Destugues-------------------
20*a5061eceSAdrien Destugues
21*a5061eceSAdrien DestuguesEmpty
22*a5061eceSAdrien Destugues
23*a5061eceSAdrien Destuguesuint8 \*Bits(void)
24*a5061eceSAdrien Destugues------------------
25*a5061eceSAdrien Destugues
26*a5061eceSAdrien DestuguesReturns the bitmap's buffer member
27*a5061eceSAdrien Destugues
28*a5061eceSAdrien Destuguesarea_id Area(void)
29*a5061eceSAdrien Destugues------------------
30*a5061eceSAdrien Destugues
31*a5061eceSAdrien DestuguesReturns the bitmap's buffer member.
32*a5061eceSAdrien Destugues
33*a5061eceSAdrien Destuguesuint32 BitsLength(void)
34*a5061eceSAdrien Destugues-----------------------
35*a5061eceSAdrien Destugues
36*a5061eceSAdrien DestuguesReturns bytes_per_row \* height
37*a5061eceSAdrien Destugues
38*a5061eceSAdrien DestuguesBRect Bounds(void)
39*a5061eceSAdrien Destugues------------------
40*a5061eceSAdrien Destugues
41*a5061eceSAdrien Destuguesreturns BRect(width-1,height-1)
42*a5061eceSAdrien Destugues
43*a5061eceSAdrien Destuguesint32 BytesPerRow(void)
44*a5061eceSAdrien Destugues-----------------------
45*a5061eceSAdrien Destugues
46*a5061eceSAdrien Destuguesreturns the bitmap's bytes_per_row member
47*a5061eceSAdrien Destugues
48*a5061eceSAdrien Destuguesvoid _HandleSpace(color_space cs, int32 bytesperline=-1)
49*a5061eceSAdrien Destugues---------------------------------------------------------
50*a5061eceSAdrien Destugues
51*a5061eceSAdrien DestuguesLarge function which essentially consists of a switch() of the available
52*a5061eceSAdrien Destuguescolor spaces and assigns the bits per pixel and bytes per line values
53*a5061eceSAdrien Destuguesbased on the color space. If bytesperline is -1, the default is used,
54*a5061eceSAdrien Destuguesotherwise it uses the specified value.
55*a5061eceSAdrien Destugues
56