► |  | Images

1 | Icons
2 | Logos
3 | Embedding Bitmaps in Compiled Files
4 | Floating-Point Bitmaps

▼ | 4 | Floating-Point Bitmaps

4.1 | Overview
4.2 | Struct Type and Accessors
4.3 | Conversion and Construction
4.4 | Component Operations
4.5 | Pointwise Operations
4.6 | Gradients and Normals
4.7 | Blur
4.8 | Resizing
4.9 | Compositing
4.10 | Spatial Transformations
4.11 | Effects

On this page:

flomap-shadow
flomap-outline

top← prev up next →

#### 4.11`` Effects

> > procedure

> > (flomap-shadow fm σ [color]) → flomap

> fm : flomap
> σ : Real
> color : (Option (U (Vectorof Real) FlVector)) = #f

Returns the alpha (zeroth) component of fm, blurred with standard deviation σ and colorized by color. Assumes fm and color are alpha-multiplied; see Opacity (Alpha Components).

If color = #f, it is interpreted as (flvector 1.0 0.0 ...), or opaque black.

Examples:

> > (flomap->bitmap
> (flomap-shadow (flomap-inset text-fm 12) 4 #(1/2 1/8 0 1/4)))

> > (flomap->bitmap
> (flomap-cc-superimpose
> (flomap-shadow (flomap-inset text-fm 12) 4 #(1/2 1/8 0 1/4))
> text-fm))

> > procedure

> > (flomap-outline fm radius [color]) → flomap

> fm : flomap
> radius : Real
> color : (Option (U (Vectorof Real) FlVector)) = #f

Returns a flomap that outlines fm with a radius-thick line when fm is superimposed over it. Assumes fm and color are alpha-multiplied; see Opacity (Alpha Components).

If color = #f, it is interpreted as (flvector 1.0 0.0 ...), or opaque black.

Examples:

> > (flomap->bitmap
> (flomap-outline (flomap-inset text-fm 2) 2 #(1 0 1 1)))

> > (flomap->bitmap
> (flomap-cc-superimpose
> (flomap-outline (flomap-inset text-fm 2) 2 #(1 0 1 1))
> text-fm))

The greatest alpha value in the returned outline is the greatest alpha value in fm. Because of this, flomap-outline does fine with flomaps with fully opaque regions that are made semi-transparent:

> > (define trans-text-fm (fm* 0.5 text-fm))

> > (flomap->bitmap trans-text-fm)

> > (flomap->bitmap
> (flomap-cc-superimpose
> (flomap-outline (flomap-inset trans-text-fm 2) 2 #(1 0 1 1))
> trans-text-fm))

However, it does not do so well with flomaps that are partly opaque and partly semi-transparent:

> > (define mixed-text-fm
> (flomap-vc-append text-fm (make-flomap 4 0 10) trans-text-fm))

> > (flomap->bitmap
> (flomap-cc-superimpose
> (flomap-outline (flomap-inset mixed-text-fm 2) 2 #(1 0 1 1))
> mixed-text-fm))

top← prev up next →