|
Boost : |
From: Lubomir Bourdev (lbourdev_at_[hidden])
Date: 2006-06-28 21:47:28
>Rather than int width, int height for image why not image_size(width,
>height).
When you need 2D value you can specify it either as two numbers or as a
point:
rgb8_image_t image(300,200);
is the same as
rgb8_image_t image(rgb8_image_t::point_t(300,200));
or in this case:
rgb8_image_t image(point2<int>(300,200));
>What is point used for <adobe/gil/core/utilities.hpp> ?
Hopefully that answers your question. Any time you have 2D coordinates,
such as image dimensions, 2D location in an image, 2D difference, etc,
you can represent them with a point.
>Isnt point2<T> always an Integer? Why is it converted to a float:
point2<T> is an integer if T is an integer. Multiplying it with a float
will make it a float point. But integer multiplication should keep it an
integer. We forgot to add this overload. We will fix that.
>Is point2 * point2 useful?
It could be. For example, the step of two nested subsampled views is the
product of their steps. But as it appears we are not currently using it.
We could remove it. Besides, it is unclear whether the above syntax
should do a dot product instead.
>Is point2 << point2 useful?
This is not currently defined. You can shift an integer point by an
integral type, but not by another point.
>point2[] may not be legal C++ as written FWIW:
>http://tinyurl.com/lvufg
Using a switch statement at that low level is prohibitively expensive. I
couldn't get MSVC8 to generate the same assembly for a switch statement
as for my cast. Besides, in the highly unlikely scenario where T would
require some padding to be aligned, I think the math still works out.
Can you give me a concrete example (as far fetched as you want, but
legal) that breaks the code?
>Arent point2's actually position vectors?
Yes, they can be used as such. Why?
>Boost.Numeric.Converter can be used for rounding and conversion of
float to >int. Adds range
>checking too, but slower, is that why you dont use it?
I am not actually familiar with all Boost libraries. But yes, in
low-level code, such as channel-level code, speed is instrumental.
>utility.hpp needs to include <iterator>
You mean gil/core/utilities.hpp? Why?
> locator might be renamed cursor.
What is the precedent?
Lubomir
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk