► |  | 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

5.92
top ← prev up next →

### 4`` Floating-Point Bitmaps

Neil Toronto <neil.toronto@gmail.com>

(require images/flomap) | package: images-lib

The images/flomap module provides the struct type flomap, whose instances represent floating-point bitmaps with any number of color components. It also provides purely functional operations on flomaps for compositing, pointwise floating-point math, blur, gradient calculation, arbitrary spatial transforms (such as rotation), and conversion to and from bitmap% instances.

This is a Typed Racket module. Its exports can generally be used from untyped code with negligible performance loss over typed code. Exceptions are documented in bold text. Most exceptions are macros used to inline floating-point operations.

The following flomap fm is used in various examples:

> > (define fm
> (draw-flomap
> (λ (fm-dc)
> (send fm-dc set-alpha 0)
> (send fm-dc set-background "black")
> (send fm-dc clear)
> (send fm-dc set-alpha 1/3)
> (send fm-dc translate 2 2)
> (send fm-dc set-pen "black" 4 'long-dash)
> (send fm-dc set-brush "red" 'solid)
> (send fm-dc draw-ellipse 0 0 192 192)
> (send fm-dc set-brush "green" 'solid)
> (send fm-dc draw-ellipse 64 0 192 192)
> (send fm-dc set-brush "blue" 'solid)
> (send fm-dc draw-ellipse 32 44 192 192))
> 260 240))
> > (flomap->bitmap fm)

It is typical to use flomap->bitmap to visualize a flomap at the REPL.

Contents:

4.1 Overview
4.1.1 Motivation
4.1.2 Conceptual Model
4.1.3 Opacity (Alpha Components)
4.1.4 Data Layout
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.10.1 Provided Transformations
4.10.2 General Transformations
4.10.3 Lens Projection and Correction
4.11 Effects

top ← prev up next →