BlinkenArea - GitList
Repositories
Blog
Wiki
libetherpix
Code
Commits
Branches
Tags
Search
Tree:
5c70d9d
Branches
Tags
master
libetherpix
simulator
pixel.h
implement receiving packets
Stefan Schuermans
commited
5c70d9d
at 2017-06-11 15:48:14
pixel.h
Blame
History
Raw
/* * EtherPix simulator * * Copyright 2017 Stefan Schuermans <stefan schuermans info> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 3 of the License. * * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef PIXEL_H #define PIXEL_H #include <gtkmm.h> #include <stdint.h> #include "bbox.h" #include "transform.h" /// a simulated pixel class Pixel { public: /// default constructor Pixel(); /// constructor based on coordinates and radius Pixel(double x, double y, double r); /** * @brief add pixel to the bounding box * @param[in,out] bb bounding box */ void updateBBox(BBox &bb) const; /** * @brief set color of pixel */ void setColor(uint8_t red, uint8_t green, uint8_t blue) { m_red = red ; m_green = green; m_blue = blue ; } /** * @brief draw pixel * @param[in] cairo cairo context for drawing * @param[in] tf coordinate transformation */ void draw(Cairo::RefPtr<Cairo::Context> &cairo, Transform const &tf) const; protected: /// parameters of pixel //@{ double m_x; ///< x coordinate double m_y; ///< y coordinate double m_r; ///< radius //@} /// color of pixel //@{ uint8_t m_red, m_green, m_blue; //@} }; #endif // #ifndef PIXEL_H