Re: Transform update?

Maarten Bosmans <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <CA+CvcKQTbo7W+5MMSQ5WgXtssWJ1CCgz5NE=0Mw3f+66D9zCOw@mail.gmail.com>
2011/11/27 Blagoj Kupev <[email protected]>:
> Hello
> I'm now in cairo and this might be already answered, but...
>
> I'd like to create a image that will be then modified by translation using a
> functionality similar to the cairo_transform function where i'd like to
> define cairo_matrix_t for each pixel. The final idea is to modify the image
> that will be projected to a white ball and after reflection it will be a
> symmetric image.

This sounds like you want arbitrary transformation. Currently Cairo
only supports affine transformations of a surface.

> I thought that i can do this using cairo_user_to_device function, but
> without any success. First, I'm not sure what is the usage of this function,
> so can anyone help me with the answers to the following questions:
> 1. How to set different cairo_matrix_t for each pixel during the
> translation, the CTM is one for complete image.

not possible

> 2. What is the purpose of cairo_to_device function?

Do you mean the cairo_user_to_device function?
That one just transforms a coordinate pair with the current
transformation matrix.

> If there's no functionality to define translation using different matrix for
> each pixel, i'd like to add this functionality in cairo...
>
> So, after i compile the cairo and make new libraries what to do to use them?
> I've succeeded in building the libraries and installing them (i can see new
> library files are copied to /usr/local/lib and other places), but i'm not
> sure if they are really used since modification do not seem to be used in
> the new application.
>
> The procedure that i'm doing is:
> - modify the cairo_translate function by adding while(1) or other line to
> see if it affects the library.
> - the code is compiled (i know this since if i put invalid line, error is
> reported)
> - sudo make install, to install the libraries
> - i'm recompiling the application that is calling cairo_translate function,
> but the new code is not executed. I'm using the following line to compile
> the application:
> gcc -o transform transform.c `pkg-config --libs --cflags gtk+-2.0`
>
> What should i do to have new library used? How to debug code in libraries?

You should link against the cairo lib you just installed (probably in
/usr/local). You can see by checking the output of pkg-config --libs
--cflags gtk+-2.0 that it only picks up your distributions cairo. To
make sure pkg-config knows about your own version, set
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig or something similar.

Maarten
--
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.