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

World: r3wp

[View] discuss view related issues

Graham
16-Apr-2006
[4726]
you're going to bar code the marathon runners ??
Henrik
16-Apr-2006
[4727x2]
already have the number mark done, but there is a catch: the number 
can only be seen after printing it out, due to the construction of 
the program. it would be nice to be able to preview it before printing.
yes
Graham
16-Apr-2006
[4729]
You've already seen my psd2draw.r script .. I just feed the same 
block thru my ps dialect to get the postsrcript and write that to 
a file.
Henrik
16-Apr-2006
[4730x2]
then I would need to redo the barcode generator...
I think it's best for me right now to create a makeshift preview 
rather than an actual preview
Graham
16-Apr-2006
[4732]
are John's and my ps dialects that disimilar ?
Henrik
16-Apr-2006
[4733]
I havent' checked yours out
Graham
16-Apr-2006
[4734]
are you on Mac still?
Henrik
16-Apr-2006
[4735]
mac and windows
Graham
16-Apr-2006
[4736]
which one are you using for this?
Henrik
16-Apr-2006
[4737]
windows
Graham
16-Apr-2006
[4738x2]
Ok, you need to install some fonts.
install these http://www.rops.org/download/std35ttf.zip
Henrik
16-Apr-2006
[4740x3]
I don't think I'll be using it, as it creates too many twists for 
me.
too much code needs to be reorganized
and it has to be working perfectly no later than tuesday...
Graham
16-Apr-2006
[4743]
switching groups
Anton
17-Apr-2006
[4744]
Ah... yes... I had actually seen the textinfo docs... but just couldn't 
remember that at all !
Terry
17-Apr-2006
[4745x2]
Why View should admit defeat.. 
http://demo.arcww.ca/sites/lblaunch/
or this .. http://www.bigfatinstitute.org/index_flash.html
Anton
17-Apr-2006
[4747]
I don't think so..
Terry
17-Apr-2006
[4748]
That's a fair enough rebuttal.. let's see the links to back it up.
Pekr
17-Apr-2006
[4749x6]
Terry - very nice - what is that - flash?
my natek on the situation - View is about to be rewritten. And it 
is here to stay for good imo. Well, we may not be in Flash league 
as for speedy and smooth presentations, but I still can't somehow 
find so integrated toolkit as View is.  If I need small encapped 
app, there is not option, but View ...
I asked my friend about Ruby, Python - as my idea was, that corporations 
should throw out tools like Delphi, VB .... .NET and JAVA are goliath 
... but he told me, that Python has to bind to other gui toolkits 
and that it is not so integrated .... he then mentioned AJAX, killing 
all needs for anything like View ... but - just go and find some 
statistics ... look at W3C and look for the state of support for 
all that MLs in recent browsers - you will find situation quite messy 
...
where is SVG support? What browser it starts from? When most of old 
browsers will be replaced/reinstalled? I think that there is still 
one or even more - let's say two years to see those technologies 
settle a bit ...
Give me one thing - decent keyboard support, add tree-view, better 
grid to Rebgui, redesign widgets to visually support in-focus state, 
and you are done! Then go and look at your "app" source - very nice 
dialect - you will NOT find anything like that anywhere. Very nice 
and readable code. The problem is, VID stopped 80% on its way to 
success - the rest, those missing 20% ruined it.
now there is new attempt - DOM3 specs, to provide e.g. even hooks 
for your web apps .... when it will be actually developed and supported 
by most browsers? Dunno .... View still has some chance, especially 
in the browser - plug-in .....
Anton
17-Apr-2006
[4755x2]
Does anyone here know about matrix math and can advise me on how 
to derive the same transform as is made by the draw dialect's IMAGE 
command with four arbitrary corner points ?
I'm looking in the AGG source.
Henrik
17-Apr-2006
[4757]
One thing I love using View for is to make very quick custom GUIs 
for customers who need to carry out special tasks, but have no idea 
how to do it via the command line. It takes minutes to build something 
up (say a simple backup/restore system) and show them which buttons 
to press. It can almost be done right in front of them.


I'd hate having to resort to downloading a 50-100 MB Flash development 
tool or build and compile Visual Basic apps, which, ooops, don't 
really work on their Linux box, and I just need a GUI with two buttons 
and a text field. Also how much system access does Flash give you? 
Can you create/move/delete files?


It's so much nicer to say "Sure, let me do this and it can be done 
in an hour" rather than "I'll have a look at it at home and we'll 
see what I can deliver some time next week."


