X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/85fcb94fc99880e8fdb127ea1fc6cb0aefa6986d..850e47aa3c20c22ff650e80e92e7795a66431863:/interface/wx/image.h diff --git a/interface/wx/image.h b/interface/wx/image.h index 80c8100f2c..4a9f0fd13f 100644 --- a/interface/wx/image.h +++ b/interface/wx/image.h @@ -83,6 +83,26 @@ public: */ virtual ~wxImageHandler(); + /** + Returns @true if this handler supports the image format contained in the + given stream. + + This function doesn't modify the current stream position (because it + restores the original position before returning; this however requires the + stream to be seekable; see wxStreamBase::IsSeekable). + */ + bool CanRead( wxInputStream& stream ); + + /** + Returns @true if this handler supports the image format contained in the + file with the given name. + + This function doesn't modify the current stream position (because it + restores the original position before returning; this however requires the + stream to be seekable; see wxStreamBase::IsSeekable). + */ + bool CanRead( const wxString& filename ); + /** Gets the preferred file extension associated with this handler. @@ -106,7 +126,9 @@ public: @param stream Opened input stream for reading image data. - Currently, the stream must support seeking. + This function doesn't modify the current stream position (because it + restores the original position before returning; this however requires the + stream to be seekable; see wxStreamBase::IsSeekable). @return Number of available images. For most image handlers, this is 1 (exceptions are TIFF and ICO formats as well as animated GIFs @@ -254,10 +276,10 @@ const unsigned char wxIMAGE_ALPHA_OPAQUE = 0xff; The constants ::wxIMAGE_ALPHA_TRANSPARENT and ::wxIMAGE_ALPHA_OPAQUE can be used to indicate those values in a more readable form. - Unlike RGB data, not all images have an alpha channel and before using - wxImage::GetAlpha you should check if this image contains an alpha channel - with wxImage::HasAlpha. Note that currently only the PNG format has full - alpha channel support so only the images loaded from PNG files can have + While all images have RGB data, not all images have an alpha channel. Before + using wxImage::GetAlpha you should check if this image contains an alpha + channel with wxImage::HasAlpha. Note that currently only the PNG format has + full alpha channel support so only the images loaded from PNG files can have alpha and, if you initialize the image alpha channel yourself using wxImage::SetAlpha, you should save it in PNG format to avoid losing it. @@ -1574,9 +1596,20 @@ public: /** - Returns @true if the current image handlers can read this file + Returns @true if at least one of the available image handlers can read + the file with the given name. + + See wxImageHandler::CanRead for more info. */ static bool CanRead(const wxString& filename); + + /** + Returns @true if at least one of the available image handlers can read + the data in the given stream. + + See wxImageHandler::CanRead for more info. + */ + static bool CanRead(wxInputStream& stream); //@{ /** @@ -1586,8 +1619,10 @@ public: For the overload taking the parameter @a filename, that's the name of the file to query. - For the overload taking the parameter @a stream, that's the ppened input - stream with image data. Currently, the stream must support seeking. + For the overload taking the parameter @a stream, that's the opened input + stream with image data. + + See wxImageHandler::GetImageCount() for more info. The parameter @a type may be one of the following values: @li wxBITMAP_TYPE_BMP: Load a Windows bitmap file.