Re: Loading a jpeg.
Mike Kobb <[email protected]>
| Newsgroups | gmane.comp.hardware.roku.technical |
|---|---|
| Message-ID | <BCEF96F2.18082%[email protected]> |
Anthony is correct: CascadeJpegFile is currently derived from class CascadeFile, which is for files on disk/server. Partly this is because camera-based JPEG files are pretty big, and loading the entire file into RAM at one time is not really desirable. But, there's no real reason we shouldn't support it for smaller stuff or things pulled from the Internet. We could instead make it use a stream, and allow file streams, memory streams, network streams, etc. --Mike > It may turn out easier to save the file to /tmp , which is a RAM disk, and > then use either photo ECP commands to display the picture, or use a command > line jpeg displayer (source attached). Then delete the ram disk file, once > complete. > > The attached example shows how to use the jpeg decoder. However, it uses > the video scaler, which may be more complicated than you want. If you don't > need to scale the images, you can also display jpegs into a regular window, > which is more straight forward. > > unfortuanly, as far as I know, I don't think you can use the JpegFile class > on an in memory structure, which it probably should do (take a Stream class > instead of a file name, for example). > > > ----- Original Message ----- > From: "Michael Artemiw" <[email protected]> > To: <[email protected]> > Sent: Wednesday, June 09, 2004 11:19 AM > Subject: [Roku-tech] Loading a jpeg. > > >> I am trying to load a jpeg from a file and am running into some problems. >> >> I have tried the following code >> >> CascadeFile cf("/mnt/smb/xpc/dwspictures/u19p.jpeg"); >> cout << cf.Open("r"); >> CascadeBitmap cb; >> cout << cb.CreateFromBitmapFile(cf); >> cout.flush(); >> >> This spits out 10 which seems to indicate there is no problem opening the > file >> but that it cannot load the jpeg. >> >> I tried making use of CascadeJpegFile but its header is not included with >> Cascade.h. When I add the appropriate include statement I get compile >> errors with jpeglib.h >> >> "typespecifier omitted for parameter", and >> "parse error before '*'" >> >> On lines 911 and 912. >> >> Are we not supposed to use CascadeJpegFile yet? Is there any way to find >> out what is going wrong in CreateFromBitmap? >> >> Thanks, >> Michael Artemiw >> DashWorks Studios >> www.dashworksstudios.com >> 416.259.7723 >> >> _______________________________________________ >> Roku-tech mailing list >> [email protected] >> http://lists.rokulabs.com/mailman/listinfo/roku-tech >> > > _______________________________________________ > Roku-tech mailing list > [email protected] > http://lists.rokulabs.com/mailman/listinfo/roku-tech > ------ Mike Kobb Senior Software Engineer, Roku Get more out of your high-def TV. High-definition photos, art, music and more. http://www.rokulabs.com tel: 650.321.1394 x12 fax: 650.321.9648