diff options
author | Jedidiah Barber <contact@jedbarber.id.au> | 2025-01-21 21:04:54 +1300 |
---|---|---|
committer | Jedidiah Barber <contact@jedbarber.id.au> | 2025-01-21 21:04:54 +1300 |
commit | b4438b2fbe895694be98e6e8426103deefc51448 (patch) | |
tree | 760d86cd7c06420a91dad102cc9546aee73146fc /body/c_fl_rgb_image.cpp | |
parent | a4703a65b015140cd4a7a985db66264875ade734 (diff) |
Split public API and private implementation files into different directories
Diffstat (limited to 'body/c_fl_rgb_image.cpp')
-rw-r--r-- | body/c_fl_rgb_image.cpp | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/body/c_fl_rgb_image.cpp b/body/c_fl_rgb_image.cpp new file mode 100644 index 0000000..65afbf9 --- /dev/null +++ b/body/c_fl_rgb_image.cpp @@ -0,0 +1,78 @@ + + +// Programmed by Jedidiah Barber +// Released into the public domain + + +#include <FL/Fl_RGB_Image.H> +#include <FL/Fl_Pixmap.H> +#include "c_fl_rgb_image.h" + + + + +RGBIMAGE new_fl_rgb_image(void *data, int w, int h, int d, int ld) { + Fl_RGB_Image *rgb = new Fl_RGB_Image(static_cast<uchar*>(data), w, h, d, ld); + return rgb; +} + +RGBIMAGE new_fl_rgb_image2(void *pix, unsigned int c) { + Fl_RGB_Image *rgb = new Fl_RGB_Image(static_cast<Fl_Pixmap*>(pix), c); + return rgb; +} + +void free_fl_rgb_image(RGBIMAGE i) { + delete static_cast<Fl_RGB_Image*>(i); +} + +size_t fl_rgb_image_get_max_size() { + return Fl_RGB_Image::max_size(); +} + +void fl_rgb_image_set_max_size(size_t v) { + Fl_RGB_Image::max_size(v); +} + +RGBIMAGE fl_rgb_image_copy(RGBIMAGE i, int w, int h) { + // virtual so disable dispatch + return static_cast<Fl_RGB_Image*>(i)->Fl_RGB_Image::copy(w, h); +} + +RGBIMAGE fl_rgb_image_copy2(RGBIMAGE i) { + return static_cast<Fl_RGB_Image*>(i)->copy(); +} + + + + +void fl_rgb_image_color_average(RGBIMAGE i, int c, float b) { + // virtual so disable dispatch + static_cast<Fl_RGB_Image*>(i)->Fl_RGB_Image::color_average(c, b); +} + +void fl_rgb_image_desaturate(RGBIMAGE i) { + // virtual so disable dispatch + static_cast<Fl_RGB_Image*>(i)->Fl_RGB_Image::desaturate(); +} + + + + +void fl_rgb_image_uncache(RGBIMAGE i) { + // virtual so disable dispatch + static_cast<Fl_RGB_Image*>(i)->Fl_RGB_Image::uncache(); +} + + + + +void fl_rgb_image_draw2(RGBIMAGE i, int x, int y) { + static_cast<Fl_RGB_Image*>(i)->draw(x, y); +} + +void fl_rgb_image_draw(RGBIMAGE i, int x, int y, int w, int h, int cx, int cy) { + // virtual so disable dispatch + static_cast<Fl_RGB_Image*>(i)->Fl_RGB_Image::draw(x, y, w, h, cx, cy); +} + + |