https://linen.dev logo
Join Discord
Powered by
# haxe-ui
  • o

    orange-van-60470

    02/06/2023, 10:50 PM
    I tried to clarify what the lib does currently, but applogise if was spammy
  • b

    bright-gpu-74537

    02/07/2023, 7:59 AM
    wow, thats alot of text 😅
  • b

    bright-gpu-74537

    02/07/2023, 8:01 AM
    i guess the main thing to me is how is relevant to haxeui - what do these things draw to... js canvas? Because why would i use this over svg (which haxeui-html5 canvas supports), i mean, haxeui-kha doesnt have a canvas impl, are you saying this could be used for that? How would it draw "kha" pixels?
  • o

    orange-van-60470

    02/07/2023, 10:03 AM
    well pixelimage has no GPU acceleration so it is probably better to mix with cornerContour and look to add TriGML to that if you really need speed. But it should be viable currently with some changes.. will have to modify 'view8' method ( used js.html.UInt8 for simplicity and easy view ) and a few other details for c++, but essentially.
    Copy code
    Haxe
    var p = new PixelShape(1024, 1024 );
    p.transparent = true;
    var arcPie = 
        '<ArcShape 
            left="100"  top="100" 
            width="500" height="480" 
            strokeColor="0xFFFF0000" strokeWidth="12" 
            fill="0xFF00FF00" 
            startAngle="0" sweepAngle="240"
            arcType="pie">
        </ArcShape>';
     TriangleGML.withString( p, arcPie, 10, 10 );
    Image.fromBytes( p.byteImage().getBytes(), p.width, p.height, TextureFormat.RGBA32 );
    var g2 = framebuffer.g2;
    g2.begin();
    g2.clear(Color.fromValue(0xff000000));
    g2.drawImage( image, 0, 0 );
    g2.end();
    I don't know much about g1 it is for lower end hardware I think, you would just loop though the pixelimage, maybe the internal RGBA format currently would be ok so direct access rather than getARGB, may need private access to image allowed.
    Copy code
    Haxe
    var g1 = frameBuffer.g1;
    g1.begin();
    // g1 clear??
    var p = new PixelShape(1024, 1024 );
    p.transparent = true;
    var arcPie = 
        '<ArcShape 
            left="100"  top="100" 
            width="500" height="480" 
            strokeColor="0xFFFF0000" strokeWidth="12" 
            fill="0xFF00FF00" 
            startAngle="0" sweepAngle="240"
            arcType="pie">
        </ArcShape>';
    TriangleGML.withString( p, arcPie, 10, 10 );
    var x = 0;
    var y = 0;
    var xx = 0;
    var maxX = x + p.width;
    var maxY = y + p.height;
    while( true ){
       g1.setPixel(x, y, p.image[ position( x++, y ) ] );
       if( x > maxX ){
         x = xx;
         y++;
       } 
       if( y > maxY ) break;
    }
    g1.end();
  • o

    orange-van-60470

    02/07/2023, 10:06 AM
    for flixel, nme, lime have some potential hook ups. but I was more thinking for wxwidgets or something??
  • o

    orange-van-60470

    02/07/2023, 10:08 AM
    by the way fixed the arc sample see projects for link
  • o

    orange-van-60470

    02/07/2023, 10:10 AM
    I am really not sure if performance is going to be fast enough for some things... recent undo changes to the project have increased the compile a lot 😦
  • o

    orange-van-60470

    02/07/2023, 10:11 AM
    I may try adding flixel and peote before kha??
  • o

    orange-van-60470

    02/07/2023, 10:17 AM
    for g1 what might be interesting even if the output hardware target does not support alpha pixels.. you can still compose the image with alpha blends of shapes and just loop through and setPixel solid ones. there is Vision support but worry it maybe too heavy and should maybe add simple kernel matrix filters myself
  • o

    orange-van-60470

    02/07/2023, 10:18 AM
    for graphics4 then triangles with cornerContour will be much faster
  • b

    bright-gpu-74537

    02/07/2023, 10:19 AM
    i mean, wx and kha sound interesting though i still think it would need to be like an external canvas replacement (shadowing or something) since adding dependency for something like that isnt something id do. Especially when all these backends have their own drawing primitives (including wx). Im not saying that it couldnt be an interesting enhancement (as a third party library / addon) though
  • o

    orange-van-60470

    02/07/2023, 10:23 AM
    do you know what capablities wx has... can it do gradients
  • o

    orange-van-60470

    02/07/2023, 10:23 AM
    can it do soft edges
  • o

    orange-van-60470

    02/07/2023, 10:24 AM
    can it skew and rotate images reasonably?
  • o

    orange-van-60470

    02/07/2023, 10:24 AM
    does it have much hittest
  • o

    orange-van-60470

    02/07/2023, 10:25 AM
    does it blend alpha
  • b

    bright-gpu-74537

    02/07/2023, 10:25 AM
    well, it has "device contexts" which are basically drawing surfaces, and it also has a glView (though i feel like that is out of scope)
  • o

    orange-van-60470

    02/07/2023, 10:25 AM
    ah
  • o

    orange-van-60470

    02/07/2023, 10:25 AM
    glView is like openGL
  • o

    orange-van-60470

    02/07/2023, 10:25 AM
    ?
  • b

    bright-gpu-74537

    02/07/2023, 10:25 AM
    https://docs.wxwidgets.org/3.0/classwx_d_c.html
  • b

    bright-gpu-74537

    02/07/2023, 10:26 AM
    yeah, i think so, never investigate that before... played with wxDC's before though
  • b

    bright-gpu-74537

    02/07/2023, 10:26 AM
    https://docs.wxwidgets.org/3.0/classwx_g_l_canvas.html
  • o

    orange-van-60470

    02/07/2023, 10:26 AM
    Cairo does not really have gradient triangles yet
  • b

    bright-gpu-74537

    02/07/2023, 10:28 AM
    apparently there is
    wxDC::GradientFillLinear()
  • o

    orange-van-60470

    02/07/2023, 10:31 AM
    pixelimage constructs from gradient triangles and quads mostly so it is relatively easy to do some complex gradient stuff
  • o

    orange-van-60470

    02/07/2023, 10:31 AM
    yet to setup edge smoothing for that and need to check not broken anythinh
  • o

    orange-van-60470

    02/07/2023, 10:32 AM
    I think grahically something like a charts component maybe ideal..
  • b

    bright-gpu-74537

    02/07/2023, 10:32 AM
    and this outputs pixels? I mean, how would that work with wx?
  • o

    orange-van-60470

    02/07/2023, 10:32 AM
    yes
1...147314741475...1687Latest