CRIMP
Check-in [6f6c45ce61]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Continued modifications to pass the location of input images into operation results.
Timelines: family | ancestors | descendants | both | infinite-plane
Files: files | file ages | folders
SHA1: 6f6c45ce61c3bed7ded879c3d4acd821c32634d9
User & Date: andreask 2011-12-14 20:25:23.216
Context
2011-12-14
21:53
Continued from previous commit. Left to check/modify are

unary: ahe, convolve, region_sum, rof

binary: atan2, hypot, pow, cannyinternal, complex div/multiply, join, joint-bilateral, threshold

other: warp-field, cut (*)

(*) Currently done via 'crop', semantic mismatch. Better as their own operator. check-in: 122bdc7d78 user: andreask tags: infinite-plane

20:25
Continued modifications to pass the location of input images into operation results. check-in: 6f6c45ce61 user: andreask tags: infinite-plane
2011-12-09
23:09
Modified to pass the location of input image into the result. check-in: 0de9cbbad8 user: andreask tags: infinite-plane
Changes
Unified Diff Ignore Whitespace Patch
Changes to c/labelcc.c.
162
163
164
165
166
167
168


169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
				 * used as background. All background pixels
				 * are coalesced into a single component.
				 * NULL means not to use a background value. */
    crimp_image* imagePtr	/* Input image to segment. */
) {
    int height = crimp_h(imagePtr);	/* Height of the image */
    int width = crimp_w(imagePtr);	/* Width of the image */


    int esize = SZ(imagePtr);	/* Size of a pixel value */
    int wm1 = width - 1;
    int wp1 = width + 1;
    size_t area = (size_t)width * (size_t)height;
				/* Area of the image in pixels */
    size_t* parent = (size_t*) ckalloc(area * sizeof(size_t));
				/* Parent link data structure for
				 * UNION-FIND partition */
    crimp_image* result = crimp_new_grey32(width, height);
				/* Result image containing subset ranks
				 * during the UNION-FIND calculation and
				 * component numbers during the component
				 * numbering pass. */
    RANK_TYPE* rank = (RANK_TYPE*) result->pixel;
				/* Pixel array for the result image */
    int i, j;			/* Row and column indices */







>
>








|







162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
				 * used as background. All background pixels
				 * are coalesced into a single component.
				 * NULL means not to use a background value. */
    crimp_image* imagePtr	/* Input image to segment. */
) {
    int height = crimp_h(imagePtr);	/* Height of the image */
    int width = crimp_w(imagePtr);	/* Width of the image */
    int locx = crimp_x(imagePtr);	/* Location of the image */
    int locy = crimp_y(imagePtr);	/* Location of the image */
    int esize = SZ(imagePtr);	/* Size of a pixel value */
    int wm1 = width - 1;
    int wp1 = width + 1;
    size_t area = (size_t)width * (size_t)height;
				/* Area of the image in pixels */
    size_t* parent = (size_t*) ckalloc(area * sizeof(size_t));
				/* Parent link data structure for
				 * UNION-FIND partition */
    crimp_image* result = crimp_new_grey32_at (locx, locy, width, height);
				/* Result image containing subset ranks
				 * during the UNION-FIND calculation and
				 * component numbers during the component
				 * numbering pass. */
    RANK_TYPE* rank = (RANK_TYPE*) result->pixel;
				/* Pixel array for the result image */
    int i, j;			/* Row and column indices */
Changes to operator/color-combine.crimp.
31
32
33
34
35
36
37

38
39
40
41
42
43
44
45
    return TCL_ERROR;
}

wr = FLOATP (combine, 0, 0);
wg = FLOATP (combine, 1, 0);
wb = FLOATP (combine, 2, 0);


result = crimp_new_grey8 (crimp_w (image), crimp_h (image));

for (y = 0; y < crimp_h (result); y++) {
    for (x = 0; x < crimp_w (result); x++) {

	double r = CH (image, 0, x, y);
	double g = CH (image, 1, x, y);
	double b = CH (image, 2, x, y);







>
|







31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
    return TCL_ERROR;
}

wr = FLOATP (combine, 0, 0);
wg = FLOATP (combine, 1, 0);
wb = FLOATP (combine, 2, 0);

result = crimp_new_grey8_at (crimp_x (image), crimp_y (image),
			     crimp_w (image), crimp_h (image));

for (y = 0; y < crimp_h (result); y++) {
    for (x = 0; x < crimp_w (result); x++) {

	double r = CH (image, 0, x, y);
	double g = CH (image, 1, x, y);
	double b = CH (image, 2, x, y);
Changes to operator/convert-float-fpcomplex.crimp.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
convert_2complex_float
Tcl_Obj* imageObj

crimp_image* image;
crimp_image* result;
int          x, y;

crimp_input (imageObj, image, float);

result = crimp_new_fpcomplex (crimp_w (image), crimp_h (image));

for (y = 0; y < crimp_h (result); y++) {
    for (x = 0; x < crimp_w (result); x++) {
	RE (result, x, y) = FLOATP (image, x, y);
	IM (result, x, y) = BLACK;
    }
}









|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
convert_2complex_float
Tcl_Obj* imageObj

crimp_image* image;
crimp_image* result;
int          x, y;

crimp_input (imageObj, image, float);

result = crimp_new_fpcomplex_at (crimp_x (image), crimp_y (image), crimp_w (image), crimp_h (image));

for (y = 0; y < crimp_h (result); y++) {
    for (x = 0; x < crimp_w (result); x++) {
	RE (result, x, y) = FLOATP (image, x, y);
	IM (result, x, y) = BLACK;
    }
}
Changes to operator/convert-float-grey16.crimp.
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28

crimp_image* image;
crimp_image* result;
int          x, y;

crimp_input (imageObj, image, float);

result = crimp_new_grey16 (crimp_w (image), crimp_h (image));

for (y = 0; y < crimp_h (image); y++) {
    for (x = 0; x < crimp_w (image); x++) {
	double f =  FLOATP(image, x, y);
	GREY16 (result, x, y) = CLAMPT (MINVAL, int, f, MAXVAL_GREY16);
    }
}







|







14
15
16
17
18
19
20
21
22
23
24
25
26
27
28

crimp_image* image;
crimp_image* result;
int          x, y;

crimp_input (imageObj, image, float);

result = crimp_new_grey16_at (crimp_x (image), crimp_y (image), crimp_w (image), crimp_h (image));

for (y = 0; y < crimp_h (image); y++) {
    for (x = 0; x < crimp_w (image); x++) {
	double f =  FLOATP(image, x, y);
	GREY16 (result, x, y) = CLAMPT (MINVAL, int, f, MAXVAL_GREY16);
    }
}
Changes to operator/convert-float-grey32.crimp.
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28

crimp_image* image;
crimp_image* result;
int          x, y;

crimp_input (imageObj, image, float);

result = crimp_new_grey32 (crimp_w (image), crimp_h (image));

for (y = 0; y < crimp_h (image); y++) {
    for (x = 0; x < crimp_w (image); x++) {
	double f =  FLOATP(image, x, y);
	GREY32 (result, x, y) = CLAMPT (MINVAL, int, f, MAXVAL_GREY32);
    }
}







|







14
15
16
17
18
19
20
21
22
23
24
25
26
27
28

crimp_image* image;
crimp_image* result;
int          x, y;

crimp_input (imageObj, image, float);

result = crimp_new_grey32_at (crimp_x (image), crimp_y (image), crimp_w (image), crimp_h (image));

for (y = 0; y < crimp_h (image); y++) {
    for (x = 0; x < crimp_w (image); x++) {
	double f =  FLOATP(image, x, y);
	GREY32 (result, x, y) = CLAMPT (MINVAL, int, f, MAXVAL_GREY32);
    }
}
Changes to operator/convert-float-grey8.crimp.
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28

crimp_image* image;
crimp_image* result;
int          x, y;

crimp_input (imageObj, image, float);

result = crimp_new_grey8 (crimp_w (image), crimp_h (image));

for (y = 0; y < crimp_h (image); y++) {
    for (x = 0; x < crimp_w (image); x++) {
	double f =  FLOATP(image, x, y);
	GREY8 (result, x, y) = CLAMPT (MINVAL, int, f, MAXVAL_GREY8);
    }
}







|







14
15
16
17
18
19
20
21
22
23
24
25
26
27
28

crimp_image* image;
crimp_image* result;
int          x, y;

crimp_input (imageObj, image, float);

result = crimp_new_grey8_at (crimp_x (image), crimp_y (image), crimp_w (image), crimp_h (image));

for (y = 0; y < crimp_h (image); y++) {
    for (x = 0; x < crimp_w (image); x++) {
	double f =  FLOATP(image, x, y);
	GREY8 (result, x, y) = CLAMPT (MINVAL, int, f, MAXVAL_GREY8);
    }
}
Changes to operator/convert-fpcomplex-float.crimp.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
convert_2float_fpcomplex
Tcl_Obj* imageObj

crimp_image* image;
crimp_image* result;
int          x, y;

crimp_input (imageObj, image, fpcomplex);

result = crimp_new_float (crimp_w (image), crimp_h (image));

for (y = 0; y < crimp_h (result); y++) {
    for (x = 0; x < crimp_w (result); x++) {
	FLOATP (result, x, y) = RE (image, x, y);
    }
}










|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
convert_2float_fpcomplex
Tcl_Obj* imageObj

crimp_image* image;
crimp_image* result;
int          x, y;

crimp_input (imageObj, image, fpcomplex);

result = crimp_new_float_at (crimp_x (image), crimp_y (image), crimp_w (image), crimp_h (image));

for (y = 0; y < crimp_h (result); y++) {
    for (x = 0; x < crimp_w (result); x++) {
	FLOATP (result, x, y) = RE (image, x, y);
    }
}

Changes to operator/convert-grey16-float.crimp.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
convert_2float_grey16
Tcl_Obj* imageObj

crimp_image* image;
crimp_image* result;
int          x, y;

crimp_input (imageObj, image, grey16);

result = crimp_new_float (crimp_w (image), crimp_h (image));

for (y = 0; y < crimp_h (image); y++) {
    for (x = 0; x < crimp_w (image); x++) {

	FLOATP (result, x, y) = GREY16 (image, x, y);
    }
}









|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
convert_2float_grey16
Tcl_Obj* imageObj

crimp_image* image;
crimp_image* result;
int          x, y;

crimp_input (imageObj, image, grey16);

result = crimp_new_float_at (crimp_x (image), crimp_y (image), crimp_w (image), crimp_h (image));

for (y = 0; y < crimp_h (image); y++) {
    for (x = 0; x < crimp_w (image); x++) {

	FLOATP (result, x, y) = GREY16 (image, x, y);
    }
}
Changes to operator/convert-grey16-fpcomplex.crimp.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
convert_2complex_grey16
Tcl_Obj* imageObj

crimp_image* image;
crimp_image* result;
int          x, y;

crimp_input (imageObj, image, grey16);

result = crimp_new_fpcomplex (crimp_w (image), crimp_h (image));

for (y = 0; y < crimp_h (result); y++) {
    for (x = 0; x < crimp_w (result); x++) {
	RE (result, x, y) = GREY16 (image, x, y);
	IM (result, x, y) = BLACK;
    }
}









|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
convert_2complex_grey16
Tcl_Obj* imageObj

crimp_image* image;
crimp_image* result;
int          x, y;

crimp_input (imageObj, image, grey16);

result = crimp_new_fpcomplex_at (crimp_x (image), crimp_y (image), crimp_w (image), crimp_h (image));

for (y = 0; y < crimp_h (result); y++) {
    for (x = 0; x < crimp_w (result); x++) {
	RE (result, x, y) = GREY16 (image, x, y);
	IM (result, x, y) = BLACK;
    }
}
Changes to operator/convert-grey32-float.crimp.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
convert_2float_grey32
Tcl_Obj* imageObj

crimp_image* image;
crimp_image* result;
int          x, y;

crimp_input (imageObj, image, grey32);

result = crimp_new_float (crimp_w (image), crimp_h (image));

for (y = 0; y < crimp_h (image); y++) {
    for (x = 0; x < crimp_w (image); x++) {

	FLOATP (result, x, y) = GREY32 (image, x, y);
    }
}









|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
convert_2float_grey32
Tcl_Obj* imageObj

crimp_image* image;
crimp_image* result;
int          x, y;

crimp_input (imageObj, image, grey32);

result = crimp_new_float_at (crimp_x (image), crimp_y (image), crimp_w (image), crimp_h (image));

for (y = 0; y < crimp_h (image); y++) {
    for (x = 0; x < crimp_w (image); x++) {

	FLOATP (result, x, y) = GREY32 (image, x, y);
    }
}
Changes to operator/convert-grey32-fpcomplex.crimp.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
convert_2complex_grey32
Tcl_Obj* imageObj

crimp_image* image;
crimp_image* result;
int          x, y;

crimp_input (imageObj, image, grey32);

result = crimp_new_fpcomplex (crimp_w (image), crimp_h (image));

for (y = 0; y < crimp_h (result); y++) {
    for (x = 0; x < crimp_w (result); x++) {
	RE (result, x, y) = GREY32 (image, x, y);
	IM (result, x, y) = BLACK;
    }
}









|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
convert_2complex_grey32
Tcl_Obj* imageObj

crimp_image* image;
crimp_image* result;
int          x, y;

crimp_input (imageObj, image, grey32);

result = crimp_new_fpcomplex_at (crimp_x (image), crimp_y (image), crimp_w (image), crimp_h (image));

for (y = 0; y < crimp_h (result); y++) {
    for (x = 0; x < crimp_w (result); x++) {
	RE (result, x, y) = GREY32 (image, x, y);
	IM (result, x, y) = BLACK;
    }
}
Changes to operator/convert-grey8-float.crimp.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
convert_2float_grey8
Tcl_Obj* imageObj

crimp_image* image;
crimp_image* result;
int          x, y;

crimp_input (imageObj, image, grey8);

result = crimp_new_float (crimp_w (image), crimp_h (image));

for (y = 0; y < crimp_h (image); y++) {
    for (x = 0; x < crimp_w (image); x++) {

	FLOATP (result, x, y) = GREY8 (image, x, y);
    }
}









|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
convert_2float_grey8
Tcl_Obj* imageObj

crimp_image* image;
crimp_image* result;
int          x, y;

crimp_input (imageObj, image, grey8);

result = crimp_new_float_at (crimp_x (image), crimp_y (image), crimp_w (image), crimp_h (image));

for (y = 0; y < crimp_h (image); y++) {
    for (x = 0; x < crimp_w (image); x++) {

	FLOATP (result, x, y) = GREY8 (image, x, y);
    }
}
Changes to operator/convert-grey8-fpcomplex.crimp.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
convert_2complex_grey8
Tcl_Obj* imageObj

crimp_image* image;
crimp_image* result;
int          x, y;

crimp_input (imageObj, image, grey8);

result = crimp_new_fpcomplex (crimp_w (image), crimp_h (image));

for (y = 0; y < crimp_h (result); y++) {
    for (x = 0; x < crimp_w (result); x++) {
	RE (result, x, y) = GREY8 (image, x, y);
	IM (result, x, y) = BLACK;
    }
}









|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
convert_2complex_grey8
Tcl_Obj* imageObj

crimp_image* image;
crimp_image* result;
int          x, y;

crimp_input (imageObj, image, grey8);

result = crimp_new_fpcomplex_at (crimp_x (image), crimp_y (image), crimp_w (image), crimp_h (image));

for (y = 0; y < crimp_h (result); y++) {
    for (x = 0; x < crimp_w (result); x++) {
	RE (result, x, y) = GREY8 (image, x, y);
	IM (result, x, y) = BLACK;
    }
}
Changes to operator/convert-grey8-hsv.crimp.
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
crimp_input (colorObj, color, hsv);

if (!crimp_require_dim (color, 256, 1)) {
    Tcl_SetResult(interp, "bad image dimension for color map, expected 256x1", TCL_STATIC);
    return TCL_ERROR;
}

result = crimp_new_hsv (crimp_w (image), crimp_h (image));

for (y = 0; y < crimp_h (image); y++) {
    for (x = 0; x < crimp_w (image); x++) {

	value = GREY8 (image, x, y);
	H (result, x, y) = H (color, value, 0);
	S (result, x, y) = S (color, value, 0);







|







21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
crimp_input (colorObj, color, hsv);

if (!crimp_require_dim (color, 256, 1)) {
    Tcl_SetResult(interp, "bad image dimension for color map, expected 256x1", TCL_STATIC);
    return TCL_ERROR;
}

result = crimp_new_hsv_at (crimp_x (image), crimp_y (image), crimp_w (image), crimp_h (image));

for (y = 0; y < crimp_h (image); y++) {
    for (x = 0; x < crimp_w (image); x++) {

	value = GREY8 (image, x, y);
	H (result, x, y) = H (color, value, 0);
	S (result, x, y) = S (color, value, 0);
Changes to operator/convert-grey8-rgb.crimp.
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
crimp_input (colorObj, color, rgb);

if (!crimp_require_dim (color, 256, 1)) {
    Tcl_SetResult(interp, "bad image dimension for color map, expected 256x1", TCL_STATIC);
    return TCL_ERROR;
}

result = crimp_new_rgb (crimp_w (image), crimp_h (image));

for (y = 0; y < crimp_h (image); y++) {
    for (x = 0; x < crimp_w (image); x++) {

	value = GREY8 (image, x, y);
	R (result, x, y) = R (color, value, 0);
	G (result, x, y) = G (color, value, 0);







|







21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
crimp_input (colorObj, color, rgb);

if (!crimp_require_dim (color, 256, 1)) {
    Tcl_SetResult(interp, "bad image dimension for color map, expected 256x1", TCL_STATIC);
    return TCL_ERROR;
}

result = crimp_new_rgb_at (crimp_x (image), crimp_y (image), crimp_w (image), crimp_h (image));

for (y = 0; y < crimp_h (image); y++) {
    for (x = 0; x < crimp_w (image); x++) {

	value = GREY8 (image, x, y);
	R (result, x, y) = R (color, value, 0);
	G (result, x, y) = G (color, value, 0);
Changes to operator/convert-grey8-rgba.crimp.
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
crimp_input (colorObj, color, rgba);

if (!crimp_require_dim (color, 256, 1)) {
    Tcl_SetResult(interp, "bad image dimension for color map, expected 256x1", TCL_STATIC);
    return TCL_ERROR;
}

result = crimp_new_rgba (crimp_w (image), crimp_h (image));

for (y = 0; y < crimp_h (image); y++) {
    for (x = 0; x < crimp_w (image); x++) {

	value = GREY8 (image, x, y);
	R (result, x, y) = R (color, value, 0);
	G (result, x, y) = G (color, value, 0);







|







21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
crimp_input (colorObj, color, rgba);

if (!crimp_require_dim (color, 256, 1)) {
    Tcl_SetResult(interp, "bad image dimension for color map, expected 256x1", TCL_STATIC);
    return TCL_ERROR;
}

result = crimp_new_rgba_at (crimp_x (image), crimp_y (image), crimp_w (image), crimp_h (image));

for (y = 0; y < crimp_h (image); y++) {
    for (x = 0; x < crimp_w (image); x++) {

	value = GREY8 (image, x, y);
	R (result, x, y) = R (color, value, 0);
	G (result, x, y) = G (color, value, 0);
Changes to operator/convert-hsv-rgb.crimp.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
convert_2rgb_hsv
Tcl_Obj* imageObj

crimp_image* image;
crimp_image* result;
int          x, y, r, g, b;

crimp_input (imageObj, image, hsv);

result = crimp_new_rgb (crimp_w (image), crimp_h (image));

for (y = 0; y < crimp_h (image); y++) {
    for (x = 0; x < crimp_w (image); x++) {

	crimp_color_hsv_to_rgb (H (image, x, y),
				S (image, x, y),
				V (image, x, y),









|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
convert_2rgb_hsv
Tcl_Obj* imageObj

crimp_image* image;
crimp_image* result;
int          x, y, r, g, b;

crimp_input (imageObj, image, hsv);

result = crimp_new_rgb_at (crimp_x (image), crimp_y (image), crimp_w (image), crimp_h (image));

for (y = 0; y < crimp_h (image); y++) {
    for (x = 0; x < crimp_w (image); x++) {

	crimp_color_hsv_to_rgb (H (image, x, y),
				S (image, x, y),
				V (image, x, y),
Changes to operator/convert-hsv-rgba.crimp.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
convert_2rgba_hsv
Tcl_Obj* imageObj

crimp_image* image;
crimp_image* result;
int          x, y, r, g, b;

crimp_input (imageObj, image, hsv);

result = crimp_new_rgba (crimp_w (image), crimp_h (image));

for (y = 0; y < crimp_h (image); y++) {
    for (x = 0; x < crimp_w (image); x++) {

	crimp_color_hsv_to_rgb (H (image, x, y),
				S (image, x, y),
				V (image, x, y),









|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
convert_2rgba_hsv
Tcl_Obj* imageObj

crimp_image* image;
crimp_image* result;
int          x, y, r, g, b;

crimp_input (imageObj, image, hsv);

result = crimp_new_rgba_at (crimp_x (image), crimp_y (image), crimp_w (image), crimp_h (image));

for (y = 0; y < crimp_h (image); y++) {
    for (x = 0; x < crimp_w (image); x++) {

	crimp_color_hsv_to_rgb (H (image, x, y),
				S (image, x, y),
				V (image, x, y),
Changes to operator/convert-rgb-grey8.crimp.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
convert_2grey8_rgb
Tcl_Obj* imageObj

crimp_image* image;
crimp_image* result;
int          x, y;

crimp_input (imageObj, image, rgb);

result = crimp_new_grey8 (crimp_w (image), crimp_h (image));

for (y = 0; y < crimp_h (image); y++) {
    for (x = 0; x < crimp_w (image); x++) {

	/*
	 * This conversion to a grey scale is based on the ITU-R 601-2 luma
	 * transform computing the "luminosity" of each pixel.









|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
convert_2grey8_rgb
Tcl_Obj* imageObj

crimp_image* image;
crimp_image* result;
int          x, y;

crimp_input (imageObj, image, rgb);

result = crimp_new_grey8_at (crimp_x (image), crimp_y (image), crimp_w (image), crimp_h (image));

for (y = 0; y < crimp_h (image); y++) {
    for (x = 0; x < crimp_w (image); x++) {

	/*
	 * This conversion to a grey scale is based on the ITU-R 601-2 luma
	 * transform computing the "luminosity" of each pixel.
Changes to operator/convert-rgb-hsv.crimp.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
convert_2hsv_rgb
Tcl_Obj* imageObj

crimp_image* image;
crimp_image* result;
int          x, y, h, s, v;

crimp_input (imageObj, image, rgb);

result = crimp_new_hsv (crimp_w (image), crimp_h (image));

for (y = 0; y < crimp_h (image); y++) {
    for (x = 0; x < crimp_w (image); x++) {

	crimp_color_rgb_to_hsv (R (image, x, y),
				G (image, x, y),
				B (image, x, y),









|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
convert_2hsv_rgb
Tcl_Obj* imageObj

crimp_image* image;
crimp_image* result;
int          x, y, h, s, v;

crimp_input (imageObj, image, rgb);

result = crimp_new_hsv_at (crimp_x (image), crimp_y (image), crimp_w (image), crimp_h (image));

for (y = 0; y < crimp_h (image); y++) {
    for (x = 0; x < crimp_w (image); x++) {

	crimp_color_rgb_to_hsv (R (image, x, y),
				G (image, x, y),
				B (image, x, y),
Changes to operator/convert-rgba-grey8.crimp.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
convert_2grey8_rgba
Tcl_Obj* imageObj

crimp_image* image;
crimp_image* result;
int          x, y;

crimp_input (imageObj, image, rgba);

result = crimp_new_grey8 (crimp_w (image), crimp_h (image));

for (y = 0; y < crimp_h (image); y++) {
    for (x = 0; x < crimp_w (image); x++) {

	/*
	 * This conversion to a grey scale is based on the ITU-R 601-2 luma
	 * transform computing the "luminosity" of each pixel.









|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
convert_2grey8_rgba
Tcl_Obj* imageObj

crimp_image* image;
crimp_image* result;
int          x, y;

crimp_input (imageObj, image, rgba);

result = crimp_new_grey8_at (crimp_x (image), crimp_y (image), crimp_w (image), crimp_h (image));

for (y = 0; y < crimp_h (image); y++) {
    for (x = 0; x < crimp_w (image); x++) {

	/*
	 * This conversion to a grey scale is based on the ITU-R 601-2 luma
	 * transform computing the "luminosity" of each pixel.
Changes to operator/convert-rgba-hsv.crimp.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
convert_2hsv_rgba
Tcl_Obj* imageObj

crimp_image* image;
crimp_image* result;
int          x, y, h, s, v;

crimp_input (imageObj, image, rgba);

result = crimp_new_hsv (crimp_w (image), crimp_h (image));

for (y = 0; y < crimp_h (image); y++) {
    for (x = 0; x < crimp_w (image); x++) {

	crimp_color_rgb_to_hsv (R (image, x, y),
				G (image, x, y),
				B (image, x, y),









|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
convert_2hsv_rgba
Tcl_Obj* imageObj

crimp_image* image;
crimp_image* result;
int          x, y, h, s, v;

crimp_input (imageObj, image, rgba);

result = crimp_new_hsv_at (crimp_x (image), crimp_y (image), crimp_w (image), crimp_h (image));

for (y = 0; y < crimp_h (image); y++) {
    for (x = 0; x < crimp_w (image); x++) {

	crimp_color_rgb_to_hsv (R (image, x, y),
				G (image, x, y),
				B (image, x, y),
Changes to operator/convert-rgba-rgb.crimp.
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

crimp_image* image;
crimp_image* result;
int          x, y;

crimp_input (imageObj, image, rgba);

result = crimp_new_rgb (crimp_w (image), crimp_h (image));

for (y = 0; y < crimp_h (image); y++) {
    for (x = 0; x < crimp_w (image); x++) {

	R (result, x, y) = R (image, x, y);
	G (result, x, y) = G (image, x, y);
	B (result, x, y) = B (image, x, y);







|







8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

crimp_image* image;
crimp_image* result;
int          x, y;

crimp_input (imageObj, image, rgba);

result = crimp_new_rgb_at (crimp_x (image), crimp_y (image), crimp_w (image), crimp_h (image));

for (y = 0; y < crimp_h (image); y++) {
    for (x = 0; x < crimp_w (image); x++) {

	R (result, x, y) = R (image, x, y);
	G (result, x, y) = G (image, x, y);
	B (result, x, y) = B (image, x, y);
Changes to operator/fftx-grey16.crimp.
1
2
3
4
5
6
7
8
9
10
11

12
13
14
15
16
17
18
19
fftx_grey16
Tcl_Obj* imageObj

crimp_image* image;
crimp_image* result;
int          x, y;
integer      n;
real*        workspace;

crimp_input (imageObj, image, grey16);


result = crimp_new_float (crimp_w (image), crimp_h (image));

n = crimp_w (image);
workspace = CRIMP_ALLOC_ARRAY (2*crimp_w (image)+15, real);
rffti_ (&n, workspace);

for (y = 0; y < crimp_h (image); y++) {
    /*











>
|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
fftx_grey16
Tcl_Obj* imageObj

crimp_image* image;
crimp_image* result;
int          x, y;
integer      n;
real*        workspace;

crimp_input (imageObj, image, grey16);

result = crimp_new_float_at (crimp_x (image), crimp_y (image),
			     crimp_w (image), crimp_h (image));

n = crimp_w (image);
workspace = CRIMP_ALLOC_ARRAY (2*crimp_w (image)+15, real);
rffti_ (&n, workspace);

for (y = 0; y < crimp_h (image); y++) {
    /*
Changes to operator/fftx-grey32.crimp.
1
2
3
4
5
6
7
8
9
10
11

12
13
14
15
16
17
18
19
fftx_grey32
Tcl_Obj* imageObj

crimp_image* image;
crimp_image* result;
int          x, y;
real*        workspace;
integer      n;

crimp_input (imageObj, image, grey32);


result = crimp_new_float (crimp_w (image), crimp_h (image));

n = crimp_w (image);
workspace = CRIMP_ALLOC_ARRAY (2*crimp_w (image)+15, real);
rffti_ (&n, workspace);

for (y = 0; y < crimp_h (image); y++) {
    /*











>
|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
fftx_grey32
Tcl_Obj* imageObj

crimp_image* image;
crimp_image* result;
int          x, y;
real*        workspace;
integer      n;

crimp_input (imageObj, image, grey32);

result = crimp_new_float_at (crimp_x (image), crimp_y (image),
			     crimp_w (image), crimp_h (image));

n = crimp_w (image);
workspace = CRIMP_ALLOC_ARRAY (2*crimp_w (image)+15, real);
rffti_ (&n, workspace);

for (y = 0; y < crimp_h (image); y++) {
    /*
Changes to operator/fftx-grey8.crimp.
1
2
3
4
5
6
7
8
9
10
11

12
13
14
15
16
17
18
19
fftx_grey8
Tcl_Obj* imageObj

crimp_image* image;
crimp_image* result;
int          x, y;
integer      n;
real*        workspace;

crimp_input (imageObj, image, grey8);


result = crimp_new_float (crimp_w (image), crimp_h (image));

n = crimp_w (image);
workspace = CRIMP_ALLOC_ARRAY (2*crimp_w (image)+15, real);
rffti_ (&n, workspace);

for (y = 0; y < crimp_h (image); y++) {
    /*











>
|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
fftx_grey8
Tcl_Obj* imageObj

crimp_image* image;
crimp_image* result;
int          x, y;
integer      n;
real*        workspace;

crimp_input (imageObj, image, grey8);

result = crimp_new_float_at (crimp_x (image), crimp_y (image),
			     crimp_w (image), crimp_h (image));

n = crimp_w (image);
workspace = CRIMP_ALLOC_ARRAY (2*crimp_w (image)+15, real);
rffti_ (&n, workspace);

for (y = 0; y < crimp_h (image); y++) {
    /*
Changes to operator/ifftx-grey16.crimp.
1
2
3
4
5
6
7
8
9
10
11

12
13
14
15
16
17
18
19
ifftx_grey16
Tcl_Obj* imageObj

crimp_image* image;
crimp_image* result;
int          x, y;
integer      n;
real*        workspace;

crimp_input (imageObj, image, grey16);


result = crimp_new_float (crimp_w (image), crimp_h (image));

n = crimp_w (image);
workspace = CRIMP_ALLOC_ARRAY (2*crimp_w (image)+15, real);
rffti_ (&n, workspace);

for (y = 0; y < crimp_h (image); y++) {
    /*











>
|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
ifftx_grey16
Tcl_Obj* imageObj

crimp_image* image;
crimp_image* result;
int          x, y;
integer      n;
real*        workspace;

crimp_input (imageObj, image, grey16);

result = crimp_new_float_at (crimp_x (image), crimp_y (image),
			     crimp_w (image), crimp_h (image));

n = crimp_w (image);
workspace = CRIMP_ALLOC_ARRAY (2*crimp_w (image)+15, real);
rffti_ (&n, workspace);

for (y = 0; y < crimp_h (image); y++) {
    /*
Changes to operator/ifftx-grey32.crimp.
1
2
3
4
5
6
7
8
9
10
11

12
13
14
15
16
17
18
19
ifftx_grey32
Tcl_Obj* imageObj

crimp_image* image;
crimp_image* result;
int          x, y;
real*        workspace;
integer      n;

crimp_input (imageObj, image, grey32);


result = crimp_new_float (crimp_w (image), crimp_h (image));

n = crimp_w (image);
workspace = CRIMP_ALLOC_ARRAY (2*crimp_w (image)+15, real);
rffti_ (&n, workspace);

for (y = 0; y < crimp_h (image); y++) {
    /*











>
|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
ifftx_grey32
Tcl_Obj* imageObj

crimp_image* image;
crimp_image* result;
int          x, y;
real*        workspace;
integer      n;

crimp_input (imageObj, image, grey32);

result = crimp_new_float_at (crimp_x (image), crimp_y (image),
			     crimp_w (image), crimp_h (image));

n = crimp_w (image);
workspace = CRIMP_ALLOC_ARRAY (2*crimp_w (image)+15, real);
rffti_ (&n, workspace);

for (y = 0; y < crimp_h (image); y++) {
    /*
Changes to operator/ifftx-grey8.crimp.
1
2
3
4
5
6
7
8
9
10
11

12
13
14
15
16
17
18
19
ifftx_grey8
Tcl_Obj* imageObj

crimp_image* image;
crimp_image* result;
int          x, y;
integer      n;
real*        workspace;

crimp_input (imageObj, image, grey8);


result = crimp_new_float (crimp_w (image), crimp_h (image));

n = crimp_w (image);
workspace = CRIMP_ALLOC_ARRAY (2*crimp_w (image)+15, real);
rffti_ (&n, workspace);

for (y = 0; y < crimp_h (image); y++) {
    /*











>
|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
ifftx_grey8
Tcl_Obj* imageObj

crimp_image* image;
crimp_image* result;
int          x, y;
integer      n;
real*        workspace;

crimp_input (imageObj, image, grey8);

result = crimp_new_float_at (crimp_x (image), crimp_y (image),
			     crimp_w (image), crimp_h (image));

n = crimp_w (image);
workspace = CRIMP_ALLOC_ARRAY (2*crimp_w (image)+15, real);
rffti_ (&n, workspace);

for (y = 0; y < crimp_h (image); y++) {
    /*
Changes to operator/imaginary-fpcomplex.crimp.
1
2
3
4
5
6
7
8
9

10
11
12
13
14
15
16
17
imaginary_fpcomplex
Tcl_Obj* imageObj

crimp_image* image;
crimp_image* result;
int          x, y;

crimp_input (imageObj, image, fpcomplex);


result = crimp_new_float (crimp_w (image), crimp_h (image));

for (y = 0; y < crimp_h (result); y++) {
    for (x = 0; x < crimp_w (result); x++) {
	FLOATP (result, x, y) = IM (image, x, y);
    }
}










>
|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
imaginary_fpcomplex
Tcl_Obj* imageObj

crimp_image* image;
crimp_image* result;
int          x, y;

crimp_input (imageObj, image, fpcomplex);

result = crimp_new_float_at (crimp_x (image), crimp_y (image),
			     crimp_w (image), crimp_h (image));

for (y = 0; y < crimp_h (result); y++) {
    for (x = 0; x < crimp_w (result); x++) {
	FLOATP (result, x, y) = IM (image, x, y);
    }
}

Changes to operator/setalpha-rgb-grey8.crimp.
16
17
18
19
20
21
22
23

24
25
26
27
28
29
30
crimp_input (imageAlphaObj, imageA, grey8);

if (!crimp_eq_dim (image, imageA)) {
    Tcl_SetResult(interp, "image dimensions do not match", TCL_STATIC);
    return TCL_ERROR;
}

result = crimp_new_rgba_at (crimp_x (image), crimp_y (image), crimp_w (image), crimp_h (image));


for (y = 0; y < crimp_h (result); y++) {
    for (x = 0; x < crimp_w (result); x++) {
	R (result, x, y) = R (image, x, y);
	G (result, x, y) = G (image, x, y);
	B (result, x, y) = B (image, x, y);
	A (result, x, y) = GREY8 (imageA, x, y);







|
>







16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
crimp_input (imageAlphaObj, imageA, grey8);

if (!crimp_eq_dim (image, imageA)) {
    Tcl_SetResult(interp, "image dimensions do not match", TCL_STATIC);
    return TCL_ERROR;
}

result = crimp_new_rgba_at (crimp_x (image), crimp_y (image),
			    crimp_w (image), crimp_h (image));

for (y = 0; y < crimp_h (result); y++) {
    for (x = 0; x < crimp_w (result); x++) {
	R (result, x, y) = R (image, x, y);
	G (result, x, y) = G (image, x, y);
	B (result, x, y) = B (image, x, y);
	A (result, x, y) = GREY8 (imageA, x, y);
Changes to operator/split-complex.crimp.
1
2
3
4
5
6
7
8
9
10
11

12

13
14
15
16
17
18
19
20
split_fpcomplex
Tcl_Obj* imageObj

Tcl_Obj*         list[2];
crimp_image*     image;
crimp_image*     real;
crimp_image*     imaginary;
int              x, y;

crimp_input (imageObj, image, fpcomplex);


real      = crimp_new_float (crimp_w (image), crimp_h (image));

imaginary = crimp_new_float (crimp_w (image), crimp_h (image));

for (y = 0; y < crimp_h (image); y++) {
    for (x = 0; x < crimp_w (image); x++) {

	/*
	 * Placing the pixels of each channel into their own image.
	 */











>
|
>
|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
split_fpcomplex
Tcl_Obj* imageObj

Tcl_Obj*         list[2];
crimp_image*     image;
crimp_image*     real;
crimp_image*     imaginary;
int              x, y;

crimp_input (imageObj, image, fpcomplex);

real      = crimp_new_float_at (crimp_x (image), crimp_y (image),
				crimp_w (image), crimp_h (image));
imaginary = crimp_new_float_at (crimp_x (image), crimp_y (image),
				crimp_w (image), crimp_h (image));

for (y = 0; y < crimp_h (image); y++) {
    for (x = 0; x < crimp_w (image); x++) {

	/*
	 * Placing the pixels of each channel into their own image.
	 */
Changes to operator/split-hsv.crimp.
1
2
3
4
5
6
7
8
9
10
11
12
13

14

15

16
17
18
19
20
21
22
23
split_hsv
Tcl_Obj* imageObj

Tcl_Obj*         list[3];
const crimp_imagetype* grey = crimp_imagetype_find ("crimp::image::grey8");
crimp_image*     image;
crimp_image*     hue;
crimp_image*     sat;
crimp_image*     val;
int              x, y;

crimp_input (imageObj, image, hsv);


hue = crimp_new (grey, crimp_w (image), crimp_h (image));

sat = crimp_new (grey, crimp_w (image), crimp_h (image));

val = crimp_new (grey, crimp_w (image), crimp_h (image));

for (y = 0; y < crimp_h (image); y++) {
    for (x = 0; x < crimp_w (image); x++) {

	/*
	 * Placing the pixels of each color channel into their own images.
	 */













>
|
>
|
>
|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
split_hsv
Tcl_Obj* imageObj

Tcl_Obj*         list[3];
const crimp_imagetype* grey = crimp_imagetype_find ("crimp::image::grey8");
crimp_image*     image;
crimp_image*     hue;
crimp_image*     sat;
crimp_image*     val;
int              x, y;

crimp_input (imageObj, image, hsv);

hue = crimp_new_at (grey, crimp_x (image), crimp_y (image),
			  crimp_w (image), crimp_h (image));
sat = crimp_new_at (grey, crimp_x (image), crimp_y (image),
			  crimp_w (image), crimp_h (image));
val = crimp_new_at (grey, crimp_x (image), crimp_y (image),
			  crimp_w (image), crimp_h (image));

for (y = 0; y < crimp_h (image); y++) {
    for (x = 0; x < crimp_w (image); x++) {

	/*
	 * Placing the pixels of each color channel into their own images.
	 */
Changes to operator/split-rgb.crimp.
1
2
3
4
5
6
7
8
9
10
11
12
13

14

15

16
17
18
19
20
21
22
23
split_rgb
Tcl_Obj* imageObj

Tcl_Obj*         list[3];
const crimp_imagetype* grey = crimp_imagetype_find ("crimp::image::grey8");
crimp_image*     image;
crimp_image*     red;
crimp_image*     green;
crimp_image*     blue;
int              x, y;

crimp_input (imageObj, image, rgb);


red   = crimp_new (grey, crimp_w (image), crimp_h (image));

green = crimp_new (grey, crimp_w (image), crimp_h (image));

blue  = crimp_new (grey, crimp_w (image), crimp_h (image));

for (y = 0; y < crimp_h (image); y++) {
    for (x = 0; x < crimp_w (image); x++) {

	/*
	 * Placing the pixels of each color channel into their own images.
	 */













>
|
>
|
>
|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
split_rgb
Tcl_Obj* imageObj

Tcl_Obj*         list[3];
const crimp_imagetype* grey = crimp_imagetype_find ("crimp::image::grey8");
crimp_image*     image;
crimp_image*     red;
crimp_image*     green;
crimp_image*     blue;
int              x, y;

crimp_input (imageObj, image, rgb);

red   = crimp_new_at (grey, crimp_x (image), crimp_y (image),
			    crimp_w (image), crimp_h (image));
green = crimp_new_at (grey, crimp_x (image), crimp_y (image),
			    crimp_w (image), crimp_h (image));
blue  = crimp_new_at (grey, crimp_x (image), crimp_y (image),
			    crimp_w (image), crimp_h (image));

for (y = 0; y < crimp_h (image); y++) {
    for (x = 0; x < crimp_w (image); x++) {

	/*
	 * Placing the pixels of each color channel into their own images.
	 */
Changes to operator/split-rgba.crimp.
8
9
10
11
12
13
14

15

16

17

18
19
20
21
22
23
24
25
crimp_image*     green;
crimp_image*     blue;
crimp_image*     alpha;
int              x, y;

crimp_input (imageObj, image, rgba);


red   = crimp_new (grey, crimp_w (image), crimp_h (image));

green = crimp_new (grey, crimp_w (image), crimp_h (image));

blue  = crimp_new (grey, crimp_w (image), crimp_h (image));

alpha = crimp_new (grey, crimp_w (image), crimp_h (image));

for (y = 0; y < crimp_h (image); y++) {
    for (x = 0; x < crimp_w (image); x++) {

	/*
	 * Placing the pixels of each color channel (and alpha) into
	 * their own images.







>
|
>
|
>
|
>
|







8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
crimp_image*     green;
crimp_image*     blue;
crimp_image*     alpha;
int              x, y;

crimp_input (imageObj, image, rgba);

red   = crimp_new_at (grey, crimp_x (image), crimp_y (image),
			    crimp_w (image), crimp_h (image));
green = crimp_new_at (grey, crimp_x (image), crimp_y (image),
			    crimp_w (image), crimp_h (image));
blue  = crimp_new_at (grey, crimp_x (image), crimp_y (image),
			    crimp_w (image), crimp_h (image));
alpha = crimp_new_at (grey, crimp_x (image), crimp_y (image),
			    crimp_w (image), crimp_h (image));

for (y = 0; y < crimp_h (image); y++) {
    for (x = 0; x < crimp_w (image); x++) {

	/*
	 * Placing the pixels of each color channel (and alpha) into
	 * their own images.
Changes to operator/sqmagnitude-fpcomplex.crimp.
9
10
11
12
13
14
15

16
17
18
19
20
21
22
23
crimp_image* result;
crimp_image* image;

int x, y;

crimp_input (imageObj, image, fpcomplex);


result = crimp_new_float (crimp_w (image), crimp_h (image));

for (y = 0; y < crimp_h (result); y++) {
    for (x = 0; x < crimp_w (result); x++) {
	double re = RE (image, x, y);
	double im = IM (image, x, y);

	FLOATP (result, x, y) = re*re + im*im;







>
|







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
crimp_image* result;
crimp_image* image;

int x, y;

crimp_input (imageObj, image, fpcomplex);

result = crimp_new_float_at (crimp_x (image), crimp_y (image),
			     crimp_w (image), crimp_h (image));

for (y = 0; y < crimp_h (result); y++) {
    for (x = 0; x < crimp_w (result); x++) {
	double re = RE (image, x, y);
	double im = IM (image, x, y);

	FLOATP (result, x, y) = re*re + im*im;
Changes to operator/trace_hysteresis.crimp.
11
12
13
14
15
16
17

18
19
20
21
22
23
24
25

crimp_image* image;
crimp_image* result;
int          x, y;

crimp_input (imageObj, image, float);


result = crimp_new_grey8 (crimp_w (image), crimp_h (image));

/*
 * Fill with black
 */

for (y = 0; y < crimp_h (result); y++) {
    for (x = 0; x < crimp_w (result); x++) {







>
|







11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

crimp_image* image;
crimp_image* result;
int          x, y;

crimp_input (imageObj, image, float);

result = crimp_new_grey8_at (crimp_x (image), crimp_y (image),
			     crimp_w (image), crimp_h (image));

/*
 * Fill with black
 */

for (y = 0; y < crimp_h (result); y++) {
    for (x = 0; x < crimp_w (result); x++) {