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
This commit is contained in:
Michael Bayne
2002-05-06 18:08:32 +00:00
parent 1c182d6e36
commit 99c4330646
24 changed files with 517 additions and 306 deletions
@@ -1,5 +1,5 @@
//
// $Id: ImageUtil.java,v 1.12 2002/05/04 21:36:32 ray Exp $
// $Id: ImageUtil.java,v 1.13 2002/05/06 18:08:32 mdb Exp $
package com.threerings.media.util;
@@ -169,6 +169,18 @@ public class ImageUtil
return new BufferedImage(nicm, image.getRaster(), false, null);
}
/**
* Recolors the supplied image as in {@link
* #recolorImage(BufferedImage,Color,float[],float[])} obtaining the
* recoloring parameters from the supplied {@link Colorization}
* instance.
*/
public static BufferedImage recolorImage (
BufferedImage image, Colorization cz)
{
return recolorImage(image, cz.rootColor, cz.range, cz.offsets);
}
/**
* Adjusts the supplied color by the specified offests, taking the
* appropriate measures for hue (wrapping it around) and saturation
@@ -245,11 +257,11 @@ public class ImageUtil
}
/**
* Create an image using the alpha channel from the first Image
* and the RGB values from the second.
* Create an image using the alpha channel from the first and the RGB
* values from the second.
*/
public static BufferedImage composeMaskedImage (BufferedImage mask,
BufferedImage base)
public static BufferedImage composeMaskedImage (
BufferedImage mask, BufferedImage base)
{
int wid = base.getWidth(null);
int hei = base.getHeight(null);
@@ -257,8 +269,8 @@ public class ImageUtil
Raster maskdata = mask.getData();
Raster basedata = base.getData();
WritableRaster target = basedata.createCompatibleWritableRaster(
wid, hei);
WritableRaster target =
basedata.createCompatibleWritableRaster(wid, hei);
// copy the alpha from the mask image
int[] adata = maskdata.getSamples(0, 0, wid, hei, 3, (int[]) null);