Commit Graph

83 Commits

Author SHA1 Message Date
Michael Bayne d7e60e2749 Not to freak out if we can't recolor an image, just log a warning and
return the unrecolored version.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2288 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-02-22 01:48:21 +00:00
Michael Bayne e6796b2d55 The amazing revamp four hundred billion. Let's see:
- Reworked colorization repository such that we now have arbitrary named
  "colorization classes" which can be used by various and sundry entities
  to colorize themselves.

- Added support for individual object colorizations as well as "spots"
  that go along with objects (will be used to automatically create portals
  into buildings and automatically position users properly when at a
  "station").

- Repackaged things in miso to more closely mimic what we do everywhere
  else (no more miso.scene, now we have miso.data and miso.client).

- Fixed up miso scene XML representation so that objects can more easily
  be expanded to have yet more stuff if we think of more stuff that they
  might aught to have in the future. Structured the miso scene model so
  that "uninteresting" objects (those that simply sit somewhere and don't
  do anything) take up a lot less memory than "interesting" objects (those
  that have action strings, "spots", colorizations and the works). I may
  want to roll colorizations into the "uninteresting" realm, but that
  remains to be seen.

- Made it possible for object tilesets to specify default render
  priorities for objects in that tileset. This will hopefully allow us to
  get by without any "custom" render priorities that are specified on
  scene objects, instead relying on the default priorities to resolve
  common conflicts.

There are surely other cleanups in there, but I think that was the major
thrust of it.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2228 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-31 23:10:46 +00:00
Michael Bayne 412c7701c3 Modified image tracing not to depend on band format but to have the image
convert whatever its internal format is into ARGB for our inspection. It's
arguably a smidge slower (though we eliminated the multiple method calls
per pixel to determine whether it is non-transparent), but will work with
any source and destination image format.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2220 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-24 22:54:08 +00:00
Michael Bayne 0a6dfcd703 Added createErrorImage(); modified createTracedImage() and
createImageMask() not to freak out if the source image is not RGBA, Java
automatically unpacks pixels appropriately for 8-bit colormapped images,
so there's no need to be so picky. In createTracedImage() we were
converting the image to a screen optimized image anyway and thus the
source image format had absolutely no bearing on what we did with the
image later.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2218 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-24 21:48:14 +00:00
Michael Bayne 4ff68a037e Log the number of bands when tracing fails.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2207 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-21 22:11:04 +00:00
Michael Bayne 6a8bee2821 Activate tracking on the image LRU cache; lower the cache size to 1 meg.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2196 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-20 19:38:37 +00:00
Michael Bayne 6f7ad6a09f Added support for obtaining the estimated memory usage of a Mirage.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2174 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-17 02:30:21 +00:00
Michael Bayne 34144c86de Configured our LRU image cache to flush images when we reach a certain
number of bytes used rather than a certain image count.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2173 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-17 02:29:32 +00:00
Michael Bayne 2640baf727 Made getEstimatedMemoryUsage() do more of the right thing.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2171 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-17 02:27:02 +00:00
Ray Greenwell 91c173b6e5 added commented out method that caused me trouble, but we may want it
or a varient someday.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2169 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-17 00:41:49 +00:00
Ray Greenwell 0e26fdcf18 BufferedImage has versions of getWidth() and getHeight() that don't
need an ImageObserver.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2166 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-16 21:38:11 +00:00
Michael Bayne c98f45e3a0 Let's get those nots in the right places.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2154 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-15 02:50:36 +00:00
Michael Bayne 0558830cff Had the beans above the frank.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2153 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-15 02:48:45 +00:00
Michael Bayne bd943707f3 Add debug toggles for running blank and disabling image preparation.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2152 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-15 02:45:37 +00:00
Michael Bayne 01a3630493 Use the adjustment directly rather than going through the prefs.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2150 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-15 02:36:18 +00:00
Michael Bayne 43bc29afd8 Static variables go above static constants.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2149 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-15 02:31:50 +00:00
Michael Bayne 60a60d49ec Use runtime adjustments for our image and tile cache size.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2145 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-15 00:47:09 +00:00
Michael Bayne 6c7b0b3836 Create our image through the image manager.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2141 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-14 04:18:25 +00:00
Michael Bayne f26cfb322d Temporary hack to make all images translucent since that works around
strange slow rendering problems we see when we allow mixed BITMASK and
TRANSLUCENT images to be rendered.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2140 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-14 04:05:56 +00:00
Michael Bayne 1512fdfa1f Begone ImageUtil.createImage(), all images are created through the image
manager.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2136 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-14 02:50:34 +00:00
Michael Bayne 3c58a1ac26 Use the appropriate transparency when creating our prepared image.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2135 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-14 00:59:55 +00:00
Michael Bayne ed847b964d Provide the appropriate transparency when requested.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2129 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-13 23:56:01 +00:00
Michael Bayne 98c2dd45db Deal with fucking stupid ass close() behavior from ImageInputStreamImpl.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2128 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-13 23:55:05 +00:00
Michael Bayne 100aa3ace3 Major media subsystem revamp:
- All images are loaded through the image manager
- Architected to allow the use of prepared or unprepared images (and
  volatile images when the day comes that they support alpha)
