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

From: Faine, Valeri <fine_at_bnl.gov>
Date: Sun, 20 Mar 2005 20:56:53 -0500


Hello dear OKUMURA,

I have tried your test with Qt/Root (see: http://root.bnl.gov ) It seems to me it works properly

See:
http://www.rhic.bnl.gov/~fine/EventDisplay/tmp/CanvasPgm.html

My best regards, Valeri

-----Original Message-----
From: owner-roottalk_at_pcroot.cern.ch [mailto:owner-roottalk_at_pcroot.cern.ch] On Behalf Of Rene Brun
Sent: Saturday, March 19, 2005 11:13 AM
To: OKUMURA, Akira
Cc: roottalk_at_pcroot.cern.ch
Subject: Re: [ROOT] How to TImage::Open a PGM file?

Valeriy Onuuchin will answer your mail when he will be back at CERN in a few days.

Rene Brun

On Sat,
19 Mar 2005, 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 Mon Mar 21 2005 - 02:57:04 MET

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