1 /* Libart_LGPL - library of basic graphic primitives
2 * Copyright (C) 1998 Raph Levien
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
27 * art_uta_new: Allocate a new uta.
28 * @x0: Left coordinate of uta.
29 * @y0: Top coordinate of uta.
30 * @x1: Right coordinate of uta.
31 * @y1: Bottom coordinate of uta.
33 * Allocates a new microtile array. The arguments are in units of
36 * Returns: the newly allocated #ArtUta.
39 art_uta_new (int x0
, int y0
, int x1
, int y1
)
43 uta
= art_new (ArtUta
, 1);
47 uta
->height
= y1
- y0
;
49 uta
->utiles
= art_new (ArtUtaBbox
, uta
->width
* uta
->height
);
51 memset (uta
->utiles
, 0, uta
->width
* uta
->height
* sizeof(ArtUtaBbox
));
56 * art_uta_new_coords: Allocate a new uta, based on pixel coordinates.
57 * @x0: Left coordinate of uta.
58 * @y0: Top coordinate of uta.
59 * @x1: Right coordinate of uta.
60 * @y1: Bottom coordinate of uta.
62 * Allocates a new microtile array. The arguments are in pixels
64 * Returns: the newly allocated #ArtUta.
67 art_uta_new_coords (int x0
, int y0
, int x1
, int y1
)
69 return art_uta_new (x0
>> ART_UTILE_SHIFT
, y0
>> ART_UTILE_SHIFT
,
70 1 + (x1
>> ART_UTILE_SHIFT
),
71 1 + (y1
>> ART_UTILE_SHIFT
));
75 * art_uta_free: Free a uta.
76 * @uta: The uta to free.
78 * Frees the microtile array structure, including the actual microtile
82 art_uta_free (ArtUta
*uta
)
84 art_free (uta
->utiles
);
88 /* User to Aardvark! */