How do you create a new image handler?
Posted: Thu Apr 07, 2005 3:34 am
I would like to manipulate ppm images, but wxwidgets currently does not support this image format. so i'd like to write my own image handler, which shouldn't be so hard for ppm images since its ppm is a pretty simple and straightforward image format.
However, I'm not sure how to go about this. I'm guessing I need to override the wxImageHandler::LoadFile(wxImage* image, wxInputStream& stream, bool verbose=true, int index=0) so that it can load a ppm image. I'm guessing the function would need to copy all the pixel values in the ppm image over into the wximage object - correct?
However, I'm not sure exactly how the image data is stored in a wximage - is just giving it an array of pixels sufficient?
I haven't been able to find any tutorials on this so any help would be nice.
However, I'm not sure how to go about this. I'm guessing I need to override the wxImageHandler::LoadFile(wxImage* image, wxInputStream& stream, bool verbose=true, int index=0) so that it can load a ppm image. I'm guessing the function would need to copy all the pixel values in the ppm image over into the wximage object - correct?
However, I'm not sure exactly how the image data is stored in a wximage - is just giving it an array of pixels sufficient?
I haven't been able to find any tutorials on this so any help would be nice.