1d1766043SAndrew Rist/************************************************************** 2cdf0e10cSrcweir * 3d1766043SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4d1766043SAndrew Rist * or more contributor license agreements. See the NOTICE file 5d1766043SAndrew Rist * distributed with this work for additional information 6d1766043SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7d1766043SAndrew Rist * to you under the Apache License, Version 2.0 (the 8d1766043SAndrew Rist * "License"); you may not use this file except in compliance 9d1766043SAndrew Rist * with the License. You may obtain a copy of the License at 10d1766043SAndrew Rist * 11d1766043SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12d1766043SAndrew Rist * 13d1766043SAndrew Rist * Unless required by applicable law or agreed to in writing, 14d1766043SAndrew Rist * software distributed under the License is distributed on an 15d1766043SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16d1766043SAndrew Rist * KIND, either express or implied. See the License for the 17d1766043SAndrew Rist * specific language governing permissions and limitations 18d1766043SAndrew Rist * under the License. 19d1766043SAndrew Rist * 20d1766043SAndrew Rist *************************************************************/ 21d1766043SAndrew Rist 22d1766043SAndrew Rist 23cdf0e10cSrcweir#ifndef __com_sun_star_rendering_CompositeOperation_idl__ 24cdf0e10cSrcweir#define __com_sun_star_rendering_CompositeOperation_idl__ 25cdf0e10cSrcweir 26cdf0e10cSrcweirmodule com { module sun { module star { module rendering { 27cdf0e10cSrcweir 28cdf0e10cSrcweir/** These constants determine how the primitive color is combined with 29cdf0e10cSrcweir the background.<p> 30cdf0e10cSrcweir 31cdf0e10cSrcweir When performing this calculations, it is assumed that all color 32cdf0e10cSrcweir values are premultiplied with the corresponding alpha values (if 33cdf0e10cSrcweir no alpha is specified, 1.0 is assumed). Then, the following 34cdf0e10cSrcweir general compositing operation is performed: 35cdf0e10cSrcweir <p> 36cdf0e10cSrcweir C = Ca * Fa + Cb * Fb 37cdf0e10cSrcweir <p> 38cdf0e10cSrcweir where C is the result color, Ca and Cb are the input colors, 39cdf0e10cSrcweir premultiplied with alpha, and Fa and Fb are described for the 40cdf0e10cSrcweir different composite modes (wherein Aa and Ab denote source and 41cdf0e10cSrcweir destination alpha, respectively).<p> 42cdf0e10cSrcweir 43*d695a2a0SJürgen Schmidt @since OpenOffice 2.0 44cdf0e10cSrcweir */ 45cdf0e10cSrcweirconstants CompositeOperation 46cdf0e10cSrcweir{ 47cdf0e10cSrcweir /** Clear the destination.<p> 48cdf0e10cSrcweir 49cdf0e10cSrcweir Clear the destination area. The function values are: Fa = Fb = 50cdf0e10cSrcweir 0.<p> 51cdf0e10cSrcweir */ 52cdf0e10cSrcweir const byte CLEAR = 0; 53cdf0e10cSrcweir 54cdf0e10cSrcweir /** Copy source as-is to the destination.<p> 55cdf0e10cSrcweir 56cdf0e10cSrcweir Copy source as-is to the destination. The function values are: 57cdf0e10cSrcweir Fa = 1, Fb = 0.<p> 58cdf0e10cSrcweir */ 59cdf0e10cSrcweir const byte SOURCE = 1; 60cdf0e10cSrcweir 61cdf0e10cSrcweir /** Leave the destination as-is.<p> 62cdf0e10cSrcweir 63cdf0e10cSrcweir Leave the destination as-is. The function values are: Fa = 0, 64cdf0e10cSrcweir Fb = 1.<p> 65cdf0e10cSrcweir */ 66cdf0e10cSrcweir const byte DESTINATION = 2; 67cdf0e10cSrcweir 68cdf0e10cSrcweir /** Copy the source over the destination.<p> 69cdf0e10cSrcweir 70cdf0e10cSrcweir Copy the source over the destination. The function values are: 71cdf0e10cSrcweir Fa = 1, Fb = 1-Aa.<p> 72cdf0e10cSrcweir */ 73cdf0e10cSrcweir const byte OVER = 3; 74cdf0e10cSrcweir 75cdf0e10cSrcweir /** Copy the source under the destination.<p> 76cdf0e10cSrcweir 77cdf0e10cSrcweir Copy the source under the destination. The function values 78cdf0e10cSrcweir are: Fa = 1-Ab, Fb = 1.<p> 79cdf0e10cSrcweir */ 80cdf0e10cSrcweir const byte UNDER = 4; 81cdf0e10cSrcweir 82cdf0e10cSrcweir /** Copy the source to the destination.<p> 83cdf0e10cSrcweir 84cdf0e10cSrcweir Copy the source to the destination, but limited to where the 85cdf0e10cSrcweir destination is. The function values are: Fa = Ab, Fb = 0.<p> 86cdf0e10cSrcweir */ 87cdf0e10cSrcweir const byte INSIDE = 5; 88cdf0e10cSrcweir 89cdf0e10cSrcweir /** Leave the destination as is.<p> 90cdf0e10cSrcweir 91cdf0e10cSrcweir Leave the destination as is, but only where the source 92cdf0e10cSrcweir was. The function values are: Fa = 0, Fb = Aa.<p> 93cdf0e10cSrcweir */ 94cdf0e10cSrcweir const byte INSIDE_REVERSE = 6; 95cdf0e10cSrcweir 96cdf0e10cSrcweir /** Copy the source to the destination<p> 97cdf0e10cSrcweir 98cdf0e10cSrcweir Copy the source to the destination, but limited to where the 99cdf0e10cSrcweir destination is not. The function values are: Fa = 1-Ab, Fb = 100cdf0e10cSrcweir 0.<p> 101cdf0e10cSrcweir */ 102cdf0e10cSrcweir const byte OUTSIDE = 7; 103cdf0e10cSrcweir 104cdf0e10cSrcweir /** Leave the destination as is.<p> 105cdf0e10cSrcweir 106cdf0e10cSrcweir Leave the destination as is, but only where the source has not 107cdf0e10cSrcweir been. The function values are: Fa = 0, Fb = 1-Aa.<p> 108cdf0e10cSrcweir */ 109cdf0e10cSrcweir const byte OUTSIDE_REVERSE = 8; 110cdf0e10cSrcweir 111cdf0e10cSrcweir /** Copy the source over the destination<p> 112cdf0e10cSrcweir 113cdf0e10cSrcweir Copy the source over the destination, but only where the 114cdf0e10cSrcweir destination is. Keep the destination. The function values are: 115cdf0e10cSrcweir Fa = Ab, Fb = 1-Aa.<p> 116cdf0e10cSrcweir */ 117cdf0e10cSrcweir const byte ATOP = 9; 118cdf0e10cSrcweir 119cdf0e10cSrcweir /** Copy the destination over the source.<p> 120cdf0e10cSrcweir 121cdf0e10cSrcweir Copy the destination over the source, but only where the 122cdf0e10cSrcweir source is. Keep the source. The function values are: Fa = 123cdf0e10cSrcweir 1-Ab, Fb = Aa.<p> 124cdf0e10cSrcweir */ 125cdf0e10cSrcweir const byte ATOP_REVERSE = 10; 126cdf0e10cSrcweir 127cdf0e10cSrcweir /** Combine source and destination by exclusive or.<p> 128cdf0e10cSrcweir 129cdf0e10cSrcweir Take only the parts where either source or destination, but 130cdf0e10cSrcweir not both visible. The function values are: Fa = 1-Ab, Fb = 131cdf0e10cSrcweir 1-Aa.<p> 132cdf0e10cSrcweir */ 133cdf0e10cSrcweir const byte XOR = 11; 134cdf0e10cSrcweir 135cdf0e10cSrcweir /** Add source and destination values.<p> 136cdf0e10cSrcweir 137cdf0e10cSrcweir Simply add contributions of both source and destination. The 138cdf0e10cSrcweir resulting color values are limited to the permissible color 139cdf0e10cSrcweir range, and clipped to the maximal value, if exceeded. The 140cdf0e10cSrcweir function values are: Fa = 1, Fb = 1.<p> 141cdf0e10cSrcweir */ 142cdf0e10cSrcweir const byte ADD = 12; 143cdf0e10cSrcweir 144cdf0e10cSrcweir /** Saturate source and destination.<p> 145cdf0e10cSrcweir 146cdf0e10cSrcweir Saturate destination with source values. The function values 147cdf0e10cSrcweir are: Fa = min(1,(1-Ab)/Aa), Fb = 1<p> 148cdf0e10cSrcweir */ 149cdf0e10cSrcweir const byte SATURATE = 13; 150cdf0e10cSrcweir}; 151cdf0e10cSrcweir 152cdf0e10cSrcweir}; }; }; }; 153cdf0e10cSrcweir 154cdf0e10cSrcweir#endif 155