multiple images changes
authorClaus Gittinger <cg@exept.de>
Tue, 24 Jun 1997 15:39:53 +0200
changeset 1773 e12d18fb2b4c
parent 1772 56b3ae478bbb
child 1774 4241f730e0a6
multiple images changes
ImageRdr.st
ImageReader.st
--- a/ImageRdr.st	Tue Jun 24 15:29:26 1997 +0200
+++ b/ImageRdr.st	Tue Jun 24 15:39:53 1997 +0200
@@ -1543,10 +1543,10 @@
 !
 
 hasMultipleImages
-    ^ self numberOfImages > 1
+    ^ imageSequence size > 1
 
     "Created: 4.4.1997 / 21:37:06 / cg"
-    "Modified: 21.6.1997 / 18:34:24 / cg"
+    "Modified: 24.6.1997 / 15:33:43 / cg"
 !
 
 height 
@@ -1563,8 +1563,8 @@
 
     |image depth|
 
-    self hasMultipleImages ifTrue:[
-        ^ self images first
+    imageSequence size > 0 ifTrue:[
+        ^ imageSequence first
     ].
 
     depth := self bitsPerPixel.
@@ -1581,25 +1581,30 @@
         mask:mask.
     ^ image
 
-    "Modified: 21.6.1997 / 18:32:27 / cg"
+    "Modified: 24.6.1997 / 15:32:48 / cg"
 !
 
 images
     "return a collection of all images as represented by myself.
      For compatibility with single-image formats, return a collection
-     containing my single image here.
-     This must be redefined in readers for formats which support multiple
-     images in a single file."
+     containing my single image here if the reader does not support
+     multiple images.
+     Readers for formats with multiple images should leave the images
+     in the imageSequence instVar as a side effect of reading."
 
     |img|
 
+    imageSequence notNil ifTrue:[
+        ^ imageSequence
+    ].
+
     img := self image.
     img isNil ifTrue:[
         ^ img
     ].
     ^ Array with:img
 
-    "Modified: 21.6.1997 / 18:35:52 / cg"
+    "Modified: 24.6.1997 / 15:35:40 / cg"
 !
 
 mask
@@ -1616,10 +1621,15 @@
      By default (here), I hold a single image;
      however, some fileFormats allow for multiple images"
 
+    |n|
+
+    (n := imageSequence size) > 0 ifTrue:[
+        ^ n
+    ].
     ^ 1
 
     "Created: 21.6.1997 / 18:33:45 / cg"
-    "Modified: 21.6.1997 / 18:35:19 / cg"
+    "Modified: 24.6.1997 / 15:33:26 / cg"
 !
 
 photometric
@@ -1835,5 +1845,5 @@
 !ImageReader class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/Attic/ImageRdr.st,v 1.49 1997-06-24 13:29:26 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/Attic/ImageRdr.st,v 1.50 1997-06-24 13:39:53 cg Exp $'
 ! !
--- a/ImageReader.st	Tue Jun 24 15:29:26 1997 +0200
+++ b/ImageReader.st	Tue Jun 24 15:39:53 1997 +0200
@@ -1543,10 +1543,10 @@
 !
 
 hasMultipleImages
-    ^ self numberOfImages > 1
+    ^ imageSequence size > 1
 
     "Created: 4.4.1997 / 21:37:06 / cg"
-    "Modified: 21.6.1997 / 18:34:24 / cg"
+    "Modified: 24.6.1997 / 15:33:43 / cg"
 !
 
 height 
@@ -1563,8 +1563,8 @@
 
     |image depth|
 
-    self hasMultipleImages ifTrue:[
-        ^ self images first
+    imageSequence size > 0 ifTrue:[
+        ^ imageSequence first
     ].
 
     depth := self bitsPerPixel.
@@ -1581,25 +1581,30 @@
         mask:mask.
     ^ image
 
-    "Modified: 21.6.1997 / 18:32:27 / cg"
+    "Modified: 24.6.1997 / 15:32:48 / cg"
 !
 
 images
     "return a collection of all images as represented by myself.
      For compatibility with single-image formats, return a collection
-     containing my single image here.
-     This must be redefined in readers for formats which support multiple
-     images in a single file."
+     containing my single image here if the reader does not support
+     multiple images.
+     Readers for formats with multiple images should leave the images
+     in the imageSequence instVar as a side effect of reading."
 
     |img|
 
+    imageSequence notNil ifTrue:[
+        ^ imageSequence
+    ].
+
     img := self image.
     img isNil ifTrue:[
         ^ img
     ].
     ^ Array with:img
 
-    "Modified: 21.6.1997 / 18:35:52 / cg"
+    "Modified: 24.6.1997 / 15:35:40 / cg"
 !
 
 mask
@@ -1616,10 +1621,15 @@
      By default (here), I hold a single image;
      however, some fileFormats allow for multiple images"
 
+    |n|
+
+    (n := imageSequence size) > 0 ifTrue:[
+        ^ n
+    ].
     ^ 1
 
     "Created: 21.6.1997 / 18:33:45 / cg"
-    "Modified: 21.6.1997 / 18:35:19 / cg"
+    "Modified: 24.6.1997 / 15:33:26 / cg"
 !
 
 photometric
@@ -1835,5 +1845,5 @@
 !ImageReader class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/ImageReader.st,v 1.49 1997-06-24 13:29:26 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/ImageReader.st,v 1.50 1997-06-24 13:39:53 cg Exp $'
 ! !