The libart library
<<< Previous Page | Home | Up | Next Page >>>

# Micro Tile Array

## Name

Micro Tile Array --

## Synopsis

    typedef     ArtUtaBbox;
    struct      ArtUta;
    ArtUta*     art_uta_from_vpath              (const ArtVpath *vec);
    ArtUta*     art_uta_from_svp                (const ArtSVP *svp);
    ArtUta*     art_uta_from_irect              (ArtIRect *bbox);
    void        art_uta_add_line                (ArtUta *uta,
                                                 double x0,
                                                 double y0,
                                                 double x1,
                                                 double y1,
                                                 int *rbuf,
                                                 int rbuf_rowstride);
    ArtUta*     art_uta_union                   (ArtUta *uta1,
                                                 ArtUta *uta2);
    ArtUta*     art_uta_new                     (int x0,
                                                 int y0,
                                                 int x1,
                                                 int y1);
    ArtUta*     art_uta_new_coords              (int x0,
                                                 int y0,
                                                 int x1,
                                                 int y1);
    void        art_uta_free                    (ArtUta *uta);

## Description

## Details

### ArtUtaBbox

    typedef art_u32 ArtUtaBbox;

### struct ArtUta

    struct ArtUta {
      int x0;
      int y0;
      int width;
      int height;
      ArtUtaBbox *utiles;
    };

### art_uta_from_vpath ()

    ArtUta*     art_uta_from_vpath              (const ArtVpath *vec);

Generates a uta covering `vec`. The resulting uta is of course approximate, ie it may cover more pixels than covered by `vec`.

`vec` : | The source vpath.
Returns : | the new uta.

### art_uta_from_svp ()

    ArtUta*     art_uta_from_svp                (const ArtSVP *svp);

Generates a uta covering `svp`. The resulting uta is of course approximate, ie it may cover more pixels than covered by `svp`.

Note: I will want to replace this with a more direct implementation. But this gets the api in place.

`svp` : | The source svp.
Returns : | the new uta.

### art_uta_from_irect ()

    ArtUta*     art_uta_from_irect              (ArtIRect *bbox);

Generates a uta exactly covering `bbox`. Please do not call this function with a `bbox` with zero height or width.

`bbox` : | The source rectangle.
Returns : | the new uta.

### art_uta_add_line ()

    void        art_uta_add_line                (ArtUta *uta,
                                                 double x0,
                                                 double y0,
                                                 double x1,
                                                 double y1,
                                                 int *rbuf,
                                                 int rbuf_rowstride);

Add the line (`x0`, `y0`) - (`x1`, `y1`) to `uta`, and also update the winding number buffer used for rendering the interior. `rbuf` contains the first partial difference (in the X direction) of the winding number, measured in grid cells. Thus, each time that a line crosses a horizontal uta grid line, an entry of `rbuf` is incremented if `y1` > `y0`, decremented otherwise.

Note that edge handling is fairly delicate. Please rtfs for details.

`uta` : | The uta to modify.
`x0` : | X coordinate of line start point.
`y0` : | Y coordinate of line start point.
`x1` : | X coordinate of line end point.
`y1` : | Y coordinate of line end point.
`rbuf` : | Buffer containing first difference of winding number.
`rbuf_rowstride` : | Rowstride of `rbuf`.

### art_uta_union ()

    ArtUta*     art_uta_union                   (ArtUta *uta1,
                                                 ArtUta *uta2);

Computes the union of `uta1` and `uta2`. The union is approximate, but coverage is guaranteed over all pixels included in either of the arguments, ie more pixels may be covered than the "exact" union.

Note: this routine is used in the Gnome Canvas to accumulate the region that needs to be repainted. However, since it copies over the entire uta (which might be largish) even when the update may be small, it can be a performance bottleneck. There are two approaches to this problem, both of which are probably worthwhile. First, the generated uta's should always be limited to the visible window, thus guaranteeing that uta's never become large. Second, there should be a new, destructive union operation that only touches a small part of the uta when the update is small.

`uta1` : | One uta.
`uta2` : | The other uta.
Returns : | The new union uta.

### art_uta_new ()

    ArtUta*     art_uta_new                     (int x0,
                                                 int y0,
                                                 int x1,
                                                 int y1);

Allocates a new microtile array. The arguments are in units of tiles, not pixels.

`x0` : | Left coordinate of uta.
`y0` : | Top coordinate of uta.
`x1` : | Right coordinate of uta.
`y1` : | Bottom coordinate of uta.
Returns : | the newly allocated ArtUta.

### art_uta_new_coords ()

    ArtUta*     art_uta_new_coords              (int x0,
                                                 int y0,
                                                 int x1,
                                                 int y1);

Allocates a new microtile array. The arguments are in pixels

`x0` : | Left coordinate of uta.
`y0` : | Top coordinate of uta.
`x1` : | Right coordinate of uta.
`y1` : | Bottom coordinate of uta.
Returns : | the newly allocated ArtUta.

### art_uta_free ()

    void        art_uta_free                    (ArtUta *uta);

Frees the microtile array structure, including the actual microtile data.

`uta` : | The uta to free.

<<< Previous Page | Home | Up | Next Page >>>
MicroTile Arrays | GNU Free Documentation License