Click here to Skip to main content
16,004,529 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Wordle 1,176 - 3 4 me Pin
pkfox6-Sep-24 20:59
professionalpkfox6-Sep-24 20:59 
GeneralRe: Wordle 1,176 Pin
Cp-Coder6-Sep-24 22:56
Cp-Coder6-Sep-24 22:56 
GeneralRe: Wordle 1,176 Pin
pkfox7-Sep-24 10:15
professionalpkfox7-Sep-24 10:15 
GeneralRe: Wordle 1,176 Pin
StarNamer@work7-Sep-24 0:29
professionalStarNamer@work7-Sep-24 0:29 
GeneralRe: Wordle 1,176 Pin
Rich Leyshon7-Sep-24 0:48
Rich Leyshon7-Sep-24 0:48 
GeneralRe: Wordle 1,176 Pin
PJ Arends7-Sep-24 9:11
professionalPJ Arends7-Sep-24 9:11 
GeneralRe: Wordle 1,176 Pin
jmaida7-Sep-24 17:15
jmaida7-Sep-24 17:15 
RantWhy is there so much to SVG? Pin
honey the codewitch6-Sep-24 18:05
mvahoney the codewitch6-Sep-24 18:05 
I need my vector graphics library to be feature complete enough to render most SVG.

I have that, with some compromises for embedded, such as using TTF instead of WOFF or whatever for the font formats.

The trouble is there is just so much to it. You have fills, strokes, gradients, textures, fonts, paths, basic shapes, and all kinds of minutia therein.

I've fleshed out my header file for my class, and it's huge, and I'm not entirely finished with it.

I'd like to break it up somehow because I'm overwhelmed, but I need to get a lot of it done before I can even test a little.

I pasted the class proto here, sans supporting structures to give you an idea of the mess I'm up against.

I hate messes.

C++
class canvas final {
    void* m_info;
    canvas(const canvas& rhs)=delete;
    canvas& operator=(const canvas& rhs)=delete;
public:
    typedef gfx_result(*on_write_callback_type)(const rect16& bounds, rgba_pixel<32> color, void* state);
    canvas();
    canvas(size16 dimensions);
    canvas(canvas&& rhs);
    ~canvas();
    gfx_result initialize();
    bool initialized() const;
    void deinitialize();
    canvas& operator=(canvas&& rhs);
    on_write_callback_type on_write_callback() const;
    void* on_write_callback_state() const;
    void on_write_callback(on_write_callback_type callback, void* state=nullptr);

    size16 dimensions() const;
    void dimensions(size16 value);
    rect16 bounds() const;
    
    rgba_pixel<32> stroke_color() const;
    void stroke_color(rgba_pixel<32> value);
    canvas_gradient stroke_gradient() const;
    void stroke_gradient(const canvas_gradient& value);
    canvas_texture stroke_texture() const;
    void stroke_texture(const canvas_texture& value);
    canvas_stroke_style stroke_style() const;
    void stroke_style(const canvas_stroke_style& value);
    canvas_dash stroke_dash() const;
    void stroke_dash(const canvas_dash& value);
    canvas_paint_type stroke_paint_type() const;
    void stroke_paint_type(canvas_paint_type value);
    rgba_pixel<32> fill_color() const;
    void fill_color(rgba_pixel<32> value);
    canvas_gradient fill_gradient() const;
    void fill_gradient(const canvas_gradient& value);
    canvas_texture fill_texture() const;
    void fill_texture(const canvas_texture& value);
    canvas_paint_type fill_paint_type() const;
    void fill_paint_type(canvas_paint_type value);
    stream* font() const;
    void font(stream& ttf_stream, size_t index);
    float font_size() const;
    void font_size(float value);
    canvas_fill_rule fill_rule() const;
    fill_rule(canvas_fill_rule value);
    canvas_compositing_mode compositing_mode() const;
    void compositing_mode(canvas_compositing_mode value);
    float opacity() const;
    void opacity(float value);
    ::gfx::matrix matrix() const;
    void matrix(const ::gfx::matrix& value);
    rectf fill_bounds() const;
    rectf stroke_bounds() const;
    
