FLTK logo

Re: Change an image when already loaded as Fl_()_Image

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.general  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: Change an image when already loaded as Fl_()_Image matthiasm Mar 16, 2008  
 
Yes, you can alter an Fl_RGB_Image. Fl_RGB_Image::copy(w, h) for  
example copies an image and scales it to the desired size in one go.  
Fl_RGB_Image::desaturate() changes color values without copying the  
image. Everything you need is in the source code in src/Fl_Image.cxx .

Matthias

On 16.03.2008, at 23:31, Zoltan Phelps wrote:

> I searched the forum but didn't find any suitable thread.
> In my application i would like to show two images, one "original"  
> version and one "altered" version (e.g. after LUT conversion).
> My question is - how can i access the pixel data of an Fl_RGB_Image  
> directly? The source code reveals only the "const char * const  
> *data();" member function but as it is constant i'm not able to  
> change anything. Is there another suitable way? Or is it better to  
> just keep an unsigned char array with the pixel data, change it as  
> desired and redraw it with the fl_draw_image function without  
> creating any Fl_()_Image object? I'm a bit confused because with  
> different libraries i used to create an image object and to alter  
> its pixel data there had always been an access member function.
> Thanks in advance!
> ZP
> _______________________________________________
> fltk mailing list
> fltk-B9D8k9nSxTHQT0dZR+AlfA@public.gmane.org
> http://lists.easysw.com/mailman/listinfo/fltk

----
http://robowerk.com/
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.