< prev index next >

modules/javafx.graphics/src/main/java/com/sun/pisces/RendererBase.java

Print this page
rev 10044 : 8166230: use @Native annotation in graphics, media classes
Reviewed-by: kcr
   1 /*
   2  * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package com.sun.pisces;
  27 


  28 public final class RendererBase {
  29 
  30     /**
  31      * @defgroup CompositingRules Compositing rules supported by PISCES
  32      * When drawing two objects to one pixel area, there are several possibilities
  33      * how composite color is made of source and destination contributions.
  34      * Objects can overlap pixel fully and/or partialy. One object could be above
  35      * the second one and they both can be partialy or fully transparent (alpha).
  36      * The way, we count composite color and alpha from theirs contributions is
  37      * called compositing rule (Porter-Duff).
  38      * @def COMPOSITE_CLEAR
  39      * @ingroup CompositingRules
  40      * Compositing rule COMPOSITE_CLEAR. This rule applied to destination pixel sets
  41      * its color to 0x00000000 - transparent black - regardless to source color.
  42      * @see setCompositeRule(int), setComposite(int, float)
  43      * @def COMPOSITE_SRC
  44      * @ingroup CompositingRules
  45      * Compositing rule COMPOSITE_SRC. This rule applied to destination pixel sets
  46      * its color to source color - regardless to previous color of destination
  47      * pixel.
  48      * @see setCompositeRule(int), setComposite(int, float)
  49      * @def COMPOSITE_SRC_OVER
  50      * @ingroup CompositingRules
  51      * Compositing rule COMPOSITE_SRC_OVER. This rule is kind of intuitive. When we
  52      * look through transparent green glass bottle at some object, we can see
  53      * mixture of glass and objects colors. Composite color is alpha-weigth average
  54      * of source and destination.
  55      * @see setCompositeRule(int), PiscesRenderer.setComposite(int, float)
  56      */
  57     public static final int COMPOSITE_CLEAR    = 0;
  58     public static final int COMPOSITE_SRC      = 1;
  59     public static final int COMPOSITE_SRC_OVER = 2;
  60 
  61     /**
  62      * Constant indicating 8/8/8/8 ARGB alpha-premultiplied pixel data stored
  63      * in a <code>int</code> array.
  64      */
  65     public static final int TYPE_INT_ARGB_PRE = 1;
  66 
  67     public static final int IMAGE_MODE_NORMAL = 1;
  68     public static final int IMAGE_MODE_MULTIPLY = 2;
  69 
  70     public static final int IMAGE_FRAC_EDGE_KEEP = 0;
  71     public static final int IMAGE_FRAC_EDGE_PAD  = 1;
  72     public static final int IMAGE_FRAC_EDGE_TRIM = 2;
  73 }
   1 /*
   2  * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package com.sun.pisces;
  27 
  28 import java.lang.annotation.Native;
  29 
  30 public final class RendererBase {
  31 
  32     /**
  33      * @defgroup CompositingRules Compositing rules supported by PISCES
  34      * When drawing two objects to one pixel area, there are several possibilities
  35      * how composite color is made of source and destination contributions.
  36      * Objects can overlap pixel fully and/or partialy. One object could be above
  37      * the second one and they both can be partialy or fully transparent (alpha).
  38      * The way, we count composite color and alpha from theirs contributions is
  39      * called compositing rule (Porter-Duff).
  40      * @def COMPOSITE_CLEAR
  41      * @ingroup CompositingRules
  42      * Compositing rule COMPOSITE_CLEAR. This rule applied to destination pixel sets
  43      * its color to 0x00000000 - transparent black - regardless to source color.
  44      * @see setCompositeRule(int), setComposite(int, float)
  45      * @def COMPOSITE_SRC
  46      * @ingroup CompositingRules
  47      * Compositing rule COMPOSITE_SRC. This rule applied to destination pixel sets
  48      * its color to source color - regardless to previous color of destination
  49      * pixel.
  50      * @see setCompositeRule(int), setComposite(int, float)
  51      * @def COMPOSITE_SRC_OVER
  52      * @ingroup CompositingRules
  53      * Compositing rule COMPOSITE_SRC_OVER. This rule is kind of intuitive. When we
  54      * look through transparent green glass bottle at some object, we can see
  55      * mixture of glass and objects colors. Composite color is alpha-weigth average
  56      * of source and destination.
  57      * @see setCompositeRule(int), PiscesRenderer.setComposite(int, float)
  58      */
  59     @Native public static final int COMPOSITE_CLEAR    = 0;
  60     @Native public static final int COMPOSITE_SRC      = 1;
  61     @Native public static final int COMPOSITE_SRC_OVER = 2;
  62 
  63     /**
  64      * Constant indicating 8/8/8/8 ARGB alpha-premultiplied pixel data stored
  65      * in a <code>int</code> array.
  66      */
  67     @Native public static final int TYPE_INT_ARGB_PRE = 1;
  68 
  69     @Native public static final int IMAGE_MODE_NORMAL = 1;
  70     @Native public static final int IMAGE_MODE_MULTIPLY = 2;
  71 
  72     @Native public static final int IMAGE_FRAC_EDGE_KEEP = 0;
  73     @Native public static final int IMAGE_FRAC_EDGE_PAD  = 1;
  74     @Native public static final int IMAGE_FRAC_EDGE_TRIM = 2;
  75 }
< prev index next >