Eine aufbereitete Darstellung der Quelle

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

Benutzer

Quelle  cutout.rs

  Sprache: Rust
 

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */


//! Cutouts patterns act a mask on top of already rendered content.
//!
//! Their main purpose is to "punch a hole" in the current layer so that
//! an underlay layer can be seen through it.
//! The clip chain controls the shape of the mask. When rendering the
//! cutout, opaque white means pixels will be fully masked, transparent
//! black means pixels will be shown, and values in between represent
//! different levels of transparency.

use api::{ColorF, units::*};

use crate::pattern::{Pattern, PatternBuilder, PatternBuilderContext, PatternBuilderState};
use crate::renderer::BlendMode;

pub struct Cutout;

impl PatternBuilder for Cutout {
    fn build(
        &self,
        _sub_rect: Option<DeviceRect>,
        _offset: LayoutVector2D,
        _ctx: &PatternBuilderContext,
        _state: &mut PatternBuilderState,
    ) -> Pattern {
        Pattern::color(ColorF::WHITE)
            .with_blend_mode(BlendMode::PremultipliedDestOut)
    }
}

// TODO: Cutouts are applied to the destination layer entirely in the alpha
// pass, the fully masked segments could be drawn in the opaque pass.

// TODO: Currently, complex masks for cutouts are drawn into intermediate
// surfaces using the same logic as regular patterns. They could be drawn
// directly into the the destination layer. 

Messung V0.5 in Prozent
C=90 H=96 G=93

¤ Dauer der Verarbeitung: 0.4 Sekunden  ¤

*© 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

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Statistik
#Sources=277311
#Domains=752002