// Given a src rect in texels to be filtered, this number of surrounding texels are needed by // the kernel in x and y. static constexpr int kBicubicFilterTexelPad = 2;
// Private copy of SkFilterQuality, just for legacy deserialization // Matches values in SkFilterQuality enum SkLegacyFQ {
kNone_SkLegacyFQ = 0, //!< nearest-neighbor; fastest but lowest quality
kLow_SkLegacyFQ = 1, //!< bilerp
kMedium_SkLegacyFQ = 2, //!< bilerp + mipmaps; good for down-scaling
kHigh_SkLegacyFQ = 3, //!< bicubic resampling; slowest but good quality
// Returns true if the sampling can be ignored when the CTM is identity. staticbool NoChangeWithIdentityMatrix(const SkSamplingOptions& sampling) { // If B == 0, the cubic resampler should have no effect for identity matrices // https://entropymine.com/imageworsener/bicubic/ // We assume aniso has no effect with an identity transform. return !sampling.useCubic || sampling.cubic.B == 0;
}
// Makes a fallback SkSamplingOptions for cases where anisotropic filtering is not allowed. // anisotropic filtering can access mip levels if present, but we don't add mipmaps to non- // mipmapped images when the user requests anisotropic. So we shouldn't fall back to a // sampling that would trigger mip map creation. static SkSamplingOptions AnisoFallback(bool imageIsMipped) { auto mm = imageIsMipped ? SkMipmapMode::kLinear : SkMipmapMode::kNone; return SkSamplingOptions(SkFilterMode::kLinear, mm);
}
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.