Skip to content

Commit ed30c5a

Browse files
committed
Add PImage methods: isLoaded, getWidth, getHeight, format field
1 parent 749a6d0 commit ed30c5a

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/Processing.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,10 @@ class PImage {
566566
// These mirror the Processing Java API; dirty flag is used by updatePixels()
567567
void loadPixels() {}
568568
void updatePixels() { dirty = true; }
569+
bool isLoaded() const { return width>0 && height>0; }
570+
int getWidth() const { return width; }
571+
int getHeight() const { return height; }
572+
int format = 1; // RGB=1, ARGB=2, ALPHA=4
569573

570574
// Upload CPU pixels to the GPU texture
571575
void uploadTexture(); // defined in Processing.cpp

0 commit comments

Comments
 (0)