Re: How to TImage::Open a PGM file?

From: Valeriy Onuchin <Valeri.Onoutchine_at_cern.ch>
Date: Tue, 22 Mar 2005 19:13:23 +0100


Hi OKUMURA Akira,
OK. I see the problem. Hopefully be fixed asap.

Thanks. Regards. Valeriy

Valeriy Onuchin wrote:

> Hi,
> could you csend me a sample file?
>
> Thanks. Regards. Valeriy
>
> "OKUMURA, Akira" wrote:
>
> > Dear ROOTers,
> >
> > (ROOT version 4.02/00 on Mac OS X 10.3.8)
> >
> > When I try to open a PGM file using the function
> > static TImage* TImage::Open(const char* file, TImage::EImageFileTypes
> > type = kUnknown)
> > the PGM file seems to be opened as a PPM file.
> > Because white to black gradations are converted to red to black
> > gradations when they are 'Draw()'n.
> >
> > Additionally, vertical noises often appear on the image. (Not always)
> > The noises contains not only R but also G and B.
> >
> > How can I open and draw PGM files correctly?
> >
> > Here is a short test macro.
> >
> > void test()
> > {
> > TImage* img;
> > TCanvas* c = new TCanvas("test", "test", 600, 600);
> >
> > for(int i=0; i<10; i++){
> > img = TImage::Open("test.pgm", TImage::EImageFileTypes::kPnm);
> > img->Draw();
> > c->Update();
> > }
> > }
> >
> > Sincerely,
> >
> > OKUMURA, Akira oxon_at_icrr.u-tokyo.ac.jp
> > Institute for Cosmic Ray Research, University of Tokyo
> > 5-1-5 Kashiwanoha Kashiwa Chiba 277-8582 Japan
> > Tel/Fax : +81 4-7136-3153
> > Skype : okumura.akira
Received on Tue Mar 22 2005 - 19:13:28 MET

This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:06 MET