[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] gzz ./TODO doc/Gzz_Memory.rst gzz/mem/MemoryCon...
From: |
Tuomas J. Lukka |
Subject: |
[Gzz-commits] gzz ./TODO doc/Gzz_Memory.rst gzz/mem/MemoryCon... |
Date: |
Wed, 08 Jan 2003 00:40:36 -0500 |
CVSROOT: /cvsroot/gzz
Module name: gzz
Changes by: Tuomas J. Lukka <address@hidden> 03/01/08 00:40:35
Modified files:
. : TODO
doc : Gzz_Memory.rst
gzz/mem : MemoryConsumer.java
Added files:
gzz/mem : MemoryPartitioner.java
Log message:
More mem architecture work
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/TODO.diff?tr1=1.491&tr2=1.492&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/doc/Gzz_Memory.rst.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/mem/MemoryPartitioner.java?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/mem/MemoryConsumer.java.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
Patches:
Index: gzz/TODO
diff -u gzz/TODO:1.491 gzz/TODO:1.492
--- gzz/TODO:1.491 Tue Jan 7 05:22:24 2003
+++ gzz/TODO Wed Jan 8 00:40:35 2003
@@ -257,6 +257,7 @@
- structure editing
+ adjustable zoom / distortion area by mouse
+ joystick?
+ - PEG move Obs to gzz.util, freeze some gzz.util classes
- better graphics for xupdf and pp
- fillets without the original object
- normal direction as data
Index: gzz/doc/Gzz_Memory.rst
diff -u gzz/doc/Gzz_Memory.rst:1.6 gzz/doc/Gzz_Memory.rst:1.7
--- gzz/doc/Gzz_Memory.rst:1.6 Tue Jan 7 07:27:04 2003
+++ gzz/doc/Gzz_Memory.rst Wed Jan 8 00:40:35 2003
@@ -22,7 +22,6 @@
float secToCreate
float usage
- simpler = assoc MemoryConsumer role(lowerqual) multi(*) - multi(1)
MemoryConsumer
class Texture
fields
@@ -48,7 +47,6 @@
horizontally(50, tex, FullTexture, MosaicTexture);
vertically(100, atex, Texture, tex);
vertically(100, foo, MosaicTexture, MosaicTile);
- simpler.p = MemoryConsumer.c{left} .. MemoryConsumer.c + (-150,150){1,1}
.. MemoryConsumer.c{down};
Especially the relationship between MemoryConsumer, MosaicTexture and
MosaicTile is difficult: Textures consume a particular amount of memory,
@@ -100,8 +98,8 @@
class MemoryConsumer "interface"
methods
boolean getScalable()
- int getMaxBytes()
- void setReservation(int bytes, Obs o)
+ int getMaxBytes(float quality)
+ void setReservation(int bytes, float quality, Obs o)
int getReservation()
class client
@@ -109,14 +107,11 @@
class CacheFacade
- class ImageLoader
-
dep "enqueue, hash" CacheFacade MemoryConsumer
- dep "load" ImageLoader MemoryConsumer
dep "create" client MemoryConsumer
---
- horizontally(50, foo, client, CacheFacade, ImageLoader);
+ horizontally(50, foo, client, CacheFacade);
vertically(100, bar, MemoryConsumer, foo);
The class ``MemoryConsumer`` abstracts a single memoryconsumer, where
@@ -131,8 +126,10 @@
another parameter, the importance, when getting the texture rectangle.
.. UML:: memorytexAPI
+
+ jlinkpackage gzz.mem
- class GLSpans "staticAPI"
+ class GLSpanner "staticAPI"
methods
TexRect get(PageSpan p, float importance, Obs o)
@@ -140,19 +137,40 @@
fields
SinglePageSpan sp
- assoc pagequal multi(1) - multi(0..1) TextureImageMemoryConsumer
+ assoc pagequal compos multi(1) - multi(0..1) TextureImageMemoryConsumer
+
+ dep "use" GLSpanner MemoryPartitioner
- class MemoryConsumer
class TextureImageMemoryConsumer
inherit MemoryConsumer
+ methods
+ TexRect getTexRect(Obs o)
+
+ bigpackage gzz.mem
+
+ class MemoryPartitioner
+ jlink
+ methods
+ void request(MemoryConsumer c, float importance, float quality, Obs
o)
+ assoc multi(*) - multi(1) MemoryConsumer
+
+
+ class MemoryConsumer "interface"
+ jlink
+ methods
+ int getMaxBytes(float quality)
+ void setReservation(int bytes, float quality, Obs o)
---
- vertically(60, aaa, MemoryConsumer, TextureImageMemoryConsumer);
+ vertically(60, aaa, MemoryPartitioner, MemoryConsumer,
TextureImageMemoryConsumer);
- pagequal.w = GLSpans.e;
+ pagequal.w = GLSpanner.e;
horizontally(60, bbb, pagequal, TextureImageMemoryConsumer);
+ gzz.mem.nw = MemoryPartitioner.nw + (-30, 30);
+ gzz.mem.se = MemoryConsumer.se + (30, -30);
+
Defining the importance function is not simple; this represents the
tradeoffs between memory use for the focus and context. The first,
@@ -165,7 +183,7 @@
The cases between the two extremes are the difficult ones.
-
-
+Need to be able to handle case of 1 focus-request + 100 low-quality non-focus
requests
+IN A SINGLE VOBSCENE.
Index: gzz/gzz/mem/MemoryConsumer.java
diff -u gzz/gzz/mem/MemoryConsumer.java:1.2 gzz/gzz/mem/MemoryConsumer.java:1.3
--- gzz/gzz/mem/MemoryConsumer.java:1.2 Tue Jan 7 07:27:04 2003
+++ gzz/gzz/mem/MemoryConsumer.java Wed Jan 8 00:40:35 2003
@@ -1,10 +1,21 @@
// (c) Tuomas J. Lukka
package gzz.mem;
+import gzz.Obs;
/** An object representing an entity which would like
* to consume a significant amount of memory (large image or such).
* Memoryconsumers <b>must</b> work as hash keys.
+ * <p>
+ * Quality is an important variable whose semantics are not defined in this
interface
+ * beyond that
+ * <ul>
+ * <li> It is a float
+ * <li> Larger quality = more bytes
+ * <li> May be interpolated: a quality between any two qualities that have been
+ * given to the MemoryPartitioner API may be given.
+ * </ul>
+ * an example of quality would be DPI (dots per inch) for images.
*/
public interface MemoryConsumer {
/** Whether this object can make use of byte amounts less
@@ -12,8 +23,9 @@
*/
boolean getScalable();
/** The maximum number of bytes this object would like to consume.
+ * @param quality The quality at which the maximum bytes are requested.
*/
- int getMaxBytes();
+ int getMaxBytes(float quality);
/** Set the amount of memory this object is allowed to consume.
* Once it's done, Obs will be called from an unspecified thread.
* If setReservation is called again before the Obs for a previous
@@ -21,9 +33,11 @@
* the previous Obs will be called at all. The size, when the later Obs
* is called, is the new one.
* @param bytes The maximum amount of bytes this object should reserve.
- * @param o Observer to call when size has been adjusted
+ * @param quality Maximum quality that should be loaded (if quality is
+ * adjusted in discrete steps, the class may round
upwards).
+ * @param o Observer to call (if non-null) when size has been adjusted
*/
- void setReservation(int bytes, Obs o);
+ void setReservation(int bytes, float quality, Obs o);
/** Get the number of bytes currently used.
*/
int getReservation();
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gzz-commits] gzz ./TODO doc/Gzz_Memory.rst gzz/mem/MemoryCon...,
Tuomas J. Lukka <=