Rihards Balass / 4DGL-mbed-32PTU
Revision:
9:32eb75c01e9d
Parent:
8:b634ac9c92f8
Child:
10:b959bb206e6b
diff -r b634ac9c92f8 -r 32eb75c01e9d Picaso_4DGL-32PTU_graphics.cpp
--- a/Picaso_4DGL-32PTU_graphics.cpp	Mon Sep 12 12:12:09 2016 +0000
+++ b/Picaso_4DGL-32PTU_graphics.cpp	Mon Sep 12 12:48:47 2016 +0000
@@ -460,5 +460,60 @@
     getResponse(1);
 }
 
+//**************************************************************************
+// The Set Clip Window command specifies a clipping window region on the screen such
+// that any objects and text placed onto the screen will be clipped and displayed only
+// within that region. For the clipping window to take effect, the clipping setting must be
+// enabled separately using the “Clipping” command
+//**************************************************************************
+void PICASO_4DGL :: setClipWindow(short x1, short y1, short x2, short y2) {
+    
+    char command[10] = "";
+    
+    command[0] = (SET_CLIP_WINDOW >> (8*1)) & 0xff;
+    command[1] = (SET_CLIP_WINDOW >> (8*0)) & 0xff;
+    command[2] = (x1 >> (8*1)) & 0xff;
+    command[3] = (x1 >> (8*0)) & 0xff;
+    command[4] = (y1 >> (8*1)) & 0xff;
+    command[5] = (y1 >> (8*0)) & 0xff;
+    command[6] = (x2 >> (8*1)) & 0xff;
+    command[7] = (x2 >> (8*0)) & 0xff;
+    command[8] = (y2 >> (8*1)) & 0xff;
+    command[9] = (y2 >> (8*0)) & 0xff;
+    
+    writeCOMMAND(command, 10);
+    getResponse(1);
+}
 
+//**************************************************************************
+// The Clipping command Enables or Disables the ability for Clipping to be used. 
+// The clipping points are set with “Set Clip Window” and must be set first.
+//**************************************************************************
+void PICASO_4DGL :: clipping(short value) {
+    
+    char command[4] = "";
+    
+    command[0] = (CLIPPING >> (8*1)) & 0xff;
+    command[1] = (CLIPPING >> (8*0)) & 0xff;
+    command[2] = (value >> (8*1)) & 0xff;
+    command[3] = (value >> (8*0)) & 0xff;
+    
+    writeCOMMAND(command, 4);
+    getResponse(1);
+}
 
+//**************************************************************************
+// The Extend Clip Region command forces the clip region to the extent 
+// of the last text that was printed, or the last image that was shown.
+//**************************************************************************
+void PICASO_4DGL :: extendClipRegion() {
+    
+    char command[2] = "";
+    
+    command[0] = (EXTEND_CLIP >> (8*1)) & 0xff;
+    command[1] = (EXTEND_CLIP >> (8*0)) & 0xff;
+    
+    writeCOMMAND(command, 2);
+    getResponse(1);
+}
+