comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Changing the order of true color images
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Changing the order of true color images [message #28824] Wed, 16 January 2002 05:17 Go to previous message
ronn is currently offline  ronn
Messages: 123
Registered: April 1999
Senior Member
in article Z4T08.21077$WQ1.3331811@news6-win.server.ntlworld.com, Martin
Downing at martin.downing@ntlworld.com wrote on 1/15/02 5:01 AM:

> Hi Ronn,
> Flipping an image in Y really is very trivial C code, but maybe if you are
> not used to image data it seems hard. I'll do it for 2d for
> you below, extending to 3d when pixel interleaved will be just a matter of
> setting sx = dim_x*3
>

In the interest of completeness here is the completed C example based on
Martin's suggestion.

/*{{:|{{:|{{:|{{:|{{:|{{:|{{:|{{:|{{:|{{:|{{:|{{:|{{:|*/

void flipY( char * image, int ndims, int sx, int sy)
{
int hy,i,j;
char tmp;

hy = sy/2;
if( ndims == 3) sx = sx*ndims;

for (j=0;j<hy;j++) {
for( i=0; i<sx; i++){
tmp = image[i+sx*j];
image[i+sx*j] = image[sx*(sy-j-1)+i];
image[sx*(sy-j-1)+i] = tmp;
}
}
}

/*{{:|{{:|{{:|{{:|{{:|{{:|{{:|{{:|{{:|{{:|{{:|{{:|{{:|*/

-Ronn


--
Ronn Kling
KRS, inc.
email: ronn@rlkling.com
"Application Development with IDL"� programming book updated for IDL5.5!
"Calling C from IDL, Using DLM's to extend your IDL code" NEW BOOK!
http://www.rlkling.com/
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Segmentation of Multiple ROIs
Next Topic: Re: problem after upgrading

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:06:05 PDT 2025

Total time taken to generate the page: 0.00566 seconds