MCPcopy Create free account
hub / github.com/chenshuo/muduo / Plot

Method Plot

examples/procmon/plot.cc:11–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9struct Plot::MyGdFont : public gdFont {};
10
11Plot::Plot(int width, int height, int totalSeconds, int samplingPeriod)
12 : width_(width),
13 height_(height),
14 totalSeconds_(totalSeconds),
15 samplingPeriod_(samplingPeriod),
16 image_(gdImageCreate(width_, height_)),
17 font_(static_cast<MyGdFont*>(gdFontGetSmall())),
18 fontWidth_(font_->w),
19 fontHeight_(font_->h),
20 background_(gdImageColorAllocate(image_, 255, 255, 240)),
21 black_(gdImageColorAllocate(image_, 0, 0, 0)),
22 gray_(gdImageColorAllocate(image_, 200, 200, 200)),
23 blue_(gdImageColorAllocate(image_, 128, 128, 255)),
24 kRightMargin_(3 * fontWidth_ + 5),
25 ratioX_(static_cast<double>(samplingPeriod_ * (width_ - kLeftMargin_ - kRightMargin_)) / totalSeconds_)
26{
27 // gdImageSetAntiAliased(image_, black_);
28}
29
30Plot::~Plot()
31{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected