![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
I'm using the following library:
http://cairographics.org/
Now, can *anybody* figure out what the default coordinate space is?!
Seriously, I can't find this information anywhere in the documentation.
Is (0,0) at the bottom-left corner? The top-left corner? Somewhere else?
What??
It seems this is so trivial they forgot to actually write it down. >_<
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On Thu, 19 Nov 2009 12:23:03 +0100, Invisible <voi### [at] dev null> wrote:
> I'm using the following library:
>
> http://cairographics.org/
>
> Now, can *anybody* figure out what the default coordinate space is?!
>
> Seriously, I can't find this information anywhere in the documentation.
> Is (0,0) at the bottom-left corner? The top-left corner? Somewhere else?
> What??
>
> It seems this is so trivial they forgot to actually write it down. >_<
The user space coordinate system depends on the device space coordinate
system. By default, the mapping between them is an identity transformation.
I think most device spaces have (0,0) in the upper left corner, but I am
not sure if that is a requirement or a coincidence.
No, I did not figure this out by reading the Cairo documentation, which
seems to consist mostly of Doxygen-style pseudo-docs.
--
FE
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Fredrik Eriksson wrote:
> The user space coordinate system depends on the device space coordinate
> system. By default, the mapping between them is an identity transformation.
Yes. This much is stated explicitly.
> I think most device spaces have (0,0) in the upper left corner, but I am
> not sure if that is a requirement or a coincidence.
For raster image formats (JPEG, PNG, GIF, TIFF...) this is true.
However, for both PostScript and PDF [the formats I'm actually
interested in], the default origin point is actually the bottom-left
corner, not the top-left.
In addition to this, both of these formats allow the coordinate space to
be arbitrarily transformed. (Cairo provides the same functionallity
itself as well, but PS and PDF have it natively.) So I'm not sure if
Cairo is using the native defaults, or transforming them to match the
other backends, or...?
> No, I did not figure this out by reading the Cairo documentation, which
> seems to consist mostly of Doxygen-style pseudo-docs.
Yeah, it is a little... sparse?
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On Thu, 19 Nov 2009 13:36:13 +0100, Invisible <voi### [at] dev null> wrote:
>
> However, for both PostScript and PDF [the formats I'm actually
> interested in], the default origin point is actually the bottom-left
> corner, not the top-left.
>
> In addition to this, both of these formats allow the coordinate space to
> be arbitrarily transformed. (Cairo provides the same functionallity
> itself as well, but PS and PDF have it natively.) So I'm not sure if
> Cairo is using the native defaults, or transforming them to match the
> other backends, or...?
Then how about you just try it, and find out?
--
FE
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Invisible schrieb:
> Now, can *anybody* figure out what the default coordinate space is?!
>
> Seriously, I can't find this information anywhere in the documentation.
> Is (0,0) at the bottom-left corner? The top-left corner? Somewhere else?
> What??
>
> It seems this is so trivial they forgot to actually write it down. >_<
Experience indicates that everything that virtually all graphics output
frameworks have (0,0) at the top-left corner - and the samples confirm
that it is the case here as well.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Invisible schrieb:
> In addition to this, both of these formats allow the coordinate space to
> be arbitrarily transformed. (Cairo provides the same functionallity
> itself as well, but PS and PDF have it natively.) So I'm not sure if
> Cairo is using the native defaults, or transforming them to match the
> other backends, or...?
Why not just... try it out?
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Invisible wrote:
> It seems this is so trivial they forgot to actually write it down. >_<
That's OK. The graphics lib I'm workign with takes R, G, B, and A. And
sometimes A=0xFF means opaque and sometimes it means transparent. And you
get to guess for any given function whether A comes first in the list or last.
--
Darren New, San Diego CA, USA (PST)
Is God willing to prevent naglams, but unable?
Then he is not omnipotent.
Is he able, but not willing, to prevent naglams?
Then he is malevolent.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Darren New wrote:
> That's OK. The graphics lib I'm workign with takes R, G, B, and A. And
> sometimes A=0xFF means opaque and sometimes it means transparent. And
> you get to guess for any given function whether A comes first in the
> list or last.
Wow, that's pretty sweet, man.
That's almost as good as the threadDelay function, that doesn't tell you
whether the argument is seconds or miliseconds or picoseconds or...
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Invisible wrote:
> That's almost as good as the threadDelay function, that doesn't tell you
> whether the argument is seconds or miliseconds or picoseconds or...
Probably biliseconds.
--
Darren New, San Diego CA, USA (PST)
Is God willing to prevent naglams, but unable?
Then he is not omnipotent.
Is he able, but not willing, to prevent naglams?
Then he is malevolent.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
>> In addition to this, both of these formats allow the coordinate space
>> to be arbitrarily transformed. (Cairo provides the same functionallity
>> itself as well, but PS and PDF have it natively.) So I'm not sure if
>> Cairo is using the native defaults, or transforming them to match the
>> other backends, or...?
>
> Why not just... try it out?
In the PostScript case, since Ghostscript insists on displaying every PS
file under the assumption of A4 paper, it's hard to decide where Cairo
thinks the edge of the paper is. PDF works correctly, however, and this
indicates that Cairo is indeed translating and reflecting the coordinate
system such that the origin is the top-left corner.
They could have saved me a whole heap of trouble if this were written
down somewhere. (Note that it doesn't even say what the coordinate
system is for image surfaces either...)
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |