colors.cc
Go to the documentation of this file.00001 #include "Vision/colors.h"
00002 #include <cstdio>
00003
00004
00005 std::ostream& operator<<(std::ostream &os, const rgb &rgbval) {
00006 os << "[" << (unsigned int)rgbval.red
00007 << "," << (unsigned int)rgbval.green
00008 << "," << (unsigned int)rgbval.blue
00009 << "]";
00010 return os;
00011 }
00012
00013
00014 std::string toString(const rgb &rgbval) {
00015 char buff[15];
00016 snprintf(buff,15,"%d %d %d",rgbval.red,rgbval.green,rgbval.blue);
00017 return buff;
00018 }
00019
00020
00021
00022 std::ostream& operator<<(std::ostream &os, const yuv &yuvval) {
00023 os << "yuv[" << (unsigned int)yuvval.y
00024 << "," << (unsigned int)yuvval.u
00025 << "," << (unsigned int)yuvval.v
00026 << "]";
00027 return os;
00028 }
00029
00030
00031 std::string toString(const yuv &yuvval) {
00032 char buff[15];
00033 snprintf(buff,15,"%d %d %d",yuvval.y,yuvval.u,yuvval.v);
00034 return buff;
00035 }
00036
00037