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

From: Rene Brun <brun_at_pcroot.cern.ch>
Date: Sat, 19 Mar 2005 17:13:19 +0100 (MET)


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 Sat Mar 19 2005 - 17:13:51 MET

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