Eine aufbereitete Darstellung der Quelle

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

Benutzer

Quelle  SkPDFGlyphUse.h

  Sprache: C
 

// Copyright 2018 Google LLC
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
#ifndef SkPDFGlyphUse_DEFINED
#define SkPDFGlyphUse_DEFINED

#include "include/core/SkTypes.h"
#include "src/utils/SkBitSet.h"

class SkPDFGlyphUse {
public:
    SkPDFGlyphUse() : fBitSet(0) {}
    SkPDFGlyphUse(SkGlyphID firstNonZero, SkGlyphID lastGlyph)
        : fBitSet(lastGlyph - firstNonZero + 2)
        , fFirstNonZero(firstNonZero)
        , fLastGlyph(lastGlyph) { SkASSERT(firstNonZero >= 1); }
    ~SkPDFGlyphUse() = default;
    SkPDFGlyphUse(SkPDFGlyphUse&&) = default;
    SkPDFGlyphUse& operator=(SkPDFGlyphUse&&) = default;

    SkGlyphID firstNonZero() const { return fFirstNonZero; }
    SkGlyphID lastGlyph() const { return fLastGlyph; }
    void set(SkGlyphID gid) { fBitSet.set(this->toCode(gid)); }
    bool has(SkGlyphID gid) const { return fBitSet.test(this->toCode(gid)); }

    template<typename FN>
    void getSetValues(FN f) const {
        if (fFirstNonZero == 1) {
            return fBitSet.forEachSetIndex(std::move(f));
        }
        size_t offset = fFirstNonZero - 1;
        fBitSet.forEachSetIndex([&f, offset](size_t v) { f(v == 0 ? v : v + offset); });
    }

private:
    SkBitSet fBitSet;
    SkGlyphID fFirstNonZero = 0;
    SkGlyphID fLastGlyph = 0;

    size_t toCode(SkGlyphID gid) const {
        if (gid == 0 || fFirstNonZero == 1) {
            return gid;
        }
        SkASSERT(gid >= fFirstNonZero && gid <= fLastGlyph);
        return gid - fFirstNonZero + 1;
    }
    SkPDFGlyphUse(const SkPDFGlyphUse&) = delete;
    SkPDFGlyphUse& operator=(const SkPDFGlyphUse&) = delete;
};
#endif  // SkPDFGlyphUse_DEFINED

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

¤ Dauer der Verarbeitung: 0.3 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