octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

uint8NDArray


From: Andrej Lojdl
Subject: uint8NDArray
Date: Fri, 26 Jul 2013 20:52:22 +0200

I'm using uint8NDArray in my code, but there seems to be some kind of problems.
Can any one who worked with this data type take a look and assume what the problem can be. I'm not expecting direct answers, but more some pin points 
on what to look. 


uint8NDArray data;
std::ifstream file;
 // read data from PPM file to Array for OpenGL rendering
      file.open("default.ppm");
      std::cout<<"--READING--"<<std::endl;
      file>>magic_number>>skip;
      std::getline(file, comment);
      file>>width>>height>>max_color;
      // reading the data, row by row
      for(int j=0; j<width; j++)
        {
          for(int i=0; i<height; i++)
            {
              file>>data(0,i,j); //red
              file>>data(1,i,j); //green
              file>>data(2,i,j); //blue
              data(3,i,j) = 0;   //alpha -> transparent
            }
        }
      file.close();
      std::cout<<"--DONE READING--"<<std::endl;  
      cmd = remove("default.ppm");

Thanks in advance,
Andrej Lojdl

reply via email to

[Prev in Thread] Current Thread [Next in Thread]