Bug 24023 - java.awt.Image.getScaledInstance not implemented
Summary: java.awt.Image.getScaledInstance not implemented
Status: RESOLVED FIXED
Alias: None
Product: classpath
Classification: Unclassified
Component: awt (show other bugs)
Version: 0.18
: P2 normal
Target Milestone: 0.91
Assignee: Thomas Fitzsimmons
URL:
Keywords:
Depends on: 24701
Blocks:
  Show dependency treegraph
 
Reported: 2005-09-22 21:21 UTC by Wolfgang Baer
Modified: 2006-05-07 19:56 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-09-23 19:20:21


Attachments
Patch to make SCALE_SMOOTH the same as SCALE_AREA_AVERAGING. (377 bytes, patch)
2006-04-29 12:46 UTC, pere
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Wolfgang Baer 2005-09-22 21:21:10 UTC
Hi all,

java.awt.Image.getScaledInstance is not completely implemented. 

The following two scale flag cases are not implemented:
case SCALE_SMOOTH:
case SCALE_AREA_AVERAGING:
default:
  throw new Error("not implemented");

This is done quickly however the needed classes 
java/awt/image/ReplicateScaleFilter and
java/awt/image/AreaAveragingScaleFilter are only
stub classes.

This causes the startup error for JUMP. A simple 
workaround is to use the other scale flag types
until the classes are properly implemented:

switch (flags)
  {
    case SCALE_DEFAULT:
    case SCALE_FAST:
    case SCALE_REPLICATE:
    case SCALE_SMOOTH: 
       // FIXME Implement java/awt/image/ReplicateScaleFilter
    case SCALE_AREA_AVERAGING: 
      // FIXME Implement java/awt/image/AreaAveragingScaleFilter
      ImageProducer producer =
        new FilteredImageSource(this.getSource(),
            new ReplicateScaleFilter(width, height));
      return Toolkit.getDefaultToolkit().createImage(producer);     
    }

Wolfgang
Comment 1 pere 2006-04-29 10:30:50 UTC
ReplicateScaleFilter is now implemented, but AreaAveragingScaleFilter is still
a stub.  I suspect AreaAveragingScaleFilter should be used when the SCALE_SMOOTH
flag is used.  See also bug #24701 about the AreaAveragingScaleFilter stub.
Comment 2 pere 2006-04-29 12:46:23 UTC
Created attachment 11347 [details]
Patch to make SCALE_SMOOTH the same as SCALE_AREA_AVERAGING.

If SCALE_SMOOTH should be the same as SCALE_AREA_AVERAGING this patch
should be applied to implement it.
Comment 3 Sven de Marothy 2006-05-03 19:41:30 UTC
Fixed.