New Image class and nonexistent


#1

I upgraded to the latest version and had to change some code related to the changes in Image.

All is fine except the “invalid Image” idiom which was solved by checking against a NULL pointer and now has no equivalent. Having a “nonexistent” or equivalent mechanism to create empty Images (like in File) would really help.

[code]struct Foo {
Image snapshot_;
};

Foo foo;

if (foo.snapshot_ == Image::nonexistent) {
// create snapshot
}[/code]


#2

It already does that - Image() creates a null image, and you’ve got Image::isNull() and image::isValid() to test it. I guess I could also add a static Image::null object to improve code clarity.


#3

Ok, nice.

I think the http://rawmaterialsoftware.com/juce/api/classImage.html API doc is not in sync then. I do not know if this API doc is meant to display edge or stable.

Gaspard


#4

Yes, the online docs will be out-of-date - they’re built from the last stable release.