Can you use Cairo blend modes?

I am looking at ofGraphics, and notice that it has support for some blendmodes:

OF_BLENDMODE_DISABLED
OF_BLENDMODE_ALPHA
OF_BLENDMODE_ADD
OF_BLENDMODE_SUBTRACT
OF_BLENDMODE_MULTIPLY
OF_BLENDMODE_SCREEN

Looking at the source code, it looks like under the hood, they are implemented via cairo:

void ofCairoRenderer::setBlendMode(ofBlendMode blendMode){
	switch (blendMode){
		case OF_BLENDMODE_ALPHA:{
			cairo_set_operator(cr,CAIRO_OPERATOR_OVER);
			break;
		}

		case OF_BLENDMODE_ADD:{
			cairo_set_operator(cr,CAIRO_OPERATOR_ADD);
			break;
		}
#if (CAIRO_VERSION_MAJOR==1 && CAIRO_VERSION_MINOR>=10) || CAIRO_VERSION_MAJOR>1
		case OF_BLENDMODE_MULTIPLY:{
			cairo_set_operator(cr,CAIRO_OPERATOR_MULTIPLY);
			break;
		}

		case OF_BLENDMODE_SCREEN:{
			cairo_set_operator(cr,CAIRO_OPERATOR_SCREEN);
			break;
		}

		case OF_BLENDMODE_SUBTRACT:{
			cairo_set_operator(cr, CAIRO_OPERATOR_SOFT_LIGHT);
			break;
		}
#endif

		default:
			break;
	}
}

However, not all Cairo blend modes are implemented. For example:

CAIRO_OPERATOR_SOFT_LIGHT

More info: enter link description here

So, my question is:

  1. Is there a way when using ofGraphics to have access to all of the cairo blend modes?
  2. If not, is there a reason why they were not all added? (Look at the code, it looks like it would be trivial to add).

mike

that class is the cairo renderer that is only used when rendering to PDF throuhg ofBegin/EndRenderToPDF() not when rendering to the screen using openGL

Thanks. It is unfortunate as it has much better blend mode support.

I did do some work last night to see if I could get them to work but didnt have any luck. Thanks for the answer.

I was trying the same and the following command worked, but I had to call once for each object drawing on screen. it seems to work only on the first object after the command.
cairo_set_operator(cairo->getCairoContext(),CAIRO_OPERATOR_MULTIPLY);

Using Cairo blend modes (ADD) I’ve noticed cairo renderer always begins with a grey rectangle RGB(60, 60, 60), so I can’t use a black background.
Saving to a file confirms there is always a grey rectangle under everything, even if I call

        ofGetCurrentRenderer()->background(ofColor(0,0));
        ofGetCurrentRenderer()->setBackgroundColor(ofColor(0,0));

Any ideas?