For those things, it doesn't matter that View doesn't use Aero, Quartz 
Extreme or super fast hardware acceleration to display a few simple 
buttons. It just does the job you need to do.
Geomol
17-Apr-2006
[4758x4]
Anton, I know about matrix math and have a book here with the standard 
4x4 matrix operations for transformation like rotation, scale, etc. 
in 3D, if you need those. But are you sure, AGG use matrix math to 
do the 4-corner IMAGE trick? I would guess, it's some (2D) texture 
algorithm.
Anton, one approach is to make a scanline routine. Sort the 4 corners 
according to y-coord. Start with the point with the lowest y-coord 
and look the colour up in the image (the point in that corner). For 
the next line (down on the monitor), you find the fraction, you've 
moved along the line to the point at the right side from where you 
started, and the same for the line to the point on the left side. 
Then you can find each colour for the pixels between the 2 points. 
You can keep doing this, until you reach one of the 2 next corners 
in the original corner points. Then you go along a new line to the 
last corner point. The same for the other end of the scanline. A 
problem is then to make the result look smooth. Bi-linear or tri-linear 
filtering can help here. I hope, I make some sense. It's a lot easier 
to draw than explain.
Maybe a little drawing can help me:

00010000
00222000
03333300
44444440
05555555
00666660
00077700
00008000

0 = background

1-8 = the 8 scanlines, this little figure is made of. The 8 scanlines 
are drawn starting with 1 and ending with 8. The colours in each 
pixel in each scanline is picked from the original image.
Each scanline has to be mapped onto the original image to find the 
colours. If such a mapping is made with straight lines, I predict 
the result to look ok with nice rectangle-like figures. But if one 
corner is far away from the rest, or moved in between the others, 
the result might be awful. A better way could be to map the scanlines 
as Bezier-curves on the original image. Could be interesting to know, 
how AGG does it, now that AGG's result is so good.
Terry
17-Apr-2006
[4762]
Also how much system access does Flash give you? Can you create/move/delete 
files?

RASH gives any flash movie total control over the desktop via Rebol. 
 RASH was 'absorbed' by ~Framewerks~, and now we can 'push' to the 
browser via RASH

I've found over the years, that the best solutions are hybrids... 
part browser, part javascript (ajax),  part rebol (uniserve), and 
flash (UI and pushing to the browser via flash's tcp and DOM handling)
Anton
18-Apr-2006
[4763x5]
Geomol, I've just spent some time translating AGG code to rebol, 
soon I shall test it.
Thanks for your idea, by the way, but I need to have the exact same 
transformation used by DRAW IMAGE with four points. I just need to 
transform a single point at a time.
So it has to be the funky perspective transform. I found  include/agg_trans_perspective.h
But maybe if you have some C++ knowledge you can help me with this 
iterator class, found within class trans_perspective:
        class iterator_x
        {
            double den;
            double den_step;
            double nom_x;
            double nom_x_step;
            double nom_y;
            double nom_y_step;

        public:
            double x;
            double y;

            iterator_x() {}

            iterator_x(double tx, double ty, double step, const double m[8][1]) 
            :
                den(m[6][0] * tx + m[7][0] * ty + 1.0),
                den_step(m[6][0] * step),
                nom_x(m[0][0] + m[1][0] * tx + m[2][0] * ty),
                nom_x_step(m[1][0] * step),
                nom_y(m[3][0] + m[4][0] * tx + m[5][0] * ty),
                nom_y_step(m[4][0] * step),
                x(nom_x / den),
                y(nom_y / den)
            {
            }

            void operator ++ ()
            {
                den   += den_step;
                nom_x += nom_x_step;
                nom_y += nom_y_step;
                double d = 1.0 / den;
                x = nom_x * d;
                y = nom_y * d;
            }
        };


        //--------------------------------------------------------------------
        iterator_x begin(double x, double y, double step) const
        {
            return iterator_x(x, y, step, m_mtx);
        }
Can you describe what the iterator does so I may translate the concept 
to rebol ?
Geomol
18-Apr-2006
[4768x6]
Oh, it's been a while, since I did C++, but it's something like:
6 private (internal) variables: den, den_step ... nom_y_step
2 public: x and y
Constructor iterator_x without arguments does nothing.

Constructor iterator_x with 3 arguments (and a constant!? The constant 
is an 8D vector) does (REBOL code):
den: (m[6] * tx) + (m[7] * ty) + 1.0
...
y: nom_y / den

Then an operator ++, so you can write: iterator_x_object++;

And the operator runs the code in the function. End of class definition 
at the };

Then some sort of begin situation!? I think, if you make an object 
of class iterator_x, you give 3 arguments: x, y and step. Then m_mtx 
is added from somewhere. m_mtx must be defined somewhere else, I 
guess.
So in all, an instance of the class iterator_x is made giving 3 arguments, 
and the constant m_mtx is added from somewhere. The iterator is used 
by using the operator ++, and the 2 variables x and y can be seen 
from the outside world.
(The instance is not made here, but can be made. This is just definition 
code.)
My REBOL code is wrong. :-) It should be:
den: (m/6 * tx) + (m/7 * ty) + 1.0
It's a bit weird, that m_mtx is 2 dimensional [8][1]. It's like in 
REBOL:
m_mtx: [[1.0] [2.0]Ê[3.0].... [8.0]]
where you could just do:
m_mtx: [1.0 2.0 3.0 ... 8.0]
If you choose the first way, you have to write:
den: (m/6/1 * tx) + (m/7/1 * ty) + 1.0
Anton
18-Apr-2006
[4774]
I think it helps in operations with other matrices, eg: [8][8]
Geomol
18-Apr-2006
[4775]
Probably.