Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F98698111
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
Wed, Jan 15, 17:48
Size
1 KB
Mime Type
text/x-c
Expires
Fri, Jan 17, 17:48 (2 d)
Engine
blob
Format
Raw Data
Handle
23620863
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