The CairoOperator class
(No version information available, might only be in Git)
Introduction
This is used to set the compositing operator for all cairo drawing operations.
The default operator is CairoOperator::OVER
The operators marked as unbounded modify their destination even outside of the mask layer (that is, their effect is not bound by the mask layer). However, their effect can still be limited by way of clipping.
To keep things simple, the operator descriptions here document the behavior for when both source and destination are either fully transparent or fully opaque. The actual implementation works for translucent layers too. For a more detailed explanation of the effects of each operator, including the mathematical definitions, see http://cairographics.org/operators/.
Class synopsis
Predefined Constants
CairoOperator::CLEAR
-
Clear destination layer (bounded)
CairoOperator::SOURCE
-
Replace destination layer (bounded)
CairoOperator::OVER
-
Draw source layer on top of destination layer (bounded)
CairoOperator::IN
-
Draw source where there was destination content (unbounded)
CairoOperator::OUT
-
Draw source where there was no destination content (unbounded)
CairoOperator::ATOP
-
Draw source on top of destination content and only there
CairoOperator::DEST
-
Ignore the source
CairoOperator::DEST_OVER
-
Draw destination on top of source
CairoOperator::DEST_IN
-
Leave destination only where there was source content (unbounded)
CairoOperator::DEST_OUT
-
Leave destination only where there was no source content
CairoOperator::DEST_ATOP
-
Leave destination on top of source content and only there (unbounded)
CairoOperator::XOR
-
Source and destination are shown where there is only one of them
CairoOperator::ADD
-
Source and destination layers are accumulated
CairoOperator::SATURATE
-
Like
CairoOperator::OVER
, but assuming source and dest are disjoint geometries
English translation
You have asked to visit this site in English. For now, only the interface is translated, but not all the content yet.If you want to help me in translations, your contribution is welcome. All you need to do is register on the site, and send me a message asking me to add you to the group of translators, which will give you the opportunity to translate the pages you want. A link at the bottom of each translated page indicates that you are the translator, and has a link to your profile.
Thank you in advance.
Document created the 30/01/2003, last modified the 26/10/2018
Source of the printed document:https://www.gaudry.be/en/php-rf-class.cairooperator.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.