Removed tabs and trailing whitespaces.

This commit is contained in:
David Odin 2003-09-27 23:02:39 +00:00
parent 079101d656
commit e6cd5255d0
10 changed files with 308 additions and 323 deletions

View file

@ -1,3 +1,10 @@
2003-09-28 DindinX <david@dindinx.net>
* libgimpmath/gimpmatrix.[ch]:
* libgimpmath/gimpmd5.[ch]:
* libgimpmath/gimpvector.[ch]:
* libgimpmath/test-md5.c: Removed tabs and trailing whitespaces.
2003-09-28 Michael Natterer <mitch@gimp.org> 2003-09-28 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage.c (gimp_image_transform_temp_buf): use a much * app/core/gimpimage.c (gimp_image_transform_temp_buf): use a much

View file

@ -169,16 +169,6 @@ Utilities to set up and manipulate vectors.
@y: @y:
<!-- ##### FUNCTION gimp_vector2_new_val ##### -->
<para>
</para>
@x:
@y:
@Returns:
<!-- ##### FUNCTION gimp_vector2_add ##### --> <!-- ##### FUNCTION gimp_vector2_add ##### -->
<para> <para>

View file

@ -54,7 +54,7 @@ gimp_matrix2_identity (GimpMatrix2 *matrix)
*/ */
void void
gimp_matrix2_mult (const GimpMatrix2 *matrix1, gimp_matrix2_mult (const GimpMatrix2 *matrix1,
GimpMatrix2 *matrix2) GimpMatrix2 *matrix2)
{ {
GimpMatrix2 tmp; GimpMatrix2 tmp;
@ -98,10 +98,10 @@ gimp_matrix3_identity (GimpMatrix3 *matrix)
*/ */
void void
gimp_matrix3_transform_point (const GimpMatrix3 *matrix, gimp_matrix3_transform_point (const GimpMatrix3 *matrix,
gdouble x, gdouble x,
gdouble y, gdouble y,
gdouble *newx, gdouble *newx,
gdouble *newy) gdouble *newy)
{ {
gdouble w; gdouble w;
@ -129,7 +129,7 @@ gimp_matrix3_transform_point (const GimpMatrix3 *matrix,
*/ */
void void
gimp_matrix3_mult (const GimpMatrix3 *matrix1, gimp_matrix3_mult (const GimpMatrix3 *matrix1,
GimpMatrix3 *matrix2) GimpMatrix3 *matrix2)
{ {
gint i, j; gint i, j;
GimpMatrix3 tmp; GimpMatrix3 tmp;
@ -142,11 +142,11 @@ gimp_matrix3_mult (const GimpMatrix3 *matrix1,
t3 = matrix1->coeff[i][2]; t3 = matrix1->coeff[i][2];
for (j = 0; j < 3; j++) for (j = 0; j < 3; j++)
{ {
tmp.coeff[i][j] = t1 * matrix2->coeff[0][j]; tmp.coeff[i][j] = t1 * matrix2->coeff[0][j];
tmp.coeff[i][j] += t2 * matrix2->coeff[1][j]; tmp.coeff[i][j] += t2 * matrix2->coeff[1][j];
tmp.coeff[i][j] += t3 * matrix2->coeff[2][j]; tmp.coeff[i][j] += t3 * matrix2->coeff[2][j];
} }
} }
*matrix2 = tmp; *matrix2 = tmp;
@ -162,8 +162,8 @@ gimp_matrix3_mult (const GimpMatrix3 *matrix1,
*/ */
void void
gimp_matrix3_translate (GimpMatrix3 *matrix, gimp_matrix3_translate (GimpMatrix3 *matrix,
gdouble x, gdouble x,
gdouble y) gdouble y)
{ {
gdouble g, h, i; gdouble g, h, i;
@ -189,8 +189,8 @@ gimp_matrix3_translate (GimpMatrix3 *matrix,
*/ */
void void
gimp_matrix3_scale (GimpMatrix3 *matrix, gimp_matrix3_scale (GimpMatrix3 *matrix,
gdouble x, gdouble x,
gdouble y) gdouble y)
{ {
matrix->coeff[0][0] *= x; matrix->coeff[0][0] *= x;
matrix->coeff[0][1] *= x; matrix->coeff[0][1] *= x;
@ -210,7 +210,7 @@ gimp_matrix3_scale (GimpMatrix3 *matrix,
*/ */
void void
gimp_matrix3_rotate (GimpMatrix3 *matrix, gimp_matrix3_rotate (GimpMatrix3 *matrix,
gdouble theta) gdouble theta)
{ {
gdouble t1, t2; gdouble t1, t2;
gdouble cost, sint; gdouble cost, sint;
@ -243,7 +243,7 @@ gimp_matrix3_rotate (GimpMatrix3 *matrix,
*/ */
void void
gimp_matrix3_xshear (GimpMatrix3 *matrix, gimp_matrix3_xshear (GimpMatrix3 *matrix,
gdouble amount) gdouble amount)
{ {
matrix->coeff[0][0] += amount * matrix->coeff[1][0]; matrix->coeff[0][0] += amount * matrix->coeff[1][0];
matrix->coeff[0][1] += amount * matrix->coeff[1][1]; matrix->coeff[0][1] += amount * matrix->coeff[1][1];
@ -259,7 +259,7 @@ gimp_matrix3_xshear (GimpMatrix3 *matrix,
*/ */
void void
gimp_matrix3_yshear (GimpMatrix3 *matrix, gimp_matrix3_yshear (GimpMatrix3 *matrix,
gdouble amount) gdouble amount)
{ {
matrix->coeff[1][0] += amount * matrix->coeff[0][0]; matrix->coeff[1][0] += amount * matrix->coeff[0][0];
matrix->coeff[1][1] += amount * matrix->coeff[0][1]; matrix->coeff[1][1] += amount * matrix->coeff[0][1];
@ -407,10 +407,10 @@ gimp_matrix3_is_diagonal (const GimpMatrix3 *matrix)
for (i = 0; i < 3; i++) for (i = 0; i < 3; i++)
{ {
for (j = 0; j < 3; j++) for (j = 0; j < 3; j++)
{ {
if (i != j && fabs (matrix->coeff[i][j]) > EPSILON) if (i != j && fabs (matrix->coeff[i][j]) > EPSILON)
return FALSE; return FALSE;
} }
} }
return TRUE; return TRUE;
@ -432,18 +432,18 @@ gimp_matrix3_is_identity (const GimpMatrix3 *matrix)
for (i = 0; i < 3; i++) for (i = 0; i < 3; i++)
{ {
for (j = 0; j < 3; j++) for (j = 0; j < 3; j++)
{ {
if (i == j) if (i == j)
{ {
if (fabs (matrix->coeff[i][j] - 1.0) > EPSILON) if (fabs (matrix->coeff[i][j] - 1.0) > EPSILON)
return FALSE; return FALSE;
} }
else else
{ {
if (fabs (matrix->coeff[i][j]) > EPSILON) if (fabs (matrix->coeff[i][j]) > EPSILON)
return FALSE; return FALSE;
} }
} }
} }
return TRUE; return TRUE;
@ -474,11 +474,11 @@ gimp_matrix3_is_simple (const GimpMatrix3 *matrix)
for (i = 0; i < 2; i++) for (i = 0; i < 2; i++)
{ {
for (j = 0; j < 2; j++) for (j = 0; j < 2; j++)
{ {
absm = fabs (matrix->coeff[i][j]); absm = fabs (matrix->coeff[i][j]);
if (absm > EPSILON && fabs (absm - 1.0) > EPSILON) if (absm > EPSILON && fabs (absm - 1.0) > EPSILON)
return FALSE; return FALSE;
} }
} }
return TRUE; return TRUE;
@ -486,9 +486,9 @@ gimp_matrix3_is_simple (const GimpMatrix3 *matrix)
void void
gimp_matrix4_to_deg (const GimpMatrix4 *matrix, gimp_matrix4_to_deg (const GimpMatrix4 *matrix,
gdouble *a, gdouble *a,
gdouble *b, gdouble *b,
gdouble *c) gdouble *c)
{ {
*a = 180 * (asin (matrix->coeff[1][0]) / G_PI_2); *a = 180 * (asin (matrix->coeff[1][0]) / G_PI_2);
*b = 180 * (asin (matrix->coeff[2][0]) / G_PI_2); *b = 180 * (asin (matrix->coeff[2][0]) / G_PI_2);

View file

@ -45,23 +45,23 @@ struct _GimpMatrix4
void gimp_matrix2_identity (GimpMatrix2 *matrix); void gimp_matrix2_identity (GimpMatrix2 *matrix);
void gimp_matrix2_mult (const GimpMatrix2 *matrix1, void gimp_matrix2_mult (const GimpMatrix2 *matrix1,
GimpMatrix2 *matrix2); GimpMatrix2 *matrix2);
void gimp_matrix3_identity (GimpMatrix3 *matrix); void gimp_matrix3_identity (GimpMatrix3 *matrix);
void gimp_matrix3_mult (const GimpMatrix3 *matrix1, void gimp_matrix3_mult (const GimpMatrix3 *matrix1,
GimpMatrix3 *matrix2); GimpMatrix3 *matrix2);
void gimp_matrix3_translate (GimpMatrix3 *matrix, void gimp_matrix3_translate (GimpMatrix3 *matrix,
gdouble x, gdouble x,
gdouble y); gdouble y);
void gimp_matrix3_scale (GimpMatrix3 *matrix, void gimp_matrix3_scale (GimpMatrix3 *matrix,
gdouble x, gdouble x,
gdouble y); gdouble y);
void gimp_matrix3_rotate (GimpMatrix3 *matrix, void gimp_matrix3_rotate (GimpMatrix3 *matrix,
gdouble theta); gdouble theta);
void gimp_matrix3_xshear (GimpMatrix3 *matrix, void gimp_matrix3_xshear (GimpMatrix3 *matrix,
gdouble amount); gdouble amount);
void gimp_matrix3_yshear (GimpMatrix3 *matrix, void gimp_matrix3_yshear (GimpMatrix3 *matrix,
gdouble amount); gdouble amount);
void gimp_matrix3_affine (GimpMatrix3 *matrix, void gimp_matrix3_affine (GimpMatrix3 *matrix,
gdouble a, gdouble a,
gdouble b, gdouble b,
@ -78,15 +78,15 @@ gboolean gimp_matrix3_is_identity (const GimpMatrix3 *matrix);
gboolean gimp_matrix3_is_simple (const GimpMatrix3 *matrix); gboolean gimp_matrix3_is_simple (const GimpMatrix3 *matrix);
void gimp_matrix3_transform_point (const GimpMatrix3 *matrix, void gimp_matrix3_transform_point (const GimpMatrix3 *matrix,
gdouble x, gdouble x,
gdouble y, gdouble y,
gdouble *newx, gdouble *newx,
gdouble *newy); gdouble *newy);
void gimp_matrix4_to_deg (const GimpMatrix4 *matrix, void gimp_matrix4_to_deg (const GimpMatrix4 *matrix,
gdouble *a, gdouble *a,
gdouble *b, gdouble *b,
gdouble *c); gdouble *c);
G_END_DECLS G_END_DECLS

View file

@ -40,12 +40,12 @@ struct _GimpMD5Context
static void gimp_md5_init (GimpMD5Context *ctx); static void gimp_md5_init (GimpMD5Context *ctx);
static void gimp_md5_transform (guint32 buf[4], static void gimp_md5_transform (guint32 buf[4],
const guint32 in[16]); const guint32 in[16]);
static void gimp_md5_update (GimpMD5Context *ctx, static void gimp_md5_update (GimpMD5Context *ctx,
const guchar *buf, const guchar *buf,
guint32 len); guint32 len);
static void gimp_md5_final (GimpMD5Context *ctx, static void gimp_md5_final (GimpMD5Context *ctx,
guchar digest[16]); guchar digest[16]);
@ -54,7 +54,7 @@ static void gimp_md5_final (GimpMD5Context *ctx,
* @buffer: byte buffer * @buffer: byte buffer
* @buffer_size: buffer size (in bytes) or -1 if @buffer is nul-terminated. * @buffer_size: buffer size (in bytes) or -1 if @buffer is nul-terminated.
* @digest: 16 bytes buffer receiving the hash code. * @digest: 16 bytes buffer receiving the hash code.
* *
* Get the md5 hash of a buffer. The result is put in the 16 bytes * Get the md5 hash of a buffer. The result is put in the 16 bytes
* buffer @digest. * buffer @digest.
* *
@ -74,7 +74,7 @@ gimp_md5_get_digest (const gchar *buffer,
g_return_if_fail (buffer != NULL); g_return_if_fail (buffer != NULL);
g_return_if_fail (digest != NULL); g_return_if_fail (digest != NULL);
if (buffer_size < 0) if (buffer_size < 0)
buffer_size = strlen (buffer); buffer_size = strlen (buffer);
@ -84,11 +84,11 @@ gimp_md5_get_digest (const gchar *buffer,
} }
static inline void static inline void
byte_reverse (guint32 *buf, byte_reverse (guint32 *buf,
guint32 longs) guint32 longs)
{ {
#if G_BYTE_ORDER != G_LITTLE_ENDIAN #if G_BYTE_ORDER != G_LITTLE_ENDIAN
do do
{ {
*buf = GINT32_TO_LE (*buf); *buf = GINT32_TO_LE (*buf);
buf++; buf++;
@ -104,31 +104,31 @@ gimp_md5_init (GimpMD5Context *ctx)
ctx->buf[1] = 0xefcdab89; ctx->buf[1] = 0xefcdab89;
ctx->buf[2] = 0x98badcfe; ctx->buf[2] = 0x98badcfe;
ctx->buf[3] = 0x10325476; ctx->buf[3] = 0x10325476;
ctx->bits[0] = 0; ctx->bits[0] = 0;
ctx->bits[1] = 0; ctx->bits[1] = 0;
} }
static void static void
gimp_md5_update (GimpMD5Context *ctx, gimp_md5_update (GimpMD5Context *ctx,
const guchar *buf, const guchar *buf,
guint32 len) guint32 len)
{ {
guint32 t; guint32 t;
/* Update bitcount */ /* Update bitcount */
t = ctx->bits[0]; t = ctx->bits[0];
if ((ctx->bits[0] = t + ((guint32) len << 3)) < t) if ((ctx->bits[0] = t + ((guint32) len << 3)) < t)
ctx->bits[1]++; /* Carry from low to high */ ctx->bits[1]++; /* Carry from low to high */
ctx->bits[1] += len >> 29; ctx->bits[1] += len >> 29;
t = (t >> 3) & 0x3f; t = (t >> 3) & 0x3f;
/* Handle any leading odd-sized chunks */ /* Handle any leading odd-sized chunks */
if (t) if (t)
{ {
guchar *p = (guchar *) ctx->in + t; guchar *p = (guchar *) ctx->in + t;
t = 64 - t; t = 64 - t;
if (len < t) if (len < t)
{ {
@ -142,10 +142,10 @@ gimp_md5_update (GimpMD5Context *ctx,
gimp_md5_transform (ctx->buf, (guint32 *) ctx->in); gimp_md5_transform (ctx->buf, (guint32 *) ctx->in);
buf += t; buf += t;
len -= t; len -= t;
} }
/* Process data in 64-byte chunks */ /* Process data in 64-byte chunks */
while (len >= 64) while (len >= 64)
{ {
memcpy (ctx->in, buf, 64); memcpy (ctx->in, buf, 64);
byte_reverse ((guint32 *) ctx->in, 16); byte_reverse ((guint32 *) ctx->in, 16);
@ -153,52 +153,52 @@ gimp_md5_update (GimpMD5Context *ctx,
buf += 64; buf += 64;
len -= 64; len -= 64;
} }
/* Handle any remaining bytes of data. */ /* Handle any remaining bytes of data. */
memcpy (ctx->in, buf, len); memcpy (ctx->in, buf, len);
} }
static void static void
gimp_md5_final (GimpMD5Context *ctx, gimp_md5_final (GimpMD5Context *ctx,
guchar digest[16]) guchar digest[16])
{ {
guint32 count; guint32 count;
guchar *p; guchar *p;
/* Compute number of bytes mod 64 */ /* Compute number of bytes mod 64 */
count = (ctx->bits[0] >> 3) & 0x3F; count = (ctx->bits[0] >> 3) & 0x3F;
/* Set the first char of padding to 0x80. This is safe since there is /* Set the first char of padding to 0x80. This is safe since there is
always at least one byte free */ always at least one byte free */
p = ctx->in + count; p = ctx->in + count;
*p++ = 0x80; *p++ = 0x80;
/* Bytes of padding needed to make 64 bytes */ /* Bytes of padding needed to make 64 bytes */
count = 64 - 1 - count; count = 64 - 1 - count;
/* Pad out to 56 mod 64 */ /* Pad out to 56 mod 64 */
if (count < 8) if (count < 8)
{ {
/* Two lots of padding: Pad the first block to 64 bytes */ /* Two lots of padding: Pad the first block to 64 bytes */
memset (p, 0, count); memset (p, 0, count);
byte_reverse ((guint32 *) ctx->in, 16); byte_reverse ((guint32 *) ctx->in, 16);
gimp_md5_transform (ctx->buf, (guint32 *) ctx->in); gimp_md5_transform (ctx->buf, (guint32 *) ctx->in);
/* Now fill the next block with 56 bytes */ /* Now fill the next block with 56 bytes */
memset (ctx->in, 0, 56); memset (ctx->in, 0, 56);
} }
else else
{ {
/* Pad block to 56 bytes */ /* Pad block to 56 bytes */
memset (p, 0, count - 8); memset (p, 0, count - 8);
} }
byte_reverse ((guint32 *) ctx->in, 14); byte_reverse ((guint32 *) ctx->in, 14);
/* Append length in bits and transform */ /* Append length in bits and transform */
((guint32 *) ctx->in)[14] = ctx->bits[0]; ((guint32 *) ctx->in)[14] = ctx->bits[0];
((guint32 *) ctx->in)[15] = ctx->bits[1]; ((guint32 *) ctx->in)[15] = ctx->bits[1];
gimp_md5_transform (ctx->buf, (guint32 *) ctx->in); gimp_md5_transform (ctx->buf, (guint32 *) ctx->in);
byte_reverse (ctx->buf, 4); byte_reverse (ctx->buf, 4);
memcpy (digest, ctx->buf, 16); memcpy (digest, ctx->buf, 16);
@ -215,24 +215,24 @@ gimp_md5_final (GimpMD5Context *ctx,
/* This is the central step in the MD5 algorithm. */ /* This is the central step in the MD5 algorithm. */
#define MD5STEP(f, w, x, y, z, data, s) \ #define MD5STEP(f, w, x, y, z, data, s) \
( w += f(x, y, z) + data, w = w<<s | w>>(32-s), w += x ) ( w += f(x, y, z) + data, w = w<<s | w>>(32-s), w += x )
/* /*
* The core of the MD5 algorithm, this alters an existing MD5 hash to * The core of the MD5 algorithm, this alters an existing MD5 hash to
* reflect the addition of 16 longwords of new data. md5_Update blocks * reflect the addition of 16 longwords of new data. md5_Update blocks
* the data and converts bytes into longwords for this routine. * the data and converts bytes into longwords for this routine.
*/ */
static void static void
gimp_md5_transform (guint32 buf[4], gimp_md5_transform (guint32 buf[4],
const guint32 in[16]) const guint32 in[16])
{ {
register guint32 a, b, c, d; register guint32 a, b, c, d;
a = buf[0]; a = buf[0];
b = buf[1]; b = buf[1];
c = buf[2]; c = buf[2];
d = buf[3]; d = buf[3];
MD5STEP (F1, a, b, c, d, in[0] + 0xd76aa478, 7); MD5STEP (F1, a, b, c, d, in[0] + 0xd76aa478, 7);
MD5STEP (F1, d, a, b, c, in[1] + 0xe8c7b756, 12); MD5STEP (F1, d, a, b, c, in[1] + 0xe8c7b756, 12);
MD5STEP (F1, c, d, a, b, in[2] + 0x242070db, 17); MD5STEP (F1, c, d, a, b, in[2] + 0x242070db, 17);
@ -249,7 +249,7 @@ gimp_md5_transform (guint32 buf[4],
MD5STEP (F1, d, a, b, c, in[13] + 0xfd987193, 12); MD5STEP (F1, d, a, b, c, in[13] + 0xfd987193, 12);
MD5STEP (F1, c, d, a, b, in[14] + 0xa679438e, 17); MD5STEP (F1, c, d, a, b, in[14] + 0xa679438e, 17);
MD5STEP (F1, b, c, d, a, in[15] + 0x49b40821, 22); MD5STEP (F1, b, c, d, a, in[15] + 0x49b40821, 22);
MD5STEP (F2, a, b, c, d, in[1] + 0xf61e2562, 5); MD5STEP (F2, a, b, c, d, in[1] + 0xf61e2562, 5);
MD5STEP (F2, d, a, b, c, in[6] + 0xc040b340, 9); MD5STEP (F2, d, a, b, c, in[6] + 0xc040b340, 9);
MD5STEP (F2, c, d, a, b, in[11] + 0x265e5a51, 14); MD5STEP (F2, c, d, a, b, in[11] + 0x265e5a51, 14);
@ -266,7 +266,7 @@ gimp_md5_transform (guint32 buf[4],
MD5STEP (F2, d, a, b, c, in[2] + 0xfcefa3f8, 9); MD5STEP (F2, d, a, b, c, in[2] + 0xfcefa3f8, 9);
MD5STEP (F2, c, d, a, b, in[7] + 0x676f02d9, 14); MD5STEP (F2, c, d, a, b, in[7] + 0x676f02d9, 14);
MD5STEP (F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20); MD5STEP (F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20);
MD5STEP (F3, a, b, c, d, in[5] + 0xfffa3942, 4); MD5STEP (F3, a, b, c, d, in[5] + 0xfffa3942, 4);
MD5STEP (F3, d, a, b, c, in[8] + 0x8771f681, 11); MD5STEP (F3, d, a, b, c, in[8] + 0x8771f681, 11);
MD5STEP (F3, c, d, a, b, in[11] + 0x6d9d6122, 16); MD5STEP (F3, c, d, a, b, in[11] + 0x6d9d6122, 16);
@ -283,7 +283,7 @@ gimp_md5_transform (guint32 buf[4],
MD5STEP (F3, d, a, b, c, in[12] + 0xe6db99e5, 11); MD5STEP (F3, d, a, b, c, in[12] + 0xe6db99e5, 11);
MD5STEP (F3, c, d, a, b, in[15] + 0x1fa27cf8, 16); MD5STEP (F3, c, d, a, b, in[15] + 0x1fa27cf8, 16);
MD5STEP (F3, b, c, d, a, in[2] + 0xc4ac5665, 23); MD5STEP (F3, b, c, d, a, in[2] + 0xc4ac5665, 23);
MD5STEP (F4, a, b, c, d, in[0] + 0xf4292244, 6); MD5STEP (F4, a, b, c, d, in[0] + 0xf4292244, 6);
MD5STEP (F4, d, a, b, c, in[7] + 0x432aff97, 10); MD5STEP (F4, d, a, b, c, in[7] + 0x432aff97, 10);
MD5STEP (F4, c, d, a, b, in[14] + 0xab9423a7, 15); MD5STEP (F4, c, d, a, b, in[14] + 0xab9423a7, 15);
@ -300,7 +300,7 @@ gimp_md5_transform (guint32 buf[4],
MD5STEP (F4, d, a, b, c, in[11] + 0xbd3af235, 10); MD5STEP (F4, d, a, b, c, in[11] + 0xbd3af235, 10);
MD5STEP (F4, c, d, a, b, in[2] + 0x2ad7d2bb, 15); MD5STEP (F4, c, d, a, b, in[2] + 0x2ad7d2bb, 15);
MD5STEP (F4, b, c, d, a, in[9] + 0xeb86d391, 21); MD5STEP (F4, b, c, d, a, in[9] + 0xeb86d391, 21);
buf[0] += a; buf[0] += a;
buf[1] += b; buf[1] += b;
buf[2] += c; buf[2] += c;

View file

@ -20,7 +20,7 @@
* Modified June 1993 by Colin Plumb for altered md5.c. * Modified June 1993 by Colin Plumb for altered md5.c.
* Modified October 1995 by Erik Troan for RPM * Modified October 1995 by Erik Troan for RPM
*/ */
#ifndef __GIMP_MD5_H__ #ifndef __GIMP_MD5_H__
#define __GIMP_MD5_H__ #define __GIMP_MD5_H__
@ -28,8 +28,8 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */ /* For information look into the C source or the html documentation */
void gimp_md5_get_digest (const gchar *buffer, void gimp_md5_get_digest (const gchar *buffer,
gint buffer_size, gint buffer_size,
guchar digest[16]); guchar digest[16]);

View file

@ -63,7 +63,7 @@ static const GimpVector3 gimp_vector3_unit_z = { 0.0, 0.0, 1.0 };
**/ **/
gdouble gdouble
gimp_vector2_inner_product (const GimpVector2 *vector1, gimp_vector2_inner_product (const GimpVector2 *vector1,
const GimpVector2 *vector2) const GimpVector2 *vector2)
{ {
return (vector1->x * vector2->x + vector1->y * vector2->y); return (vector1->x * vector2->x + vector1->y * vector2->y);
} }
@ -80,7 +80,7 @@ gimp_vector2_inner_product (const GimpVector2 *vector1,
**/ **/
gdouble gdouble
gimp_vector2_inner_product_val (GimpVector2 vector1, gimp_vector2_inner_product_val (GimpVector2 vector1,
GimpVector2 vector2) GimpVector2 vector2)
{ {
return (vector1.x * vector2.x + vector1.y * vector2.y); return (vector1.x * vector2.x + vector1.y * vector2.y);
} }
@ -98,12 +98,12 @@ gimp_vector2_inner_product_val (GimpVector2 vector1,
* Note that in 2D, this function is mostly useful to test if two * Note that in 2D, this function is mostly useful to test if two
* vectors are parallel or not, or to compute the area spawned by two * vectors are parallel or not, or to compute the area spawned by two
* vectors. * vectors.
* *
* Returns: The cross product. * Returns: The cross product.
**/ **/
GimpVector2 GimpVector2
gimp_vector2_cross_product (const GimpVector2 *vector1, gimp_vector2_cross_product (const GimpVector2 *vector1,
const GimpVector2 *vector2) const GimpVector2 *vector2)
{ {
GimpVector2 normal; GimpVector2 normal;
@ -126,7 +126,7 @@ gimp_vector2_cross_product (const GimpVector2 *vector1,
**/ **/
GimpVector2 GimpVector2
gimp_vector2_cross_product_val (GimpVector2 vector1, gimp_vector2_cross_product_val (GimpVector2 vector1,
GimpVector2 vector2) GimpVector2 vector2)
{ {
GimpVector2 normal; GimpVector2 normal;
@ -179,7 +179,7 @@ gimp_vector2_normalize (GimpVector2 *vector)
len = gimp_vector2_length (vector); len = gimp_vector2_length (vector);
if (len != 0.0) if (len != 0.0)
{ {
len = 1.0 / len; len = 1.0 / len;
vector->x *= len; vector->x *= len;
@ -195,7 +195,7 @@ gimp_vector2_normalize (GimpVector2 *vector)
* gimp_vector2_normalize_val: * gimp_vector2_normalize_val:
* *
* @vector: a #GimpVector2 (by value) * @vector: a #GimpVector2 (by value)
* *
* Computes and returns the normalized vector corresponding with the one * Computes and returns the normalized vector corresponding with the one
* passed in argument. * passed in argument.
* *
@ -210,7 +210,7 @@ gimp_vector2_normalize_val (GimpVector2 vector)
len = gimp_vector2_length_val (vector); len = gimp_vector2_length_val (vector);
if (len != 0.0) if (len != 0.0)
{ {
len = 1.0 / len; len = 1.0 / len;
normalized.x = vector.x * len; normalized.x = vector.x * len;
@ -233,7 +233,7 @@ gimp_vector2_normalize_val (GimpVector2 vector)
**/ **/
void void
gimp_vector2_mul (GimpVector2 *vector, gimp_vector2_mul (GimpVector2 *vector,
gdouble factor) gdouble factor)
{ {
vector->x *= factor; vector->x *= factor;
vector->y *= factor; vector->y *= factor;
@ -251,10 +251,10 @@ gimp_vector2_mul (GimpVector2 *vector,
**/ **/
GimpVector2 GimpVector2
gimp_vector2_mul_val (GimpVector2 vector, gimp_vector2_mul_val (GimpVector2 vector,
gdouble factor) gdouble factor)
{ {
GimpVector2 result; GimpVector2 result;
result.x = vector.x * factor; result.x = vector.x * factor;
result.y = vector.y * factor; result.y = vector.y * factor;
@ -272,8 +272,8 @@ gimp_vector2_mul_val (GimpVector2 vector,
**/ **/
void void
gimp_vector2_add (GimpVector2 *result, gimp_vector2_add (GimpVector2 *result,
const GimpVector2 *vector1, const GimpVector2 *vector1,
const GimpVector2 *vector2) const GimpVector2 *vector2)
{ {
result->x = vector1->x + vector2->x; result->x = vector1->x + vector2->x;
result->y = vector1->y + vector2->y; result->y = vector1->y + vector2->y;
@ -290,13 +290,13 @@ gimp_vector2_add (GimpVector2 *result,
**/ **/
GimpVector2 GimpVector2
gimp_vector2_add_val (GimpVector2 vector1, gimp_vector2_add_val (GimpVector2 vector1,
GimpVector2 vector2) GimpVector2 vector2)
{ {
GimpVector2 result; GimpVector2 result;
result.x = vector1.x + vector2.x; result.x = vector1.x + vector2.x;
result.y = vector1.y + vector2.y; result.y = vector1.y + vector2.y;
return result; return result;
} }
@ -311,8 +311,8 @@ gimp_vector2_add_val (GimpVector2 vector1,
**/ **/
void void
gimp_vector2_sub (GimpVector2 *result, gimp_vector2_sub (GimpVector2 *result,
const GimpVector2 *vector1, const GimpVector2 *vector1,
const GimpVector2 *vector2) const GimpVector2 *vector2)
{ {
result->x = vector1->x - vector2->x; result->x = vector1->x - vector2->x;
result->y = vector1->y - vector2->y; result->y = vector1->y - vector2->y;
@ -330,13 +330,13 @@ gimp_vector2_sub (GimpVector2 *result,
**/ **/
GimpVector2 GimpVector2
gimp_vector2_sub_val (GimpVector2 vector1, gimp_vector2_sub_val (GimpVector2 vector1,
GimpVector2 vector2) GimpVector2 vector2)
{ {
GimpVector2 result; GimpVector2 result;
result.x = vector1.x - vector2.x; result.x = vector1.x - vector2.x;
result.y = vector1.y - vector2.y; result.y = vector1.y - vector2.y;
return result; return result;
} }
@ -350,8 +350,8 @@ gimp_vector2_sub_val (GimpVector2 vector1,
**/ **/
void void
gimp_vector2_set (GimpVector2 *vector, gimp_vector2_set (GimpVector2 *vector,
gdouble x, gdouble x,
gdouble y) gdouble y)
{ {
vector->x = x; vector->x = x;
vector->y = y; vector->y = y;
@ -368,7 +368,7 @@ gimp_vector2_set (GimpVector2 *vector,
**/ **/
GimpVector2 GimpVector2
gimp_vector2_new (gdouble x, gimp_vector2_new (gdouble x,
gdouble y) gdouble y)
{ {
GimpVector2 vector; GimpVector2 vector;
@ -382,7 +382,7 @@ gimp_vector2_new (gdouble x,
* gimp_vector2_neg: * gimp_vector2_neg:
* @vector: a #GimpVector2 (by address) * @vector: a #GimpVector2 (by address)
* *
* Negates the @vector (i.e. negate all its coordinates). * Negates the @vector (i.e. negate all its coordinates).
**/ **/
void void
gimp_vector2_neg (GimpVector2 *vector) gimp_vector2_neg (GimpVector2 *vector)
@ -399,11 +399,11 @@ gimp_vector2_neg (GimpVector2 *vector)
* *
* Returns: the negated vector. * Returns: the negated vector.
**/ **/
GimpVector2 GimpVector2
gimp_vector2_neg_val (GimpVector2 vector) gimp_vector2_neg_val (GimpVector2 vector)
{ {
GimpVector2 result; GimpVector2 result;
result.x = vector.x * -1.0; result.x = vector.x * -1.0;
result.y = vector.y * -1.0; result.y = vector.y * -1.0;
@ -419,7 +419,7 @@ gimp_vector2_neg_val (GimpVector2 vector)
**/ **/
void void
gimp_vector2_rotate (GimpVector2 *vector, gimp_vector2_rotate (GimpVector2 *vector,
gdouble alpha) gdouble alpha)
{ {
GimpVector2 result; GimpVector2 result;
@ -436,12 +436,12 @@ gimp_vector2_rotate (GimpVector2 *vector,
* *
* Computes and returns the rotation of the @vector by @alpha radians, * Computes and returns the rotation of the @vector by @alpha radians,
* counterclockwize. * counterclockwize.
* *
* Returns: the @vector rotated by @alpha radians. * Returns: the @vector rotated by @alpha radians.
**/ **/
GimpVector2 GimpVector2
gimp_vector2_rotate_val (GimpVector2 vector, gimp_vector2_rotate_val (GimpVector2 vector,
gdouble alpha) gdouble alpha)
{ {
GimpVector2 result; GimpVector2 result;
@ -467,11 +467,11 @@ gimp_vector2_rotate_val (GimpVector2 vector,
**/ **/
gdouble gdouble
gimp_vector3_inner_product (const GimpVector3 *vector1, gimp_vector3_inner_product (const GimpVector3 *vector1,
const GimpVector3 *vector2) const GimpVector3 *vector2)
{ {
return (vector1->x * vector2->x + return (vector1->x * vector2->x +
vector1->y * vector2->y + vector1->y * vector2->y +
vector1->z * vector2->z); vector1->z * vector2->z);
} }
/** /**
@ -486,11 +486,11 @@ gimp_vector3_inner_product (const GimpVector3 *vector1,
**/ **/
gdouble gdouble
gimp_vector3_inner_product_val (GimpVector3 vector1, gimp_vector3_inner_product_val (GimpVector3 vector1,
GimpVector3 vector2) GimpVector3 vector2)
{ {
return (vector1.x * vector2.x + return (vector1.x * vector2.x +
vector1.y * vector2.y + vector1.y * vector2.y +
vector1.z * vector2.z); vector1.z * vector2.z);
} }
/** /**
@ -505,12 +505,12 @@ gimp_vector3_inner_product_val (GimpVector3 vector1,
* *
* This function can be used to compute the normal of the plan defined by * This function can be used to compute the normal of the plan defined by
* @vector1 and @vector2. * @vector1 and @vector2.
* *
* Returns: The cross product. * Returns: The cross product.
**/ **/
GimpVector3 GimpVector3
gimp_vector3_cross_product (const GimpVector3 *vector1, gimp_vector3_cross_product (const GimpVector3 *vector1,
const GimpVector3 *vector2) const GimpVector3 *vector2)
{ {
GimpVector3 normal; GimpVector3 normal;
@ -534,7 +534,7 @@ gimp_vector3_cross_product (const GimpVector3 *vector1,
**/ **/
GimpVector3 GimpVector3
gimp_vector3_cross_product_val (GimpVector3 vector1, gimp_vector3_cross_product_val (GimpVector3 vector1,
GimpVector3 vector2) GimpVector3 vector2)
{ {
GimpVector3 normal; GimpVector3 normal;
@ -557,8 +557,8 @@ gdouble
gimp_vector3_length (const GimpVector3 *vector) gimp_vector3_length (const GimpVector3 *vector)
{ {
return (sqrt (vector->x * vector->x + return (sqrt (vector->x * vector->x +
vector->y * vector->y + vector->y * vector->y +
vector->z * vector->z)); vector->z * vector->z));
} }
/** /**
@ -573,8 +573,8 @@ gdouble
gimp_vector3_length_val (GimpVector3 vector) gimp_vector3_length_val (GimpVector3 vector)
{ {
return (sqrt (vector.x * vector.x + return (sqrt (vector.x * vector.x +
vector.y * vector.y + vector.y * vector.y +
vector.z * vector.z)); vector.z * vector.z));
} }
/** /**
@ -608,7 +608,7 @@ gimp_vector3_normalize (GimpVector3 *vector)
* gimp_vector3_normalize_val: * gimp_vector3_normalize_val:
* *
* @vector: a #GimpVector3 (by value) * @vector: a #GimpVector3 (by value)
* *
* Computes and returns the normalized vector corresponding with the one * Computes and returns the normalized vector corresponding with the one
* passed in argument. * passed in argument.
* *
@ -643,12 +643,12 @@ gimp_vector3_normalize_val (GimpVector3 vector)
* @factor: a scalar * @factor: a scalar
* *
* Multiplies each component of the @vector by @factor. * Multiplies each component of the @vector by @factor.
* Note that this is equivalent to multiplied the length of @vector * Note that this is equivalent to multiplied the length of @vector
* by @factor. * by @factor.
**/ **/
void void
gimp_vector3_mul (GimpVector3 *vector, gimp_vector3_mul (GimpVector3 *vector,
gdouble factor) gdouble factor)
{ {
vector->x *= factor; vector->x *= factor;
vector->y *= factor; vector->y *= factor;
@ -665,12 +665,12 @@ gimp_vector3_mul (GimpVector3 *vector,
* *
* Returns: the resulting #GimpVector3. * Returns: the resulting #GimpVector3.
**/ **/
GimpVector3 GimpVector3
gimp_vector3_mul_val (GimpVector3 vector, gimp_vector3_mul_val (GimpVector3 vector,
gdouble factor) gdouble factor)
{ {
GimpVector3 result; GimpVector3 result;
result.x = vector.x * factor; result.x = vector.x * factor;
result.y = vector.y * factor; result.y = vector.y * factor;
result.z = vector.z * factor; result.z = vector.z * factor;
@ -689,8 +689,8 @@ gimp_vector3_mul_val (GimpVector3 vector,
**/ **/
void void
gimp_vector3_sub (GimpVector3 *result, gimp_vector3_sub (GimpVector3 *result,
const GimpVector3 *vector1, const GimpVector3 *vector1,
const GimpVector3 *vector2) const GimpVector3 *vector2)
{ {
result->x = vector1->x - vector2->x; result->x = vector1->x - vector2->x;
result->y = vector1->y - vector2->y; result->y = vector1->y - vector2->y;
@ -707,9 +707,9 @@ gimp_vector3_sub (GimpVector3 *result,
* *
* Returns: the resulting #GimpVector3. * Returns: the resulting #GimpVector3.
**/ **/
GimpVector3 GimpVector3
gimp_vector3_sub_val (GimpVector3 vector1, gimp_vector3_sub_val (GimpVector3 vector1,
GimpVector3 vector2) GimpVector3 vector2)
{ {
GimpVector3 result; GimpVector3 result;
@ -731,9 +731,9 @@ gimp_vector3_sub_val (GimpVector3 vector1,
**/ **/
void void
gimp_vector3_set (GimpVector3 *vector, gimp_vector3_set (GimpVector3 *vector,
gdouble x, gdouble x,
gdouble y, gdouble y,
gdouble z) gdouble z)
{ {
vector->x = x; vector->x = x;
vector->y = y; vector->y = y;
@ -750,10 +750,10 @@ gimp_vector3_set (GimpVector3 *vector,
* *
* Returns: the resulting GimpVector3. * Returns: the resulting GimpVector3.
**/ **/
GimpVector3 GimpVector3
gimp_vector3_new (gdouble x, gimp_vector3_new (gdouble x,
gdouble y, gdouble y,
gdouble z) gdouble z)
{ {
GimpVector3 vector; GimpVector3 vector;
@ -775,8 +775,8 @@ gimp_vector3_new (gdouble x,
**/ **/
void void
gimp_vector3_add (GimpVector3 *result, gimp_vector3_add (GimpVector3 *result,
const GimpVector3 *vector1, const GimpVector3 *vector1,
const GimpVector3 *vector2) const GimpVector3 *vector2)
{ {
result->x = vector1->x + vector2->x; result->x = vector1->x + vector2->x;
result->y = vector1->y + vector2->y; result->y = vector1->y + vector2->y;
@ -793,16 +793,16 @@ gimp_vector3_add (GimpVector3 *result,
* *
* Returns: the resulting #GimpVector3. * Returns: the resulting #GimpVector3.
**/ **/
GimpVector3 GimpVector3
gimp_vector3_add_val (GimpVector3 vector1, gimp_vector3_add_val (GimpVector3 vector1,
GimpVector3 vector2) GimpVector3 vector2)
{ {
GimpVector3 result; GimpVector3 result;
result.x = vector1.x + vector2.x; result.x = vector1.x + vector2.x;
result.y = vector1.y + vector2.y; result.y = vector1.y + vector2.y;
result.z = vector1.z + vector2.z; result.z = vector1.z + vector2.z;
return result; return result;
} }
@ -810,7 +810,7 @@ gimp_vector3_add_val (GimpVector3 vector1,
* gimp_vector3_neg: * gimp_vector3_neg:
* @vector: a #GimpVector3 (by address) * @vector: a #GimpVector3 (by address)
* *
* Negates the @vector (i.e. negate all its coordinates). * Negates the @vector (i.e. negate all its coordinates).
**/ **/
void void
gimp_vector3_neg (GimpVector3 *vector) gimp_vector3_neg (GimpVector3 *vector)
@ -828,7 +828,7 @@ gimp_vector3_neg (GimpVector3 *vector)
* *
* Returns: the negated vector. * Returns: the negated vector.
**/ **/
GimpVector3 GimpVector3
gimp_vector3_neg_val (GimpVector3 vector) gimp_vector3_neg_val (GimpVector3 vector)
{ {
GimpVector3 result; GimpVector3 result;
@ -836,7 +836,7 @@ gimp_vector3_neg_val (GimpVector3 vector)
result.x = vector.x * -1.0; result.x = vector.x * -1.0;
result.y = vector.y * -1.0; result.y = vector.y * -1.0;
result.z = vector.z * -1.0; result.z = vector.z * -1.0;
return result; return result;
} }
@ -857,9 +857,9 @@ gimp_vector3_neg_val (GimpVector3 vector)
**/ **/
void void
gimp_vector3_rotate (GimpVector3 *vector, gimp_vector3_rotate (GimpVector3 *vector,
gdouble alpha, gdouble alpha,
gdouble beta, gdouble beta,
gdouble gamma) gdouble gamma)
{ {
GimpVector3 s, t; GimpVector3 s, t;
@ -902,11 +902,11 @@ gimp_vector3_rotate (GimpVector3 *vector,
* *
* Returns: the rotated vector. * Returns: the rotated vector.
**/ **/
GimpVector3 GimpVector3
gimp_vector3_rotate_val (GimpVector3 vector, gimp_vector3_rotate_val (GimpVector3 vector,
gdouble alpha, gdouble alpha,
gdouble beta, gdouble beta,
gdouble gamma) gdouble gamma)
{ {
GimpVector3 s, t, result; GimpVector3 s, t, result;
@ -943,25 +943,25 @@ gimp_vector3_rotate_val (GimpVector3 vector,
* @y: the ordinate of the point in the screen rectangle to map. * @y: the ordinate of the point in the screen rectangle to map.
* @vp: position of the observer (by address). * @vp: position of the observer (by address).
* @p: the resulting point (by address). * @p: the resulting point (by address).
* *
* \"Compute screen (sx,sy)-(sx+w,sy+h) to 3D unit square mapping. * \"Compute screen (sx,sy)-(sx+w,sy+h) to 3D unit square mapping.
* The plane to map to is given in the z field of p. The observer * The plane to map to is given in the z field of p. The observer
* is located at position vp (vp->z!=0.0).\" * is located at position vp (vp->z!=0.0).\"
* *
* In other words, this computes the projection of the point (@x ,@y) to * In other words, this computes the projection of the point (@x ,@y) to
* the plane z = @p->z (parallel to XY), from the @vp point of view through * the plane z = @p->z (parallel to XY), from the @vp point of view through
* the screen (@sx, @sy)->(@sx+@w, @sy+@h) * the screen (@sx, @sy)->(@sx+@w, @sy+@h)
**/ **/
void void
gimp_vector_2d_to_3d (gint sx, gimp_vector_2d_to_3d (gint sx,
gint sy, gint sy,
gint w, gint w,
gint h, gint h,
gint x, gint x,
gint y, gint y,
const GimpVector3 *vp, const GimpVector3 *vp,
GimpVector3 *p) GimpVector3 *p)
{ {
gdouble t = 0.0; gdouble t = 0.0;
@ -976,7 +976,7 @@ gimp_vector_2d_to_3d (gint sx,
else else
{ {
p->x = (gdouble) (x - sx) / (gdouble) w; p->x = (gdouble) (x - sx) / (gdouble) w;
p->y = (gdouble) (y - sy) / (gdouble) h; p->y = (gdouble) (y - sy) / (gdouble) h;
} }
} }
@ -997,17 +997,17 @@ gimp_vector_2d_to_3d (gint sx,
* *
* Returns: the computed #GimpVector3 point. * Returns: the computed #GimpVector3 point.
**/ **/
GimpVector3 GimpVector3
gimp_vector_2d_to_3d_val (gint sx, gimp_vector_2d_to_3d_val (gint sx,
gint sy, gint sy,
gint w, gint w,
gint h, gint h,
gint x, gint x,
gint y, gint y,
GimpVector3 vp, GimpVector3 vp,
GimpVector3 p) GimpVector3 p)
{ {
GimpVector3 result; GimpVector3 result;
gdouble t = 0.0; gdouble t = 0.0;
if (vp.x != 0.0) if (vp.x != 0.0)
@ -1021,9 +1021,9 @@ gimp_vector_2d_to_3d_val (gint sx,
else else
{ {
result.x = (gdouble) (x - sx) / (gdouble) w; result.x = (gdouble) (x - sx) / (gdouble) w;
result.y = (gdouble) (y - sy) / (gdouble) h; result.y = (gdouble) (y - sy) / (gdouble) h;
} }
return result; return result;
} }
@ -1047,13 +1047,13 @@ gimp_vector_2d_to_3d_val (gint sx,
**/ **/
void void
gimp_vector_3d_to_2d (gint sx, gimp_vector_3d_to_2d (gint sx,
gint sy, gint sy,
gint w, gint w,
gint h, gint h,
gdouble *x, gdouble *x,
gdouble *y, gdouble *y,
const GimpVector3 *vp, const GimpVector3 *vp,
const GimpVector3 *p) const GimpVector3 *p)
{ {
gdouble t; gdouble t;
GimpVector3 dir; GimpVector3 dir;

View file

@ -49,111 +49,111 @@ struct _GimpVector4
/* Two dimensional vector functions */ /* Two dimensional vector functions */
/* ================================ */ /* ================================ */
gdouble gimp_vector2_inner_product (const GimpVector2 *vector1, gdouble gimp_vector2_inner_product (const GimpVector2 *vector1,
const GimpVector2 *vector2); const GimpVector2 *vector2);
gdouble gimp_vector2_inner_product_val (GimpVector2 vector1, gdouble gimp_vector2_inner_product_val (GimpVector2 vector1,
GimpVector2 vector2); GimpVector2 vector2);
GimpVector2 gimp_vector2_cross_product (const GimpVector2 *vector1, GimpVector2 gimp_vector2_cross_product (const GimpVector2 *vector1,
const GimpVector2 *vector2); const GimpVector2 *vector2);
GimpVector2 gimp_vector2_cross_product_val (GimpVector2 vector1, GimpVector2 gimp_vector2_cross_product_val (GimpVector2 vector1,
GimpVector2 vector2); GimpVector2 vector2);
gdouble gimp_vector2_length (const GimpVector2 *vector); gdouble gimp_vector2_length (const GimpVector2 *vector);
gdouble gimp_vector2_length_val (GimpVector2 vector); gdouble gimp_vector2_length_val (GimpVector2 vector);
void gimp_vector2_normalize (GimpVector2 *vector); void gimp_vector2_normalize (GimpVector2 *vector);
GimpVector2 gimp_vector2_normalize_val (GimpVector2 vector); GimpVector2 gimp_vector2_normalize_val (GimpVector2 vector);
void gimp_vector2_mul (GimpVector2 *vector, void gimp_vector2_mul (GimpVector2 *vector,
gdouble factor); gdouble factor);
GimpVector2 gimp_vector2_mul_val (GimpVector2 vector, GimpVector2 gimp_vector2_mul_val (GimpVector2 vector,
gdouble factor); gdouble factor);
void gimp_vector2_sub (GimpVector2 *result, void gimp_vector2_sub (GimpVector2 *result,
const GimpVector2 *vector1, const GimpVector2 *vector1,
const GimpVector2 *vector2); const GimpVector2 *vector2);
GimpVector2 gimp_vector2_sub_val (GimpVector2 vector1, GimpVector2 gimp_vector2_sub_val (GimpVector2 vector1,
GimpVector2 vector2); GimpVector2 vector2);
void gimp_vector2_set (GimpVector2 *vector, void gimp_vector2_set (GimpVector2 *vector,
gdouble x, gdouble x,
gdouble y); gdouble y);
GimpVector2 gimp_vector2_new (gdouble x, GimpVector2 gimp_vector2_new (gdouble x,
gdouble y); gdouble y);
void gimp_vector2_add (GimpVector2 *result, void gimp_vector2_add (GimpVector2 *result,
const GimpVector2 *vector1, const GimpVector2 *vector1,
const GimpVector2 *vector2); const GimpVector2 *vector2);
GimpVector2 gimp_vector2_add_val (GimpVector2 vector1, GimpVector2 gimp_vector2_add_val (GimpVector2 vector1,
GimpVector2 vector2); GimpVector2 vector2);
void gimp_vector2_neg (GimpVector2 *vector); void gimp_vector2_neg (GimpVector2 *vector);
GimpVector2 gimp_vector2_neg_val (GimpVector2 vector); GimpVector2 gimp_vector2_neg_val (GimpVector2 vector);
void gimp_vector2_rotate (GimpVector2 *vector, void gimp_vector2_rotate (GimpVector2 *vector,
gdouble alpha); gdouble alpha);
GimpVector2 gimp_vector2_rotate_val (GimpVector2 vector, GimpVector2 gimp_vector2_rotate_val (GimpVector2 vector,
gdouble alpha); gdouble alpha);
/* Three dimensional vector functions */ /* Three dimensional vector functions */
/* ================================== */ /* ================================== */
gdouble gimp_vector3_inner_product (const GimpVector3 *vector1, gdouble gimp_vector3_inner_product (const GimpVector3 *vector1,
const GimpVector3 *vector2); const GimpVector3 *vector2);
gdouble gimp_vector3_inner_product_val (GimpVector3 vector1, gdouble gimp_vector3_inner_product_val (GimpVector3 vector1,
GimpVector3 vector2); GimpVector3 vector2);
GimpVector3 gimp_vector3_cross_product (const GimpVector3 *vector1, GimpVector3 gimp_vector3_cross_product (const GimpVector3 *vector1,
const GimpVector3 *vector2); const GimpVector3 *vector2);
GimpVector3 gimp_vector3_cross_product_val (GimpVector3 vector1, GimpVector3 gimp_vector3_cross_product_val (GimpVector3 vector1,
GimpVector3 vector2); GimpVector3 vector2);
gdouble gimp_vector3_length (const GimpVector3 *vector); gdouble gimp_vector3_length (const GimpVector3 *vector);
gdouble gimp_vector3_length_val (GimpVector3 vector); gdouble gimp_vector3_length_val (GimpVector3 vector);
void gimp_vector3_normalize (GimpVector3 *vector); void gimp_vector3_normalize (GimpVector3 *vector);
GimpVector3 gimp_vector3_normalize_val (GimpVector3 vector); GimpVector3 gimp_vector3_normalize_val (GimpVector3 vector);
void gimp_vector3_mul (GimpVector3 *vector, void gimp_vector3_mul (GimpVector3 *vector,
gdouble factor); gdouble factor);
GimpVector3 gimp_vector3_mul_val (GimpVector3 vector, GimpVector3 gimp_vector3_mul_val (GimpVector3 vector,
gdouble factor); gdouble factor);
void gimp_vector3_sub (GimpVector3 *result, void gimp_vector3_sub (GimpVector3 *result,
const GimpVector3 *vector1, const GimpVector3 *vector1,
const GimpVector3 *vector2); const GimpVector3 *vector2);
GimpVector3 gimp_vector3_sub_val (GimpVector3 vector1, GimpVector3 gimp_vector3_sub_val (GimpVector3 vector1,
GimpVector3 vector2); GimpVector3 vector2);
void gimp_vector3_set (GimpVector3 *vector, void gimp_vector3_set (GimpVector3 *vector,
gdouble x, gdouble x,
gdouble y, gdouble y,
gdouble z); gdouble z);
GimpVector3 gimp_vector3_new (gdouble x, GimpVector3 gimp_vector3_new (gdouble x,
gdouble y, gdouble y,
gdouble z); gdouble z);
void gimp_vector3_add (GimpVector3 *result, void gimp_vector3_add (GimpVector3 *result,
const GimpVector3 *vector1, const GimpVector3 *vector1,
const GimpVector3 *vector2); const GimpVector3 *vector2);
GimpVector3 gimp_vector3_add_val (GimpVector3 vector1, GimpVector3 gimp_vector3_add_val (GimpVector3 vector1,
GimpVector3 vector2); GimpVector3 vector2);
void gimp_vector3_neg (GimpVector3 *vector); void gimp_vector3_neg (GimpVector3 *vector);
GimpVector3 gimp_vector3_neg_val (GimpVector3 vector); GimpVector3 gimp_vector3_neg_val (GimpVector3 vector);
void gimp_vector3_rotate (GimpVector3 *vector, void gimp_vector3_rotate (GimpVector3 *vector,
gdouble alpha, gdouble alpha,
gdouble beta, gdouble beta,
gdouble gamma); gdouble gamma);
GimpVector3 gimp_vector3_rotate_val (GimpVector3 vector, GimpVector3 gimp_vector3_rotate_val (GimpVector3 vector,
gdouble alpha, gdouble alpha,
gdouble beta, gdouble beta,
gdouble gamma); gdouble gamma);
/* 2d <-> 3d Vector projection functions */ /* 2d <-> 3d Vector projection functions */
/* ===================================== */ /* ===================================== */
void gimp_vector_2d_to_3d (gint sx, void gimp_vector_2d_to_3d (gint sx,
gint sy, gint sy,
gint w, gint w,
gint h, gint h,
gint x, gint x,
gint y, gint y,
const GimpVector3 *vp, const GimpVector3 *vp,
GimpVector3 *p); GimpVector3 *p);
GimpVector3 gimp_vector_2d_to_3d_val (gint sx, GimpVector3 gimp_vector_2d_to_3d_val (gint sx,
gint sy, gint sy,
gint w, gint w,
gint h, gint h,
gint x, gint x,
gint y, gint y,
GimpVector3 vp, GimpVector3 vp,
GimpVector3 p); GimpVector3 p);
void gimp_vector_3d_to_2d (gint sx, void gimp_vector_3d_to_2d (gint sx,
gint sy, gint sy,

View file

@ -9,7 +9,7 @@
#include "gimpmd5.h" #include "gimpmd5.h"
static const gchar * test[7][2] = static const gchar * test[7][2] =
{ {
{ "", "d41d8cd98f00b204e9800998ecf8427e" }, { "", "d41d8cd98f00b204e9800998ecf8427e" },
{ "a", "0cc175b9c0f1b6a831c399e269772661" }, { "a", "0cc175b9c0f1b6a831c399e269772661" },
@ -38,7 +38,7 @@ main (void)
for (j = 0; j < 16; j++) for (j = 0; j < 16; j++)
{ {
guchar buf[4]; guchar buf[4];
g_snprintf (buf, 3, "%02x", digest[j]); g_snprintf (buf, 3, "%02x", digest[j]);
g_print (buf); g_print (buf);
if (strncmp (buf, test[i][1] + j*2, 2)) if (strncmp (buf, test[i][1] + j*2, 2))
@ -48,12 +48,12 @@ main (void)
if (!correct) if (!correct)
{ {
g_print g_print
("\nWRONG digest!! Please report to http://bugzilla.gnome.org/\n"); ("\nWRONG digest!! Please report to http://bugzilla.gnome.org/\n");
return 1; return 1;
} }
} }
g_print ("\nLooks good.\n\n"); g_print ("\nLooks good.\n\n");
return 0; return 0;
} }

View file

@ -75,7 +75,7 @@ INSTOBJEXT = @INSTOBJEXT@
.po.pox: .po.pox:
$(MAKE) $(GETTEXT_PACKAGE).pot $(MAKE) $(GETTEXT_PACKAGE).pot
$(MSGMERGE) $< $(srcdir)/$(GETTEXT_PACKAGE).pot -o $*.pox $(MSGMERGE) $< $(srcdir)/$(GETTEXT_PACKAGE).pot -o $*pox
.po.mo: .po.mo:
$(MSGFMT) -o $@ $< $(MSGFMT) -o $@ $<
@ -179,6 +179,7 @@ dvi info tags TAGS ID:
mostlyclean: mostlyclean:
rm -f core core.* *.pox $(GETTEXT_PACKAGE).po *.old.po cat-id-tbl.tmp rm -f core core.* *.pox $(GETTEXT_PACKAGE).po *.old.po cat-id-tbl.tmp
rm -fr *.o rm -fr *.o
rm -f .intltool-merge-cache
clean: mostlyclean clean: mostlyclean
@ -207,7 +208,7 @@ update-po: Makefile
cat=`basename $$cat`; \ cat=`basename $$cat`; \
lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
echo "$$lang:"; \ echo "$$lang:"; \
if $(MSGMERGE) $$lang.po $(GETTEXT_PACKAGE).pot -o $$tmpdir/$$lang.new.po; then \ if $$tmpdir/$(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --dist -o $$tmpdir/$$lang.new.po $$lang; then \
if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
rm -f $$tmpdir/$$lang.new.po; \ rm -f $$tmpdir/$$lang.new.po; \
else \ else \
@ -225,19 +226,6 @@ update-po: Makefile
fi; \ fi; \
done done
.po: Makefile
$(MAKE) $(PACKAGE).pot;
PATH=`pwd`/../src:$$PATH; \
echo; printf "$*: "; \
if $(MSGMERGE) $*; then \
rm -f $*.old.po; \
else \
echo "msgmerge for * failed!"; \
mv $*.old.po $*.po; \
fi; \
msgfmt --statistics $*.po; echo;
# POTFILES is created from POTFILES.in by stripping comments, empty lines # POTFILES is created from POTFILES.in by stripping comments, empty lines
# and Intltool tags (enclosed in square brackets), and appending a full # and Intltool tags (enclosed in square brackets), and appending a full
# relative path to them # relative path to them