LaTo
12th July 2015, 15:37
Thanks for your suggestions LaTo.
I deliberately kept the code separate and as separate function call to make it easy to rip out for other uses,
as for coding style, that is how I've always done it and it is quite clear to me.
Sure but you can do that without duplicating such large portion of code ;)
I notice that you multiply the Y coords by pitch and add X offset rather than using a raster pointer incremented by pitch at every line,
that is a lot of multiplications that could be replaced by a simple addition every now and then, not something I would not do myself.
Yes, that's micro-optimization... In an analysis filter like this you won't gain much speed, anyways I changed the code.
However, debug pixel sampling functionality is broken as histogram plots Luma 255 where histogram is zero (ie white outline),
original MatchHistogramDebug() plots histogram value only @ Y= 255(bottom line), outline only rendered where histogram value is greater than 0.
My bad, copy-pasted too quickly and forgotten the > 0 check... I fixed the code.
I did however like your overall style, but is not mine, I'm a C programmer not CPP, each to their own I guess.
And just to clarify, the TAKE_3 post also contains the bug fix.
Thanks for your work LaTo, much appreciated. :)
Your contributions are well appreciated too, thanks!
I deliberately kept the code separate and as separate function call to make it easy to rip out for other uses,
as for coding style, that is how I've always done it and it is quite clear to me.
Sure but you can do that without duplicating such large portion of code ;)
I notice that you multiply the Y coords by pitch and add X offset rather than using a raster pointer incremented by pitch at every line,
that is a lot of multiplications that could be replaced by a simple addition every now and then, not something I would not do myself.
Yes, that's micro-optimization... In an analysis filter like this you won't gain much speed, anyways I changed the code.
However, debug pixel sampling functionality is broken as histogram plots Luma 255 where histogram is zero (ie white outline),
original MatchHistogramDebug() plots histogram value only @ Y= 255(bottom line), outline only rendered where histogram value is greater than 0.
My bad, copy-pasted too quickly and forgotten the > 0 check... I fixed the code.
I did however like your overall style, but is not mine, I'm a C programmer not CPP, each to their own I guess.
And just to clarify, the TAKE_3 post also contains the bug fix.
Thanks for your work LaTo, much appreciated. :)
Your contributions are well appreciated too, thanks!