Documentation
¶
Overview ¶
Package loupe is the frozen frame the color picker and the region overlay paint behind everything, and the magnified pixel grid they show near the pointer over it: the color picker's card and the region overlay's magnifier.
Index ¶
- Constants
- func Draw(cv *render.Canvas, img *image.RGBA, centerX, centerY, x0, y0 int)
- func DrawFrame(cv *render.Canvas, frame render.StillImage, box render.Rect)
- func Pixel(img *image.RGBA, x, y int) color.RGBA
- func Place(box render.Rect, cx, cy float64, w, h int) (int, int)
- func SampleAt(img *image.RGBA, logicalW, logicalH int, lx, ly float64) (int, int)
Constants ¶
const ( // Zoom is the size of one magnified source pixel. Zoom = 11 // Radius is the grid's radius in source pixels: the grid is // 2*Radius+1 square. Radius = 8 // Size is the grid's edge in logical pixels. Size = (2*Radius + 1) * Zoom // Offset is how far a card sits from the cursor, on each axis. Offset = 24.0 )
Grid geometry of color_picker/mod.rs.
Variables ¶
This section is empty.
Functions ¶
func Draw ¶
Draw paints the grid of img's pixels around the frame pixel (centerX, centerY) with its top-left at (x0, y0), the centre pixel boxed.
func DrawFrame ¶ added in v0.2.0
DrawFrame paints the frozen frame over the logical box: one frame pixel per device pixel when the frame has the box's device size, the output's usual case, else scaled into it as it is drawn. The frame is drawn from its own pixels, never from a resampled copy, so the surface holds no raster beyond the capture.
Types ¶
This section is empty.