Skip to content

WhatsCanvas Public API Reference

This document is a lightweight index of the public headers under include/wsc/. It is meant to stay close to the current C++ API; behavioral contracts remain documented in README and focused docs.

Headers

  • wsc/wsc.h
  • wsc/base.h
  • wsc/Canvas.h
  • wsc/Color.h
  • wsc/Font.h
  • wsc/Image.h
  • wsc/ImageFilter.h
  • wsc/Log.h
  • wsc/Matrix.h
  • wsc/Paint.h
  • wsc/Path.h
  • wsc/Surface.h
  • wsc/TextureSource.h
  • wsc/Version.h

wsc/base.h

class Point

Public members:

  • Point(int x = 0, int y = 0);
  • int getX() const;
  • void setX(int x);
  • int getY() const;
  • void setY(int y);
  • void set(int x, int y);
  • bool operator==(const Point &other) const;
  • bool operator!=(const Point &other) const;
  • Point operator+(const Point &other) const;
  • Point operator+(int scalar) const;
  • Point operator-(const Point &other) const;
  • Point operator-(int scalar) const;
  • Point &operator+=(const Point &other);
  • Point &operator+=(int scalar);
  • Point &operator-=(const Point &other);
  • Point &operator-=(int scalar);
  • Point operator*(int scalar) const;

class PointF

Public members:

  • PointF(float x = 0.0f, float y = 0.0f);
  • float getX() const;
  • void setX(float x);
  • float getY() const;
  • void setY(float y);
  • void set(float x, float y);
  • bool operator==(const PointF &other) const;
  • bool operator!=(const PointF &other) const;
  • PointF operator+(const PointF &other) const;
  • PointF operator+(float scalar) const;
  • PointF operator-(const PointF &other) const;
  • PointF operator-(float scalar) const;
  • PointF &operator+=(const PointF &other);
  • PointF &operator+=(float scalar);
  • PointF &operator-=(const PointF &other);
  • PointF &operator-=(float scalar);
  • PointF operator*(float scalar) const;
  • PointF operator/(float scalar) const;

class Size

Public members:

  • Size(int width = 0, int height = 0);
  • int getWidth() const;
  • void setWidth(int width);
  • int getHeight() const;
  • void setHeight(int height);
  • void set(int width, int height);
  • bool operator==(const Size &other) const;
  • bool operator!=(const Size &other) const;

class SizeF

Public members:

  • SizeF(float width = 0.0f, float height = 0.0f);
  • float getWidth() const;
  • void setWidth(float width);
  • float getHeight() const;
  • void setHeight(float height);
  • void set(float width, float height);
  • bool operator==(const SizeF &other) const;
  • bool operator!=(const SizeF &other) const;

class RectF

Public members:

  • RectF(float x = 0.0f, float y = 0.0f, float width = 0.0f, float height = 0.0f);
  • RectF(const PointF &leftTop, const PointF &bottomRight);
  • float getX() const;
  • void setX(float x);
  • float getY() const;
  • void setY(float y);
  • PointF getLeftTop() const;
  • PointF getBottomRight() const;
  • float getWidth() const;
  • void setWidth(float width);
  • float getHeight() const;
  • void setHeight(float height);
  • SizeF getSize() const;
  • PointF getCenter() const;
  • void setCenter(const PointF &center);
  • void setCenter(float cx, float cy);
  • bool contains(float px, float py) const;
  • bool contains(const PointF &point) const;
  • void transform(float dx, float dy);
  • void scale(float sx, float sy);
  • float getArea() const;
  • float getPerimeter() const;
  • bool intersects(const RectF &other) const;
  • bool isSquare() const;
  • RectF getIntersection(const RectF &other) const;

class Rect

Public members:

  • Rect(int x = 0, int y = 0, int width = 0, int height = 0);
  • Rect(const Point &leftTop, const Point &bottomRight);
  • int getX() const;
  • void setX(int x);
  • int getY() const;
  • void setY(int y);
  • Point getLeftTop() const;
  • Point getBottomRight() const;
  • int getWidth() const;
  • void setWidth(int width);
  • int getHeight() const;
  • void setHeight(int height);
  • Size getSize() const;
  • PointF getCenter() const;
  • void setCenter(const Point &center);
  • void setCenter(int cx, int cy);
  • bool contains(int px, int py) const;
  • bool contains(const Point &point) const;
  • void transform(int dx, int dy);
  • void scale(float sx, float sy);
  • int getArea() const;
  • int getPerimeter() const;
  • bool intersects(const Rect &other) const;
  • bool isSquare() const;
  • Rect getIntersection(const Rect &other) const;

wsc/Canvas.h

class Canvas

Public members:

  • static void initialize();
  • static void finalize();
  • static bool loadOpenGL(OpenGLProcAddress loadProcAddress);
  • static std::string getOpenGLVersionString();
  • static void setGammaCorrect(bool enabled);
  • static bool isGammaCorrect();
  • ~Canvas();
  • Canvas(const Canvas &) = delete;
  • Canvas &operator=(const Canvas &) = delete;
  • static std::unique_ptr<Canvas> create(Backend backend, int width, int height);
  • static std::unique_ptr<Canvas> create(std::initializer_list<Backend> preferred, int width, int height);
  • static bool isBackendAvailable(Backend backend);
  • Backend backend() const;
  • int getTextureWidth() const override;
  • int getTextureHeight() const override;
  • bool isTextureValid() const override;
  • bool isRenderTarget() const override;
  • RenderStats getRenderStats() const;
  • void setGpuTimingEnabled(bool enabled);
  • bool initializeContext();
  • void finalizeContext();
  • bool isContextInitialized() const;
  • void releaseResources();
  • void setSize(int width, int height);
  • int getWidth() const;
  • int getHeight() const;
  • void setColor(Color color);
  • void setColor(float r, float g, float b, float a = 1.0f);
  • Color getColor() const;
  • void setBlendMode(Paint::BlendMode blendMode);
  • Paint::BlendMode getBlendMode() const;
  • void drawColor(const Color &color);
  • void drawColor(float r, float g, float b, float a = 1.0f);
  • void drawPaint(const Paint &paint);
  • void drawPoint(int x, int y, const Paint &paint);
  • void drawPoint(float x, float y, const Paint &paint);
  • void drawPoint(const Point &point, const Paint &paint);
  • void drawPoint(const PointF &point, const Paint &paint);
  • void drawPoints(const std::vector<Point> &points, const Paint &paint);
  • void drawPoints(const std::vector<PointF> &points, const Paint &paint);
  • void drawLine(int x1, int y1, int x2, int y2, const Paint &paint);
  • void drawLine(float x1, float y1, float x2, float y2, const Paint &paint);
  • void drawLine(const Point &start, const Point &end, const Paint &paint);
  • void drawLine(const PointF &start, const PointF &end, const Paint &paint);
  • void drawLines(const std::vector<Point> &points, const Paint &paint);
  • void drawLines(const std::vector<PointF> &points, const Paint &paint);
  • void drawPolyline(const std::vector<Point> &points, const Paint &paint);
  • void drawPolyline(const std::vector<PointF> &points, const Paint &paint);
  • void drawPolygon(const std::vector<Point> &points, const Paint &paint);
  • void drawPolygon(const std::vector<PointF> &points, const Paint &paint);
  • void drawRect(const RectF &rect, const Paint &paint);
  • void drawRect(const Rect &rect, const Paint &paint);
  • void drawRoundRect(const RectF &rect, float radius, const Paint &paint);
  • void drawRoundRect(const Rect &rect, float radius, const Paint &paint);
  • void drawRoundRect(const RectF &rect, float topLeftRadius, float topRightRadius, float bottomRightRadius, float bottomLeftRadius, const Paint &paint);
  • void drawRoundRect(const Rect &rect, float topLeftRadius, float topRightRadius, float bottomRightRadius, float bottomLeftRadius, const Paint &paint);
  • void drawBoxShadow(const RectF &rect, float radius, float spread, float blurRadius, float dx, float dy, const Color &color);
  • void drawBoxShadow(const RectF &rect, float topLeftRadius, float topRightRadius, float bottomRightRadius, float bottomLeftRadius, float spread, float blurRadius, float dx, float dy, const Color &color);
  • void drawCircle(float centerX, float centerY, float radius, const Paint &paint);
  • void drawCircle(const PointF &center, float radius, const Paint &paint);
  • void drawCircle(const Point &center, float radius, const Paint &paint);
  • void drawOval(const RectF &bounds, const Paint &paint);
  • void drawOval(const Rect &bounds, const Paint &paint);
  • void drawArc(const RectF &bounds, float startRadians, float sweepRadians, bool useCenter, const Paint &paint);
  • void drawArc(const Rect &bounds, float startRadians, float sweepRadians, bool useCenter, const Paint &paint);
  • void drawArc(const RectF &bounds, float startRadians, float sweepRadians, ArcMode mode, const Paint &paint);
  • void drawArc(const Rect &bounds, float startRadians, float sweepRadians, ArcMode mode, const Paint &paint);
  • void drawPath(const Path &path, const Paint &paint);
  • RectF measureStrokeBounds(const Path &path, const Paint &paint) const;
  • void drawImage(const Image &image, float x, float y, const Paint &paint);
  • void drawImage(const Image &image, const RectF &dst, const Paint &paint);
  • void drawImage(const Image &image, const RectF &src, const RectF &dst, const Paint &paint);
  • void drawImageFit(const Image &image, const RectF &dst, ImageFit fit, const Paint &paint);
  • void drawImageFit(const Image &image, const RectF &dst, ImageFit fit, ImageAnchor anchor, const Paint &paint);
  • void drawImageFit(const Image &image, const RectF &dst, ImageFit fit, float alignX, float alignY, const Paint &paint);
  • void drawImageNinePatch(const Image &image, const RectF &centerSrc, const RectF &dst, const Paint &paint);
  • void drawImageRounded(const Image &image, const RectF &dst, float radius, const Paint &paint);
  • void drawImageRounded(const Image &image, const RectF &dst, float topLeftRadius, float topRightRadius, float bottomRightRadius, float bottomLeftRadius, const Paint &paint);
  • void drawImageCircle(const Image &image, const PointF &center, float radius, const Paint &paint);
  • void drawImageTiled(const Image &image, const RectF &dst, const Paint &paint);
  • void drawImageTiled(const Image &image, const RectF &dst, float tileWidth, float tileHeight, const Paint &paint);
  • void drawImage(const ITextureSource &source, float x, float y, const Paint &paint);
  • void drawImage(const ITextureSource &source, const RectF &dst, const Paint &paint);
  • bool loadImage(Image &image, const char *imagePath);
  • bool loadImageFromEncodedMemory(Image &image, const unsigned char *data, int size, bool generateMipmaps = true);
  • bool loadImageFromRGBA(Image &image, const unsigned char *pixels, int width, int height, bool generateMipmaps = false);
  • bool loadImageFromRGBA(Image &image, const std::vector<unsigned char> &pixels, int width, int height, bool generateMipmaps = false);
  • bool replaceImageRGBA(Image &image, const unsigned char *pixels, int width, int height, bool generateMipmaps = false);
  • bool replaceImageRGBA(Image &image, const std::vector<unsigned char> &pixels, int width, int height, bool generateMipmaps = false);
  • bool updateImageRGBA(Image &image, const unsigned char *pixels, int x, int y, int width, int height, bool regenerateMipmaps = true);
  • bool updateImageRGBA(Image &image, const std::vector<unsigned char> &pixels, int x, int y, int width, int height, bool regenerateMipmaps = true);
  • bool wrapExternalTexture(Image &image, std::uint32_t textureId, int width, int height, bool mipmapsGenerated = false);
  • bool wrapExternalMetalTexture(Image &image, void *texture, int width, int height, bool mipmapsGenerated = false);
  • void drawText(const std::string &text, float x, float y, const Paint &paint);
  • void drawTextBox(const std::string &text, const RectF &bounds, const Paint &paint);
  • void drawTextBox(const std::string &text, const RectF &bounds, float lineHeight, const Paint &paint);
  • void drawTextBox(const std::string &text, const RectF &bounds, float lineHeight, int maxLines, bool ellipsize, const Paint &paint);
  • std::vector<TextLine> layoutTextBox(const std::string &text, const RectF &bounds, const Paint &paint) const;
  • std::vector<TextLine> layoutTextBox(const std::string &text, const RectF &bounds, float lineHeight, const Paint &paint) const;
  • std::vector<TextLine> layoutTextBox(const std::string &text, const RectF &bounds, float lineHeight, int maxLines, bool ellipsize, const Paint &paint) const;
  • void drawTextOnPath(const std::string &text, const Path &path, const Paint &paint);
  • void drawTextOnPath(const std::string &text, const Path &path, float hOffset, float vOffset, const Paint &paint);
  • float measureText(const std::string &text, const Paint &paint) const;
  • RectF measureTextBounds(const std::string &text, const Paint &paint) const;
  • TextMetrics measureTextMetrics(const std::string &text, const Paint &paint) const;
  • bool registerFontFace(const FontFace &face);
  • bool refreshSystemFonts();
  • bool setFontFallbackChain(const FontFallbackChain &chain);
  • bool setTextBackend(TextBackend backend, TextRenderMode renderMode = TextRenderMode::Grayscale);
  • TextBackend textBackend() const;
  • int save();
  • int saveLayer(const RectF &bounds, const Paint &paint);
  • int saveLayer(const Rect &bounds, const Paint &paint);
  • int saveLayer(const RectF &bounds, const Paint &paint, const LayerOptions &options);
  • int saveLayer(const Rect &bounds, const Paint &paint, const LayerOptions &options);
  • void restore();
  • int getSaveCount() const;
  • void restoreToCount(int saveCount);
  • Matrix4 getMatrix() const;
  • PointF mapPoint(const PointF &point) const;
  • RectF mapRect(const RectF &rect) const;
  • RectF mapRect(const Rect &rect) const;
  • bool inverseMapPoint(const PointF &devicePoint, PointF &localPoint) const;
  • bool inverseMapRect(const RectF &deviceRect, RectF &localRect) const;
  • bool isPointInClip(const PointF &devicePoint) const;
  • bool hitTestPathFill(const Path &path, const PointF &devicePoint) const;
  • bool hitTestPathStroke(const Path &path, const PointF &devicePoint, float strokeWidth) const;
  • bool hasClip() const;
  • bool getClipBounds(RectF &bounds) const;
  • bool quickReject(const RectF &rect) const;
  • bool quickReject(const Rect &rect) const;
  • bool quickReject(const Path &path, const Paint &paint) const;
  • void clipPath(const Path &path);
  • void clipRect(const RectF &rect);
  • void clipRect(const Rect &rect);
  • void setMatrix(const Matrix4 &matrix);
  • void resetMatrix();
  • void setDevicePixelRatio(float ratio);
  • float devicePixelRatio() const;
  • void concat(const Matrix4 &matrix);
  • void translate(float dx, float dy);
  • void scale(float sx, float sy);
  • void rotate(float radians);
  • void beginFrame();
  • void endFrame();
  • void shutdown();
  • bool readPixelsRGBA(std::vector<unsigned char> &pixels) const;
  • std::vector<unsigned char> readPixelsRGBA() const;
  • bool readPixelsRGBAAsync(ReadPixelsCallback callback);
  • bool pollReadPixelsRGBAAsync();
  • bool hasPendingReadPixelsRGBAAsync() const;
  • bool savePixelsPPM(const std::string &path) const;
  • static std::uint64_t hashPixelsRGBA(const std::vector<unsigned char> &pixels);
  • std::uint64_t computePixelsHashRGBA() const;
  • bool setOutputTarget(const OutputTarget &target);
  • bool present();
  • void resizeOutput(int width, int height);
  • bool isPresentable() const;
  • void *vulkanInstance() const;
  • void *vulkanPhysicalDevice() const;
  • void *vulkanDevice() const;
  • void *vulkanQueue() const;
  • unsigned int vulkanQueueFamily() const;
  • void *metalDevice() const;
  • void *metalCommandQueue() const;
  • void *metalLastRenderedTexture() const;

