2 * libwmfun - WindowMaker texture function library
3 * Copyright (C) 1999 Tobias Gloth
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
25 * Revision 1.1 2000/12/03 18:58:41 id
26 * initiate plugins branch
28 * Revision 1.1.1.1 1999/02/21 17:16:47 gloth
35 RImage
*bilinear (int argc
, char **argv
, int width
, int height
,
45 if (!start_image ("bilinear", argc
, 4, 5, width
, height
, &image
)) {
50 if (!parse_color (argv
[i
], color
[i
])) {
51 error ("can't parse color: \"%s\"\n", argv
[i
]);
57 for (i
=0; i
<height
; i
++) {
58 int b
= 0xff * i
/ height
;
61 for (j
=0; j
<width
; j
++) {
62 int r
= 0xff * j
/ width
;
73 ( f
[0] * color
[0][k
] +
76 f
[3] * color
[3][k
] ) >> 8;
79 if (RRGBAFormat
==image
->format
)