Boost logo

Boost :

From: Adam Badura (abadura_at_[hidden])
Date: 2005-09-27 02:41:34

> It is not clear that you'll need really many classes. Specifically, do you
> know of any use case where you need to manipulate HSV color format
> directly? Say, scale an image in that format? I don't, but I'm not
> expert.

    I'm not either. And if you judge by the grade which I have on my graphic
curse then I'm not good at all... :)
    I don't know any such uses. But I think that EVEN if there are NON it is
no cause to not allow (or ease) writting such a code, because someone might
whant to do something like this. Besides there is a lot of thingks I have
never seen to be used but know supporting libraries...

> STL analogy is not right. Say you want to implement "add rain drops to
> image" functionality for image editor. That functionality should be in
> of dynamic library. So, you can just write template function. You need to
> instantiate it so that the library has certain binary interface. And the
> question is whether you better code against the binary interface and don't
> bother with templates.

    Yes. With templates you want be able to do binary. But why would you
like that much? Note that with tamplates you actually can do the same what
you would do withouth them. You can write binary in form

    color_rgb<rgb_float> interpolate(vertex vertex1, vertex vertex2, vertex
vertex3) {/*...*/}

instead of my

    template<typename color> color interpolate(vertex vertex1, vertex
vertex2, vertex vertex3) {/*...*/}

    Naturally. You will have to write one function per color representation
you want to support but without templates you would need this as well, so
you don't loos anything here... Additionally, you can even gain. In your
library you write ON template function and to have a binary you just
parametrize it with few representations you find most useful...

> Because you seem to associate a color object with each point. For YUV, the
> number of points for U and V and smaller than for Y. So, if I have
> color_yuv c = ...;
> c.u();
> what happens if the given point of image has no 'u' component?

    I must still find solution to problems like this. I think that an
exception would be OK alongside a function that tells whether u and v are
available. But this could be to much overhead for release version of a
program, so I would like to rovide a function that returns a value redgless
of actual color point state, but perhabs undefined when ther is no wanted
component or someting like this. Also it would be very useful to easy swich
beetwean those types of functions.
    So I'm still think here...

    Adam Badura

Boost list run by bdawes at, gregod at, cpdaniel at, john at