wsc/Color.h

class Color

Public members:

  • Color();
  • Color(int r, int g, int b, int a = 255);
  • Color(float r, float g, float b, float a = 1.0f);
  • static Color fromFloat(float r, float g, float b, float a = 1.0f);
  • static Color fromHex(const std::string &hex);
  • int getR() const;
  • int getG() const;
  • int getB() const;
  • int getA() const;
  • float a() const;
  • float r() const;
  • float g() const;
  • float b() const;
  • void getNormalized(float *rgba) const;

wsc/Font.h

Enums: - FontSlant - FontSourceType

struct FontDescriptor

Public members:

  • FontDescriptor() = default;
  • explicit FontDescriptor(std::string familyName);
  • FontDescriptor(std::string familyName, int fontWeight, FontSlant fontSlant = FontSlant::NORMAL);

struct FontCodepointRange

Public members:

  • FontCodepointRange() = default;
  • FontCodepointRange(std::uint32_t firstCodepoint, std::uint32_t lastCodepoint);
  • bool contains(std::uint32_t codepoint) const;

class FontFace

Public members:

  • static FontFace fromFile(FontDescriptor descriptor, std::string path, int faceIndex = 0);
  • static FontFace fromMemory(FontDescriptor descriptor, std::vector<std::uint8_t> bytes, int faceIndex = 0);
  • const FontDescriptor &descriptor() const;
  • const std::string &family() const;
  • int weight() const;
  • FontSlant slant() const;
  • FontSourceType sourceType() const;
  • int faceIndex() const;
  • const std::string &path() const;
  • const std::vector<std::uint8_t> *bytes() const;
  • void addCodepointRange(std::uint32_t firstCodepoint, std::uint32_t lastCodepoint);
  • const std::vector<FontCodepointRange> &codepointRanges() const;
  • bool hasCodepointRanges() const;
  • bool supportsCodepoint(std::uint32_t codepoint) const;
  • bool isValid() const;

