AxialShadingPattern Class Documentation

classAxialShadingPattern : ShadingPattern

Namespace:datalogics_interface

Inherits from:
ShadingPattern

Detailed Description

An axial shading specifies a color blend that varies along a linear axis between two endpoints, and indefinitely perpendicular to that axis.

Constructor & Destructor Documentation

AxialShadingPattern

Parameters

color_space: ColorSpace &

The color space for the pattern.

coords: const std::vector< Point > &

The coordinates of the two endpoints of the axial shading.

functions: const std::vector< std::shared_ptr< Function > > &

One 1-in n-out function, or an array of n 1-in 1-out functions that determine the values of the color channels.

Create an AxialShadingPattern.

Member Function Documentation

get_anti_alias

boolget_anti_alias()

Returns:

true if anti-aliasing is enabled, false otherwise.

When enabled, the shading function is filtered to prevent aliasing artifacts.

get_bounding_box

Rectget_bounding_box()

Returns:

The bounding box Rect, or NULL if none is set.

The coordinates are interpreted in the target coordinate space. If present, provides an additional, temporary clipping boundary to the shading.

get_color_space

Returns:

The ColorSpace of the shading pattern.

This space is restricted to be any space except a Pattern space.

get_coords

Returns:

A list of two Point objects defining the start and end of the axis.

The coordinates of the two endpoints of the axial shading.

get_domain

std::vector< double >get_domain()

Returns:

A list of two doubles, or null if not set.

An array of two numbers that specify the limiting values of the parametric variable t. This variable t varies linearly between these two values as the gradient varies between the starting and ending points of the axis.

Defaults to [0, 1]. May be NULL.

get_extend

std::vector< bool >get_extend()

Returns:

A list of two booleans, or null if not set.

An array of two boolean values indicating whether to extend the shading beyond the starting and ending points of the axis, respectively.

Default value: [false, false]. May be NULL.

get_functions

Returns:

A list of Function objects used to compute color values.

One 1-in n-out function, or an array of n 1-in 1-out functions that determine the values of the color channels, where n is the number of color components in the shading's color space. The functions are called with a parametric variable t which varies across the Domain.

get_pdf_object

Returns:

The PDFObject representing this pattern in the PDF document.

Gets the underlying PDF object for this pattern.

set_anti_alias

voidset_anti_alias(boolanti_alias)

Parameters

anti_alias: bool

true to enable anti-aliasing, false to disable it.

Returns:

void

When enabled, the shading function is filtered to prevent aliasing artifacts.

set_bounding_box

voidset_bounding_box(const Rect &bbox)

Parameters

bbox: const Rect &

The bounding box Rect to set, or NULL to remove it.

Returns:

void

The coordinates are interpreted in the target coordinate space. If present, provides an additional, temporary clipping boundary to the shading. Set to NULL to remove the bounding box.

set_color_space

voidset_color_space(ColorSpace &color_space)

Parameters

color_space: ColorSpace &

The ColorSpace to set for the shading pattern.

Returns:

void

This space is restricted to be any space except a Pattern space.

set_domain

voidset_domain(const std::vector< double > &domain)

Parameters

domain: const std::vector< double > &

A list of exactly two doubles, or null to remove.

Returns:

void

An array of two numbers that specify the limiting values of the parametric variable t. This variable t varies linearly between these two values as the gradient varies between the starting and ending points of the axis.

Default value: [0, 1]. Pass NULL to remove the domain entry.

set_extend

voidset_extend(const std::vector< bool > &extend)

Parameters

extend: const std::vector< bool > &

A list of exactly two booleans, or null to remove.

Returns:

void

An array of two boolean values indicating whether to extend the shading beyond the starting and ending points of the axis, respectively.

Default value: [false, false]. Pass NULL to remove the extend entry.

set_functions

Parameters

functions: const std::vector< std::shared_ptr< Function > > &

A list of one or more Function objects. Must contain at least one function.

Returns:

void

One 1-in n-out function, or an array of n 1-in 1-out functions that determine the values of the color channels, where n is the number of color components in the shading's color space. The functions are called with a parametric variable t which varies across the Domain.

to_string

std::stringto_string()

Returns:

A formatted string describing this AxialShadingPattern.

The string includes the color space, background color, bounding box, anti-alias flag, coordinates, function, domain, and extend values.