Commit 3ca948cb authored by Raph Levien's avatar Raph Levien

Mostly adding API doc headers, some small fixes.

parent 7bc67b49
1999-08-24 Raph Levien <raph@gimp.org>
art_affine.c, art_alphagamma.c, art_alphagamma.h, art_bpath.c,
art_bpath.h, art_gray_svp.c, art_misc.c, art_pixbuf.c,
art_pixbuf.h, art_point.h, art_rect.c, art_rect.h: Added api
documentation headers.
* testart.c: Added "dash" test, for testing the vpath_dash
functions.
* art_rgb_pixbuf_affine.h: Fixed the #ifdef for conditional
inclusion. Thanks to Kristian Hogsberg Kristensen for spotting
the bug.
1999-08-24 Raph Levien <raph@gimp.org>
* art_svp_render_aa.c (art_svp_render_aa): Added some tests to
avoid NaN for infinite slopes, which were causing problems on
Alphas. Closes bug #1966.
1999-08-20 Federico Mena Quintero <federico@redhat.com>
* configure.in: Fixed library's libtool version number.
......
......@@ -33,6 +33,12 @@
the natural basic functions of an affine transformation.
*/
/**
* art_affine_point: Do an affine transformation of a point.
* @dst: Where the result point is stored.
* @src: The original point.
@ @affine: The affine transformation.
**/
void
art_affine_point (ArtPoint *dst, const ArtPoint *src,
const double affine[6])
......@@ -45,6 +51,16 @@ art_affine_point (ArtPoint *dst, const ArtPoint *src,
dst->y = x * affine[1] + y * affine[3] + affine[5];
}
/** art_affine_invert: Find the inverse of an affine transformation.
* @dst: Where the resulting affine is stored.
* @src: The original affine transformation.
*
* All non-degenerate affine transforms are invertible. If the original
* affine is degenerate or nearly so, expect numerical instability and
* very likely core dumps on Alpha and other fp-picky architectures.
* Otherwise, @dst multiplied with @src, or @src multiplied with @dst
* will be (to within roundoff error) the identity affine.
**/
void
art_affine_invert (double dst[6], const double src[6])
{
......@@ -59,8 +75,17 @@ art_affine_invert (double dst[6], const double src[6])
dst[5] = -src[4] * dst[1] - src[5] * dst[3];
}
/* flip the matrix, FALSE, FALSE is a simple copy operation, and
TRUE, TRUE equals a rotation by 180 degrees */
/** art_affine_flip: Flip an affine transformation horizontally and/or vertically.
* @dst_affine: Where the resulting affine is stored.
* @src_affine: The original affine transformation.
* @horiz: Whether or not to flip horizontally.
* @vert: Whether or not to flip horizontally.
*
* Flips the affine transform. FALSE for both @horiz and @vert implements
* a simple copy operation. TRUE for both @horiz and @vert is a
* 180 degree rotation. It is ok for @src_affine and @dst_affine to
* be equal pointers.
**/
void
art_affine_flip (double dst_affine[6], const double src_affine[6], int horz, int vert)
{
......@@ -145,12 +170,20 @@ art_ftoa (char str[80], double x)
return p - str;
}
/* Convert affine trasformation to concise PostScript string representation.
The identity transform is mapped to the null string.
*/
#include <stdlib.h>
/**
* art_affine_to_string: Convert affine transformation to concise PostScript string representation.
* @str: Where to store the resulting string.
* @src: The affine transform.
*
* Converts an affine transform into a bit of PostScript code that
* implements the transform. Special cases of scaling, rotation, and
* translation are detected, and the corresponding PostScript
* operators used (this greatly aids understanding the output
* generated). The identity transform is mapped to the null string.
**/
void
art_affine_to_string (char str[128], const double src[6])
{
......@@ -221,12 +254,18 @@ art_affine_to_string (char str[128], const double src[6])
strcpy (str + ix, "] concat");
}
/* dst is the composition of doing affine src1 then src2. Note that
the PostScript concat operator multiplies on the left, i.e. if
"M concat" is equivalent to "CTM = multiply (M, CTM)";
It is safe to call this function with dst equal to one of the args.
*/
/** art_affine_multiply: Multiply two affine transformation matrices.
* @dst: Where to store the result.
* @src1: The first affine transform to multiply.
* @src2: The second affine transform to multiply.
*
* Multiplies two affine transforms together, i.e. the resulting @dst
* is equivalent to doing first @src1 then @src2. Note that the
* PostScript concat operator multiplies on the left, i.e. "M concat"
* is equivalent to "CTM = multiply (M, CTM)";
*
* It is safe to call this function with @dst equal to @src1 or @src2.
**/
void
art_affine_multiply (double dst[6], const double src1[6], const double src2[6])
{
......@@ -246,7 +285,11 @@ art_affine_multiply (double dst[6], const double src1[6], const double src2[6])
dst[5] = d5;
}
/* set up the identity matrix */
/** art_affine_identity: Set up the identity matrix.
* @dst: Where to store the resulting affine transform.
*
* Sets up an identity matrix.
**/
void
art_affine_identity (double dst[6])
{
......@@ -258,7 +301,14 @@ art_affine_identity (double dst[6])
dst[5] = 0;
}
/* set up a scaling matrix */
/** art_affine_scale: Set up a scaling matrix.
* @dst: Where to store the resulting affine transform.
* @sx: X scale factor.
* @sy: Y scale factor.
*
* Sets up a scaling matrix.
**/
void
art_affine_scale (double dst[6], double sx, double sy)
{
......@@ -270,7 +320,16 @@ art_affine_scale (double dst[6], double sx, double sy)
dst[5] = 0;
}
/* set up a rotation matrix; theta is given in degrees */
/** art_affine_rotate: Set up a rotation affine transform.
* @dst: Where to store the resulting affine transform.
* @theta: Rotation angle in degrees.
*
* Sets up a rotation matrix. In the standard libart coordinate
* system, in which increasing y moves downward, this is a
* counterclockwise rotation. In the standard PostScript coordinate
* system, which is reversed in the y direction, it is a clockwise
* rotation.
**/
void
art_affine_rotate (double dst[6], double theta)
{
......@@ -286,7 +345,14 @@ art_affine_rotate (double dst[6], double theta)
dst[5] = 0;
}
/* set up a shearing matrix; theta is given in degrees */
/** art_affine_shear: Set up a shearing matrix.
* @dst: Where to store the resulting affine transform.
* @theta: Shear angle in degrees.
*
* Sets up a shearing matrix. In the standard libart coordinate system
* and a small value for theta, || becomes \\. Horizontal lines remain
* unchanged.
**/
void
art_affine_shear (double dst[6], double theta)
{
......@@ -301,7 +367,13 @@ art_affine_shear (double dst[6], double theta)
dst[5] = 0;
}
/* set up a translation matrix */
/** art_affine_translate: Set up a translation matrix.
* @dst: Where to store the resulting affine transform.
* @tx: X translation amount.
* @tx: Y translation amount.
*
* Sets up a translation matrix.
**/
void
art_affine_translate (double dst[6], double tx, double ty)
{
......@@ -313,16 +385,31 @@ art_affine_translate (double dst[6], double tx, double ty)
dst[5] = ty;
}
/* find the affine's "expansion factor", i.e. the scale amount */
/** art_affine_expansion: Find the affine's expansion factor.
* @src: The affine transformation.
*
* Finds the expansion factor, i.e. the square root of the factor
* by which the affine transform affects area. In an affine transform
* composed of scaling, rotation, shearing, and translation, returns
* the amount of scaling.
*
* Return value: the expansion factor.
**/
double
art_affine_expansion (const double src[6])
{
return sqrt (src[0] * src[3] - src[1] * src[2]);
}
/* Determine whether the affine transformation is rectilinear,
i.e. whether a rectangle aligned to the grid is transformed into
another rectangle aligned to the grid. */
/** art_affine_rectilinear: Determine whether the affine transformation is rectilinear.
* @src: The original affine transformation.
*
* Determines whether @src is rectilinear, i.e. grid-aligned
* rectangles are transformed to other grid-aligned rectangles. The
* implementation has epsilon-tolerance for roundoff errors.
*
* Return value: TRUE if @src is rectilinear.
**/
int
art_affine_rectilinear (const double src[6])
{
......@@ -330,7 +417,15 @@ art_affine_rectilinear (const double src[6])
(fabs (src[0]) < EPSILON && fabs (src[3]) < EPSILON));
}
/* Determine whether two affine transformations are equal within grid allignment */
/** art_affine_equal: Determine whether two affine transformations are equal.
* @matrix1: An affine transformation.
* @matrix2: Another affine transformation.
*
* Determines whether @matrix1 and @matrix2 are equal, with
* epsilon-tolerance for roundoff errors.
*
* Return value: TRUE if @matrix1 and @matrix2 are equal.
**/
int
art_affine_equal (double matrix1[6], double matrix2[6])
{
......
......@@ -24,6 +24,19 @@
#include "art_alphagamma.h"
/** art_alphagamma_new: Create a new &ArtAlphaGamma.
* @gamma: Gamma value.
*
* Create a new &ArtAlphaGamma for a specific value of @gamma. When
* correctly implemented (which is generally not the case in libart),
* alpha compositing with an alphagamma parameter is equivalent to
* applying the gamma transformation to source images, doing the alpha
* compositing (in linear intensity space), then applying the inverse
* gamma transformation, bringing it back to a gamma-adjusted
* intensity space.
*
* Return value: The newly created &ArtAlphaGamma.
**/
ArtAlphaGamma *
art_alphagamma_new (double gamma)
{
......@@ -58,6 +71,11 @@ art_alphagamma_new (double gamma)
return alphagamma;
}
/** art_alphagamma_free: Free an &ArtAlphaGamma.
* @alphagamma: An &ArtAlphaGamma.
*
* Frees the &ArtAlphaGamma.
**/
void
art_alphagamma_free (ArtAlphaGamma *alphagamma)
{
......
......@@ -29,6 +29,7 @@ extern "C" {
typedef struct _ArtAlphaGamma ArtAlphaGamma;
struct _ArtAlphaGamma {
/*< private >*/
double gamma;
int invtable_size;
int table[256];
......
......@@ -25,10 +25,18 @@
#include "art_bpath.h"
/* Result (x', y') = (matrix[0] * x + matrix[2] * y + matrix[4],
matrix[1] * x + matrix[3] * y + matrix[5])
Returns newly allocated transformed path. */
/** art_bpath_affine_transform: Affine transform an &ArtBpath.
* @src: The source &ArtBpath.
* @matrix: The affine transform.
*
* Affine transform the bezpath, returning a newly allocated &ArtBpath
* (allocated using art_alloc()).
*
* Result (x', y') = (matrix[0] * x + matrix[2] * y + matrix[4],
* matrix[1] * x + matrix[3] * y + matrix[5])
*
* Return value: the transformed &ArtBpath.
**/
ArtBpath *
art_bpath_affine_transform (const ArtBpath *src, const double matrix[6])
{
......
......@@ -32,6 +32,7 @@ extern "C" {
typedef struct _ArtBpath ArtBpath;
struct _ArtBpath {
/*< public >*/
ArtPathcode code;
double x1;
double y1;
......
......@@ -87,10 +87,25 @@ art_gray_svp_callback (void *callback_data, int y,
data->buf += data->rowstride;
}
/* Render the vector path into the bytemap. Each pixel gets a value
proportional to the area within the pixel overlapping the (filled)
vector path */
/** art_gray_svp_aa: Render the vector path into the bytemap.
* @svp: The SVP to render.
* @x0: The view window's left coord.
* @y0: The view window's top coord.
* @x1: The view window's right coord.
* @y1: The view window's bottom coord.
* @buf: The buffer where the bytemap is stored.
* @rowstride: the rowstride for @buf.
*
* Each pixel gets a value proportional to the area within the pixel
* overlapping the (filled) SVP. Pixel (x, y) is stored at:
*
* @buf[(y - * @y0) * @rowstride + (x - @x0)]
*
* All pixels @x0 <= x < @x1, @y0 <= y < @y1 are generated. A
* stored value of zero is no coverage, and a value of 255 is full
* coverage. The area within the pixel (x, y) is the region covered
* by [x..x+1] and [y..y+1].
**/
void
art_gray_svp_aa (const ArtSVP *svp,
int x0, int y0, int x1, int y1,
......
......@@ -24,7 +24,11 @@
#include <stdarg.h>
#include "art_misc.h"
/* Print the error message to stderr and exit with a return code of 1 */
/** art_die: Print the error message to stderr and exit with a return code of 1.
* @fmt: The printf-style format for the error message.
*
* Used for dealing with severe errors.
**/
void
art_die (const char *fmt, ...)
{
......@@ -36,7 +40,11 @@ art_die (const char *fmt, ...)
exit (1);
}
/* Print the error message to stderr */
/** art_die: Print the error message to stderr.
* @fmt: The printf-style format for the error message.
*
* Used for generating warnings.
**/
void
art_warn (const char *fmt, ...)
{
......
......@@ -21,10 +21,26 @@
#include "art_pixbuf.h"
/* A generic data structure for holding a buffer of pixels. One way
to think about this module is as a virtualization over specific
pixel buffer formats. */
/** art_pixbuf_new_rgb_dnotify: Create a new RGB &ArtPixBuf with explicit destroy notification.
* @pixels: A buffer containing the actual pixel data.
* @width: The width of the pixbuf.
* @height: The height of the pixbuf.
* @rowstride: The rowstride of the pixbuf.
* @dfunc_data: The private data passed to @dfunc.
* @dfunc: The destroy notification function.
*
* Creates a generic data structure for holding a buffer of RGB
* pixels. It is possible to think of an &ArtPixBuf as a
* virtualization over specific pixel buffer formats.
*
* @dfunc is called with @dfunc_data and @pixels as arguments when the
* &ArtPixBuf is destroyed. Using a destroy notification function
* allows a wide range of memory management disciplines for the pixel
* memory. A NULL value for @dfunc is also allowed and means that no
* special action will be taken on destruction.
*
* Return value: The newly created &ArtPixBuf.
**/
ArtPixBuf *
art_pixbuf_new_rgb_dnotify (art_u8 *pixels, int width, int height, int rowstride,
void *dfunc_data, ArtDestroyNotify dfunc)
......@@ -48,6 +64,26 @@ art_pixbuf_new_rgb_dnotify (art_u8 *pixels, int width, int height, int rowstride
return pixbuf;
}
/** art_pixbuf_new_rgba_dnotify: Create a new RGBA &ArtPixBuf with explicit destroy notification.
* @pixels: A buffer containing the actual pixel data.
* @width: The width of the pixbuf.
* @height: The height of the pixbuf.
* @rowstride: The rowstride of the pixbuf.
* @dfunc_data: The private data passed to @dfunc.
* @dfunc: The destroy notification function.
*
* Creates a generic data structure for holding a buffer of RGBA
* pixels. It is possible to think of an &ArtPixBuf as a
* virtualization over specific pixel buffer formats.
*
* @dfunc is called with @dfunc_data and @pixels as arguments when the
* &ArtPixBuf is destroyed. Using a destroy notification function
* allows a wide range of memory management disciplines for the pixel
* memory. A NULL value for @dfunc is also allowed and means that no
* special action will be taken on destruction.
*
* Return value: The newly created &ArtPixBuf.
**/
ArtPixBuf *
art_pixbuf_new_rgba_dnotify (art_u8 *pixels, int width, int height, int rowstride,
void *dfunc_data, ArtDestroyNotify dfunc)
......@@ -71,12 +107,44 @@ art_pixbuf_new_rgba_dnotify (art_u8 *pixels, int width, int height, int rowstrid
return pixbuf;
}
/** art_pixbuf_new_const_rgb: Create a new RGB &ArtPixBuf with constant pixel data.
* @pixels: A buffer containing the actual pixel data.
* @width: The width of the pixbuf.
* @height: The height of the pixbuf.
* @rowstride: The rowstride of the pixbuf.
*
* Creates a generic data structure for holding a buffer of RGB
* pixels. It is possible to think of an &ArtPixBuf as a
* virtualization over specific pixel buffer formats.
*
* No action is taken when the &ArtPixBuf is destroyed. Thus, this
* function is useful when the pixel data is constant or statically
* allocated.
*
* Return value: The newly created &ArtPixBuf.
**/
ArtPixBuf *
art_pixbuf_new_const_rgb (const art_u8 *pixels, int width, int height, int rowstride)
{
return art_pixbuf_new_rgb_dnotify ((art_u8 *) pixels, width, height, rowstride, NULL, NULL);
}
/** art_pixbuf_new_const_rgba: Create a new RGBA &ArtPixBuf with constant pixel data.
* @pixels: A buffer containing the actual pixel data.
* @width: The width of the pixbuf.
* @height: The height of the pixbuf.
* @rowstride: The rowstride of the pixbuf.
*
* Creates a generic data structure for holding a buffer of RGBA
* pixels. It is possible to think of an &ArtPixBuf as a
* virtualization over specific pixel buffer formats.
*
* No action is taken when the &ArtPixBuf is destroyed. Thus, this
* function is suitable when the pixel data is constant or statically
* allocated.
*
* Return value: The newly created &ArtPixBuf.
**/
ArtPixBuf *
art_pixbuf_new_const_rgba (const art_u8 *pixels, int width, int height, int rowstride)
{
......@@ -89,19 +157,57 @@ art_pixel_destroy (void *func_data, void *data)
art_free (data);
}
/** art_pixbuf_new_rgb: Create a new RGB &ArtPixBuf.
* @pixels: A buffer containing the actual pixel data.
* @width: The width of the pixbuf.
* @height: The height of the pixbuf.
* @rowstride: The rowstride of the pixbuf.
*
* Creates a generic data structure for holding a buffer of RGB
* pixels. It is possible to think of an &ArtPixBuf as a
* virtualization over specific pixel buffer formats.
*
* The @pixels buffer is freed with art_free() when the &ArtPixBuf is
* destroyed. Thus, this function is suitable when the pixel data is
* allocated with art_alloc().
*
* Return value: The newly created &ArtPixBuf.
**/
ArtPixBuf *
art_pixbuf_new_rgb (art_u8 *pixels, int width, int height, int rowstride)
{
return art_pixbuf_new_rgb_dnotify (pixels, width, height, rowstride, NULL, art_pixel_destroy);
}
/** art_pixbuf_new_rgba: Create a new RGBA &ArtPixBuf.
* @pixels: A buffer containing the actual pixel data.
* @width: The width of the pixbuf.
* @height: The height of the pixbuf.
* @rowstride: The rowstride of the pixbuf.
*
* Creates a generic data structure for holding a buffer of RGBA
* pixels. It is possible to think of an &ArtPixBuf as a
* virtualization over specific pixel buffer formats.
*
* The @pixels buffer is freed with art_free() when the &ArtPixBuf is
* destroyed. Thus, this function is suitable when the pixel data is
* allocated with art_alloc().
*
* Return value: The newly created &ArtPixBuf.
**/
ArtPixBuf *
art_pixbuf_new_rgba (art_u8 *pixels, int width, int height, int rowstride)
{
return art_pixbuf_new_rgba_dnotify (pixels, width, height, rowstride, NULL, art_pixel_destroy);
}
/* free an ArtPixBuf with destroy notification */
/** art_pixbuf_free: Destroy an &ArtPixBuf.
* @pixbuf: The &ArtPixBuf to be destroyed.
*
* Destroys the &ArtPixBuf, calling the destroy notification function
* (if non-NULL) so that the memory for the pixel buffer can be
* properly reclaimed.
**/
void
art_pixbuf_free (ArtPixBuf *pixbuf)
{
......@@ -119,7 +225,14 @@ art_pixbuf_free (ArtPixBuf *pixbuf)
art_free (pixbuf);
}
/* deprecated function, use the _dnotify variants for allocation instead */
/** art_pixbuf_free_shallow:
* @pixbuf: The &ArtPixBuf to be destroyed.
*
* Destroys the &ArtPixBuf without calling the destroy notification function.
*
* This function is deprecated. Use the _dnotify variants for
* allocation instead.
**/
void
art_pixbuf_free_shallow (ArtPixBuf *pixbuf)
{
......
......@@ -43,6 +43,7 @@ typedef enum {
has n_channels samples. It is stored in simple packed format. */
struct _ArtPixBuf {
/*< public >*/
ArtPixFormat format;
int n_channels;
int has_alpha;
......
......@@ -27,6 +27,7 @@ extern "C" {
typedef struct _ArtPoint ArtPoint;
struct _ArtPoint {
/*< public >*/
double x, y;
};
......
......@@ -31,7 +31,12 @@
/* rectangle primitives stolen from gzilla */
/* Make a copy of the rectangle. */
/** art_irect_copy: Make a copy of an integer rectangle.
* @dest: Where the copy is stored.
* @src: The source rectangle.
*
* Copies the rectangle.
**/
void
art_irect_copy (ArtIRect *dest, const ArtIRect *src) {
dest->x0 = src->x0;
......@@ -40,7 +45,13 @@ art_irect_copy (ArtIRect *dest, const ArtIRect *src) {
dest->y1 = src->y1;
}
/* Find the smallest rectangle that includes both source rectangles. */
/** art_irect_union: Find union of two integer rectangles.
* @dest: Where the result is stored.
* @src1: A source rectangle.
* @src2: Another source rectangle.
*
* Finds the smallest rectangle that includes @src1 and @src2.
**/
void
art_irect_union (ArtIRect *dest, const ArtIRect *src1, const ArtIRect *src2) {
if (art_irect_empty (src1)) {
......@@ -55,7 +66,13 @@ art_irect_union (ArtIRect *dest, const ArtIRect *src1, const ArtIRect *src2) {
}
}
/* Return the intersection of the two rectangles */
/** art_irect_intersection: Find intersection of two integer rectangles.
* @dest: Where the result is stored.
* @src1: A source rectangle.
* @src2: Another source rectangle.
*
* Finds the intersection of @src1 and @src2.
**/
void
art_irect_intersect (ArtIRect *dest, const ArtIRect *src1, const ArtIRect *src2) {
dest->x0 = MAX (src1->x0, src2->x0);
......@@ -64,7 +81,11 @@ art_irect_intersect (ArtIRect *dest, const ArtIRect *src1, const ArtIRect *src2)
dest->y1 = MIN (src1->y1, src2->y1);
}
/* Return true if the rectangle is empty. */
/** art_irect_empty: Determine whether integer rectangle is empty.
* @src: The source rectangle.
*
* Return value: TRUE if @src is an empty rectangle, FALSE otherwise.
**/
int
art_irect_empty (const ArtIRect *src) {
return (src->x1 <= src->x0 || src->y1 <= src->y0);
......@@ -77,7 +98,12 @@ gboolean irect_point_inside (ArtIRect *rect, GzwPoint *point) {
}
#endif
/* Make a copy of the rectangle. */
/** art_drect_copy: Make a copy of a rectangle.
* @dest: Where the copy is stored.
* @src: The source rectangle.
*
* Copies the rectangle.
**/
void
art_drect_copy (ArtDRect *dest, const ArtDRect *src) {
dest->x0 = src->x0;
......@@ -86,7 +112,13 @@ art_drect_copy (ArtDRect *dest, const ArtDRect *src) {
dest->y1 = src->y1;
}
/* Find the smallest rectangle that includes both source rectangles. */
/** art_drect_union: Find union of two rectangles.
* @dest: Where the result is stored.
* @src1: A source rectangle.
* @src2: Another source rectangle.
*
* Finds the smallest rectangle that includes @src1 and @src2.
**/
void
art_drect_union (ArtDRect *dest, const ArtDRect *src1, const ArtDRect *src2) {
if (art_drect_empty (src1)) {
......@@ -101,7 +133,13 @@ art_drect_union (ArtDRect *dest, const ArtDRect *src1, const ArtDRect *src2) {
}
}
/* Return the intersection of the two rectangles */
/** art_drect_intersection: Find intersection of two rectangles.
* @dest: Where the result is stored.
* @src1: A source rectangle.
* @src2: Another source rectangle.
*
* Finds the intersection of @src1 and @src2.
**/
void
art_drect_intersect (ArtDRect *dest, const ArtDRect *src1, const ArtDRect *src2) {
dest->x0 = MAX (src1->x0, src2->x0);
......@@ -110,12 +148,26 @@ art_drect_intersect (ArtDRect *dest, const ArtDRect *src1, const ArtDRect *src2)
dest->y1 = MIN (src1->y1, src2->y1);
}
/* Return true if the rectangle is empty. */
/** art_irect_empty: Determine whether rectangle is empty.
* @src: The source rectangle.
*
* Return value: TRUE if @src is an empty rectangle, FALSE otherwise.
**/
int
art_drect_empty (const ArtDRect *src) {
return (src->x1 <= src->x0 || src->y1 <= src->y0);
}
/** art_drect_affine_transform: Affine transform rectangle.
* @dst: Where to store the result.
* @src: The source rectangle.
* @matrix: The affine transformation.
*
* Find the smallest rectangle enclosing the affine transformed @src.
* The result is exactly the affine transformation of @src when
* @matrix specifies a rectilinear affine transformation, otherwise it
* is a conservative approximation.
**/
void
art_drect_affine_transform (ArtDRect *dst, const ArtDRect *src, const double matrix[6])
{
......@@ -136,6 +188,12 @@ art_drect_affine_transform (ArtDRect *dst, const ArtDRect *src, const double mat
dst->y1 = MAX (MAX (y00, y10), MAX (y01, y11));
}
/** art_drect_to_irect: Convert rectangle to integer rectangle.
* @dst: Where to store resulting integer rectangle.
* @src: The source rectangle.
*
* Find the smallest integer rectangle that encloses @src.
**/
void
art_drect_to_irect (ArtIRect *dst, ArtDRect *src)
{
......
......@@ -28,10 +28,12 @@ typedef struct _ArtDRect ArtDRect;
typedef struct _ArtIRect ArtIRect;
struct _ArtDRect {
/*< public >*/
double x0, y0, x1, y1;
};
struct _ArtIRect {
/*< public >*/
int x0, y0, x1, y1;
};
......
......@@ -17,8 +17,8 @@
* Boston, MA 02111-1307, USA.
*/
#ifndef __ART_RGB_AFFINE_H__
#define __ART_RGB_AFFINE_H__
#ifndef __ART_RGB_PIXBUF_AFFINE_H__
#define __ART_RGB_PIXBUF_AFFINE_H__
/* This module handles compositing of affine-transformed generic
pixbuf images over rgb pixel buffers. */
......
......@@ -379,6 +379,7 @@ usage (void)
fprintf (stderr, "usage: testart <test>\n"
" where <test> is one of:\n"
" testpat -- make random star + gradients test pattern\n"
" dash -- dash test (output is valid PostScript)\n"
" dist -- distance test\n");
exit (1);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment