aboutsummaryrefslogtreecommitdiff
path: root/externals/gridflow/format/jpeg.c
diff options
context:
space:
mode:
authorN.N. <matju@users.sourceforge.net>2006-03-15 04:55:34 +0000
committerN.N. <matju@users.sourceforge.net>2006-03-15 04:55:34 +0000
commita89a3c9fecd05a623aef900114cf936ba9ecd9e7 (patch)
treeca324f1fce798773c13c065e25eb491451fbace1 /externals/gridflow/format/jpeg.c
parentfcc7e06dd433c53507f40eff12d3187a9ac13456 (diff)
0.8.1
svn path=/trunk/; revision=4710
Diffstat (limited to 'externals/gridflow/format/jpeg.c')
-rw-r--r--externals/gridflow/format/jpeg.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/externals/gridflow/format/jpeg.c b/externals/gridflow/format/jpeg.c
index e59d8e06..4363be52 100644
--- a/externals/gridflow/format/jpeg.c
+++ b/externals/gridflow/format/jpeg.c
@@ -1,5 +1,5 @@
/*
- $Id: jpeg.c,v 1.1 2005-10-04 02:02:15 matju Exp $
+ $Id: jpeg.c,v 1.2 2006-03-15 04:37:46 matju Exp $
GridFlow
Copyright (c) 2001,2002,2003,2004 by Mathieu Bouchard
@@ -42,6 +42,7 @@ struct FormatJPEG : Format {
int fd;
FILE *f;
\decl Ruby frame ();
+ \decl void quality (short quality);
\decl void initialize (Symbol mode, Symbol source, String filename);
\grin 0 int
};
@@ -108,6 +109,13 @@ static bool gfeof(FILE *f) {
return Qnil;
}
+\def void quality (short quality) {
+ quality = min(max((int)quality,0),100);
+ // should the last arg ("baseline") be set to true ?
+ // and what is it for? is it for accuracy of the DC component?
+ jpeg_set_quality(&cjpeg,quality,false);
+}
+
\def void initialize (Symbol mode, Symbol source, String filename) {
rb_call_super(argc,argv);
if (source!=SYM(file)) RAISE("usage: jpeg file <filename>");
@@ -121,7 +129,7 @@ static bool gfeof(FILE *f) {
\classinfo {
IEVAL(rself,
- "install '#in:jpeg',1,1;@mode=6;"
+ "install '#io:jpeg',1,1;@mode=6;"
"include GridFlow::EventIO; suffixes_are'jpeg','jpg'");
}
\end class FormatJPEG