Re: Thoughts about a new GdkPixbuf transform interface



> >void       gdk_pixbuf_transform_set_affine      (GdkPixbufTransform
> *transform,
> >						 double              a00,
> >						 double              a01,
> >						 double              a02,
> >						 double              a10,
> >						 double              a11,
> >						 double              a12);
> >
> What is "affine" anyway?
> Natural values for arbitrary transform is offset + 2x2 matrix, as in 
> formula:
> 
> | dest_x |   | offset_x |     | m00 m01 | | src_x |
> | dest_y | = | offset_y |  +  | m10 m11 |*| src_y |
> 

Yes, this is exactly what affine is. It can be represented a bit more neatly
as

|dst_x|    | offset_x m00 m01 |    | 1       |
|dst_y| = | offset_y m10 m11 | * | src_x |
                                                 | src_y |

Actually, I would personally love to see this extended to projective
transformations by
extending the matrix to a 3x3 matrix.

> 
> >/* Composite onto a pixbuf */
> >void       gdk_pixbuf_transform_composite       (GdkPixbufTransform
> *transform,
> >						 GdkPixbuf          *dest,
> >						 int                 render_x,
> >						 int                 render_y,
> >						 int                 render_width,
> >						 int                 render_height);
> >
> What's this? I just don't get it.
> if "Composite" stands for
>  - "render", "do the transform", then why we need any more arguments? 

They select the rectangle which actually gets rendered.

> 
> >typedef enum GdkPixbufEdgeMode {
> >  GDK_PIXBUF_EDGE_NEAREST,
> >  GDK_PIXBUF_EDGE_TRANSPARENT,
> >  GDK_PIXBUF_EDGE_TILE
> >};
> >
> >/* Specify what to do for source pixels off the edge */
> >void gdk_pixbuf_transform_set_edge_mode (GdkPixbufTransform *transform,
> >					 GdkPixbufEdgeMode   mode);
> >
> What's this?!
> Absolutly no idea what this is all _about_.

See section 9 of the Xrender specification for this:

http://cvsweb.xfree86.org/cvsweb/~checkout~/xc/doc/specs/Render/protocol?rev=1.7&content-type=text/plain
 
Matthias

-- 
+++ GMX - Mail, Messaging & more  http://www.gmx.net +++
Bitte lächeln! Fotogalerie online mit GMX ohne eigene Homepage!




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