Discussion:
Extending shoebot api to use neglected bits of cairo :)
Stuart Axon
2010-05-31 22:23:55 UTC
Permalink
So I don't forget:

Cairo has some stuff we should put in... it supports filling with images, mirrored or not.

I was thinking we could extend background() to work with images (with option to mirror).

Also there are gradient fills, and radial gradients.. we should definitely open up these too.

S++
ricardo lafuente
2010-06-02 20:15:12 UTC
Permalink
Post by Stuart Axon
Cairo has some stuff we should put in... it supports filling with images, mirrored or not.
I was thinking we could extend background() to work with images (with option to mirror).
I'm thinking of the "preferably one way to do one thing" principle in
Python. How would this be an improvement from using image() passing the
size of the canvas?
Post by Stuart Axon
Also there are gradient fills, and radial gradients.. we should definitely open up these too.
Agree. I'm wondering how the syntax for defining them should be.
Probably worth discussing on IRC soon?
Dave Crossland
2010-06-02 20:52:19 UTC
Permalink
Post by ricardo lafuente
Post by Stuart Axon
it supports filling with images, mirrored or not.
I'm thinking of the "preferably one way to do one thing" principle in
Python. How would this be an improvement from using image() passing the size
of the canvas?
Is "filling with images" how image() works?
--
Regards,
Dave
Stuart Axon
2010-06-02 23:13:23 UTC
Permalink
It would mean that we wouldn't need to draw once with a single colour and
then over draw that with images.

+ With the fill modes available to cairo the semantics are a bit different -
they can repeat or be mirrored or not repeat.

Image() is more - draw a single image - not "fill with images".
+ If the underlying library supports it, it's possibly faster than us
manually filling the background with a load of tiling images
(+ implementing the mirroring would be some work even
in shoebot).


Maybe I should try coming up with a syntax and we can see if it makes
any sense :)

S++



----- Original Message ----
Sent: Wed, June 2, 2010 9:52:19 PM
Subject: Re: [shoebot-devel] Extending shoebot api to use neglected bits of cairo :)
On 2 June 2010 22:15, ricardo lafuente <
it
supports filling with images, mirrored or not.
I'm thinking of
the "preferably one way to do one thing" principle in
Python. How would
this be an improvement from using image() passing the size
of the
canvas?
Is "filling with images" how image() works?
--
Regards,
Dave
_______________________________________________
Shoebot-devel
mailing list
http://lists.tinkerhouse.net/listinfo.cgi/shoebot-devel-tinkerhouse.net
Dave Crossland
2010-06-02 23:49:57 UTC
Permalink
Post by Dave Crossland
Is "filling with images" how image() works?
It sounds like image() should be refactored to use Cairo's "filling
with images" function :)
Stuart Axon
2010-06-03 00:32:06 UTC
Permalink
I'd have a look at cairo set_extend, the documentation probably makes more
sense than I have (especially after beer :)

Also, cairo patterns in general.


S++



----- Original Message ----
Sent: Thu, June 3, 2010 12:49:57 AM
Subject: Re: [shoebot-devel] Extending shoebot api to use neglected bits of cairo :)
On 3 June 2010 01:13, Stuart Axon <
Post by Dave Crossland
Is "filling with images" how image() works?
It sounds like image()
should be refactored to use Cairo's "filling
with images" function
:)
_______________________________________________
Shoebot-devel mailing
list
http://lists.tinkerhouse.net/listinfo.cgi/shoebot-devel-tinkerhouse.net
ricardo lafuente
2010-06-03 09:49:09 UTC
Permalink
Post by Stuart Axon
It would mean that we wouldn't need to draw once with a single colour and
then over draw that with images.
Aha -- got it.

Even then, background() is not mandatory; drawing on a backgroundless
image will result in a transparent background. (not sure if Nodebox also
does this, but definitely a good feature in my book :)

Still, the image fill sounds exciting.
Post by Stuart Axon
Maybe I should try coming up with a syntax and we can see if it makes
any sense :)
That would be great :)

:r
Post by Stuart Axon
S++
----- Original Message ----
Sent: Wed, June 2, 2010 9:52:19 PM
Subject: Re: [shoebot-devel] Extending shoebot api to use neglected bits of cairo :)
On 2 June 2010 22:15, ricardo lafuente<
it
supports filling with images, mirrored or not.
I'm thinking of
the "preferably one way to do one thing" principle in
Python. How would
this be an improvement from using image() passing the size
of the
canvas?
Is "filling with images" how image() works?
Stuart Axon
2010-06-03 15:54:20 UTC
Permalink
Aside from backgrounds I think explicitly supporting patterns could be quit. Interesting, not sure what the api would look like, but you should probably be able to fill and stroke with them.

Wrt background, I think the default should be White, but maybe we should support None to not draw it too.

Perhaps if fill and stroke support patterns we can also pass one them to background.

Having an explicit pattern api that works everywhere is a lot less cracktastic than my initial idea of just passing the image and tile params to background.
Post by ricardo lafuente
Post by Stuart Axon
It would mean that we wouldn't need to draw once with a single colour and
then over draw that with images.
Aha -- got it.
Even then, background() is not mandatory; drawing on a backgroundless
image will result in a transparent background. (not sure if Nodebox also
does this, but definitely a good feature in my book :)
Still, the image fill sounds exciting.
Post by Stuart Axon
Maybe I should try coming up with a syntax and we can see if it makes
any sense :)
That would be great :)
:r
Post by Stuart Axon
S++
----- Original Message ----
Sent: Wed, June 2, 2010 9:52:19 PM
Subject: Re: [shoebot-devel] Extending shoebot api to use neglected bits of cairo :)
On 2 June 2010 22:15, ricardo lafuente<
it
supports filling with images, mirrored or not.
I'm thinking of
the "preferably one way to do one thing" principle in
Python. How would
this be an improvement from using image() passing the size
of the
canvas?
Is "filling with images" how image() works?
_______________________________________________
Shoebot-devel mailing list
http://lists.tinkerhouse.net/listinfo.cgi/shoebot-devel-tinkerhouse.net
Loading...