Package net.sf.jpluck.palm.bitmap

Examples of net.sf.jpluck.palm.bitmap.CompositeBitmap


        }
    }

    private void addCompositeImage(Resource resource, BufferedImage image, ImageSettings imageSettings,
                                   boolean alternate) {
        CompositeBitmap compositeBitmap = CompositeBitmap.create(image, imageSettings.getBitDepth());
        if (compositeBitmap.getRows() == 1) {
            ImageRecord imageRecord = resource.createImageRecord(compositeBitmap.getBitmapAt(0, 0), alternate);
            pluckerDocument.addRecord(imageRecord);
        } else {
            String[] segmentURIs = new String[compositeBitmap.getRows()];
            String uri = (resource.isRedirected() ? resource.getRedirectionURI() : resource.getURI());
            if (alternate) {
                uri += ".alternate";
            }
            for (int i = 0, n = compositeBitmap.getRows(); i < n; i++) {
                segmentURIs[i] = uri + "-" + (i + 1);
                pluckerDocument.addRecord(new ImageRecord(segmentURIs[i], compositeBitmap.getBitmapAt(i, 0)));
            }

            CompositeImageRecord imageRecord = resource.createCompositeImageRecord(segmentURIs, 1, alternate);
            pluckerDocument.addRecord(imageRecord);
        }
View Full Code Here


      TextRecordResult result = new TextRecordResult(textRecord, new URIRewriter(), 100, false, document);
      transformer.transform(new DOMSource(dom), result);
      document.addRecord(textRecord);
        } else if (mimeType.startsWith("image/")) {
      BufferedImage image = ImageIO.read(new ByteArrayInputStream(data));
      CompositeBitmap compositeBitmap = CompositeBitmap.create(image, bpp);
      String[] uris = new String[compositeBitmap.getRows()];
      for (int j = 0, n = compositeBitmap.getRows(); j < n; j++) {
        uris[j] = "http://127.0.0.1/-" + j;
        document.addRecord(new ImageRecord(uris[j], compositeBitmap.getBitmapAt(j, 0)));
      }
      document.addRecord(new CompositeImageRecord("http://127.0.0.1/", uris, 1));
        }

        if (name.length() > 31) {
View Full Code Here

      int width = image.getWidth();
      int height = image.getHeight();
      image = ImageConverter.rescale(image, ((maxWidth > 0) ? maxWidth : width),
                   ((maxHeight > 0) ? maxHeight : height));

      CompositeBitmap compositeBitmap = CompositeBitmap.create(image, bpp);
      String uri = file.toURI().toString();     
      home.addParagraph(2).addText(i + " ").addLinkStart(uri).addText(file.getName()).addLinkEnd();
     
      String[] uris = new String[compositeBitmap.getRows()];
      for (int j = 0, n = compositeBitmap.getRows(); j < n; j++) {
        uris[j] = uri + "-" + j;
        document.addRecord(new ImageRecord(uris[j], compositeBitmap.getBitmapAt(j, 0)));
      }
      document.addRecord(new CompositeImageRecord(uri, uris, 1));
      if (!noBookmarks) {
        document.addBookmark(file.getName(), uri);
      }
View Full Code Here

TOP

Related Classes of net.sf.jpluck.palm.bitmap.CompositeBitmap

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.