[q-lang-cvs] q/modules/magick magick.c,1.25,1.26 magick.q,1.24,1.25
Brought to you by:
agraef
From: <ag...@us...> - 2003-12-30 12:00:26
|
Update of /cvsroot/q-lang/q/modules/magick In directory sc8-pr-cvs1:/tmp/cvs-serv18005 Modified Files: magick.c magick.q Log Message: added image_fuzz, set_image_fuzz functions Index: magick.c =================================================================== RCS file: /cvsroot/q-lang/q/modules/magick/magick.c,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** magick.c 30 Dec 2003 05:32:20 -0000 1.25 --- magick.c 30 Dec 2003 12:00:22 -0000 1.26 *************** *** 498,501 **** --- 498,543 ---- } + FUNCTION(magick,image_compression,argc,argv) + { + Image *img; + if (argc == 1 && isobj(argv[0], type(Image), (void**)&img)) + return mkuint(img->compression); + else + return __FAIL; + } + + FUNCTION(magick,set_image_compression,argc,argv) + { + Image *img; + unsigned long compression; + if (argc == 2 && isobj(argv[0], type(Image), (void**)&img) && + isuint(argv[1], &compression)) { + img->compression = compression; + return mkvoid; + } else + return __FAIL; + } + + FUNCTION(magick,image_fuzz,argc,argv) + { + Image *img; + if (argc == 1 && isobj(argv[0], type(Image), (void**)&img)) + return mkint(img->fuzz); + else + return __FAIL; + } + + FUNCTION(magick,set_image_fuzz,argc,argv) + { + Image *img; + long fuzz; + if (argc == 2 && isobj(argv[0], type(Image), (void**)&img) && + isint(argv[1], &fuzz)) { + img->fuzz = fuzz; + return mkvoid; + } else + return __FAIL; + } + FUNCTION(magick,image_page,argc,argv) { *************** *** 534,558 **** else return __FAIL; - return mkvoid; - } else - return __FAIL; - } - - FUNCTION(magick,image_compression,argc,argv) - { - Image *img; - if (argc == 1 && isobj(argv[0], type(Image), (void**)&img)) - return mkuint(img->compression); - else - return __FAIL; - } - - FUNCTION(magick,set_image_compression,argc,argv) - { - Image *img; - unsigned long compression; - if (argc == 2 && isobj(argv[0], type(Image), (void**)&img) && - isuint(argv[1], &compression)) { - img->compression = compression; return mkvoid; } else --- 576,579 ---- Index: magick.q =================================================================== RCS file: /cvsroot/q-lang/q/modules/magick/magick.q,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** magick.q 30 Dec 2003 05:43:48 -0000 1.24 --- magick.q 30 Dec 2003 12:00:22 -0000 1.25 *************** *** 195,205 **** /* Some secondary image properties can be retrieved and changed with the ! following operations. */ public extern image_background_color IMG, set_image_background_color IMG PIXEL; public extern image_border_color IMG, set_image_border_color IMG PIXEL; public extern image_matte_color IMG, set_image_matte_color IMG PIXEL; ! public extern image_page IMG, set_image_page IMG PAGE; public extern image_compression IMG, set_image_compression IMG COMPRESSION; /* The following operations let you retrieve and change attributes (string --- 195,231 ---- /* Some secondary image properties can be retrieved and changed with the ! following operations. The following properties are currently supported: ! ! - background_color, border_color, matte_color: The image background, border ! and matte colors, specified as RGBA pixel values. ! ! - compression: The image's compression method, used as the default method ! when writing the image. This can be any of the compression type values ! defined in the manifest constants section at the beginning of this ! module. ! ! - fuzz: This integer value is used to match pixels in various operations, ! such as the flood_fill functions. The default value is zero, meaning that ! colors only match if they are identical. You can set this value to a ! positive number to increase the range of colors which match a given pixel ! value. ! ! - page: The equivalent PostScript page size of the image, specified as a ! quadrupel (X,Y,W,H), where (X,Y) denotes the page offset and (W,H) its ! dimension. This information is used when saving the image in PostScript ! format (in which case the coordinates are interpreted in PostScript ! coordinate space). The (X,Y) coordinates are also used by various image ! manipulation routines which combine images, such as flatten and mosaic ! (in this case the coordinates are in pixels). When setting this value, ! you can either specify the entire quadrupel, or only the (X,Y) values; in ! the latter case only the offset values are changed. */ public extern image_background_color IMG, set_image_background_color IMG PIXEL; public extern image_border_color IMG, set_image_border_color IMG PIXEL; public extern image_matte_color IMG, set_image_matte_color IMG PIXEL; ! public extern image_compression IMG, set_image_compression IMG COMPRESSION; + public extern image_fuzz IMG, set_image_fuzz IMG FUZZ; + public extern image_page IMG, set_image_page IMG PAGE; /* The following operations let you retrieve and change attributes (string |