Struct egli::ConfigFilterRef [] [src]

pub struct ConfigFilterRef {
    // some fields omitted
}

[EGL 1.0] Configuration filter builder.

Methods

impl ConfigFilterRef

fn from_native(handle: EGLDisplay) -> ConfigFilterRef

fn with_alpha_mask_size(self, min_size: u32) -> Self

Must be followed by a nonnegative integer that indicates the desired alpha mask buffer size, in bits. The smallest alpha mask buffers of at least the specified size are preferred. The default value is zero.

The alpha mask buffer is used only by OpenGL and OpenGL ES client APIs.

fn with_alpha_size(self, min_size: u32) -> Self

Must be followed by a nonnegative integer that indicates the desired size of the alpha component of the color buffer, in bits. If this value is zero, color buffers with the smallest alpha component size are preferred. Otherwise, color buffers with the largest alpha component of at least the specified size are preferred. The default value is zero.

fn with_bind_to_texture_rgb(self, value: Option<bool>) -> Self

Must be followed by None, Some(true), or Some(false). If Some(true) is specified, then only frame buffer configurations that support binding of color buffers to an OpenGL ES RGB texture will be considered. Currently only frame buffer configurations that support pbuffers allow this. The default value is None.

fn with_bind_to_texture_rgba(self, value: Option<bool>) -> Self

Must be followed by one of None, Some(true), or Some(false). If Some(true) is specified, then only frame buffer configurations that support binding of color buffers to an OpenGL ES RGBA texture will be considered. Currently only frame buffer configurations that support pbuffers allow this. The default value is None.

fn with_blue_size(self, min_size: u32) -> Self

Must be followed by a nonnegative integer that indicates the desired size of the blue component of the color buffer, in bits. If this value is zero, color buffers with the smallest blue component size are preferred. Otherwise, color buffers with the largest blue component of at least the specified size are preferred. The default value is zero.

fn with_buffer_size(self, min_size: u32) -> Self

Must be followed by a nonnegative integer that indicates the desired color buffer size, in bits. The smallest color buffers of at least the specified size are preferred. The default value is zero.

The color buffer size is the sum of EGL_RED_SIZE, EGL_GREEN_SIZE, EGL_BLUE_SIZE, and EGL_ALPHA_SIZE, and does not include any padding bits which may be present in the pixel format. It is usually preferable to specify desired sizes for these color components individually.

fn with_color_buffer_type(self, value: ColorBufferType) -> Self

Must be followed by one of EGL_RGB_BUFFER or EGL_LUMINANCE_BUFFER.

EGL_RGB_BUFFER indicates an RGB color buffer; in this case, attributes EGL_RED_SIZE, EGL_GREEN_SIZE and EGL_BLUE_SIZE must be non-zero, and EGL_LUMINANCE_SIZE must be zero.

EGL_LUMINANCE_BUFFER indicates a luminance color buffer. In this case EGL_RED_SIZE, EGL_GREEN_SIZE, EGL_BLUE_SIZE must be zero, and EGL_LUMINANCE_SIZE must be non-zero.

For both RGB and luminance color buffers, EGL_ALPHA_SIZE may be zero or non-zero.

fn with_config_caveat(self, value: Option<ConfigCaveat>) -> Self

Must be followed by None, ConfigCaveat::None, ConfigCaveat::Slow, or ConfigCaveat::NonConformant.

If None is specified, then configs are not matched for this attribute. The default value is None.

If ConfigCaveat::None is specified, then configs are matched for this attribute, but only configs with no caveats (neither Slow or NonConformant) will be considered.

If ConfigCaveat::Slow is specified, then only slow configs configurations will be considered. The meaning of "slow" is implementation-dependent, but typically indicates a non-hardware-accelerated (software) implementation.

If ConfigCaveat::NonConformant is specified, then only configs supporting non-conformant OpenGL ES contexts will be considered.

If the EGL version is 1.3 or later, caveat ConfigCaveat::NonConformant is obsolete, since the same information can be specified via the EGL_CONFORMANT attribute on a per-client-API basis, not just for OpenGL ES.

fn with_config_id(self, value: Option<i32>) -> Self

