Giter VIP home page Giter VIP logo

agge's People

Contributors

tyoma avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

agge's Issues

Several build issues on MacOS

../src/agge/parallel.cpp:21:68: error: arithmetic on a pointer to an incomplete type 'agge::parallel::thread'
../src/agge/parallel.cpp:22:12: error: allocation of incomplete type 'agge::parallel::thread'
../src/agge/parallel.cpp:39:11: error: subscript of pointer to incomplete type 'agge::parallel::thread'
../src/agge/parallel.cpp:40:11: error: subscript of pointer to incomplete type 'agge::parallel::thread'
../src/agge/parallel.cpp:44:11: error: subscript of pointer to incomplete type 'agge::parallel::thread'
../src/agge/parallel.cpp:52:11: error: subscript of pointer to incomplete type 'agge::parallel::thread'
../agge/memory.h:33:11: error: invalid application of 'sizeof' to an incomplete type 'agge::parallel::thread'
../agge.text/font.h:51:16: error: implicit instantiation of undefined template 'std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >'
../agge.text/font.h:48:47: error: implicit instantiation of undefined template 'std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >'
../agge.text/font.h:51:16: error: implicit instantiation of undefined template 'std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >'
../agge.text/font.h:48:47: error: implicit instantiation of undefined template 'std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >'
../agge.text/font.h:51:16: error: implicit instantiation of undefined template 'std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >'
../agge.text/font.h:48:47: error: implicit instantiation of undefined template 'std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >'
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__hash_table:1991:29: error: cannot initialize object parameter of type 'std::__1::__hash_node_base<std::__1::__hash_node<std::__1::__hash_value_type<agge::font::key, std::__1::weak_ptr<agge::font> >, void *> *>' with an expression of type 'std::__1::__hash_node<std::__1::__hash_value_type<agge::font::key, std::__1::weak_ptr<agge::font> >, void *>'
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__hash_table:1996:23: error: cannot initialize object parameter of type 'std::__1::__hash_node_base<std::__1::__hash_node<std::__1::__hash_value_type<agge::font::key, std::__1::weak_ptr<agge::font> >, void *> *>' with an expression of type 'std::__1::__hash_node<std::__1::__hash_value_type<agge::font::key, std::__1::weak_ptr<agge::font> >, void *>'
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__hash_table:2003:16: error: static_cast from 'pointer' (aka 'std::__1::__hash_node<std::__1::__hash_value_type<agge::font::key, std::__1::weak_ptr<agge::font> >, void *> *') to '__next_pointer' (aka 'std::__1::__hash_node_base<std::__1::__hash_node<std::__1::__hash_value_type<agge::font::key, std::__1::weak_ptr<agge::font> >, void *> *> *'), which are not related by inheritance, is not allowed
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__hash_table:1991:29: error: cannot initialize object parameter of type 'std::__1::__hash_node_base<std::__1::__hash_node<std::__1::__hash_value_type<agge::font::key, std::__1::weak_ptr<agge::font::accessor> >, void *> *>' with an expression of type 'std::__1::__hash_node<std::__1::__hash_value_type<agge::font::key, std::__1::weak_ptr<agge::font::accessor> >, void *>'
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__hash_table:1996:23: error: cannot initialize object parameter of type 'std::__1::__hash_node_base<std::__1::__hash_node<std::__1::__hash_value_type<agge::font::key, std::__1::weak_ptr<agge::font::accessor> >, void *> *>' with an expression of type 'std::__1::__hash_node<std::__1::__hash_value_type<agge::font::key, std::__1::weak_ptr<agge::font::accessor> >, void *>'
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__hash_table:2003:16: error: static_cast from 'pointer' (aka 'std::__1::__hash_node<std::__1::__hash_value_type<agge::font::key, std::__1::weak_ptr<agge::font::accessor> >, void *> *') to '__next_pointer' (aka 'std::__1::__hash_node_base<std::__1::__hash_node<std::__1::__hash_value_type<agge::font::key, std::__1::weak_ptr<agge::font::accessor> >, void *> *> *'), which are not related by inheritance, is not allowed
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__hash_table:1991:29: error: cannot initialize object parameter of type 'std::__1::__hash_node_base<std::__1::__hash_node<std::__1::__hash_value_type<agge::font::key, std::__1::pair<agge::font *, unsigned int> >, void *> *>' with an expression of type 'std::__1::__hash_node<std::__1::__hash_value_type<agge::font::key, std::__1::pair<agge::font *, unsigned int> >, void *>'
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__hash_table:1996:23: error: cannot initialize object parameter of type 'std::__1::__hash_node_base<std::__1::__hash_node<std::__1::__hash_value_type<agge::font::key, std::__1::pair<agge::font *, unsigned int> >, void *> *>' with an expression of type 'std::__1::__hash_node<std::__1::__hash_value_type<agge::font::key, std::__1::pair<agge::font *, unsigned int> >, void *>'
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__hash_table:2003:16: error: static_cast from 'pointer' (aka 'std::__1::__hash_node<std::__1::__hash_value_type<agge::font::key, std::__1::pair<agge::font *, unsigned int> >, void *> *') to '__next_pointer' (aka 'std::__1::__hash_node_base<std::__1::__hash_node<std::__1::__hash_value_type<agge::font::key, std::__1::pair<agge::font *, unsigned int> >, void *> *> *'), which are not related by inheritance, is not allowed

