libmypaint 1.6.1
Loading...
Searching...
No Matches
MyPaintSurface2 Struct Reference

Extends MyPaintSurface with support for spectral ops and multiple bounding boxes. More...

#include <mypaint-surface.h>

Public Types

typedef int(* MyPaintSurfaceDrawDabFunction2) (MyPaintSurface2 *self, float x, float y, float radius, float color_r, float color_g, float color_b, float opaque, float hardness, float alpha_eraser, float aspect_ratio, float angle, float lock_alpha, float colorize, float posterize, float posterize_num, float paint)
 Like #MyPaintSurfaceDrawDabFunction, but supporting posterization and spectral mixing.
 
typedef void(* MyPaintSurfaceGetColorFunction2) (MyPaintSurface2 *self, float x, float y, float radius, float *color_r, float *color_g, float *color_b, float *color_a, float paint)
 Like MyPaintSurfaceGetColorFunction, but for spectral colors.
 
typedef void(* MyPaintSurfaceEndAtomicFunction2) (MyPaintSurface2 *self, MyPaintRectangles *roi)
 Like #MyPaintSurfaceEndAtomicFunction, but with support for multiple invalidation rectangles.
 

Public Member Functions

MyPaintSurfacemypaint_surface2_to_surface (MyPaintSurface2 *self)
 Safely access the parent MyPaintSurface interface.
 
void mypaint_surface2_get_color (MyPaintSurface2 *self, float x, float y, float radius, float *color_r, float *color_g, float *color_b, float *color_a, float paint)
 Call the surface's get_color_pigment function.
 
void mypaint_surface2_end_atomic (MyPaintSurface2 *self, MyPaintRectangles *roi)
 Call the surface's end_atomic_multi function.
 
int mypaint_surface2_draw_dab (MyPaintSurface2 *self, float x, float y, float radius, float color_r, float color_g, float color_b, float opaque, float hardness, float alpha_eraser, float aspect_ratio, float angle, float lock_alpha, float colorize, float posterize, float posterize_num, float paint)
 Call the surface's draw_dab_pigment function.
 

Data Fields

MyPaintSurface parent
 Parent interface.
 
MyPaintSurfaceDrawDabFunction2 draw_dab_pigment
 See MyPaintSurfaceDrawDabFunction2.
 
MyPaintSurfaceGetColorFunction2 get_color_pigment
 See MyPaintSurfaceGetColorFunction2.
 
MyPaintSurfaceEndAtomicFunction2 end_atomic_multi
 See MyPaintSurfaceEndAtomicFunction2.
 

Detailed Description

Extends MyPaintSurface with support for spectral ops and multiple bounding boxes.

This extends the regular MyPaintSurface with three new functions that support the use of spectral blending, for drawing dabs and getting color, and additionally supports using multiple invalidation rectangles when finalizing drawing operations.

The interface functions for MyPaintSurface can be called with instances of MyPaintSurface2 via the use of mypaint_surface2_to_surface (or just casting). Concrete implementations of MypaintSurface2 should support this.

See also
MyPaintSurface

Member Typedef Documentation

◆ MyPaintSurfaceDrawDabFunction2

typedef int(* MyPaintSurfaceDrawDabFunction2) (MyPaintSurface2 *self, float x, float y, float radius, float color_r, float color_g, float color_b, float opaque, float hardness, float alpha_eraser, float aspect_ratio, float angle, float lock_alpha, float colorize, float posterize, float posterize_num, float paint)

Like #MyPaintSurfaceDrawDabFunction, but supporting posterization and spectral mixing.

Parameters
posterizePosterization factor
posterize_numNumber of posterization levels
paintSpectral mixing factor
See also
MyPaintSurfaceDrawDabFunction

◆ MyPaintSurfaceEndAtomicFunction2

typedef void(* MyPaintSurfaceEndAtomicFunction2) (MyPaintSurface2 *self, MyPaintRectangles *roi)

Like #MyPaintSurfaceEndAtomicFunction, but with support for multiple invalidation rectangles.

See also
MyPaintSurfaceEndAtomicFunction

◆ MyPaintSurfaceGetColorFunction2

typedef void(* MyPaintSurfaceGetColorFunction2) (MyPaintSurface2 *self, float x, float y, float radius, float *color_r, float *color_g, float *color_b, float *color_a, float paint)

Like MyPaintSurfaceGetColorFunction, but for spectral colors.

Parameters
paintSpectral mixing factor. To what extent spectral weighting will be used in place of straight averaging. Input value range: [0.0, 1.0]
See also
MyPaintSurfaceGetColorFunction

Member Function Documentation

◆ mypaint_surface2_draw_dab()

int mypaint_surface2_draw_dab ( MyPaintSurface2 * self,
float x,
float y,
float radius,
float color_r,
float color_g,
float color_b,
float opaque,
float hardness,
float alpha_eraser,
float aspect_ratio,
float angle,
float lock_alpha,
float colorize,
float posterize,
float posterize_num,
float paint )

Call the surface's draw_dab_pigment function.

See MyPaintSurfaceDrawDabFunction2 for details.

◆ mypaint_surface2_end_atomic()

void mypaint_surface2_end_atomic ( MyPaintSurface2 * self,
MyPaintRectangles * roi )

Call the surface's end_atomic_multi function.

See MyPaintSurfaceEndAtomicFunction2 for details.

◆ mypaint_surface2_get_color()

void mypaint_surface2_get_color ( MyPaintSurface2 * self,
float x,
float y,
float radius,
float * color_r,
float * color_g,
float * color_b,
float * color_a,
float paint )

Call the surface's get_color_pigment function.

See MyPaintSurfaceGetColorFunction2 for details.

◆ mypaint_surface2_to_surface()

MyPaintSurface * mypaint_surface2_to_surface ( MyPaintSurface2 * self)

Safely access the parent MyPaintSurface interface.

Field Documentation

◆ draw_dab_pigment

MyPaintSurfaceDrawDabFunction2 MyPaintSurface2::draw_dab_pigment

◆ end_atomic_multi

◆ get_color_pigment

MyPaintSurfaceGetColorFunction2 MyPaintSurface2::get_color_pigment

◆ parent

MyPaintSurface MyPaintSurface2::parent

Parent interface.


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