PixelLive SDK Frequently Asked Questions

  1. ImageLock::read seems very slow.

    Since some Image instance may do very heavy operations in it, ImageLock::read sometimes takes very long time. To make it faster, you can use ImageCache function to insert cache. The folloing sample illustrates how to use ImageCache:

    #include "pxl_imageutils.h"
    using namespace Celartem::ImageUtils;
    
    ...
    
    AutoPtr<Image> cached = ImageCache(verySlowImage);
    
    You can also set the cache's tile size and the cache amount by the parameter of ImageCache function.

    Anyway, it also may be slow even if you adopt ImageCache. If you are trying to display the image on the display quickly, you had better introduce Delayed Drawing.

  2. What does PixelLiveSystem::load / DocFactory::load do?

    They loads metadata and some of the image information and they don't load any actual image data. Since some applications may want to load only metadata but image data, we provide a way to do so. But Doc::createImage also does not load any image data. It only create an Image instance that manages the physical memory space for the image. The loading of the actual image data is done on demand; it is done on the time you calls ImageLock::read if no cached image is available.

  3. The image I've loaded is not in RGB (maybe in CMYK), how can I do?

    You can use ToSRGB for this purpose.

  4. How can I get resolution information of an image?

    Use MetadataUtils::getXResolution and MetadataUtils::getYResolution function.

  5. I cannot load Doc instance from a Storage instance twice.

    The cause is quite simple. PixelLiveSystem::load / DocFactory::load accesses to the Storage instance and they does not rewind the storage pointer. All you have to do is put Storage::setPos just before the second load.


This document is automatically generated using doxygen 1.5.4 at Fri Jun 27 18:22:54 2008.