summaryrefslogtreecommitdiff
path: root/src/c_fl_bitmap.cpp
blob: 6a38b1eb97ece2632f9fb742c417d392feaec507 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46


#include <FL/Fl_Bitmap.H>
#include "c_fl_bitmap.h"




BITMAP new_fl_bitmap(void *data, int w, int h) {
    Fl_Bitmap *b = new Fl_Bitmap(reinterpret_cast<uchar*>(data), w, h);
    return b;
}

void free_fl_bitmap(BITMAP b) {
    delete reinterpret_cast<Fl_Bitmap*>(b);
}

BITMAP fl_bitmap_copy(BITMAP b, int w, int h) {
    //  virtual so disable dispatch
    return reinterpret_cast<Fl_Bitmap*>(b)->Fl_Bitmap::copy(w, h);
}

BITMAP fl_bitmap_copy2(BITMAP b) {
    return reinterpret_cast<Fl_Bitmap*>(b)->copy();
}




void fl_bitmap_uncache(BITMAP b) {
    // virtual so disable dispatch
    reinterpret_cast<Fl_Bitmap*>(b)->Fl_Bitmap::uncache();
}




void fl_bitmap_draw2(BITMAP b, int x, int y) {
    reinterpret_cast<Fl_Bitmap*>(b)->draw(x, y);
}

void fl_bitmap_draw(BITMAP b, int x, int y, int w, int h, int cx, int cy) {
    // virtual so disable dispatch
    reinterpret_cast<Fl_Bitmap*>(b)->Fl_Bitmap::draw(x, y, w, h, cx, cy);
}