Type Definition libnotcurses_sys::NcChannel[][src]

pub type NcChannel = u32;
Expand description

32 bits of context-dependent info containing NcRgb + NcAlpha + extra (alias of u32).

It is:

  • a 24-bit NcRgb value
  • plus 8 bits divided in:
    • 2 bits of NcAlpha
    • 6 bits of context-dependent info

The context details are documented in NcChannels

Diagram

~~AA~~~~ RRRRRRRR GGGGGGGG BBBBBBBB

type in C: channel (uint32_t)

See also

Trait Implementations

If this bit is set, we are not using the default color.

Note: this is equivalent to NcChannels::BG_DEFAULT_MASK

Extract these bits to get the (background) NcAlpha mask.

Note: this is equivalent to NcChannels::BG_ALPHA_MASK

If this bit and DEFAULT_MASK are set, we’re using a palette-indexed background color

Note: this is equivalent to NcChannels::BG_PALETTE_MASK

Extract these bits to get the background NcRgb value.

Note: this is equivalent to NcChannels::BG_RGB_MASK

New NcChannel, set to black and NOT using the “default color”.

New NcChannel, set to black and using the “default color”.

New NcChannel, expects NcRgb.

New NcChannel, expects NcRgb & NcAlpha.

New NcChannel, expects three RGB NcComponent components.

New NcChannel, expects three RGB NcComponent components & NcAlpha.

Combines this NcChannel as foreground, with another as background into an NcChannels.

C style function: channels_combine().

Combines this NcChannel as background, with another as foreground into an NcChannels.

C style function: channels_combine().

Gets the NcAlpha.

C style function: ncchannel_alpha().

Sets the NcAlpha.

C style function: ncchannel_set_alpha().

Returns true if the channel is set to RGB color.

C style function: ncchannel_rgb_p().

Gets the NcRgb.

C style function: ncchannel_rgb().

Sets the NcRgb, and marks the NcChannel as NOT using the “default color”, retaining the other bits unchanged.

C style function: ncchannel_set().

Gets the three NcComponents.

C style function: ncchannel_rgb8().

Sets the three NcComponents, and marks the NcChannel as NOT using the “default color”.

C style function: ncchannel_set_rgb8().

Gets the red NcComponent.

C style function: ncchannel_r().

Gets the green NcComponent.

C style function: ncchannel_g().

Gets the blue NcComponent.

C style function: ncchannel_b().

Sets the red NcComponent, and returns the new NcChannel.

C style function: ncchannel_set_r().

Sets the green NcComponent, and returns the new NcChannel.

C style function: ncchannel_set_g().

Sets the blue NcComponent, and returns the new NcChannel.

C style function: ncchannel_set_b().

Is this NcChannel using the “default color” rather than RGB/palette-indexed?

C style function: ncchannel_default_p().

Marks this NcChannel as using its “default color”, which also marks it opaque.

C style function: ncchannel_set_default().

Marks this NcChannel as not using its “default color”.

The following methods also marks the channel as NOT using the “default color”:

C style function: ncchannel_set_not_default().

Extracts the NcPaletteIndex from the NcChannel.

The channel must be palette-indexed, or the return value is meaningless. Verify palette indexing with palindex_p.

C style function: ncchannel_palindex().

Is this NcChannel using palette-indexed color rather than RGB?

C style function: ncchannel_palindex_p().

Sets the NcPaletteIndex of the NcChannel, and the channel into palette-indexed mode.

C style function: ncchannel_set_palindex().