Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  gskgpucolorstatesprivate.h

  Sprache: C
 

#pragma once

#include "gskgputypesprivate.h"

#include "gdk/gdkcolorprivate.h"
#include "gdk/gdkcolorstateprivate.h"

#define COLOR_SPACE_OUTPUT_PREMULTIPLIED (1u << 2)
#define COLOR_SPACE_ALT_PREMULTIPLIED    (1u << 3)
#define COLOR_SPACE_OUTPUT_SHIFT 8u
#define COLOR_SPACE_ALT_SHIFT 16u
#define COLOR_SPACE_COLOR_STATE_MASK 0xFFu

static inline GskGpuColorStates
gsk_gpu_color_states_create_equal (gboolean output_is_premultiplied,
                                   gboolean alt_is_premultiplied)
{
  /* We use ID 0 here for the colorspaces - if that ever becomes an issue
   * that it maps to SRGB, we need to invent something */

  return (output_is_premultiplied ? COLOR_SPACE_OUTPUT_PREMULTIPLIED : 0) |
         (alt_is_premultiplied ? COLOR_SPACE_ALT_PREMULTIPLIED : 0);
}

static inline GskGpuColorStates
gsk_gpu_color_states_create (GdkColorState *output_color_state,
                             gboolean       output_is_premultiplied,
                             GdkColorState *alt_color_state,
                             gboolean       alt_is_premultiplied)
{
  g_assert (GDK_IS_DEFAULT_COLOR_STATE (output_color_state));
  g_assert (GDK_IS_DEFAULT_COLOR_STATE (alt_color_state));

  if (gdk_color_state_equal (output_color_state, alt_color_state))
    return gsk_gpu_color_states_create_equal (output_is_premultiplied, alt_is_premultiplied);

  return (GDK_DEFAULT_COLOR_STATE_ID (output_color_state) << COLOR_SPACE_OUTPUT_SHIFT) |
         (output_is_premultiplied ? COLOR_SPACE_OUTPUT_PREMULTIPLIED : 0) |
         (GDK_DEFAULT_COLOR_STATE_ID (alt_color_state) << COLOR_SPACE_ALT_SHIFT) |
         (alt_is_premultiplied ? COLOR_SPACE_ALT_PREMULTIPLIED : 0);
}

static inline GdkColorState *
gsk_gpu_color_states_get_output (GskGpuColorStates self)
{
  return ((GdkColorState *) &gdk_default_color_states[(self >> COLOR_SPACE_OUTPUT_SHIFT) & COLOR_SPACE_COLOR_STATE_MASK]);
}

static inline gboolean
gsk_gpu_color_states_is_output_premultiplied (GskGpuColorStates self)
{
  return !!(self & COLOR_SPACE_OUTPUT_PREMULTIPLIED);
}

static inline GdkColorState *
gsk_gpu_color_states_get_alt (GskGpuColorStates self)
{
  return ((GdkColorState *) &gdk_default_color_states[(self >> COLOR_SPACE_ALT_SHIFT) & COLOR_SPACE_COLOR_STATE_MASK]);
}

static inline gboolean
gsk_gpu_color_states_is_alt_premultiplied (GskGpuColorStates self)
{
  return !!(self & COLOR_SPACE_ALT_PREMULTIPLIED);
}

/* Note: this function should only return a colorstate other than
 * color->color_state *only* if the shaders can't handle the conversion
 * from color->color_state to ccs.
 */

static inline GdkColorState *
gsk_gpu_color_states_find (GdkColorState  *ccs,
                           const GdkColor *color)
{
  if (GDK_IS_DEFAULT_COLOR_STATE (color->color_state))
    return color->color_state;
  else
    return ccs;
}

Messung V0.5 in Prozent
C=98 H=96 G=96

¤ Dauer der Verarbeitung: 0.15 Sekunden  (vorverarbeitet am  2026-07-02) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik