Home |
Class PegJpgConvert HMI (Human-Machine Interface) Classes |
Class PegJpgConvertPegJpgConvert is a PegImageConvert derived class for reading and de-compressing PPG input images. Before using PegJpgConvert, be sure to read the PegImageConvert base class documentation. PegJpgConvert reads JPG image files and produces PegBitmap structures. The structures produced are not deleted when the PegJpgConvert object is deleted, unless you first call the DestroyImages() function before deleting the PegJpgConvert object. Normal usage is to create the PegJpgConvert object, use it to read and decompress any number of JPG images, and to retrieve the PegBitmap structures from the conversion object using the GetBitmapList() function. Once you have retrieved the output produced, you can delete the conversion object without losing any data. After you are done using or displaying the PegBitmaps produced, you should free the memory associated with the run-time conversion by deleting the PegBitmap(s). You can delete PegBitmap by calling PegScreen::DestroyBitmap(). Note that run-time decompression of JPG images is CPU and memory intensive. Run-time decoding of random JPG images requires a target system with at least several hundred KBytes of dynamic memory. DEFAULT_MAX_JPEG_MEM (64k) defines the maximum amount of dynamic memory the JPG decoder may use. Virtual memory using disk files will be used if additional memory is required during the decode process. The amount of memory required is largely dependant on the type of JPG files being decoded and the file (image) size. For small (i.e. up to 200x200) images, 64k bytes of dynamic memory has proven to be sufficient. For larger or more complex images, larger dynamic memory regions will be required. It is interesting to note that since JPG is an analog encode/decode process, running out of memory results in a loss of image quality, it does not usually prevent the JPG decoder from producing an image. class PegJpgConvert : public PegImageConvert { public: PegJpgConvert(PEGUINT wId = 0); BOOL ReadImage(FILE * fd, PEGINT iCount = 1); }; ConstructorsThe constructor creates an image conversion object. Method ReadImageThis function reads the JPG image from the given file. The iCount parameter is ignored for JPG image files.
|