xtd 0.2.0
xtd::drawing::imaging::effects::blur_effect Struct Reference
Inheritance diagram for xtd::drawing::imaging::effects::blur_effect:
xtd::drawing::imaging::effects::effect xtd::abstract_object xtd::object

Definition

The xtd::drawing::imaging::effects::blur_effect blurs the image with radius.

Namespace
xtd::drawing::imaging::effects
Library
xtd.drawing
Appearance
Original Converted
Examples
The following example code shows how tu use xtd::drawing::imaging::effects::blur_effect with image.
const auto img = image::from_file("ball.png");
auto result = image_effector::set_effect(img, blur_effect {10});
result.save("ball_blur.png");
void save(const xtd::string &filename) const
Saves this xtd::drawing::image to the specified file or stream.
static image from_file(const xtd::string &filename)
Creates an image from the specified file.
static xtd::drawing::image set_effect(const xtd::drawing::image &image, const xtd::drawing::imaging::effects::effect &effect)
Sets the specified effects to the specifid image.
The xtd::drawing::imaging::effects::blur_effect blurs the image with radius.
Definition blur_effect.hpp:34

Public Properties

bool expand_edge
 Gets or sets a value that indicates whether the bitmap expands by an amount equal to the blur radius.
 
int32 horizontal_radius
 Gets or sets the horizontal radius value.
 
int32 vertical_radius
 Gets or sets the vertical radius value.
 

Public Constructors

 blur_effect ()=default
 Initialise the new instance of xtd::drawing::imaging::blur_effect object.
 
 blur_effect (int32 radius)
 Initialise the new instance of xtd::drawing::imaging::blur_effect object with specified horizontal and vertical radius.
 
 blur_effect (int32 radius, bool expand_edge)
 Initialise the new instance of xtd::drawing::imaging::blur_effect object with specified horizontal and vertical radius, and expand edge boolean.
 
 blur_effect (int32 horizontal_radius, int32 vertical_radius)
 Initialise the new instance of xtd::drawing::imaging::blur_effect object with specified horizontal and vertical radius.
 
 blur_effect (int32 horizontal_radius, int32 vertical_radius, bool expand_edge)
 Initialise the new instance of xtd::drawing::imaging::blur_effect object with specified horizontal and vertical radius, and expand edge boolean.
 

Protected Methods

void apply (xtd::drawing::image &image) const override
 Apply the effect.
 

Additional Inherited Members

- Public Member Functions inherited from xtd::object
 object ()=default
 Create a new instance of the ultimate base class object.
 
virtual bool equals (const object &obj) const noexcept
 Determines whether the specified object is equal to the current object.
 
virtual xtd::size get_hash_code () const noexcept
 Serves as a hash function for a particular type.
 
virtual type_object get_type () const noexcept
 Gets the type of the current instance.
 
template<class object_t >
xtd::uptr< object_t > memberwise_clone () const
 Creates a shallow copy of the current object.
 
virtual xtd::string to_string () const noexcept
 Returns a xtd::string that represents the current object.
 
- Static Public Member Functions inherited from xtd::object
template<class object_a_t , class object_b_t >
static bool equals (const object_a_t &object_a, const object_b_t &object_b) noexcept
 Determines whether the specified object instances are considered equal.
 
template<class object_a_t , class object_b_t >
static bool reference_equals (const object_a_t &object_a, const object_b_t &object_b) noexcept
 Determines whether the specified object instances are the same instance.
 
- Protected Member Functions inherited from xtd::drawing::imaging::effects::effect
- Protected Member Functions inherited from xtd::abstract_object
 abstract_object ()=default
 Initializes a new instance of the xtd::abstract_object class.
 

Constructor & Destructor Documentation

◆ blur_effect() [1/5]

xtd::drawing::imaging::effects::blur_effect::blur_effect ( )
default

Initialise the new instance of xtd::drawing::imaging::blur_effect object.

◆ blur_effect() [2/5]

xtd::drawing::imaging::effects::blur_effect::blur_effect ( int32  radius)
explicit

Initialise the new instance of xtd::drawing::imaging::blur_effect object with specified horizontal and vertical radius.

Parameters
radiusThe radius of the blur in pixels.

◆ blur_effect() [3/5]

xtd::drawing::imaging::effects::blur_effect::blur_effect ( int32  radius,
bool  expand_edge 
)

Initialise the new instance of xtd::drawing::imaging::blur_effect object with specified horizontal and vertical radius, and expand edge boolean.

Parameters
radiusThe radius of the blur in pixels.
expand_edgetrue if the bitmap expands by an amount equal to the radius so that it can have soft edges. false if the bitmap remains the same size and the soft edges are clipped.

◆ blur_effect() [4/5]

xtd::drawing::imaging::effects::blur_effect::blur_effect ( int32  horizontal_radius,
int32  vertical_radius 
)

Initialise the new instance of xtd::drawing::imaging::blur_effect object with specified horizontal and vertical radius.

Parameters
horizontal_radiusThe horizontal radius of the blur in pixels.
vertical_radiusThe vertical radius of the blur in pixels.

◆ blur_effect() [5/5]

xtd::drawing::imaging::effects::blur_effect::blur_effect ( int32  horizontal_radius,
int32  vertical_radius,
bool  expand_edge 
)

Initialise the new instance of xtd::drawing::imaging::blur_effect object with specified horizontal and vertical radius, and expand edge boolean.

Parameters
horizontal_radiusThe horizontal radius of the blur in pixels.
vertical_radiusThe vertical radius of the blur in pixels.
expand_edgetrue if the bitmap expands by an amount equal to the radius so that it can have soft edges. false if the bitmap remains the same size and the soft edges are clipped.

Member Function Documentation

◆ apply()

void xtd::drawing::imaging::effects::blur_effect::apply ( xtd::drawing::image image) const
overrideprotectedvirtual

Apply the effect.

Parameters
graphicsThe graphics to apply effect.
imageThe image where the effect is applied.

Implements xtd::drawing::imaging::effects::effect.

Member Data Documentation

◆ expand_edge

bool xtd::drawing::imaging::effects::blur_effect::expand_edge

Gets or sets a value that indicates whether the bitmap expands by an amount equal to the blur radius.

Parameters
expand_edgetrue if the bitmap expands by an amount equal to the radius so that it can have soft edges. false if the bitmap remains the same size and the soft edges are clipped.

◆ horizontal_radius

int32 xtd::drawing::imaging::effects::blur_effect::horizontal_radius

Gets or sets the horizontal radius value.

Parameters
horizontal_radiusThe horizontal radius of the blur in pixels.
Remarks
If the horizontal_radius is 0, there will be no horizontal blurring.

◆ vertical_radius

int32 xtd::drawing::imaging::effects::blur_effect::vertical_radius

Gets or sets the vertical radius value.

Parameters
vertical_radiusThe vertical radius of the blur in pixels.
Remarks
If the vertical_radius is 0, there will be no vertical blurring.

The documentation for this struct was generated from the following file: