Donner SVG main
0.8.0 ยท 382bd0190.8.0 main
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
ImageSampling.h File Reference
#include <cstddef>
#include <cstdint>
#include <ostream>
#include <span>
#include <vector>
#include "donner/base/Transform.h"
#include "donner/base/Utils.h"
#include "donner/svg/core/ImageRendering.h"
Include dependency graph for ImageSampling.h:

Namespaces

namespace  donner
 Top-level Donner namespace, which is split into different sub-namespaces such as donner::svg and donner::css.
namespace  donner::svg
 Donner SVG library, which can load, manipulate and render SVG files.

Enumerations

enum class  donner::svg::ImageSamplingKernel : std::uint8_t {
  donner::svg::Nearest ,
  donner::svg::Bilinear ,
  donner::svg::MitchellCubic ,
  donner::svg::PixelatedSmooth
}
 Resampling kernel a backend applies when it scales a raster <image>. More...

Functions

std::ostream & donner::svg::operator<< (std::ostream &os, ImageSamplingKernel kernel)
 ostream output operator for ImageSamplingKernel.
constexpr ImageSamplingKernel donner::svg::ImageSamplingKernelFor (ImageRendering imageRendering)
 Selects the raster resampling kernel for a resolved image-rendering value.
ImageSamplingKernel donner::svg::ImageSamplingKernelFor (ImageRendering imageRendering, const Transform2d &deviceFromImage)
 Selects the resampling kernel for drawing a raster through deviceFromImage.
std::vector< std::uint8_t > donner::svg::RasterizeImagePremultiplied (std::span< const std::uint8_t > premultipliedPixels, int sourceWidth, int sourceHeight, const Transform2d &deviceFromImage, int outputWidth, int outputHeight, ImageSamplingKernel kernel)
 Rasterizes a premultiplied image through an affine transform into a bounded device surface.

Variables

constexpr std::int64_t donner::svg::kMaxImageSamplingDimension = 16384
 Maximum output axis of a materialized procedural image-sampling surface.
constexpr std::size_t donner::svg::kMaxImageSamplingSurfacePixels = 16 * 1024 * 1024
 Maximum pixels in one materialized image-sampling surface.