|
![](/i/fill.gif) |
Le 2012/04/20 03:02, Le_Forgeron a écrit :
> Le 20/04/2012 04:34, Alain a écrit :
>>>>
>>>> As of version 3.7 experimental support for reading the pixel resolution
>>>> of an image map was added. This is done by giving an image map pigment
>>>> identifier to max_extent(), which will then return the resolution of the
>>>> image map as the x and y values of the returned vector.
>>>>
>>>> Sample code:
>>>> #declare Image =
>>>> pigment {
>>>> image_map {
>>>> jpeg "YourImage.jpg"
>>>> once
>>>> }
>>>> };
>>>>
>>>> #declare Resolution = max_extent ( Image );
>>>>
>>>> It return Resolution =<horizontal_size, vertical_size, 0>;
>>>>
>>>>
>
>> max_extent() and min_extent() both return vectors. It's needed to define
>> the bouncing box of the object used as an argument.
>> In ordinary use, min_extent return the front or near, bottom left corner
>> of the bounding box and max_extent() return the back or far, top right
>> corner.
>
> Indeed, I found the overloading a bit too much. Can't it be keep clear
> and meaningful instead of a kludge on max_extend ?
> what about
>
> #declare Resolution = image_size ( Image );
>
> instead ?
> With neat specification about a 3D vector: width in pixel, height in
> pixel, depth in bits or bit per channel ?
> Maybe more than 3D vector ? 3rd one for the number of channels and 4th
> one for the depth in bit per channel ?
> What about alpha... 5D ?
>
> Note: I'm talking about the SDL itself, I find perturbing reusing
> max_extend in such context. I like dog called dog, and cat a cat.
>
>
> If we go down to image analysis in SDL, are we not sacrificing some
> concepts of Povray to make a clone of photoshop/gimp ?
>
As the documentation, that I copyed verbatim, state, it's still in the
experimental stage. Experimental features are inherently subject to changes.
Post a reply to this message
|
![](/i/fill.gif) |