class FontFallbackChain

Public members:

  • FontFallbackChain() = default;
  • explicit FontFallbackChain(std::string primaryFamily);
  • const std::string &primaryFamily() const;
  • void setPrimaryFamily(std::string family);
  • void addFallbackFamily(std::string family);
  • bool contains(const std::string &family) const;
  • void clearFallbacks();
  • const std::vector<std::string> &fallbackFamilies() const;
  • std::vector<std::string> familiesInResolutionOrder() const;

class FontManager

Public members:

  • bool registerFontFile(const FontDescriptor &descriptor, const std::string &path, int faceIndex = 0);
  • bool registerFontMemory(const FontDescriptor &descriptor, std::vector<std::uint8_t> bytes, int faceIndex = 0);
  • bool registerFace(FontFace face);
  • bool hasFamily(const std::string &family) const;
  • const FontFace *findFirstFace(const std::string &family) const;
  • std::vector<const FontFace *> findFaces(const std::string &family) const;
  • const FontFace *findBestFace(const std::string &family, int weight = 400, FontSlant slant = FontSlant::NORMAL) const;
  • bool addFallbackFamily(const std::string &primaryFamily, const std::string &fallbackFamily);
  • const FontFallbackChain *fallbackChain(const std::string &family) const;
  • std::vector<std::string> resolveFamilies(const std::string &preferredFamily) const;
  • const std::vector<FontFace> &faces() const;
  • void clear();

class FontSystem

Public members:

  • static bool fileExists(const std::string &path);
  • static std::vector<FontFace> defaultSystemFontFaces();
  • static void refreshDefaultSystemFontFaces();
  • static void refreshDiscoveredFontFaces();
  • static void refreshDefaultSystemFontFacesOnly();
  • static std::uint64_t refreshInstalledFonts();
  • static std::uint64_t installedFontGeneration();
  • static FontFallbackChain defaultFallbackChain(const std::string &primaryFamily = kDefaultPrimaryFamily);
  • static std::vector<FontFace> discoverInstalledFontFaces();

wsc/Image.h

class Image

Public members:

  • Image();
  • ~Image() override;
  • Image(const Image &) = delete;
  • Image &operator=(const Image &) = delete;
  • Image(Image &&other) noexcept;
  • Image &operator=(Image &&other) noexcept;
  • int getWidth() const;
  • int getHeight() const;
  • bool hasMipmaps() const;
  • bool loadFromEncodedMemory(Canvas &canvas, const unsigned char *data, int size, bool generateMipmaps = true);
  • bool loadFromRGBA(Canvas &canvas, const unsigned char *pixels, int width, int height, bool generateMipmaps = false);
  • bool loadFromRGBA(Canvas &canvas, const std::vector<unsigned char> &pixels, int width, int height, bool generateMipmaps = false);
  • bool replacePixelsRGBA(Canvas &canvas, const unsigned char *pixels, int width, int height, bool generateMipmaps = false);
  • bool replacePixelsRGBA(Canvas &canvas, const std::vector<unsigned char> &pixels, int width, int height, bool generateMipmaps = false);
  • bool updatePixelsRGBA(Canvas &canvas, const unsigned char *pixels, int x, int y, int width, int height, bool regenerateMipmaps = true);
  • bool updatePixelsRGBA(Canvas &canvas, const std::vector<unsigned char> &pixels, int x, int y, int width, int height, bool regenerateMipmaps = true);
  • bool wrapExternalTexture(Canvas &canvas, std::uint32_t textureId, int width, int height, bool mipmapsGenerated = false);
  • bool wrapExternalMetalTexture(Canvas &canvas, void *texture, int width, int height, bool mipmapsGenerated = false);
  • int getTextureWidth() const override;
  • int getTextureHeight() const override;
  • bool isTextureValid() const override;
  • bool isRenderTarget() const override;

wsc/ImageFilter.h

class ImageFilter

Public members:

  • ImageFilter() = default;
  • static ImageFilter blur(float radiusX, float radiusY, TileMode tileMode = TileMode::Clamp);
  • static ImageFilter blur(float radius, TileMode tileMode = TileMode::Clamp);
  • static ImageFilter blurSigma(float sigmaX, float sigmaY, TileMode tileMode = TileMode::Clamp);
  • static ImageFilter blurSigma(float sigma, TileMode tileMode = TileMode::Clamp);
  • static ImageFilter innerShadow(float radiusX, float radiusY, float offsetX, float offsetY, const Color &color);
  • static ImageFilter innerShadow(float radius, float offsetX, float offsetY, const Color &color);
  • static ImageFilter innerShadowSigma(float sigmaX, float sigmaY, float offsetX, float offsetY, const Color &color);
  • static ImageFilter innerShadowSigma(float sigma, float offsetX, float offsetY, const Color &color);
  • static ImageFilter frostedGlass(float blurSigma, float saturation = 1.18f, float brightness = 1.04f, float contrast = 1.02f, float grain = 0.012f, TileMode tileMode = TileMode::Clamp);
  • ImageFilter &setColorAdjustment(float saturation, float brightness = 1.0f, float contrast = 1.0f);
  • ImageFilter &setGrain(float amount);
  • Type type() const;
  • bool isValid() const;
  • float radiusX() const;
  • float radiusY() const;
  • float offsetX() const;
  • float offsetY() const;
  • Color shadowColor() const;
  • TileMode tileMode() const;
  • float saturation() const;
  • float brightness() const;
  • float contrast() const;
  • float grain() const;
  • bool hasColorAdjustment() const;
  • bool hasGrain() const;
  • float samplingOutset() const;
  • float outputOutset() const;

class ImageFilterChain

Public members:

  • ImageFilterChain() = default;
  • explicit ImageFilterChain(const ImageFilter &filter);
  • ImageFilterChain &append(const ImageFilter &filter);
  • ImageFilterChain &appendColorMatrix(const std::array<float, 20> &matrix);
  • ImageFilterChain &appendOffset(float dx, float dy);
  • std::size_t size() const;
  • bool empty() const;
  • bool isValid() const;
  • const Node &operator[](std::size_t index) const;
  • float samplingOutset() const;
  • float outputOutset() const;

class LayerOptions

Public members:

  • LayerOptions &setImageFilter(const ImageFilter &filter);
  • LayerOptions &setImageFilter(const ImageFilterChain &filters);
  • LayerOptions &setBackdropFilter(const ImageFilter &filter);
  • LayerOptions &setBackdropFilter(const ImageFilterChain &filters);
  • const ImageFilter &imageFilter() const;
  • const ImageFilter &backdropFilter() const;
  • const ImageFilterChain &imageFilterChain() const;
  • const ImageFilterChain &backdropFilterChain() const;
  • bool hasImageFilter() const;
  • bool hasBackdropFilter() const;

wsc/Log.h

Enums: - LogLevel

struct LogMessage

No public methods detected by the lightweight generator.

class Log

Public members:

  • static void setLevel(LogLevel level);
  • static LogLevel level();
  • static bool isEnabled(LogLevel level);
  • static void setHandler(LogHandler handler);
  • static void write(LogLevel level, const char *category, std::string message);
  • static const char *levelName(LogLevel level);

wsc/Matrix.h

class Matrix4

