1 /**
2  * Copyright 2010 JogAmp Community. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without modification, are
5  * permitted provided that the following conditions are met:
6  *
7  *    1. Redistributions of source code must retain the above copyright notice, this list of
8  *       conditions and the following disclaimer.
9  *
10  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
11  *       of conditions and the following disclaimer in the documentation and/or other materials
12  *       provided with the distribution.
13  *
14  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
15  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
16  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
17  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
19  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
21  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
22  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23  *
24  * The views and conclusions contained in the software and documentation are those of the
25  * authors and should not be interpreted as representing official policies, either expressed
26  * or implied, of JogAmp Community.
27  */
28 
29 package com.jogamp.nativewindow;
30 
31 import com.jogamp.common.type.WriteCloneable;
32 
33 /**
34  * Specifies an immutable set of capabilities that a window's rendering context
35  * must support, such as color depth per channel.
36  *
37  * @see com.jogamp.nativewindow.Capabilities
38  */
39 public interface CapabilitiesImmutable extends VisualIDHolder, WriteCloneable, Comparable<CapabilitiesImmutable> {
40 
41     /**
42      * Returns the number of bits for the color buffer's red
43      * component. On some systems only the color depth, which is the sum of the
44      * red, green, and blue bits, is considered.
45      */
getRedBits()46     int getRedBits();
47 
48     /**
49      * Returns the number of bits for the color buffer's green
50      * component. On some systems only the color depth, which is the sum of the
51      * red, green, and blue bits, is considered.
52      */
getGreenBits()53     int getGreenBits();
54 
55     /**
56      * Returns the number of bits for the color buffer's blue
57      * component. On some systems only the color depth, which is the sum of the
58      * red, green, and blue bits, is considered.
59      */
getBlueBits()60     int getBlueBits();
61 
62     /**
63      * Returns the number of bits for the color buffer's alpha
64      * component. On some systems only the color depth, which is the sum of the
65      * red, green, and blue bits, is considered.
66      */
getAlphaBits()67     int getAlphaBits();
68 
69     /**
70      * Returns whether an opaque or translucent surface is requested, supported or chosen.
71      * <p>
72      * Default is true, i.e. opaque.
73      * </p>
74      */
isBackgroundOpaque()75     boolean isBackgroundOpaque();
76 
77     /**
78      * Returns whether an on- or offscreen surface is requested, available or chosen.
79      * <p>
80      * Default is true, i.e. onscreen.
81      * </p>
82      * <p>
83      * Mind that an capabilities intance w/ <i>available</i> semantics
84      * may show onscreen, but also the offscreen modes FBO, Pbuffer or {@link #setBitmap(boolean) bitmap}.
85      * This is valid, since one native configuration maybe used for either functionality.
86      * </p>
87      */
isOnscreen()88     boolean isOnscreen();
89 
90     /**
91      * Returns whether bitmap offscreen mode is requested, available or chosen.
92      * <p>
93      * Default is false.
94      * </p>
95      * <p>
96      * For chosen capabilities, only the selected offscreen surface is set to <code>true</code>.
97      * </p>
98      */
isBitmap()99     boolean isBitmap();
100 
101     /**
102      * Gets the transparent red value for the frame buffer configuration. This
103      * value is undefined if; equals true.
104      */
getTransparentRedValue()105     int getTransparentRedValue();
106 
107     /**
108      * Gets the transparent green value for the frame buffer configuration. This
109      * value is undefined if; equals true.
110      */
getTransparentGreenValue()111     int getTransparentGreenValue();
112 
113     /**
114      * Gets the transparent blue value for the frame buffer configuration. This
115      * value is undefined if; equals true.
116      */
getTransparentBlueValue()117     int getTransparentBlueValue();
118 
119     /**
120      * Gets the transparent alpha value for the frame buffer configuration. This
121      * value is undefined if; equals true.
122      */
getTransparentAlphaValue()123     int getTransparentAlphaValue();
124 
125     /** Equality over the immutable attributes of both objects */
126     @Override
equals(Object obj)127     boolean equals(Object obj);
128 
129     /** hash code over the immutable attributes of both objects */
130     @Override
hashCode()131     int hashCode();
132 
133     /** Return a textual representation of this object. Use the given StringBuilder [optional]. */
toString(StringBuilder sink)134     StringBuilder toString(StringBuilder sink);
135 
136     /** Returns a textual representation of this object. */
137     @Override
toString()138     String toString();
139 }
140