Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

ImageBuffer.cc

Go to the documentation of this file.
00001 #include "ImageBuffer.h"
00002 #include <cstdlib>
00003 
00004 void convertPGMImgToImageBuffer(PGMImg& pgmImg, ImageBuffer& buffer){
00005   buffer.width = pgmImg.getWidth();
00006   buffer.height = pgmImg.getHeight();
00007   buffer.byteArray = (unsigned char*)malloc(sizeof(unsigned char) * buffer.width * buffer.height);
00008   int ptr = 0;
00009   for (int i = 0; i < buffer.height; i++){
00010     for (int j = 0; j < buffer.width; j++){
00011       buffer.byteArray[ptr++] = pgmImg.getPixel(j, i);
00012     }
00013   }
00014 }

Tekkotsu v5.1CVS
Generated Mon May 9 04:58:42 2016 by Doxygen 1.6.3