setting pixels function? [closed]

asked 2014-05-01 08:05:21 -0600

sasa gravatar image

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); };

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by sturkmen
close date 2020-10-19 16:16:26.194811



please avoid the arcane c-api, use the c++ one instead

berak gravatar imageberak ( 2014-05-02 03:01:10 -0600 )edit

I suppose it depend on whether I want a c or c++ interface?

sasa gravatar imagesasa ( 2014-05-02 04:59:31 -0600 )edit

that's no question. the c-api is dead .you want the c++ interface.

and here's the drawing functions

berak gravatar imageberak ( 2014-05-02 05:04:43 -0600 )edit

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.

sasa gravatar imagesasa ( 2014-05-02 09:06:47 -0600 )edit

let's just close it here. if you're complaining about deficiancies of the c-api, - too late.

berak gravatar imageberak ( 2014-05-02 15:35:42 -0600 )edit

I'm suggesting that, for symmetry, there should be an equivalent to cv_rectangle that sets a single pixel.

sasa gravatar imagesasa ( 2014-05-02 17:07:08 -0600 )edit