    // path builder - separate class?
    gfx_result move_to(pointf location);
    gfx_result line_to(pointf location);
    gfx_result quad_to(pointf point1, pointf point2);
    gfx_result cubic_to(pointf point1, pointf point2, pointf point3);
    gfx_result arc_to(sizef radiuses,float angle, bool large_arc, bool sweep, pointf location);
    gfx_result rectangle(const rectf& bounds);
    gfx_result rounded_rectangle(const rectf bounds, sizef radiuses);
    gfx_result ellipse(pointf center, sizef radiuses);
    gfx_result circle(pointf center, float radius);
    gfx_result arc(pointf center, float radius, float a0, float a1, bool ccw);
    gfx_result close_path();  
};

Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix

GeneralRe: Why is there so much to SVG? Pin
trΓΈnderen7-Sep-24 13:47
trΓΈnderen7-Sep-24 13:47 
GeneralRe: Why is there so much to SVG? Pin
honey the codewitch7-Sep-24 14:12
mvahoney the codewitch7-Sep-24 14:12 
GeneralAnyone care to take a stab... Pin
David O'Neil6-Sep-24 17:29
professionalDavid O'Neil6-Sep-24 17:29 
GeneralRe: Anyone care to take a stab... Pin
jschell7-Sep-24 4:08
jschell7-Sep-24 4:08 
GeneralRe: Anyone care to take a stab... Pin
Gary Stachelski 20217-Sep-24 4:49
Gary Stachelski 20217-Sep-24 4:49 
GeneralRe: Anyone care to take a stab... Pin
David O'Neil8-Sep-24 18:46
professionalDavid O'Neil8-Sep-24 18:46 
GeneralRe: Anyone care to take a stab... Pin
Paul61247-Sep-24 19:18
Paul61247-Sep-24 19:18 
GeneralRe: Anyone care to take a stab... Pin
David O'Neil8-Sep-24 18:45
professionalDavid O'Neil8-Sep-24 18:45 
GeneralRe: Anyone care to take a stab... Pin
BernardIE53177-Sep-24 15:44
BernardIE53177-Sep-24 15:44 
GeneralRe: Anyone care to take a stab... Pin
RainHat9-Sep-24 6:18
RainHat9-Sep-24 6:18 
GeneralUsing ChatGPT 4o to convert a C# Windows Form to HTML and Blazor Pin
MSBassSinger6-Sep-24 12:11
professionalMSBassSinger6-Sep-24 12:11 
GeneralRe: Using ChatGPT 4o to convert a C# Windows Form to HTML and Blazor Pin
honey the codewitch6-Sep-24 14:09
mvahoney the codewitch6-Sep-24 14:09 
GeneralRe: Using ChatGPT 4o to convert a C# Windows Form to HTML and Blazor Pin
MSBassSinger6-Sep-24 17:40
professionalMSBassSinger6-Sep-24 17:40 
GeneralStar Trek Cats? Yes, It's Real (Squeeeee!) Pin
raddevus6-Sep-24 11:34
mvaraddevus6-Sep-24 11:34 
GeneralRe: Star Trek Cats? Yes, It's Real (Squeeeee!) Pin
jschell7-Sep-24 4:12
jschell7-Sep-24 4:12 
GeneralRe: Star Trek Cats? Yes, It's Real (Squeeeee!) Pin
Daniel Pfeffer7-Sep-24 9:10
professionalDaniel Pfeffer7-Sep-24 9:10 
GeneralRe: Star Trek Cats? Yes, It's Real (Squeeeee!) Pin
raddevus8-Sep-24 4:12
mvaraddevus8-Sep-24 4:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.