Commit Graph

64 Commits

Author SHA1 Message Date
Neil Toronto
a713ca8a8b Added nan?, infinite?, degrees->radians, radians->degrees, exact-round, exact-floor, exact-ceiling, exact-truncate to racket/math
Altered TR's random arithmetic testing to generate single-flonums and very small flonums; fails now because of erroneous types

Fixes to sgn, sinh, cosh, and tanh:
 * preserve single-flonum-ness
 * correct zero sign (-0.0) for negative return values that are smaller than epsilon
 * correct behavior with NaN and infinite inputs
2012-06-05 22:40:44 -06:00
Matthew Flatt
68e005fb2c racket/draw: make-immutable-{color,brush,pen} => make-{color,brush,pen}
Also, use keywords for `make-pen' and `make-brush'.

Adding `make-pen' and `make-color' creates many conflicts among
teaching libraries, such as `2htdp/image'. These are easy to fix
up in the tree, but adding such obvious names to `racket/draw'
may create other compatibility problems, so we might have to reconsider
the names.

In consultation with Asumu.
2012-05-01 21:04:40 -06:00
Robby Findler
10d19bf8d5 adjust 2htdp/image library so that it doesn't create arbitrarily large
bitmaps when rendering images

closes PR 12277 (except I didn't fix the make-bitmap contract)

include in 5.2
2011-10-11 08:33:50 -05:00
Robby Findler
34581b7050 try using size-in-pixels for the font primitive in 2htdp/image
closes PR 11883

(the earlier commit with this message was just completely bogus)
2011-09-27 16:24:23 -05:00
Robby Findler
6c91288f2f speed up bitmap rotation (could probably revisit this to
speed up flipping (and also to do all three in one pass)
2011-08-23 18:56:51 -05:00
Robby Findler
b425ca90d2 fix bug in the loading of non-alpha bitmaps (also: minor Rackety) 2011-08-23 18:56:50 -05:00
Robby Findler
034e4f2364 add test cases for old file 2htdp/image file formats
(and fix corresponding bugs)
2011-08-23 07:12:11 -05:00
Robby Findler
1f02106318 2htdp/image
normalize the internal representation of bitmaps so it always uses an alpha
bitmap instead of sometimes using a mask bitmap and sometimes using alpha.
This also fixes a bug where the library would get consfused when it saved
a bitmap to a file, since it didn't record if it was an alpha bitmap or not.

This improves the save files that contain images, cutting the size for bitmaps
in half (bringing the drracket save file down to a mere 25x larger than the
png file format for the example I was using...)
2011-08-22 19:09:52 -05:00
Robby Findler
8ccf50b84b use the pre-multiplied alphas when comparing images for 2htdp/image 2011-08-22 19:09:50 -05:00
Robby Findler
56b82ba83c fix the png conversion code for 2htdp/image images
closes PR 12061
  please merge to the release branch
2011-07-22 08:09:17 -05:00
Eli Barzilay
3157955d40 ".ss" -> ".rkt" scan done. 2011-07-02 10:37:53 -04:00
Robby Findler
9e36dc8eb3 adding a missing 2htdp/image color => racket/gui color coercion
closes PR 11956
2011-06-02 16:27:09 -07:00
Robby Findler
7b4e673081 adjust drracket's value printer to specially treat 2htdp/image images.
related to PR 11849
2011-04-14 15:26:43 -05:00
David Van Horn
c9519fd113 Fixed various spelling errors. 2011-02-03 17:42:33 -05:00
Robby Findler
670d58d134 added un/cache-image, a function that enables/disables the drawing cache in 2htdp/image images 2011-01-06 14:24:01 -06:00
Robby Findler
dd9e8c530b fix the use of draw-caret in 2htdp/image 2011-01-03 20:54:07 -06:00
Matthew Flatt
cf344b9926 fix dimensions of cached image bitmap 2011-01-03 19:13:56 -07:00
Robby Findler
30f9c4338f make sure make-bitmap gets exacts as args 2011-01-03 19:56:37 -06:00
Robby Findler
ac52a63d4a cache drawing in 2htdp/image snip's draw method 2011-01-03 15:06:41 -06:00
Robby Findler
d886df2acc 2htdp/image: when selected, draw with some transparency so the selection is visible 2011-01-03 14:42:57 -06:00
Robby Findler
7716851cde 2htdp/image: added support for alpha as a mode? argument 2011-01-01 20:01:50 -06:00
Robby Findler
830c797ee4 use pen's alpha color stuff in 2htdp/image 2010-12-31 10:25:01 -06:00
Robby Findler
1d89cfc9d7 2htdp/image fix bitmap scaling to respect alpha channels 2010-12-28 19:08:11 -06:00
Robby Findler
54c337e5d3 2htdp/image: use erase instead of clear to zero out a bitmap 2010-12-27 21:51:16 -06:00
Robby Findler
835f7753dc generalize the color structs to have an alpha field and then use that in the bitmap conversion functions 2010-12-27 21:51:14 -06:00
Robby Findler
e896360dcf take advantage of new equal<%> and snip% setup to make image-snip%s equal to 2htdp/image images (when appropriate) 2010-12-24 06:34:43 -06:00
Sam Tobin-Hochstadt
fb76a887d8 Refactor to create `racket/snip' collection. 2010-12-17 12:32:26 -05:00
Sam Tobin-Hochstadt
8a8a8dbe4b Separate snip% from the gui 2010-12-17 12:32:26 -05:00
Sam Tobin-Hochstadt
13cae20838 Fixes for PNG conversion, and make `image-snip%' convertible. 2010-12-17 12:32:25 -05:00
Sam Tobin-Hochstadt
d92ce41a6f Make 2htdp/image produce png-convertible results. 2010-12-17 12:32:25 -05:00
Robby Findler
52092eeb80 remove sillyness 2010-12-17 10:02:35 -06:00
Robby Findler
8add8cfdf5 Revert "change 2htdp/image to try to improve the way drawing works when there is sharing the in the tree"
This reverts commit 9ce75b8f76.
2010-12-12 15:18:06 -06:00
Robby Findler
91aa9f756a finally, a fix that makes the 2htdp/image test suite pass! 2010-12-12 15:14:04 -06:00
Robby Findler
9ce75b8f76 change 2htdp/image to try to improve the way drawing works when there is sharing the in the tree 2010-12-12 15:14:04 -06:00
Robby Findler
bf62d4b6d6 get two more 2htdp/image test cases to pass 2010-11-25 09:03:06 -06:00
Robby Findler
a658a7620b a (failed) attempt to fix equality comparison (but at least it is a step in the right direction (I think)) 2010-11-25 06:55:00 -06:00
Matthew Flatt
1db27b474f fix merge mistake 2010-11-05 15:54:56 -06:00
Matthew Flatt
05cfffdf9e v5.4.99.1, executable-yield-handler', and make-bitmap' etc. 2010-11-05 15:54:50 -06:00
Robby Findler
ae5cd21a1b 2htdp/image: changed the way drawing works, specifically avoid normalization before drawing to preserve sharing 2010-11-04 13:55:41 -05:00
Robby Findler
4941aec617 removed unused argument to normalize-image 2010-11-04 13:55:40 -05:00
Robby Findler
6a414bd18a fixed some bugs in the way 2htdp/images were marshalled and unmarshalled 2010-10-28 17:20:43 -05:00
Robby Findler
7ef1e8bd90 fixed a bug in the way old 2htdp/image files were parsed (those that contain bitmaps) 2010-10-28 17:20:43 -05:00
Robby Findler
02d8b5cebf 2htdp/image: adjusted the image you get when parsing fails so that it draws inside its bounding box 2010-10-28 17:20:42 -05:00
Robby Findler
a744958fd5 added support to the 2htdp/image library for reading files when there is no GUI around.
currently the support is limited to images that can only report their sizes and pinholes and where equal?
signals an error unless the arguments are eq?.
2010-10-28 11:32:14 -05:00
Robby Findler
35f64145ca adjusted the way caching works for bitmaps to be more effective 2010-10-22 06:45:57 -05:00
Robby Findler
1d0ebeae62 added a check to avoid creating a new bitmap struct (so caching works better when you flip images that are not scaled) 2010-10-14 14:05:12 -05:00
Robby Findler
05d16d9311 closes PR 11293 2010-10-07 19:36:18 -05:00
Robby Findler
08b9396e2f closes PR 11236 2010-09-21 16:47:55 -05:00
Robby Findler
d2e443ac97 made equality check on images sensitive to pinholes 2010-09-06 20:39:11 -05:00
Robby Findler
e3b51e8cf4 made scaling work with pinholes 2010-09-06 20:39:11 -05:00