Public members:

  • Matrix4();
  • explicit Matrix4(const std::array<float, 16> &values);
  • explicit Matrix4(const float *columnMajorValues);
  • static Matrix4 identity();
  • const std::array<float, 16> &values() const;
  • const float *data() const;
  • float *data();
  • float at(std::size_t column, std::size_t row) const;
  • void set(std::size_t column, std::size_t row, float value);

wsc/Paint.h

class Paint

Public members:

  • Paint();
  • Paint(const Paint &other);
  • Paint &operator=(const Paint &other);
  • Paint(Paint &&other) noexcept;
  • Paint &operator=(Paint &&other) noexcept;
  • ~Paint();
  • void setAntiAlias(bool aa);
  • bool isAntiAlias() const;
  • void setColor(const Color &color);
  • void setColor(int r, int g, int b, int a = 255);
  • void setColor(float r, float g, float b, float a = 1.0f);
  • void setFillColor(const Color &color);
  • void setAlpha(int alpha);
  • void setAlpha(float alpha);
  • int getAlpha() const;
  • float getAlphaF() const;
  • Color getFillColor() const;
  • void setLinearGradient(float startX, float startY, float endX, float endY, const Color &startColor, const Color &endColor);
  • void setLinearGradient(float startX, float startY, float endX, float endY, const std::vector<ColorStop> &stops);
  • void setRadialGradient(float centerX, float centerY, float radius, const Color &startColor, const Color &endColor);
  • void setRadialGradient(float centerX, float centerY, float radius, const std::vector<ColorStop> &stops);
  • void clearShader();
  • ShaderType getShaderType() const;
  • void setShaderTileMode(ShaderTileMode tileMode);
  • ShaderTileMode getShaderTileMode() const;
  • bool hasLinearGradient() const;
  • bool hasRadialGradient() const;
  • float getGradientStartX() const;
  • float getGradientStartY() const;
  • float getGradientEndX() const;
  • float getGradientEndY() const;
  • Color getGradientStartColor() const;
  • Color getGradientEndColor() const;
  • const std::vector<ColorStop> &getGradientStops() const;
  • float getRadialCenterX() const;
  • float getRadialCenterY() const;
  • float getRadialRadius() const;
  • Color getRadialStartColor() const;
  • Color getRadialEndColor() const;
  • void setShadowLayer(float radius, float dx, float dy, const Color &color);
  • void clearShadowLayer();
  • bool hasShadowLayer() const;
  • float getShadowRadius() const;
  • float getShadowDx() const;
  • float getShadowDy() const;
  • Color getShadowColor() const;
  • Color getColor() const;
  • void setStrokeWidth(float width);
  • float getStrokeWidth() const;
  • void setStrokeMiterLimit(float limit);
  • float getStrokeMiterLimit() const;
  • void setTextSize(float size);
  • float getTextSize() const;
  • void setFontFamily(const std::string &family);
  • void setFont(const std::string &family);
  • const std::string &getFontFamily() const;
  • const std::string &getFont() const;
  • bool hasFontFamily() const;
  • void clearFontFamily();
  • void clearFont();
  • void setFontWeight(int weight);
  • int getFontWeight() const;
  • void setFontSlant(FontSlant slant);
  • FontSlant getFontSlant() const;
  • void setLetterSpacing(float spacing);
  • float getLetterSpacing() const;
  • void setTextAlign(TextAlign align);
  • TextAlign getTextAlign() const;
  • void setTextBaseline(TextBaseline baseline);
  • TextBaseline getTextBaseline() const;
  • void setTextLocale(const std::string &locale);
  • const std::string &getTextLocale() const;
  • bool hasTextLocale() const;
  • void setFontFeature(const std::string &tag, std::uint32_t value = 1);
  • void clearFontFeatures();
  • const std::vector<FontFeature> &getFontFeatures() const;
  • void setUnderline(bool enabled);
  • bool isUnderline() const;
  • void setStrikethrough(bool enabled);
  • bool isStrikethrough() const;
  • void setTextRenderMode(TextRenderMode mode);
  • TextRenderMode getTextRenderMode() const;
  • void setBlendMode(BlendMode blendMode);
  • BlendMode getBlendMode() const;
  • void setImageSampling(ImageSampling sampling);
  • ImageSampling getImageSampling() const;
  • void setImageTileMode(ImageTileMode tileMode);
  • ImageTileMode getImageTileMode() const;
  • void setCornerPathEffect(float radius);
  • void clearCornerPathEffect();
  • bool hasCornerPathEffect() const;
  • float getCornerPathEffectRadius() const;
  • void setDashPathEffect(const std::vector<float> &intervals, float phase = 0.0f);
  • void clearDashPathEffect();
  • bool hasDashPathEffect() const;
  • const std::vector<float> &getDashIntervals() const;
  • float getDashPhase() const;
  • void setColorMatrix(const std::array<float, 20> &matrix);
  • void clearColorMatrix();
  • bool hasColorMatrix() const;
  • const std::array<float, 20> &getColorMatrix() const;
  • void setStrokeColor(const Color &color);
  • void setStrokeColor(int r, int g, int b, int a = 255);
  • void setStrokeColor(float r, float g, float b, float a = 1.0f);
  • Color getStrokeColor() const;
  • void setStyle(Style style);
  • Style getStyle() const;
  • void setStrokeCap(StrokeCap cap);
  • StrokeCap getStrokeCap() const;
  • void setStrokeJoin(StrokeJoin join);
  • StrokeJoin getStrokeJoin() const;