This is using a fairly up to date clang-suite on MacOS. Might I suggest adding the -Wall -Wextra -Werror and -std=c++11 (or appropriate standard) flags in your CMakeLists.txt for applicable platforms? It'll help the robustnest of the code.

Performance

Hi there!

Great to see this library :) I'm interested to know if you've done any performance comparisons between agg and agge that you'd be willing to share? Very interested to see what your improvements are!

Also, I note that on the surface you have cut down dramatically on the number of source files compared to the original. Is this because you have simplified it, or have you implemented only a subset of the original features?

All the best,
Projectitis

Apple Sillicon support

Is support for Apple sillicon planned ? For the moment it won't compile :

[build] /Library/Developer/CommandLineTools/usr/lib/clang/15.0.0/include/emmintrin.h:14:2: error: "This header is only meant to be used on x86 and x64 architecture"
[build] #error "This header is only meant to be used on x86 and x64 architecture"

Nice project, but what is utee

The project is nice, but there are 2 libraries strmd and utee, could somebody indicate what utee is and where I can find it?

ideas for code (part-0)

I can not insist here. It is your code. So if you want to look into them.
If you agree on some of those updates I could make some smaller issues for myself and PRs.
This issue is way too big to be done all at once.

So what I've noticed.
0. What is target C++ standard for this library?
In example with balls-async there was unique_ptr. So it looks like C++11 at least.
So maybe one could shift code there. As I looked in class dash I saw C++2003 style.
I understand you migrated it from agg. And probably have no time for being C++11 code idealist.

  1. In my experience this pattern will oftenly repeat:
    image

When I contemplated agg I wanted to make it more expressive and functional style-like.
(Ex. similar to C++20 ranges)
And looks like you also trying to write less types.
The pattern in picture above is piping. So one can just overload binary operator of preference for it to mean "pipe source with generator (decorator?)". So, code above will look like one of examples depending on preference:
line(19.5f*scale, 300.5f*scale, 319.5f*scale, 300.5f*scale)|dash_style|line_style
line(19.5f*scale, 300.5f*scale, 319.5f*scale, 300.5f*scale)/dash_style/line_style
line(19.5f*scale, 300.5f*scale, 319.5f*scale, 300.5f*scale)^dash_style^line_style
line(19.5f*scale, 300.5f*scale, 319.5f*scale, 300.5f*scale)+dash_style+line_style
line(19.5f*scale, 300.5f*scale, 319.5f*scale, 300.5f*scale)>>dash_style>>line_style
line(19.5f*scale, 300.5f*scale, 319.5f*scale, 300.5f*scale)>dash_style>line_style
line(19.5f*scale, 300.5f*scale, 319.5f*scale, 300.5f*scale)<=dash_style<=line_style

Looking at these now most distinctive is IMO "^".
Operators +-*/% could be in parameters of line, |&% are hard to see.
Shift and comparison may be toooo confusing here.
And ^ stands out in this expression as natural separator making it easy to read.

Or (I like it less) one can add template method named ex .with:
line(19.5f*scale, 300.5f*scale, 319.5f*scale, 300.5f*scale).with(dash_style).with(line_style).

