Skip to content

blur does not accommodate the current backing scale #52

Description

@lexi-lambda

Since blur draws into a bitmap, it should be backing scale-aware. This program demonstrates the problem:

#lang racket

(require racket/gui/base
         pict
         pict/shadow)

(define bmp (make-bitmap 10 10 #:backing-scale 50))
(define dc (new bitmap-dc% [bitmap bmp]))
(draw-pict (blur (circle 8) 1) dc 1 1)

(define bmp-bytes (make-bytes (* 500 500 4)))
(send bmp get-argb-pixels 0 0 500 500 bmp-bytes #:unscaled? #t)
(define bmp* (make-bitmap 500 500))
(send bmp* set-argb-pixels 0 0 500 500 bmp-bytes)
(show-pict (bitmap bmp*))

It produces the following image as output:

…while a blur implementation that accommodates the current backing scale should produce this image, instead:

This example is obviously intentionally exaggerated, but this issue does mean that when rendering to HiDPI displays, blur will produce bitmaps at less than screen quality.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions