By accident I used GL_RGB to allocate an ofPixels and then spent a long time debugging why the width was 0 (assuming it was related to vectors and std::move), until I realized I should have used OF_IMAGE_COLOR instead.
// wrong
ofPixels p;
p.allocate(w, h, GL_RGB);
Functions like ofPixelFormatFromImageType and channelsFromPixelFormat give warnings when trying to use an unrecognized image type. Couldn’t this check also be done when using GL_RGB?
So if you pass a macro that resolves to an int, you will be using the first call. So in other words, the only way to prevent this is error is to remove the first API. Which I don’t think is good for anyone. Otherwise creating a new type channel, but that would make things overcomplicated and also would break everyone’s code. That’s all I know. Maybe somebody else can find a good solution?