Actually template overloading of operators without restrictions is unsafe.
One should use sort of dispatch techniques or concepts. But this can be done right!

  1. in design of class
    image
    one can use universal reference in member declaration:
    GeneratorT &&_generator;
    and forwarding in ctor:
	template <typename SourceT, typename GeneratorT>
	inline path_generator_adapter<SourceT, GeneratorT>::path_generator_adapter(const SourceT &source, GeneratorT &&generator)
		: _source(source), _generator(std::forward<GeneratorT>(generator)), _state(initial)
	{	}

and in assist (or operator of preference 😄):

	template <typename SourceT, typename GeneratorT>
	path_generator_adapter<SourceT, GeneratorT> assist(const SourceT &source, GeneratorT &&generator)
	{	return path_generator_adapter<SourceT, GeneratorT>(source, std::forward<GeneratorT>(generator));	}

And default move and copy constructors.

Why bother?
With this you can use on a fly construction like:
line(19.5f*scale, 300.5f*scale, 319.5f*scale, 300.5f*scale)^create_some_custom_line_style(some_params)

  1. when looked at this part:
    image
    There can be piping too!
    Imagine code will look like:
line(19.5f*scale, 300.5f*scale, 319.5f*scale, 300.5f*scale)
          ^dash().add_dash(1.0f*scale, 1.0f*scale).dash_start(0.5f*scale)
          ^line_style.width(1.0f*scale).set_cap(caps::butt());
  1. To my taste dash::remove_all_dashes() can be renamed as clear() when reused.
    Also, some guideline discourage duplication in class and method names.
    So, maybe dash().add(1.0f*scale, 1.0f*scale).start(0.5f*scale)?

I see those are public methods and there are "public but actually not for user" methods to generate vertexes.
Will study further.

That's it by now.

BR, Daniel

Anti-Grain Evolution !

Really happy to see Anti-Grain Evolution !
Thank you for this !

Do you have any plans to use C++17 or at least C++14 for it ?
Asking this because there are bunch of std::auto_ptr in the code and other pre C++11 code.

plotting/charts library

Hi, Artem,
Thank you for developing this library!
I've always dreamed about backend as agg for plotting.
I was astonished my Maxim's work. (It is still big loss for C++ community that Maxim passed away in 2013).
Unfortunately, I wasn't able to totally grasp his library.

I know python's matplotlib uses agg as backend.
So I was thinking to find something as good in implementation details but with modern C++ interfaces to use as backend.
And I'm glad I've found agge.
In answer to issue question about performance you mentioned you use agge for charts on your main work.

If you already have charts is it possible to share this library in github?
Otherwise, I'd write my own (if I don't burn out 😄) and bombard you with questions in the process.
I also want to implement 3d-line plots in 3d-axes as matplotlib does.

I want this plotting library to be able to render huge time series in almost real time, i.e. as fast as possible.
So agge backend looks very attractive for this matter, too.

Actually, I want to use plotting library in my data visualisation project.
And for GUI I plan to use slint-ui.
They do not have plotting library, and I can render plot in buffer there.
(There is Rust library called plotters I tried to use. But I'm not happy with it's backend.
I'd want different linestyles. I even proposed some ideas there and implemented them by "forking and breaking". But I'm not sure those will be there any tine. And I'm not that good in Rust, I guess.)
And agge go same approach agg did. So agge already has all functionality I need. Backend is floating point, too.

I'm not sure if antialiasing is made. Because I see pixelised saws on knot edges
image
Maybe, it is already aliased, and I have way too big monitor. And I'm too picky. 😅

To finalize all my wordy essay, I have some questions.
0. Consider opening discussions section, because issues is hard way to contact you.
There Is also show and tell section. I could share some code snippets there.

  1. Is there anti-aliasing? AFAIK, agg boasted smooth antialiased lines. Maybe, there is some special wrapper to have this.
    https://agg.sourceforge.net/antigrain.com/doc/introduction/introduction.agdoc.html#toc0005
  2. Could you share plotting/charts library (in abstract part) if possible?
  3. Otherwise, could you direct me to write my own plotting/charts library using agge as backend?
  4. Also, you mentioned you are writing your own GUI. How raw is it? Maybe, I could use it instead of slint-ui?

Thank you for library once again. I'll study it this weekend, definetely.

Best Regards,
Daniel

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.