Package net.sourceforge.jiu.geometry

Examples of net.sourceforge.jiu.geometry.Resample$CList


    {
      return in;
    }
    try
    {
      Resample res = new Resample();
      res.setFilter(Resample.FILTER_TYPE_LANCZOS3);
      res.setInputImage(in);
      float thumbRatio = 1.0f;
      float imageRatio = (float)in.getWidth() / (float)in.getHeight();
      int width = maxLength;
      int height = maxLength;
      if (thumbRatio < imageRatio)
      {
        height = (int)(maxLength / imageRatio);
      }
      else
      {
        width = (int)(maxLength * imageRatio);
      }
      //float x = (float)in.getWidth() / maxLength;
      //float y = (float)in.getHeight() / maxLength;
      res.setSize(width, height);
      res.process();
      return res.getOutputImage();
    }
    catch (OperationFailedException ofe)
    {
      return null;
    }
View Full Code Here

TOP

Related Classes of net.sourceforge.jiu.geometry.Resample$CList

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.