Merge branch 'upstream' into subtree
[nikiroo-utils.git] / tterminal / DisplayLine.java
index 06a05a330ddccb50cc3ecf142cea0c4c87c38df9..87e6952fb515447b43500395d40cb8e80d0c919b 100644 (file)
@@ -248,4 +248,29 @@ public class DisplayLine {
         chars[chars.length - 1] = new Cell(newCell);
     }
 
+    /**
+     * Determine if line contains image data.
+     *
+     * @return true if the line has image data
+     */
+    public boolean isImage() {
+        for (int i = 0; i < chars.length; i++) {
+            if (chars[i].isImage()) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    /**
+     * Clear image data from line.
+     */
+    public void clearImages() {
+        for (int i = 0; i < chars.length; i++) {
+            if (chars[i].isImage()) {
+                chars[i].reset();
+            }
+        }
+    }
+
 }