Re: [ROOT] TImage, AfterImage problem

From: Reiner Rohlfs (Reiner.Rohlfs@obs.unige.ch)
Date: Fri Jun 13 2003 - 14:04:59 MEST


Hi Michal,

I think this is a libAfterImage problem.  The library has a division by 0.

In the file transform.c the line 1820 and 1821 :

				multipliers[y][x] =
(double)(palette->channels[y][x+1] - palette->channels[y][x])/
				                 	       
(points[x+1]-points[x]);

has to be replaces by 

            if (points[x+1] == points[x])
               multipliers[y][x] = 1;
            else
				   multipliers[y][x] =
(double)(palette->channels[y][x+1] - palette->channels[y][x])/
				                 	       
(points[x+1]-points[x]);

It is not important to which multipliers[y][x] is assigned to. If points[x+1]
== points[x] than multipliers[y][x] will by multiplied by 0 anyhow, as fas as I
understand the code. But it should not NaN.

With this lines your image looks OK for me. 

Rene, Fons can you also make these changes in the libAfterImage library ROOT
supports.

Cheers Reiner.



On  6-Jun-03 at 23:09, Michal Lijowski (michal@cvu.wustl.edu) wrote:
> 
>   I have one more problem with TImage or maybe AfterImage.
>   When I run the attached code I get two canvas but on the bottom
>   of the image there is white band along part of the bottom of
>   the image. The same case is for color paletter. I try to find out
>   where the problem is by running asvector program located in
>   libAfterImage/apps directory. But the resultant image has black
>   band on the bottom along full width. This band does not appear 
>   on the jpeg version of this image. I sent email to author of 
>   this software and he advised to grab the CVS version. So I did. 
>   But after correcting a couple compilation errors, the effect is 
>   the same. The resultant image from asvector program has black band
>   on the bottom.
> 
>   I am running ROOT 3.5/5 under RH Linux 9.0 with gcc 3.2.2.
> 
>   Thank you for the attention.
> 
>    Michal 
>   



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:12 MET