So, you mean that I need to copy and paste OpenCV jpeg (c++ and .h) files into
FLTK jpeg folder.
Means I need to override all opencv jpeg files over fltk jpeg ? or I need to
change the path of jpeg folder in Additional Include Directories.. Am I right ?
By the way I solved in this way, It is working perfectly.
Oimg1 = cvLoadImage(Image1, 0);
if(Oimg1 == NULL) {return 0;}
unsigned char* imgdata1 = new unsigned
char[Oimg1->width*Oimg1->height*Oimg1->nChannels];
GetImageDataFromOpenCV(Oimg1, imgdata1);
Fl_RGB_Image *rgb_img0 = new Fl_RGB_Image((const uchar *) imgdata1,
Oimg1->width, Oimg1->height, Oimg1->nChannels);
FLTKimg[0] = (Fl_Shared_Image *)rgb_img0;
> On 30 Dec 2012, at 12:19, Furqan wrote:
>
> > Thanks.
> > I think its complicated to use one jpeg with all other libs.
>
> No, it is not, it is usually easier than using the built-in jpeg libs.
>
> Indeed, on most platforms other than Windows, the system already =
> provides a libjpeg and most (all?) other libs just use that rather than =
> trying to provide their own.
>
> With fltk it is pretty easy to tell it to use a system-provided libjpeg =
> when you build the fltk libs, and I'd *assume* that other libs are =
> similar.
>
>
> >=20
> > Please tell me how can I make data for Fl_Shared_Image.
> > what I need is something like this.
> >=20
> > 1) unsigned char* imgdata1 =3D new unsigned =
> char[Oimg1->width*Oimg1->height*3];
> >=20
> > 2) GetImageDataFromOpenCV(Oimg1, imgdata1);
> >=20
> > 3) Fl_Shared_Image *sImgs =3D (Fl_Shared_Image *)(imgdata1);
> >=20
> > No. 3) could be like sImgs.set(imgdata1)
> >=20
> > I read your suggested link but, there I couldn't find a way in order =
> to set array of image data into Fl_Shared_Image.
> >=20
> > How can I achieve this?
> > thanks.
>
> I don't know what you are doing in your code, but it doesn't sound, on =
> the face of it, as if Fl_Shared_Image is the correct widget for your use =
> here...
>
> You maybe want a Fl_RGB_Image, or maybe even a basic Fl_Image...?
>
> Or perhaps derive your own widget that has the desired behaviour? That's =
> at least partly shown in the example referred to.
>
> In any case, note that Fl_Shared_Image does "contain" an Fl_Image, so =
> you can derive your own widget from Fl_Shared_Image and then manipulate =
> the internal data() member of the Fl_Image to adjust the data.
>
> Though, as I said before, I suspect that Fl_RGB_Image may be more =
> helpful here.
>
>
>
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk