setting pixels function? [closed]
There appears to be no simple function for setting pixels values. I can see loads of different ways of doing this but for symmetry sake what about something like this alongside rectangles, lines and circles?
void cvPixel(CvArr*, CvPoint, CvScalar);
void cvPixel(CvArr* img, CvPoint pt, CvScalar color){ cvSet2D(img,pt.y,pt.x,color); };
please avoid the arcane c-api, use the c++ one instead
I suppose it depend on whether I want a c or c++ interface?
that's no question. the c-api is dead .you want the c++ interface.
and here's the drawing functions
Notwithstanding the fact I want to use C not C++ the original point of the question was that there are a multitude of untidy methods for setting pixels and a lack of equivalence cf cvRectangle etc.
The point is that for symmetry with the other drawing function (like cvRectangle) it would appear logical that something like cvPixel existed. I'd rather not punctuate my code with a lot of mess just to paint one dot.
My example is what I am using in my C code where .at() is of no use to me.
What I want is a simple, symmetric and logical code base that includes this functionality and I want to code in C.
let's just close it here. if you're complaining about deficiancies of the c-api, - too late.
I'm suggesting that, for symmetry, there should be an equivalent to cv_rectangle that sets a single pixel.