Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F97284000
split_image.c
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Jan 4, 01:09
Size
1 KB
Mime Type
text/x-c
Expires
Mon, Jan 6, 01:09 (2 d)
Engine
blob
Format
Raw Data
Handle
23372811
Attached To
R1448 Lenstool-HPC
split_image.c
View Options
/***************************************************************/
/* */
/* FUNCTION: split_image */
/* */
/* PURPOSE: splits an image */
/* */
/* INPUT: image image to split */
/* nbr_lin number of lines of image */
/* nbr_col number of colums of image */
/* */
/* RETURN: 0 if everything is OK */
/* -1 if memory allocation failure */
/* */
/* VERSION: December 1992 */
/* */
/* AUTHOR: Karim BOUYOUCEF */
/* */
/***************************************************************/
#include <stdio.h>
#include "fonction.h"
#include "lt.h"
int
split_image
(
double
**
image
,
int
nbr_lin
,
int
nbr_col
)
{
/**************** declarations ************************************/
auto
int
i
,
j
;
auto
double
tmp
;
/*********** split of image ********************/
for
(
i
=
0
;
i
<
nbr_lin
/
2
;
i
++
)
for
(
j
=
0
;
j
<
nbr_col
/
2
;
j
++
)
{
tmp
=
image
[
i
+
nbr_lin
/
2
][
j
+
nbr_col
/
2
];
image
[
i
+
nbr_lin
/
2
][
j
+
nbr_col
/
2
]
=
image
[
i
][
j
];
image
[
i
][
j
]
=
tmp
;
tmp
=
image
[
i
][
j
+
nbr_col
/
2
];
image
[
i
][
j
+
nbr_col
/
2
]
=
image
[
i
+
nbr_lin
/
2
][
j
];
image
[
i
+
nbr_lin
/
2
][
j
]
=
tmp
;
}
return
(
0
);
}
Event Timeline
Log In to Comment