- Tunable caches for images and tiles
- Resource manager caches unpacked resources on the filesystem
- Various and sundry other cleanups


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2116 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-13 22:49:47 +00:00
Ray Greenwell 125a0c4fef updated to reflect new home of ImageIOLoader
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2102 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-08 05:17:35 +00:00
Ray Greenwell d595a2fab8 Added a version of composeMaskedImage() that takes a Shape object to use
as the mask.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2101 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-08 04:28:13 +00:00
Michael Bayne 1ce6951cb6 Repackaged a few things in media: sounds stuff went into media.sound and
image stuff went into media.image.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2100 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-08 04:09:03 +00:00
Michael Bayne 2807056a44 Close the InputStream instances we get from the resource manager after
we're done loading images from them.

Always load through a BufferedInputStream because that seems to fix the
bogosity with ImageIO.load() not working without a cache.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2098 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-07 07:55:24 +00:00
Walter Korman acaf39b070 Estimate memory usage in bytes rather than pixel area, assuming an int per
pixel for now.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2034 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-12-07 02:04:32 +00:00
Walter Korman ea545bcb66 Log the size of the cache along with its efficiency.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2033 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-12-07 01:10:25 +00:00
Walter Korman be34314e1a Report image cache performance in all relevant places.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2032 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-12-07 01:00:58 +00:00
Walter Korman 8c5d490b53 Use an LRUHashMap to cache images, and limit caching to 30 images.
Periodically log cache efficiency and estimated image size.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2031 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-12-07 00:58:00 +00:00
Michael Bayne 3bfca1d20a Not to complain if we can't load an image because we'll fall back to the
classpath. Removed getImageSource() as calling through to the resource
manager is simpler.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1972 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-20 03:06:06 +00:00
Michael Bayne 128547b41b Use the resource managers bundle searching lookup instead of doing things
by hand.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1966 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-20 02:15:05 +00:00
Walter Korman 275d35ce07 Added traceImage(), which will doubtless be further optimized, and it
would sure be nice to have a variant that traces the supplied image rather
than always creating a new one, and more flexibility with respect to the
alpha gradient steps might be nice, but all of that sort of thing will
just have to come later.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1950 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-15 09:29:40 +00:00
Michael Bayne 5879dee050 Steempy you eeediot! It's t not iae!
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1943 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-13 06:42:54 +00:00
Michael Bayne 401f609224 Catch any argument when loading an image and report useful things.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1942 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-13 04:24:51 +00:00
Walter Korman beca9850aa Return null in getImageSource() if the specified bundle can't be found, as
was documented, so that callers can do things like fall back to trying the
classpath rather than having the previously-thrown IOException circumvent
the rest of their antics.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1826 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-10-25 00:44:16 +00:00
Michael Bayne 8662f12241 Further support for loading images from resource bundles.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1812 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-10-17 17:42:20 +00:00
Walter Korman 78b0d1eae9 Added loadImage() variant that allows specifying the resource set from
which the image is to be loaded.  Removed unused imports.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1807 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-10-16 15:57:12 +00:00
Michael Bayne 9acc27d3f3 Not to freak out if we can't load an image. Log an error and return a fake
image instead.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1753 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-09-25 07:15:16 +00:00
Michael Bayne d675e3f970 Preserve the transparency characteristics when creating an image optimized
for display on screen.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1744 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-09-23 23:30:23 +00:00
Ray Greenwell d22350ff3c Added a version of blend that takes a float argument so that
two colors may be blended at a ratio other than 50-50.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1593 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-07-18 23:14:02 +00:00
Walter Korman 6260633ec3 Added a variant of createImage() that takes an existing image to be
rendered into the optimized image.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1558 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-07-06 00:38:45 +00:00
Michael Bayne 15e23c1076 Only fetch our default GraphicsConfiguration if we're using it.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1510 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-06-20 17:54:26 +00:00
Michael Bayne f8c31a6432 More utility methods: one for creating a new image with the same
configuration as another and one for computing a rectangle that bounds all
non-transparent pixels in an image.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1483 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-06-19 08:24:22 +00:00
Michael Bayne e00610ecdb Ensure that we're loading our images through a BufferedInputStream.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1406 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-05-29 18:45:00 +00:00
Michael Bayne 2739abf915 Support compositing images that haven't already been expanded into
separate rasters.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1355 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-05-09 16:49:16 +00:00
Michael Bayne 8063347815 Modified image recoloring to use Colorization objects since they now live
in the same package. Also added support for applying a set of
recolorizations all at once so that previous recolorings aren't borked by
subsequent recolorings (plus it's more efficient).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1340 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-05-06 23:23:08 +00:00
Michael Bayne 99c4330646 The vast and the sweeping. Modified the tile framework such that tiles no
longer provide access to their underlying image (they actually still do,
but not in the normal course of affairs). This will allow us to use
"trimmed" tiles which are trimmed to the smallest rectangle that contains
the non-transparent pixels in a tile image, which will shrink up our
components and other tiles a great deal.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1339 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-05-06 18:08:32 +00:00