r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[AGG] to discus new Rebol/View with AGG

Maxim
27-Feb-2007
[924x4]
the downside is that this is optimised for working on white BG in 
all I can see, and is obviously useless unless you have an LCD monitor.
I've only noticed the artifact in rebol when text is bold... don't 
know why.
my guess is that REBOL builds its glyphs once and then any PIXEL 
that has one of the channels to on is set as all on... so we get 
bad aliasing and some dots here and there.
AGG wouldn't have this effect since it does not seem to use clear 
text.  in fact, in general I find AGG font AA pretty ugly... is there 
a way to improve this?  even if its slow?  there are some situations 
which do not mind speed (generating HQ output graphics, for example) 
 or small GUIs or when converting face looks to bitmaps before display.. 
(trades speed for ram)
Henrik
27-Feb-2007
[928]
Maxim, I don't know. The output seems pretty similar to what is output 
with Freetype 2, but the AA is a little uneven, yes.
Maxim
27-Feb-2007
[929x4]
I find the issue is mostly with thin lines where the aa will be quite 
spectacular in its variations  especially if you look at the difference 
from 45 angle and near 0 or 90 degre angles. I know that AA should 
be an energy based repartition, which is not linear.  (gamma) such 
that two pixels at 0.5 are actually a quarter as bright as one full 
1.0 brightness pixel to our vision (obviously subjective to user 
response, applied monitor gamma and superwhite levels, etc).
for example, if you want to slide a picture of a stars, you must 
first boost the gamma of the picture by 2, do the move and then apply 
a .5 gamma.  then, the AA will have spread out according to energy 
rather than color.  which means that the 2 side-by-side pixels will 
be at much more than 0.5 of the original 1.0 single pixel brightness.
so I guess a similar operation is needed for fonts (I have no concrete 
bg in fonts, only view a similarity)
I also know that apple, quantel, adobe, MS and others have patents 
in font, and AA algorythms, which might actually prevent people from 
performing proper AA or Font rendering... even if they know how.
Oldes
27-Feb-2007
[933x2]
The AA is the reason, why I want bitmap fonts. With such a bitmap 
it would be very easy to create pixel fonts. If you take a look at 
Flash you can see, that most of the sites is using pixel precision 
fonts, which are made for fixed height but anyway are much more smaller. 
http://fontsforflash.com/
and if I can use such a image http://box.lebeda.ws/~hmm/rebol/projects/font-tools/latest/fonts/idea.png
to create glyphs which I can use in flash: http://box.lebeda.ws/~hmm/rebol/projects/font-tools/latest/fonts/idea.html
it would be nice to have a chance to use such a bitmap (or the vectorized 
glyphs) in Rebol as well
Graham
27-Feb-2007
[935x3]
Is carl going to release a linux sdk with agg enabled?
before R3 comes out ?
agg font support ie.
Cyphre
28-Feb-2007
[938]
Graham: I think the linux SDK will have agg enabled once we solve 
the font path identification thing.
Oldes
5-Mar-2007
[939x2]
How to rotate ARC?
this code draws nothing: 
view layout [
	box 400x400 effect [draw [
		rotate -90
		fill-pen red    arc 200x200 90x90 0   108 closed
		fill-pen green  arc 200x200 90x90 108 252 closed
	]]
]
Rebolek
5-Mar-2007
[941]
use 'transform instead. you need center point woith rotation and 
it's not clear where it is with 'rotate keyword (0x0 probably?)
Oldes
5-Mar-2007
[942x2]
never mind, I already used my rebol/flash dialect to make the chart. 
I just wanted to say, that there is probably a bug, because this 
is working:
view layout [
	box 400x400 effect [draw [
		rotate 15
		fill-pen red    arc 200x200 90x90 0   108 closed
		fill-pen green  arc 200x200 90x90 108 252 closed
	]]
]
Ach... ok my fault - the center point is in zero - that's why it 
was not visible - so it's probably not a bug
Rebolek
5-Mar-2007
[944]
that's what I wrote :)
Oldes
6-Mar-2007
[945]
I was just looking for some Rebol/draw (agg) manual and found this 
interesting project made using AGG (not Rebol related) http://www.contextfreeart.org/gallery/
Steeve
6-Mar-2007
[946x5]
what about a library of draw snipsets handled by rebol.org ?
they could be indexed like scripts, with keywords and other usefull 
tricks
so we could download them into draw tools using rebservices
we could think too about a standardized form for draw animations
yes we should...
Sunanda
7-Mar-2007
[951]
90+% of what you need to do that, Steeve, is already in the Library:

[1] we could (in minutes) add extra valid domains or types so a script 
could be categorised as draw-snippet


[2] the LIbrary doesn't use rebservices for an API. It has an API 
called LDS that predates rebservices (basically, the library team 
got there first). You can use it to download any script (among other 
things too)

http://www.rebol.org/cgi-bin/cgiwrap/rebol/documentation.r?script=lds-local.r#toc-50


[3] using LS to download a snippet every time it is needed would 
be slow and wasteful.....But you could easily write get-draw-snippet 
that caches results locally.
****

That would not be perfect as it would be good to have a page/pages 
showing the images the snippets produce. But if there were enough 
snippets, we could add that.....And, before we do someone else could 
beat us to it on their own website -- they could use LDS to get all 
the snippets and display the images. It'd be a neat bit of Community 
interaction.

====> Perhaps switch to Library for any detailed discussion.
Maxim
7-Mar-2007
[952]
Steve, I am about to release in the next few weeks a dataflow draw 
engine called glob.  its allows selectable layers of assembled draw 
blocks, can VERY easily animate too.
Jean-François
11-Apr-2007
[953x2]
Oldes, I also love that app.
Contextfreeart. I always thought it wouldn't be that hard for one 
of you guys to implement it in Rebol/AGG.
Cyphre
11-Apr-2007
[955]
Yep, I wanted to make Contextfree parser  in Rebol couple of years 
ago but still don't get to it. Anyway it would be a nice PARSE/DRAW 
exercise :)
Dockimbel
20-May-2007
[956x3]
In the new DRAW/AGG dialect, it seems that the 'reset-matrix command 
just don't work with 'matrix or 'translate. I've tried the examples 
from TRANSLATE command found in the online DRAW documentation, the 
2nd and 3rd examples are supposed to reset the translation, it just 
don't work (unless I've missed something obvious). Tested with View 
1.3.2.3.1 and View 2.7.5.3.1. Examples URL: http://www.rebol.com/docs/draw-ref.html#section-3.33
Whatever method I use in my DRAW code, I keep having the cumulative 
effect on TRANSLATE (and also on MATRIX).
BTW, I'm working on a DRAW-based visual CAPTCHA for web forms. I 
guess that if these commands are buggy, I'll have to  do it the old-fashion 
way, making all the calculations in REBOL (instead of letting DRAW 
do the maths).
Steeve
20-May-2007
[959]
use PUSH command instead
Anton
21-May-2007
[960]
Oldes, ContextFreeArt is nice.
Dockimbel
21-May-2007
[961]
PUSH is used the 3rd example I was refering to and doesn't work too, 
TRANSLATE still cumulates.
Cyphre
21-May-2007
[962x4]
Dockimbel: the examples you are refering to are working OK. Notice 
the beginnign coordinate of third box. I think this is what confused 
you.
(ie the third box 'offset' starts at 100x100 so after reset-matrix 
it is at 150x150)
To clarify it have a look at result this example:

view layout [
	box 600x400 effect [
		draw [ 
			fill-pen blue box 50x50 150x150
			translate 50x50 fill-pen red box 50x50 150x150
			reset-matrix
			translate 70x70 fill-pen yellow box 0x0 100x100
		]
		draw [
			translate 200x0 
			fill-pen blue box 50x50 150x150
			translate 50x50 fill-pen red box 50x50 150x150
			translate 70x70 fill-pen yellow box 0x0 100x100
		]
	]
]
The same is for the PUSH variant. Let me know if you have any other 
questions regarding this.
Dockimbel
21-May-2007
[966]
Thanks Cyphre, I was hoping I missed something ! You're right your 
example is working ok. The example in the doc was really confusing.
Cyphre
21-May-2007
[967]
Yes, the example is a bit confusing :) I hope we will have better 
DRAW docs for R3.
Dockimbel
21-May-2007
[968x4]
The following code crashes View 2.7.5.3.1 :
view layout [
	box effect [
		draw [
		    pen black red
		    push [shape [move 0x0 line 50x50]]
		]
	]
]
If you comment the 'red argument, it behaves normally.
I'm posting it to RAMBO.
Henrik
21-May-2007
[972x2]
dockimbel: http://usb.brando.com.hk/prod_detail.php?prod_id=00286
<--- related?
oops, wrong link