Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

# Representations/Perception/LowResImage.cpp

Go to the documentation of this file.

    00001 /**
    00002  * @file LowResImage.cpp
    00003  *
    00004  * @author Max Risler
    00005  *
    00006  * Implementation of class LowResImage
    00007  */
    00008
    00009 #include "LowResImage.h"
    00010
    00011 Out& operator<<(Out& stream,const LowResImage& lrImage)
    00012 {
    00013   stream << lrImage.image.cameraInfo.resolutionWidth << lrImage.image.cameraInfo.resolutionHeight << lrImage.image.frameNumber;
    00014   for(int y = 0; y < lrImage.image.cameraInfo.resolutionHeight; ++y)
    00015     for(int c = 0; c < 3; ++c)
    00016       stream.write(&lrImage.image.image[y][c][0], lrImage.image.cameraInfo.resolutionWidth);
    00017
    00018   return stream;
    00019 }
    00020
    00021 In& operator>>(In& stream,LowResImage& lrImage)
    00022 {
    00023   stream >> lrImage.image.cameraInfo.resolutionWidth
    00024          >> lrImage.image.cameraInfo.resolutionHeight
    00025          >> lrImage.image.frameNumber;
    00026
    00027   lrImage.image.setCameraInfo();
    00028
    00029   for(int y = 0; y < lrImage.image.cameraInfo.resolutionHeight; ++y)
    00030   {
    00031     int c;
    00032     for(c = 0; c < 3; ++c)
    00033       stream.read(&lrImage.image.image[y][c][0], lrImage.image.cameraInfo.resolutionWidth);
    00034     for(c = 3; c < 6; ++c)
    00035       memset(&lrImage.image.image[y][c][0], 128, lrImage.image.cameraInfo.resolutionWidth);
    00036   }
    00037
    00038   return stream;
    00039 }