[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Picture
A picture (in png, jpg, ... format) for use in a Geometry
, to be converted to an expression. It will not be combined with the other shapes in Geometry
, and only the picture that is added last to the Geometry
will be used.
Constructor:
Picture(picturename, n_min=x, n_max=y)
: creates a picture object from filename picturename
to be used in a Geometry
.
The picture will be converted to grayscale, with white being mapped to a material with refractive index n_min
and black to n_max
. The indices for grayscales are obtained through linear interpolation.
When using the Geometry
function
to_expression(prop0, prop1, d_prop, verbose=True,rescaling='ANTIALIAS')
,
the following will happen. The values of prop0
and prop1
will set the conversion from pixel units to physical length units. The parameter d_prop
determines the resolution: when set to 0 (the default), no information is lost in the picture and every pixel is used as is. In case the thickness of the slice d_prop
is set to such a value that results in a coarser picture than the original one, the following down-sample mechanisms can be used:
NEAREST
: 'Nearest' algorithm from the PIL library. As this method takes
the nearest point, no new gray colours will be created.
ANTIALIAS
: 'Average' algorithm from the PIL library. This will create a
grayscale image.
INV_AVERAGE
: Similar to ANTIALIAS
, but use geometric averaging.
See section Geometry
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] |
This document was generated by root on August, 27 2008 using texi2html 1.76.