Ream v0.1.0-1
C++ graphics library for Linux
Loading...
Searching...
No Matches
Public Attributes | List of all members
RDrawImageInfo Struct Reference

Describes how to draw an image (or a portion of it) onto an RSurface's viewport. More...

#include <RPainter.h>

Public Attributes

std::shared_ptr< RImageimage
 The image to draw.
 
CZTransform srcTransform { CZTransform::Normal }
 Transformation applied to the source rect before scaling.
 
SkScalar srcScale { 1.f }
 Scale factor applied to src.
 
SkRect src {}
 Portion of the image to draw.
 
SkIRect dst {}
 Target rect within the RSurface viewport where the image will be drawn.
 
RImageFilter minFilter { RImageFilter::Linear }
 Filter to use when the image is minified (i.e., scaled down).
 
RImageFilter magFilter { RImageFilter::Linear }
 Filter to use when the image is magnified (i.e., scaled up).
 
RImageWrap wrapS { RImageWrap::ClampToEdge }
 Wrapping mode for horizontal (S-axis) texture coordinates.
 
RImageWrap wrapT { RImageWrap::ClampToEdge }
 Wrapping mode for vertical (T-axis) texture coordinates.
 

Detailed Description

Describes how to draw an image (or a portion of it) onto an RSurface's viewport.

This struct is used by RPainter::drawImage() to define source and destination rects, transformations, and sampling options for drawing an RImage.

Member Data Documentation

◆ image

std::shared_ptr<RImage> image

The image to draw.

If nullptr, drawImage() will fail and return false.

◆ srcTransform

CZTransform srcTransform { CZTransform::Normal }

Transformation applied to the source rect before scaling.

Defaults to the identity transformation (no change).

◆ srcScale

SkScalar srcScale { 1.f }

Scale factor applied to src.

◆ src

SkRect src {}

Portion of the image to draw.

This rect can extend beyond the image bounds. It is affected by both srcTransform and srcScale.

Note
To use pixel coordinates set srcScale to 1.f.

If width or height are <= 0.f, they will be clamped to a small positive delta.

◆ dst

SkIRect dst {}

Target rect within the RSurface viewport where the image will be drawn.

For example, if the RSurface is positioned at (100, 100) and you want to draw the image in its top-left corner with a size of (width, height), then dst should be set to XYWH(100, 100, width, height).

◆ minFilter

RImageFilter minFilter { RImageFilter::Linear }

Filter to use when the image is minified (i.e., scaled down).

◆ magFilter

RImageFilter magFilter { RImageFilter::Linear }

Filter to use when the image is magnified (i.e., scaled up).

◆ wrapS

RImageWrap wrapS { RImageWrap::ClampToEdge }

Wrapping mode for horizontal (S-axis) texture coordinates.

◆ wrapT

RImageWrap wrapT { RImageWrap::ClampToEdge }

Wrapping mode for vertical (T-axis) texture coordinates.