changeset 1478:ef98becd15b1

add methods to deal with image inputs that are not files (e.g. TextGrid TGCrud).
author robcast
date Fri, 05 Feb 2016 19:03:45 +0100
parents 5a3bd01c8ed1
children b084694ec618 019c1f38718e
files common/src/main/java/digilib/conf/DigilibConfiguration.java common/src/main/java/digilib/image/ImageJobDescription.java
diffstat 2 files changed, 33 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/common/src/main/java/digilib/conf/DigilibConfiguration.java	Tue Jan 19 15:40:12 2016 +0100
+++ b/common/src/main/java/digilib/conf/DigilibConfiguration.java	Fri Feb 05 19:03:45 2016 +0100
@@ -57,7 +57,7 @@
 
     /** digilib version */
     public static String getClassVersion() {
-        return "2.3.7a";
+        return "2.3.8a";
     }
 
     /* non-static getVersion for Java inheritance */
--- a/common/src/main/java/digilib/image/ImageJobDescription.java	Tue Jan 19 15:40:12 2016 +0100
+++ b/common/src/main/java/digilib/image/ImageJobDescription.java	Fri Feb 05 19:03:45 2016 +0100
@@ -183,6 +183,30 @@
     }
 
     /**
+     * Creates new ImageJobDescription by merging Parameters from a
+     * DigilibRequest and adding an ImageSEt.
+     * 
+     * @param dlReq
+     * @param imgs
+     * @param dlcfg
+     * @return
+     * @throws ImageOpException 
+     * @throws IOException 
+     */
+    public static ImageJobDescription getInstanceWithImgs(DigilibRequest dlReq, ImageSet imgs, DigilibConfiguration dlcfg) 
+            throws IOException, ImageOpException {
+        ImageJobDescription newMap = new ImageJobDescription(dlcfg);
+        // add all params to this map
+        newMap.params.putAll(dlReq.getParams());
+        newMap.initOptions();
+        newMap.setImageSet(imgs);
+        newMap.prepareScaleParams();
+        // add ImageJobDescription back into DigilibRequest
+        dlReq.setJobDescription(newMap);
+        return newMap;
+    }
+
+    /**
      * Creates new ImageJobDescription by merging Parameters from another
      * ParameterMap.
      * 
@@ -747,6 +771,14 @@
         return imgSize;
     }
 
+    /**
+     * Set the image size.
+     * 
+     * @param size
+     */
+    public void setImgSize(ImageSize size) {
+        this.imgSize = size;
+    }
       
     /**
      * Return the X scale factor.