[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ff-cvs] alph doc/pegboard/imagespan_getwholepage--tjl/p...
From: |
Tuomas J. Lukka |
Subject: |
[ff-cvs] alph doc/pegboard/imagespan_getwholepage--tjl/p... |
Date: |
Wed, 05 Nov 2003 05:25:51 -0500 |
CVSROOT: /cvsroot/alph
Module name: alph
Branch:
Changes by: Tuomas J. Lukka <address@hidden> 03/11/05 05:25:50
Modified files:
doc/pegboard/imagespan_getwholepage--tjl: peg.rst
org/nongnu/alph: ImageSpan.java PageScrollBlock.java
org/nongnu/alph/impl: PageImageScroll.java
SimpleImageScroll.java stormalph.test
Log message:
sync
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/alph/alph/doc/pegboard/imagespan_getwholepage--tjl/peg.rst.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/alph/alph/org/nongnu/alph/ImageSpan.java.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/alph/alph/org/nongnu/alph/PageScrollBlock.java.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/alph/alph/org/nongnu/alph/impl/PageImageScroll.java.diff?tr1=1.18&tr2=1.19&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/alph/alph/org/nongnu/alph/impl/SimpleImageScroll.java.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/alph/alph/org/nongnu/alph/impl/stormalph.test.diff?tr1=1.15&tr2=1.16&r1=text&r2=text
Patches:
Index: alph/doc/pegboard/imagespan_getwholepage--tjl/peg.rst
diff -u alph/doc/pegboard/imagespan_getwholepage--tjl/peg.rst:1.1
alph/doc/pegboard/imagespan_getwholepage--tjl/peg.rst:1.2
--- alph/doc/pegboard/imagespan_getwholepage--tjl/peg.rst:1.1 Mon Jun 23
08:37:11 2003
+++ alph/doc/pegboard/imagespan_getwholepage--tjl/peg.rst Wed Nov 5
05:25:48 2003
@@ -3,9 +3,9 @@
=============================================================
:Author: Tuomas J. Lukka
-:Last-Modified: $Date: 2003/06/23 12:37:11 $
-:Revision: $Revision: 1.1 $
-:Status: Current
+:Last-Modified: $Date: 2003/11/05 10:25:48 $
+:Revision: $Revision: 1.2 $
+:Status: Accepted
Now that there are two distinct types of image spans: plain
``ImageSpan``s and ``PageImageSpan``s, it is not easy to get the entire
Index: alph/org/nongnu/alph/ImageSpan.java
diff -u alph/org/nongnu/alph/ImageSpan.java:1.4
alph/org/nongnu/alph/ImageSpan.java:1.5
--- alph/org/nongnu/alph/ImageSpan.java:1.4 Tue Apr 22 07:37:29 2003
+++ alph/org/nongnu/alph/ImageSpan.java Wed Nov 5 05:25:49 2003
@@ -48,4 +48,14 @@
*/
ImageSpan subArea(int x0, int y0, int w, int h);
+ /** Get the whole contiguous 2D image that this span is a part of
+ * (opposite of subImage).
+ * For PageImageSpans, this would be the page the pageimagespan
+ * is taken from (but only the one page), for parts
+ * of png images it would be
+ * the whole image.
+ * @see PageImageSpan
+ */
+ ImageSpan getSuperImageSpan();
+
}
Index: alph/org/nongnu/alph/PageScrollBlock.java
diff -u alph/org/nongnu/alph/PageScrollBlock.java:1.3
alph/org/nongnu/alph/PageScrollBlock.java:1.4
--- alph/org/nongnu/alph/PageScrollBlock.java:1.3 Wed Jun 11 13:50:17 2003
+++ alph/org/nongnu/alph/PageScrollBlock.java Wed Nov 5 05:25:49 2003
@@ -27,15 +27,24 @@
package org.nongnu.alph;
/** A scrollblock storing pages, e.g.PDF or PS.
+ * PageScrollblocks are the only type of scrollblock
+ * that supports two different types
+ * of spans.
+ * There are PageSpans, which are zero or more full pages,
+ * and PageImageSpans which are rectangular regions inside a <em>single</em>
page.
+ * @see PageSpan
+ * @see PageImageSpan
*/
public interface PageScrollBlock extends ScrollBlock{
- /** Get a span that represents the given range inside this scrollblock.
+ /** Get a PageSpan that represents the given range inside this scrollblock.
* Equivalent to getCurrent().subSpan(offs1,offs2).
* @param offs1 The offset the span should start at.
* @param offs2 The one-past-end offset.
*/
- Span getSpan(int offs1, int offs2);
+ PageSpan getSpan(int offs1, int offs2);
+ /** Get a PageImageSpan for the given page.
+ */
PageImageSpan getPage(int page);
}
Index: alph/org/nongnu/alph/impl/PageImageScroll.java
diff -u alph/org/nongnu/alph/impl/PageImageScroll.java:1.18
alph/org/nongnu/alph/impl/PageImageScroll.java:1.19
--- alph/org/nongnu/alph/impl/PageImageScroll.java:1.18 Fri Oct 31 02:23:42 2003
+++ alph/org/nongnu/alph/impl/PageImageScroll.java Wed Nov 5 05:25:50 2003
@@ -63,6 +63,10 @@
PageInfo pageInfo;
+ /** Single-page spans.
+ */
+ PageImageSpanImpl[] pages;
+
public boolean equals(Object o) {
if(!(o instanceof ScrollBlock)) return false;
@@ -171,6 +175,8 @@
throw new Error("Can't do pageimagescroll except for ps/pdf. ("
+contentType+")");
getPageInfo();
+
+ pages = new PageImageSpanImpl[pageInfo.getNPages()];
}
/** The resolution of the coordinates on the original paper.
@@ -183,7 +189,7 @@
public Span getCurrent() {
return new StdPageSpan(this, 0, pageInfo.getNPages());
}
- public Span getSpan(int p0, int p1) {
+ public PageSpan getSpan(int p0, int p1) {
return new StdPageSpan(this, p0, p1);
}
@@ -223,13 +229,20 @@
page +") "+
x+", "+y+", "+w+", "+h+"]";
}
+
+ public ImageSpan getSuperImageSpan() {
+ return ((PageImageScroll)scrollBlock).getPage(this.page);
+ }
}
public PageImageSpan getPage(int p) {
- return new PageImageSpanImpl(this, p, 0, 0,
- (int)pageInfo.getWidth(p),
- (int)pageInfo.getHeight(p)
- );
+ if(pages[p] == null) {
+ pages[p] = new PageImageSpanImpl(this, p, 0, 0,
+ (int)pageInfo.getWidth(p),
+ (int)pageInfo.getHeight(p)
+ );
+ }
+ return pages[p];
}
Index: alph/org/nongnu/alph/impl/SimpleImageScroll.java
diff -u alph/org/nongnu/alph/impl/SimpleImageScroll.java:1.7
alph/org/nongnu/alph/impl/SimpleImageScroll.java:1.8
--- alph/org/nongnu/alph/impl/SimpleImageScroll.java:1.7 Fri Oct 31
02:23:42 2003
+++ alph/org/nongnu/alph/impl/SimpleImageScroll.java Wed Nov 5 05:25:50 2003
@@ -94,6 +94,10 @@
return new SimpleImageSpan(x, y, w, h);
}
+ public ImageSpan getSuperImageSpan() {
+ return (SimpleImageSpan)SimpleImageScroll.this.getCurrent();
+ }
+
}
public Span getCurrent() {
Index: alph/org/nongnu/alph/impl/stormalph.test
diff -u alph/org/nongnu/alph/impl/stormalph.test:1.15
alph/org/nongnu/alph/impl/stormalph.test:1.16
--- alph/org/nongnu/alph/impl/stormalph.test:1.15 Wed Jun 11 13:54:46 2003
+++ alph/org/nongnu/alph/impl/stormalph.test Wed Nov 5 05:25:50 2003
@@ -71,6 +71,12 @@
assert sp0.intersects(sp0)
assert sp1.intersects(sp1_1)
+ sp2 = sb.getCurrent().getPage(1).subArea(1,1,2,2)
+ assert not sp0.equals(sp2)
+ assert not sp1.equals(sp2)
+ assert not sp0.equals(sp2.getSuperImageSpan())
+ assert sp1.equals(sp2.getSuperImageSpan())
+
def testAddTwice():
pool = storm.impl.TransientPool(java.util.HashSet())
salph = alph.impl.StormAlph(pool)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [ff-cvs] alph doc/pegboard/imagespan_getwholepage--tjl/p...,
Tuomas J. Lukka <=