Vector Graphics Structs Assignment

From CSE425S Wiki
Revision as of 14:28, 21 March 2022 by Dennis.cosgrove (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

CodeToInvestigate

structs

(struct point (x y) #:transparent)
(struct rectangle (a b fill outline) #:transparent)
(struct circle (center radius fill outline) #:transparent)
(struct group (offset children) #:transparent)

Racket Image Library Utilities

(define (translate pt image)
  (image:overlay/xy image:empty-image (point-x pt) (point-y pt) image))

(define (to-image-circle radius outline-color fill-color)
  (image:overlay
   (image:circle radius "outline" outline-color)
   (image:circle radius "solid" fill-color)))

(define (to-image-rectangle width height outline-color fill-color)
  (image:overlay
   (image:rectangle width height "outline" outline-color)
   (image:rectangle width height "solid" fill-color)))

Vector Graphics

file: src/main/racket/vector_graphics/vector_graphics.rkt Racket-logo.svg
functions: rectangle-min-x
rectangle-min-y
rectangle-width
rectangle-height
to-image

rectangle-min-x

(define (rectangle-min-x rect)
       (error 'not-yet-implemented)) 

rectangle-min-y

(define (rectangle-min-y rect)
       (error 'not-yet-implemented)) 

rectangle-width

(define (rectangle-width rect)
       (error 'not-yet-implemented)) 

rectangle-height

(define (rectangle-height rect)
       (error 'not-yet-implemented)) 

to-image

(define (to-image graphic)
   (error 'not-yet-implemented))