Google
  Web www.spinics.net

Re: [Gimp-user] Re: Script-Fu: what's a INT8ARRAY

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


[  date  ] 2001/08/28 | Tuesday | 10:29 AM
[ author ] Roland Roberts <roland@astrofoto.org> 

> Okay, I've figured out how to create an INT8ARRAY in script-fu, 

After a lot of digging around, I figured it out...

(cons-array n 'byte)    ; where n is a positive integer

> but
> surely I'm doing something silly because this seems too awkward.  

>     (set! foo "   ")
>     (aset foo 0 red)
>     (aset foo 1 green)
>     (aset foo 2 blue)
>     (gimp-drawable-set-pixel new-layer i j 3 
>                              (hexstr->bytes (array->hexstr foo)))
                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                               that's clever.

> Is there a better way?

(set! pixel (cons-array 3 'byte))
(aset pixel 0 red)
(aset pixel 1 green)
(aset pixel 2 blue)
(gimp-drawable-set-pixel new-layer i j 3 pixel)


Regards,
beppu


-- 
package wuv'apqvjgt;($_=join('',(*PgtnHcemgt))) # print map "beppu\@$_\n", qw(
=~ s/([HaP])(?!e)/ \U>$1/g;s/^.|:| (?=A)|>//g;y # cpan.org  lbox.org  binq.org
/c-z/a-u/;print"J$_\n";#$^%$^X@.^ <!-- japh --> # oss.lineo.com codepoet.org);


[Home]     [GIMP Development]     [Video For Linux]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Yosemite Book Store]     [gtk]     [KDE]     [Scanner]     [Gimp's Home]     [Gimp Docs]     [Gimp on Windows]     [Steve's Art]     [Webcams]     [Share Your Images]     [Free Online Dating]     [Script Fu]

Add to Google amazon