Package org.jwildfire.create.tina.palette

Examples of org.jwildfire.create.tina.palette.MedianCutQuantizer$Box


        return a;
    }

    private void goodBox(int latLo, int latHi, int lonLo, int lonHi)
    {
        new Box(latLo, latHi, lonLo, lonHi);
    }
View Full Code Here


        lonLo = fixLon(lonLo);
        lonHi = fixLon(lonHi);
        try {
            return
                lonLo <= lonHi
                ? new Box(latLo, latHi, lonLo, lonHi)
                : new BoxLatLonWithWraparound(latLo, latHi, lonLo, lonHi);
        } catch (IllegalArgumentException e) {
            throw new OutOfRangeException(String.format("latLo = %s, latHi = %s, lonLo = %s, lonHi = %s",
                                                        latLo, latHi, lonLo, lonHi));
        }
View Full Code Here

    // BoxLatLonWithWraparound interface

    public BoxLatLonWithWraparound(double latLo, double latHi, double lonLo, double lonHi)
    {
        left = new Box(latLo, latHi, Spatial.MIN_LON, lonHi);
        right = new Box(latLo, latHi, lonLo, Spatial.MAX_LON);
    }
View Full Code Here

                    break;
                default:
                    if (metadata != null) {
                        byte[] data = new byte[length];
                        in.readFully(data, 0, length);
                        metadata.addNode(new Box(length + 8,
                                                 box,
                                                 longLength,
                                                 data));
                    }
                }
View Full Code Here

     * */
    public void readIntPropertyBox(int length) throws IOException {
        if (metadata != null) {
            byte[] data = new byte[length];
            in.readFully(data, 0, length);
            metadata.addNode(new Box(length + 8, 0x6A703269, data));
        }
    }
View Full Code Here

    }

    private void writeBox(IIOMetadataNode node) throws IOException {
        int type = Box.getTypeInt((String)Box.getAttribute(node, "Type"));
        int length = new Integer((String)Box.getAttribute(node, "Length")).intValue();
        Box box = Box.createBox(type, node);
        otherLength += length;
        stream.writeInt(length);
        stream.writeInt(type);
        byte[] data = box.getContent();
        stream.write(data, 0, data.length);
    }
View Full Code Here

        byte[] imgData = Tools.readFile(file.getAbsolutePath());
        WFImage img = new ImageReader(new JLabel()).loadImage(file.getAbsolutePath());
        if (img.getImageWidth() >= minSize && img.getImageWidth() <= maxSize && img.getImageHeight() >= minSize && img.getImageHeight() <= maxSize) {
          int hashcode = RessourceManager.calcHashCode(imgData);
          SimpleImage wfImg = (SimpleImage) RessourceManager.getImage(hashcode, imgData);
          RGBPalette gradient = new MedianCutQuantizer().createPalette(wfImg);
          return new ImageData(null, file.getName(), imgData, gradient);
        }
      }
    }
    catch (Exception ex) {
View Full Code Here

    if (chooser.showOpenDialog(centerPanel) == JFileChooser.APPROVE_OPTION) {
      File file = chooser.getSelectedFile();
      try {
        SimpleImage img = new ImageReader(centerPanel).loadImage(file.getAbsolutePath());
        prefs.setLastInputImageFile(file);
        RGBPalette palette = new MedianCutQuantizer().createPalette(img);
        data.paletteKeyFrames = null;
        saveUndoPoint();
        getCurrLayer().setPalette(palette);
        setLastGradient(palette);
        refreshPaletteColorsTable();
View Full Code Here

        Tools.writeFile(f.getAbsolutePath(), imgData);
        WFImage img = new ImageReader(new JLabel()).loadImage(f.getAbsolutePath());
        if (img.getImageWidth() >= minSize && img.getImageWidth() <= maxSize && img.getImageHeight() >= minSize && img.getImageHeight() <= maxSize) {
          int hashcode = RessourceManager.calcHashCode(imgData);
          SimpleImage wfImg = (SimpleImage) RessourceManager.getImage(hashcode, imgData);
          RGBPalette gradient = new MedianCutQuantizer().createPalette(wfImg);
          return new ImageData(pageUrl, imgUrl, imgData, gradient);
        }
      }
    }
    catch (Exception ex) {
View Full Code Here

TOP

Related Classes of org.jwildfire.create.tina.palette.MedianCutQuantizer$Box

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.