@@ -164,6 +164,11 @@ class Image : public ::Image {
164164 */
165165 static ::Image Cellular (int width, int height, int tileSize) { return ::GenImageCellular (width, height, tileSize); }
166166
167+ /* *
168+ * Get clipboard image content.
169+ */
170+ static ::Image GetClipboard () { return ::GetClipboardImage (); }
171+
167172 ~Image () { Unload (); }
168173
169174 Image& operator =(const ::Image& image) {
@@ -208,7 +213,7 @@ class Image : public ::Image {
208213 */
209214 void Load (const std::string& fileName) {
210215 set (::LoadImage (fileName.c_str ()));
211- if (!IsReady ()) {
216+ if (!IsValid ()) {
212217 throw RaylibException (" Failed to load Image from file: " + fileName);
213218 }
214219 }
@@ -222,7 +227,7 @@ class Image : public ::Image {
222227 */
223228 void Load (const std::string& fileName, int width, int height, int format, int headerSize) {
224229 set (::LoadImageRaw (fileName.c_str (), width, height, format, headerSize));
225- if (!IsReady ()) {
230+ if (!IsValid ()) {
226231 throw RaylibException (" Failed to load Image from file: " + fileName);
227232 }
228233 }
@@ -236,7 +241,7 @@ class Image : public ::Image {
236241 */
237242 void Load (const std::string& fileName, int * frames) {
238243 set (::LoadImageAnim (fileName.c_str (), frames));
239- if (!IsReady ()) {
244+ if (!IsValid ()) {
240245 throw RaylibException (" Failed to load Image from file: " + fileName);
241246 }
242247 }
@@ -250,7 +255,7 @@ class Image : public ::Image {
250255 */
251256 void Load (const std::string& fileType, const unsigned char * fileData, int dataSize) {
252257 set (::LoadImageFromMemory (fileType.c_str (), fileData, dataSize));
253- if (!IsReady ()) {
258+ if (!IsValid ()) {
254259 throw RaylibException (" Failed to load Image data with file type: " + fileType);
255260 }
256261 }
@@ -264,7 +269,7 @@ class Image : public ::Image {
264269 */
265270 void Load (const ::Texture2D& texture) {
266271 set (::LoadImageFromTexture (texture));
267- if (!IsReady ()) {
272+ if (!IsValid ()) {
268273 throw RaylibException (" Failed to load Image from texture." );
269274 }
270275 }
@@ -605,6 +610,13 @@ class Image : public ::Image {
605610 ::ImageDrawLineV (this , start, end, color);
606611 }
607612
613+ /* *
614+ * Description: Draw a line defining thickness within an image
615+ */
616+ void DrawLine (::Vector2 start, ::Vector2 end, int thick, ::Color color = {255 , 255 , 255 , 255 }) {
617+ ImageDrawLineEx (this , start, end, thick, color);
618+ }
619+
608620 void DrawCircle (int centerX, int centerY, int radius, ::Color color = {255 , 255 , 255 , 255 }) {
609621 ::ImageDrawCircle (this , centerX, centerY, radius, color);
610622 }
@@ -629,6 +641,8 @@ class Image : public ::Image {
629641 ::ImageDrawRectangleLines (this , rec, thick, color);
630642 }
631643
644+ // TODO: Add ImageDrawTriangle()
645+
632646 void Draw (const ::Image& src, ::Rectangle srcRec, ::Rectangle dstRec, ::Color tint = {255 , 255 , 255 , 255 }) {
633647 ::ImageDraw (this , src, srcRec, dstRec, tint);
634648 }
@@ -728,7 +742,19 @@ class Image : public ::Image {
728742 *
729743 * @return True or false depending on whether the Image has been loaded.
730744 */
731- bool IsReady () const { return ::IsImageReady (*this ); }
745+ bool IsValid () const { return ::IsImageValid (*this ); }
746+
747+ /* *
748+ * Create an image from a selected channel of another image (GRAYSCALE)
749+ */
750+ ::Image Channel (int selectedChannel) { return ::ImageFromChannel (*this , selectedChannel); }
751+
752+ /* *
753+ * Apply custom square convolution kernel to image
754+ */
755+ void KernelConvolution (const float * kernel, int kernelSize) {
756+ ::ImageKernelConvolution (this , kernel, kernelSize);
757+ }
732758protected:
733759 void set (const ::Image& image) {
734760 data = image.data ;
0 commit comments