c++ - What does minDist(100) and the curly braces in this piece of code mean? -
i've met piece of code made me confused. it's header file defines class named colordetector. private part follows:
class colordetector { private: // minimum acceptable distance int mindist; // target color cv::vec3b target; // image containing resulting binary map cv::mat result; // inline private member function // computes distance target color. int getdistance(const cv::vec3b& color) const { // return static_cast<int>(cv::norm<int,3>(cv::vec3i(color[0]-target[0],color[1]-target[1],color[2]-target[2]))); return abs(color[0]-target[0])+ abs(color[1]-target[1])+ abs(color[2]-target[2]); } here's public declaration of class made me confused:
public: // empty constructor colordetector() : mindist(100) { // default parameter initialization here target[0]= target[1]= target[2]= 0; } i not quite clear grammar in constructor here. mindset(100) mean here , why target array written within curly braces? searched google keyword "default constructor" , "default parameter" found no relating articles. can tell me exact meaning of piece of code here?
the class of
this member initialization list see http://en.cppreference.com/w/cpp/language/initializer_list
Comments
Post a Comment