Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Gimp/app/paint/   (Gimp Bildeditor Version 3.2.0©)  Datei vom 14.2.2026 mit Größe 3 kB image not shown  

Quelle  gimpbrushcore-kernels.h   Sprache: C

 

/* gimpbrushcore-kernels.h
 *
 *   This file was generated using kernelgen as found in the tools dir.
 *   (threshold = 0.25)
 */


#pragma once


#define KERNEL_WIDTH     3
#define KERNEL_HEIGHT    3
#define KERNEL_SUBSAMPLE 4


#ifdef __cplusplus

template <class T>
struct Kernel;

template <>
struct Kernel<guchar>
{
  using value_type  = guchar;
  using kernel_type = guint;
  using accum_type  = gulong;

  static constexpr kernel_type
  coeff (kernel_type x)
  {
    return x;
  }

  static constexpr value_type
  round (accum_type x)
  {
    return (x + 128) / 256;
  }
};

template <>
struct Kernel<gfloat>
{
  using value_type  = gfloat;
  using kernel_type = gfloat;
  using accum_type  = gfloat;

  static constexpr kernel_type
  coeff (kernel_type x)
  {
    return x / 256.0f;
  }

  static constexpr value_type
  round (accum_type x)
  {
    return x;
  }
};


/*  Brush pixel subsampling kernels  */
template <class T>
struct Subsample : Kernel<T>
{
  #define C(x) (Subsample::coeff (x))

  static constexpr typename Subsample::kernel_type kernel[5][5][9] =
  {
    {
      { C( 64), C( 64), C(  0), C( 64), C( 64), C(  0), C(  0), C(  0), C(  0), },
      { C( 25), C(103), C(  0), C( 25), C(103), C(  0), C(  0), C(  0), C(  0), },
      { C(  0), C(128), C(  0), C(  0), C(128), C(  0), C(  0), C(  0), C(  0), },
      { C(  0), C(103), C( 25), C(  0), C(103), C( 25), C(  0), C(  0), C(  0), },
      { C(  0), C( 64), C( 64), C(  0), C( 64), C( 64), C(  0), C(  0), C(  0), }
    },
    {
      { C( 25), C( 25), C(  0), C(103), C(103), C(  0), C(  0), C(  0), C(  0), },
      { C(  6), C( 44), C(  0), C( 44), C(162), C(  0), C(  0), C(  0), C(  0), },
      { C(  0), C( 50), C(  0), C(  0), C(206), C(  0), C(  0), C(  0), C(  0), },
      { C(  0), C( 44), C(  6), C(  0), C(162), C( 44), C(  0), C(  0), C(  0), },
      { C(  0), C( 25), C( 25), C(  0), C(103), C(103), C(  0), C(  0), C(  0), }
    },
    {
      { C(  0), C(  0), C(  0), C(128), C(128), C(  0), C(  0), C(  0), C(  0), },
      { C(  0), C(  0), C(  0), C( 50), C(206), C(  0), C(  0), C(  0), C(  0), },
      { C(  0), C(  0), C(  0), C(  0), C(256), C(  0), C(  0), C(  0), C(  0), },
      { C(  0), C(  0), C(  0), C(  0), C(206), C( 50), C(  0), C(  0), C(  0), },
      { C(  0), C(  0), C(  0), C(  0), C(128), C(128), C(  0), C(  0), C(  0), }
    },
    {
      { C(  0), C(  0), C(  0), C(103), C(103), C(  0), C( 25), C( 25), C(  0), },
      { C(  0), C(  0), C(  0), C( 44), C(162), C(  0), C(  6), C( 44), C(  0), },
      { C(  0), C(  0), C(  0), C(  0), C(206), C(  0), C(  0), C( 50), C(  0), },
      { C(  0), C(  0), C(  0), C(  0), C(162), C( 44), C(  0), C( 44), C(  6), },
      { C(  0), C(  0), C(  0), C(  0), C(103), C(103), C(  0), C( 25), C( 25), }
    },
    {
      { C(  0), C(  0), C(  0), C( 64), C( 64), C(  0), C( 64), C( 64), C(  0), },
      { C(  0), C(  0), C(  0), C( 25), C(103), C(  0), C( 25), C(103), C(  0), },
      { C(  0), C(  0), C(  0), C(  0), C(128), C(  0), C(  0), C(128), C(  0), },
      { C(  0), C(  0), C(  0), C(  0), C(103), C( 25), C(  0), C(103), C( 25), },
      { C(  0), C(  0), C(  0), C(  0), C( 64), C( 64), C(  0), C( 64), C( 64), }
    }
  };

  #undef C
};

template <class T>
constexpr typename Subsample<T>::kernel_type Subsample<T>::kernel[5][5][9];

#endif /* __cplusplus */

Messung
CHZG
8210010094

¤ Dauer der Verarbeitung: 0.3 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover


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.