Re: Zoom and Rotate in EoG



Am Dienstag, den 06.02.2007, 03:38 -0600 schrieb Chris Wailes:
> Dear EoG List,
Hi Chris,
> I am currently an undergrad student in Computer Science and, for one
> of my class assignments, am writing a simple image viewer and editor
> using Gtk2.  This editor has to be able to both rotate and zoom the
> image viewed.  I was wondering  how EoG handles these things. 
> 
> Is a new file created and then a library like MagickWand used?  Do you
> simply rotate the GdkBitmap?  Is there some image handling part of
> Gtk2 that I do not know about?
> 
EOG uses GdkPixbuf objects to store the image data. To zoom and rotate
the images transformation matrices are used. You can take a look at the
libart_lgpl manual to see how these matrices look like:
http://www.gnome.org/~mathieu/libart/libart-affine-transformation-matrices.html

To actually apply a tranformation such a matrix is created as well as a
new empty GdkPixbuf at the required size. Then the matrix is inverted so
we can calculate the source pixel for every destination pixel and the
corresponding raw pixel data is copied between the GdkPixbufs. Take a
look at eog-transform.c to see how it works in detail.


> Any help would be great.  Thanks in advance. 
> Chris

Felix




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]