X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/12f5e1e78fe906050ff2fee9529476db332633f0..60ee01727442e8b364825cd965a3e06c21f07833:/interface/wx/image.h?ds=inline diff --git a/interface/wx/image.h b/interface/wx/image.h index 08911e6edf..9e7028b0cc 100644 --- a/interface/wx/image.h +++ b/interface/wx/image.h @@ -39,7 +39,7 @@ public: /** Destroys the wxImageHandler object. */ - ~wxImageHandler(); + virtual ~wxImageHandler(); /** Gets the file extension associated with this handler. @@ -58,7 +58,7 @@ public: @return Number of available images. For most image handlers, this is 1 (exceptions are TIFF and ICO formats). */ - int GetImageCount(wxInputStream& stream); + virtual int GetImageCount(wxInputStream& stream); /** Gets the MIME type associated with this handler. @@ -175,15 +175,16 @@ public: wxImage(); /** - Creates an image with the given size and clears it if requested. - Does not create an alpha channel. + Creates an image with the given size and clears it if requested. + + Does not create an alpha channel. @param width Specifies the width of the image. @param height Specifies the height of the image. - @clear - Clear the image with zeros. + @param clear + If @true, initialize the image to black. */ wxImage(int width, int height, bool clear = true); @@ -311,7 +312,7 @@ public: See @ref overview_refcountdestruct "reference-counted object destruction" for more info. */ - ~wxImage(); + virtual ~wxImage(); /** Register an image handler. @@ -325,7 +326,7 @@ public: @see BlurHorizontal(), BlurVertical() */ - wxImage Blur(int blurRadius); + wxImage Blur(int blurRadius) const; /** Blurs the image in the horizontal direction only. This should not be used @@ -333,7 +334,7 @@ public: @see Blur(), BlurVertical() */ - wxImage BlurHorizontal(int blurRadius); + wxImage BlurHorizontal(int blurRadius) const; /** Blurs the image in the vertical direction only. This should not be used @@ -341,12 +342,12 @@ public: @see Blur(), BlurHorizontal() */ - wxImage BlurVertical(int blurRadius); + wxImage BlurVertical(int blurRadius) const; /** Returns @true if the current image handlers can read this file */ - bool CanRead(const wxString& filename); + static bool CanRead(const wxString& filename); /** Deletes all image handlers. @@ -404,14 +405,17 @@ public: wxImage Copy() const; /** - Creates a fresh image. If @a clear is @true, the new image will be initialized - to black. + Creates a fresh image. + + If @a clear is @true, the new image will be initialized to black. Otherwise, the image data will be uninitialized. @param width The width of the image in pixels. @param height The height of the image in pixels. + @param clear + If @true, initialize the image data with zeros. @return @true if the call succeeded, @false otherwise. */ @@ -432,10 +436,9 @@ public: @return Returns @false if there is no unused colour left, @true on success. */ bool FindFirstUnusedColour(unsigned char* r, unsigned char* g, - unsigned char* b, - unsigned char startR = 1, + unsigned char* b, unsigned char startR = 1, unsigned char startG = 0, - unsigned char startB = 0); + unsigned char startB = 0) const; //@{ /** @@ -849,7 +852,7 @@ public: */ wxImage Rotate(double angle, const wxPoint& rotationCentre, bool interpolating = true, - wxPoint* offsetAfterRotation = NULL); + wxPoint* offsetAfterRotation = NULL) const; /** Returns a copy of the image rotated 90 degrees in the direction @@ -1023,6 +1026,25 @@ public: unsigned char green, unsigned char blue); + /** + Set the type of image returned by GetType(). + + This method is mostly used internally by the library but can also be + called from the user code if the image was created from data in the + given bitmap format without using LoadFile() (which would set the type + correctly automatically). + + Notice that the image must be created before this function is called. + + @since 2.9.0 + + @param type + One of bitmap type constants, @c wxBITMAP_TYPE_INVALID is a valid + value for it and can be used to reset the bitmap type to default + but @c wxBITMAP_TYPE_MAX is not allowed here. + */ + void SetType(wxBitmapType type); + /** Returns a resized version of this image without scaling it by adding either a border