wsc/Path.h

class Path

Public members:

  • Path();
  • void setFillType(FillType fillType);
  • FillType getFillType() const;
  • void moveTo(float x, float y);
  • void lineTo(float x, float y);
  • void quadTo(float controlX, float controlY, float endX, float endY);
  • void quadTo(const PointF &control, const PointF &end);
  • void cubicTo(float control1X, float control1Y, float control2X, float control2Y, float endX, float endY);
  • void cubicTo(const PointF &control1, const PointF &control2, const PointF &end);
  • void close();
  • void reset();
  • const std::vector<PathPoint> &getPoints() const;
  • bool isEmpty() const;
  • std::size_t getContourCount() const;
  • std::size_t getClosedContourCount() const;
  • bool isClosed() const;
  • RectF getBounds() const;
  • RectF getStrokeBounds(float strokeWidth) const;
  • std::vector<RectF> getContourBounds() const;
  • bool contains(float x, float y) const;
  • bool contains(const PointF &point) const;
  • bool strokeContains(float x, float y, float strokeWidth) const;
  • bool strokeContains(const PointF &point, float strokeWidth) const;
  • float length() const;
  • bool pointAtLength(float targetLength, PointF &point) const;
  • bool pointAndTangentAtLength(float targetLength, PointF &point, PointF &tangent) const;
  • Path reversed() const;
  • Path trim(float startLength, float endLength) const;
  • Path trim(float startLength, float endLength, bool wrap) const;
  • Path trim(float startLength, float endLength, bool wrap, bool reverse) const;
  • Path roundedCorners(float radius) const;
  • void offset(float dx, float dy);
  • void addRect(const RectF &rect);
  • void addOval(const RectF &rect);
  • void addRoundRect(const RectF &rect, float radius);
  • void addRoundRect(const RectF &rect, float topLeftRadius, float topRightRadius, float bottomRightRadius, float bottomLeftRadius);
  • void addCircle(float x, float y, float radius);

wsc/Surface.h

struct NativeSurface

No public methods detected by the lightweight generator.

struct SwapchainConfig

No public methods detected by the lightweight generator.

struct OutputTarget

Public members:

  • static OutputTarget Offscreen();
  • static OutputTarget OffscreenTexture();
  • static OutputTarget ToWindow(const NativeSurface &surface, const SwapchainConfig &config = SwapchainConfig());
  • static OutputTarget GLFramebuffer(unsigned int framebuffer, int width, int height, bool opaque = false);
  • static OutputTarget VulkanImageTarget(void *image, unsigned long long format, int width, int height);

wsc/TextureSource.h

class ITextureSource

Public members:

  • ITextureSource() = default;
  • ITextureSource(const ITextureSource &) = delete;
  • ITextureSource &operator=(const ITextureSource &) = delete;
  • virtual ~ITextureSource() = default;
  • virtual int getTextureWidth() const = 0;
  • virtual int getTextureHeight() const = 0;
  • virtual bool isTextureValid() const = 0;
  • virtual bool isRenderTarget() const = 0;