Improve -T in grdimage/view for transparency#7326
Conversation
Hoping this helps with #7315.
| n = gmt_graticule_path (GMT, &xx, &yy, 1, true, G->x[col] - inc2[GMT_X], G->x[col] + inc2[GMT_X], G->y[row] - inc2[GMT_Y], G->y[row] + inc2[GMT_Y]); | ||
| S->data[GMT_X] = xx; S->data[GMT_Y] = yy; S->n_rows = n; | ||
| gmt_geo_polygons (GMT, S); | ||
| gmt_M_free (GMT, xx); |
There was a problem hiding this comment.
Can't those guys be freed outside the loop?
There was a problem hiding this comment.
No, unless you rewrite it. n can vary from a few to tens or more depending on projection and MAP_LINE_STEP. I did not notice that it was particularly slow?
anbj
left a comment
There was a problem hiding this comment.
I think this is good to go.
-T+oblack+s -t40, -T+oblack@20+s -t50 and -T+oblack@20+s from #7315 (comment) now all give expected results. Let me know if you want graphical evidence.
|
Allocating and freeing inside a double loop can never be cheap. Couldn't |
|
Since you don't know the number needed, I would recommend something like this:
This means in practice that we do most allocations early on and then we just recycle. Or as you suggest, start with If you have the time to do this - which I think is pretty simple, knock yourself out! |
|
These two weeks are quite busy but I'll see. |
Hoping this helps with #7315. Perhaps @anbj can give it a spin.