summaryrefslogtreecommitdiffstats
path: root/ds9/parsers/plotparser.tac
diff options
context:
space:
mode:
Diffstat (limited to 'ds9/parsers/plotparser.tac')
-rw-r--r--ds9/parsers/plotparser.tac30
1 files changed, 30 insertions, 0 deletions
diff --git a/ds9/parsers/plotparser.tac b/ds9/parsers/plotparser.tac
index 8d951ba..cbbfdbf 100644
--- a/ds9/parsers/plotparser.tac
+++ b/ds9/parsers/plotparser.tac
@@ -40,6 +40,7 @@
%token DUPLICATE_
%token ERROR_
%token ERRORBAR_
+%token EXPORT_
%token FAMILY_
%token FILE_
%token FILENAME_
@@ -138,6 +139,15 @@
%token XAXIS_
%token YAXIS_
+%token GIF_
+%token TIFF_
+%token JPEG_
+%token PNG_
+
+%token NONE_
+%token PACKBITS_
+%token DEFLATE_
+
%%
#include yesno.trl
@@ -221,6 +231,7 @@ plotCmd : LOAD_ load
# xpa/samp only
| DATA_ dim {PlotCmdData $2}
| CLEAR_ {ProcessCmdCVAR0 PlotClearData}
+ | EXPORT_ export
| DUPLICATE_ duplicate
# backward compatibility
| DUP_ duplicate
@@ -269,6 +280,25 @@ plotCmd : LOAD_ load
| VIEW_ oldView
;
+export : STRING_ {PlotCmdExport [ExtToFormat $1] $1}
+ | STRING_ exportOps {PlotCmdExport [ExtToFormat $1] $1}
+ | exportExt STRING_ {PlotCmdExport $1 $2}
+ | exportExt STRING_ exportOps {PlotCmdExport $1 $2}
+ ;
+
+exportExt : GIF_ {set _ gif}
+ | TIFF_ {set _ tiff}
+ | JPEG_ {set _ jpeg}
+ | PNG_ {set _ png}
+ ;
+
+exportOps : NONE_ {ProcessCmdSet iap tiff,compress none}
+ | JPEG_ {ProcessCmdSet iap tiff,compress jpeg}
+ | PACKBITS_ {ProcessCmdSet iap tiff,compress packbits}
+ | DEFLATE_ {ProcessCmdSet iap tiff,compress deflate}
+ | numeric {ProcessCmdSet iap jpeg,quality $1}
+ ;
+
load : STRING_ {PlotCmdLoad $1 xy}
| STRING_ dim {PlotCmdLoad $1 $2}
;