Must be followed by a valid integer ID that indicates the desired EGL frame buffer configuration. When a EGL_CONFIG_ID is specified, all other attributes are ignored. The default value is None.

The meaning of config IDs is implementation-dependent. They are used only to uniquely identify different frame buffer configurations.

fn with_conformant(self, value: Type) -> Self

Must be followed by a bitmask indicating which types of client API contexts created with respect to the frame buffer configuration config must pass the required conformance tests for that API. Mask bits include:

renderable::OPENGL

Config supports creating OpenGL contexts.

renderable::OPENGL_ES

Config supports creating OpenGL ES 1.0 and/or 1.1 contexts.

renderable::OPENGL_ES2

Config supports creating OpenGL ES 2.0 contexts.

renderable::OPENVG

Config supports creating OpenVG contexts.

For example, if the bitmask is set to OPENGL_ES, only frame buffer configurations that support creating conformant OpenGL ES contexts will match. The default value is zero.

Most EGLConfigs should be conformant for all supported client APIs, and it is rarely desirable to select a nonconformant config. Conformance requirements limit the number of non-conformant configs that an implementation can define.

fn with_depth_size(self, min_size: u32) -> Self

Must be followed by a nonnegative integer that indicates the desired depth buffer size, in bits. The smallest depth buffers of at least the specified size is preferred. If the desired size is zero, frame buffer configurations with no depth buffer are preferred. The default value is zero.

The depth buffer is used only by OpenGL and OpenGL ES client APIs.

fn with_green_size(self, min_size: u32) -> Self

Must be followed by a nonnegative integer that indicates the desired size of the green component of the color buffer, in bits. If this value is zero, color buffers with the smallest green component size are preferred. Otherwise, color buffers with the largest green component of at least the specified size are preferred. The default value is zero.

fn with_level(self, level: i32) -> Self

Must be followed by an integer buffer level specification. This specification is honored exactly. Buffer level zero corresponds to the default frame buffer of the display. Buffer level one is the first overlay frame buffer, level two the second overlay frame buffer, and so on. Negative buffer levels correspond to underlay frame buffers. The default value is zero.

Most imlementations do not support overlay or underlay planes (buffer levels other than zero).

fn with_luminance_size(self, level: u32) -> Self

Must be followed by a nonnegative integer that indicates the desired size of the luminance component of the color buffer, in bits. If this value is zero, color buffers with the smallest luminance component size are preferred. Otherwise, color buffers with the largest luminance component of at least the specified size are preferred. The default value is zero.

fn with_match_native_pixmap(self, handle: Option<i32>) -> Self

Must be followed by the handle of a valid native pixmap, cast to Some(i32), or None. If the value is not None, only configs which support creating pixmap surfaces with this pixmap using eglCreatePixmapSurface will match this attribute. If the value is None, then configs are not matched for this attribute. The default value is None.

EGL_MATCH_NATIVE_PIXMAP was introduced due to the difficulty of determining an EGLConfig compatibile with a native pixmap using only color component sizes.

fn with_native_renderable(self, value: Option<bool>) -> Self

Must be followed by EGL_DONT_CARE, EGL_TRUE, or EGL_FALSE. If EGL_TRUE is specified, then only frame buffer configurations that allow native rendering into the surface will be considered. The default value is EGL_DONT_CARE.

fn with_max_swap_interval(self, value: Option<i32>) -> Self

Must be followed by a integer that indicates the maximum value that can be passed to eglSwapInterval. The default value is None.

fn with_min_swap_interval(self, value: Option<i32>) -> Self

Must be followed by a integer that indicates the minimum value that can be passed to eglSwapInterval. The default value is None.

fn with_red_size(self, min_size: u32) -> Self

Must be followed by a nonnegative integer that indicates the desired size of the red component of the color buffer, in bits. If this value is zero, color buffers with the smallest red component size are preferred. Otherwise, color buffers with the largest red component of at least the specified size are preferred. The default value is zero.

fn with_sample_buffers(self, value: i32) -> Self

Must be followed by the minimum acceptable number of multisample buffers. Configurations with the smallest number of multisample buffers that meet or exceed this minimum number are preferred. Currently operation with more than one multisample buffer is undefined, so only values of zero or one will produce a match. The default value is zero.

fn with_samples(self, value: i32) -> Self

Must be followed by the minimum number of samples required in multisample buffers. Configurations with the smallest number of samples that meet or exceed the specified minimum number are preferred. Note that it is possible for color samples in the multisample buffer to have fewer bits than colors in the main color buffers. However, multisampled colors maintain at least as much color resolution in aggregate as the main color buffers.

fn with_stencil_size(self, value: u32) -> Self

Must be followed by a nonnegative integer that indicates the desired stencil buffer size, in bits. The smallest stencil buffers of at least the specified size are preferred. If the desired size is zero, frame buffer configurations with no stencil buffer are preferred. The default value is zero.

The stencil buffer is used only by OpenGL and OpenGL ES client APIs.

fn with_renderable_type(self, value: Type) -> Self

Must be followed by a bitmask indicating which types of client API contexts the frame buffer configuration must support creating with eglCreateContext). Mask bits are the same as for attribute EGL_CONFORMANT. The default value is EGL_OPENGL_ES_BIT.

fn with_surface_type(self, value: Type) -> Self

Must be followed by a bitmask indicating which EGL surface types and capabilities the frame buffer configuration must support. Mask bits include:

surface::MULTISAMPLE_RESOLVE_BOX

Config allows specifying box filtered multisample resolve behavior with eglSurfaceAttrib.

surface::PBUFFER

Config supports creating pixel buffer surfaces.

surface::PIXMAP

Config supports creating pixmap surfaces.

surface::SWAP_BEHAVIOR_PRESERVED

Config allows setting swap behavior for color buffers with eglSurfaceAttrib.

surface::VG_ALPHA_FORMAT_PRE

Config allows specifying OpenVG rendering with premultiplied alpha values at surface creation time (see eglCreatePbufferSurface, eglCreatePixmapSurface, and eglCreateWindowSurface).

surface::VG_COLORSPACE_LINEAR

Config allows specifying OpenVG rendering in a linear colorspace at surface creation time (see eglCreatePbufferSurface, eglCreatePixmapSurface, and eglCreateWindowSurface).

surface::WINDOW

Config supports creating window surfaces.

For example, if the bitmask is set to surface::WINDOW | surface::PIXMAP, only frame buffer configurations that support both windows and pixmaps will be considered. The default value is surface::WINDOW.

fn with_transparent_type(self, value: TransparentType) -> Self

Must be followed by one of TransparentType::None or TransparentType::TransparentRgb. If TransparentType::None is specified, then only opaque frame buffer configurations will be considered. If TransparentType::TransparentRgb is specified, then only transparent frame buffer configurations will be considered. The default value is TransparentType::None.

Most implementations support only opaque frame buffer configurations.

fn with_transparent_red_value(self, value: Option<u32>) -> Self

Must be followed by an integer value indicating the transparent red value. The value must be between zero and the maximum color buffer value for red. Only frame buffer configurations that use the specified transparent red value will be considered. The default value is None.

This attribute is ignored unless EGL_TRANSPARENT_TYPE is included in attrib_list and specified as TransparentType::TransparentRgb.

fn with_transparent_green_value(self, value: Option<u32>) -> Self

Must be followed by an integer value indicating the transparent green value. The value must be between zero and the maximum color buffer value for green. Only frame buffer configurations that use the specified transparent green value will be considered. The default value is None.

This attribute is ignored unless EGL_TRANSPARENT_TYPE is included in attrib_list and specified as TransparentType::TransparentRgb.

fn with_transparent_blue_value(self, value: Option<u32>) -> Self

Must be followed by an integer value indicating the transparent blue value. The value must be between zero and the maximum color buffer value for blue. Only frame buffer configurations that use the specified transparent blue value will be considered. The default value is None.

This attribute is ignored unless EGL_TRANSPARENT_TYPE is included in attrib_list and specified as TransparentType::TransparentRgb.

fn choose_configs(self) -> Result<Vec<FrameBufferConfigRef>>

Get filtered display configurations.

Internally, this calls eglChooseConfig twice: to get total filtered config count, and to fill the allocated memory with config handles.

These handles are then wrapped into a new Vec<FrameBufferConfigRef>.