Re: [gtk-list] Re: [perl] example for create_from_data?



  Hello,

  you may try this code, which was sent to me by Dov Grobgeld :

=====================================================
sub pdlgrey_to_imlib_img {
    my $pdl = shift;
    my $grey_lut = shift || sequence(256)->transpose * pdl [1,1,1];
    my $rgb = $pdl->slice(":,-1:0")->interlrgb($grey_lut)->byte;
    $rgb->make_physical;
    return Gtk::Gdk::ImlibImage->create_image_from_data(${$rgb->get_dataref},
                                                        undef,
                                                        $pdl->dims);
}
=====================================================

  and his page : http://imagic.weizmann.ac.il/~dov/freesw/MakeRoi/
might interest you too.

  Hth,

  Etienne



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