Welcome to libmypaint’s documentation!

Contents:

libmypaint API reference

struct MyPaintBrushInputInfo
#include <mypaint-brush-settings.h>
Public Members
const gchar * cname
float hard_min
float soft_min
float normal
float soft_max
float hard_max
const gchar * name
const gchar * tooltip
struct MyPaintBrushSettingInfo
#include <mypaint-brush-settings.h>
Public Members
const gchar * cname
const gchar * name
gboolean constant
float min
float def
float max
const gchar * tooltip
struct MyPaintRectangle
#include <mypaint-rectangle.h>
Public Members
int x
int y
int width
int height
struct MyPaintRectangles
#include <mypaint-rectangle.h>
Public Members
int num_rectangles
MyPaintRectangle * rectangles
struct MyPaintSurface
#include <mypaint-surface.h>

MyPaintSurface:

Abstract surface type for the MyPaint brush engine. The surface interface lets the brush engine specify dabs to render, and to pick color.

Public Members
MyPaintSurfaceDrawDabFunction draw_dab
MyPaintSurfaceGetColorFunction get_color
MyPaintSurfaceBeginAtomicFunction begin_atomic
MyPaintSurfaceEndAtomicFunction end_atomic
MyPaintSurfaceDestroyFunction destroy
MyPaintSurfaceSavePngFunction save_png
int refcount
struct MyPaintSurface2
#include <mypaint-surface.h>

MyPaintSurface2: (skip)

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.

Public Members
MyPaintSurface parent
MyPaintSurfaceDrawDabFunction2 draw_dab_pigment
MyPaintSurfaceGetColorFunction2 get_color_pigment
MyPaintSurfaceEndAtomicFunction2 end_atomic_multi
struct MyPaintSymmetryData
#include <mypaint-symmetry.h>

MyPaintSymmetryData: Contains data used for symmetry calculations

Instances contain a current and pending symmetry basis, and the matrices used for the actual symmetry transforms. When the pending state is modified, the “pending_changes” flag should be set. Matrix recalculation should not be performed during draw operations.

Public Members
MyPaintSymmetryState state_current
MyPaintSymmetryState state_pending
gboolean pending_changes
gboolean active
int num_symmetry_matrices
MyPaintTransform * symmetry_matrices
struct MyPaintSymmetryState
#include <mypaint-symmetry.h>

MyPaintSymmetryState: Contains the basis for symmetry calculations

This is used to calculate the matrices that are used for the actual symmetry calculations, and to determine whether the matrices need to be recalculated.

Public Members
MyPaintSymmetryType type
float center_x
float center_y
float angle
float num_lines
struct MyPaintTiledSurface
#include <mypaint-tiled-surface.h>

MyPaintTiledSurface:

Interface and convenience class for implementing a MyPaintSurface backed by a tile store.

The size of the surface is infinite, and consumers need just implement two vfuncs.

Public Members
MyPaintSurface parent
MyPaintTileRequestStartFunction tile_request_start
MyPaintTileRequestEndFunction tile_request_end
gboolean surface_do_symmetry
float surface_center_x
struct OperationQueue * operation_queue
MyPaintRectangle dirty_bbox
gboolean threadsafe_tile_requests
int tile_size
struct MyPaintTiledSurface2
#include <mypaint-tiled-surface.h>

MyPaintTiledSurface2: (skip)

Tiled surface supporting the MyPaintSurface2 interface.

Public Members
MyPaintSurface2 parent
MyPaintTileRequestStartFunction2 tile_request_start
MyPaintTileRequestEndFunction2 tile_request_end
struct OperationQueue * operation_queue
gboolean threadsafe_tile_requests
int tile_size
MyPaintSymmetryData symmetry_data
int num_bboxes
int num_bboxes_dirtied
MyPaintRectangle * bboxes
struct MyPaintTileRequest
#include <mypaint-tiled-surface.h>
Public Members
int tx
int ty
gboolean readonly
guint16 * buffer
gpointer context
int thread_id
int mipmap_level
struct MyPaintTransform
#include <mypaint-matrix.h>
Public Members
float rows[3][3]
file mypaint-benchmark.h
Functions
void mypaint_benchmark_start(const char * name)
int mypaint_benchmark_end(void)
file mypaint-brush-settings-gen.h
Enums
MyPaintBrushInput enum

Values:

  • MYPAINT_BRUSH_INPUT_PRESSURE -
  • MYPAINT_BRUSH_INPUT_SPEED1 -
  • MYPAINT_BRUSH_INPUT_SPEED2 -
  • MYPAINT_BRUSH_INPUT_RANDOM -
  • MYPAINT_BRUSH_INPUT_STROKE -
  • MYPAINT_BRUSH_INPUT_DIRECTION -
  • MYPAINT_BRUSH_INPUT_TILT_DECLINATION -
  • MYPAINT_BRUSH_INPUT_TILT_ASCENSION -
  • MYPAINT_BRUSH_INPUT_CUSTOM -
  • MYPAINT_BRUSH_INPUT_DIRECTION_ANGLE -
  • MYPAINT_BRUSH_INPUT_ATTACK_ANGLE -
  • MYPAINT_BRUSH_INPUT_TILT_DECLINATIONX -
  • MYPAINT_BRUSH_INPUT_TILT_DECLINATIONY -
  • MYPAINT_BRUSH_INPUT_GRIDMAP_X -
  • MYPAINT_BRUSH_INPUT_GRIDMAP_Y -
  • MYPAINT_BRUSH_INPUT_VIEWZOOM -
  • MYPAINT_BRUSH_INPUT_BARREL_ROTATION -
  • MYPAINT_BRUSH_INPUT_BRUSH_RADIUS -
  • MYPAINT_BRUSH_INPUTS_COUNT -
MyPaintBrushSetting enum

Values:

  • MYPAINT_BRUSH_SETTING_OPAQUE -
  • MYPAINT_BRUSH_SETTING_OPAQUE_MULTIPLY -
  • MYPAINT_BRUSH_SETTING_OPAQUE_LINEARIZE -
  • MYPAINT_BRUSH_SETTING_RADIUS_LOGARITHMIC -
  • MYPAINT_BRUSH_SETTING_HARDNESS -
  • MYPAINT_BRUSH_SETTING_ANTI_ALIASING -
  • MYPAINT_BRUSH_SETTING_DABS_PER_BASIC_RADIUS -
  • MYPAINT_BRUSH_SETTING_DABS_PER_ACTUAL_RADIUS -
  • MYPAINT_BRUSH_SETTING_DABS_PER_SECOND -
  • MYPAINT_BRUSH_SETTING_RADIUS_BY_RANDOM -
  • MYPAINT_BRUSH_SETTING_SPEED1_SLOWNESS -
  • MYPAINT_BRUSH_SETTING_SPEED2_SLOWNESS -
  • MYPAINT_BRUSH_SETTING_SPEED1_GAMMA -
  • MYPAINT_BRUSH_SETTING_SPEED2_GAMMA -
  • MYPAINT_BRUSH_SETTING_OFFSET_BY_RANDOM -
  • MYPAINT_BRUSH_SETTING_OFFSET_BY_SPEED -
  • MYPAINT_BRUSH_SETTING_OFFSET_BY_SPEED_SLOWNESS -
  • MYPAINT_BRUSH_SETTING_SLOW_TRACKING -
  • MYPAINT_BRUSH_SETTING_SLOW_TRACKING_PER_DAB -
  • MYPAINT_BRUSH_SETTING_TRACKING_NOISE -
  • MYPAINT_BRUSH_SETTING_COLOR_H -
  • MYPAINT_BRUSH_SETTING_COLOR_S -
  • MYPAINT_BRUSH_SETTING_COLOR_V -
  • MYPAINT_BRUSH_SETTING_RESTORE_COLOR -
  • MYPAINT_BRUSH_SETTING_CHANGE_COLOR_H -
  • MYPAINT_BRUSH_SETTING_CHANGE_COLOR_L -
  • MYPAINT_BRUSH_SETTING_CHANGE_COLOR_HSL_S -
  • MYPAINT_BRUSH_SETTING_CHANGE_COLOR_V -
  • MYPAINT_BRUSH_SETTING_CHANGE_COLOR_HSV_S -
  • MYPAINT_BRUSH_SETTING_SMUDGE -
  • MYPAINT_BRUSH_SETTING_SMUDGE_LENGTH -
  • MYPAINT_BRUSH_SETTING_SMUDGE_RADIUS_LOG -
  • MYPAINT_BRUSH_SETTING_ERASER -
  • MYPAINT_BRUSH_SETTING_STROKE_THRESHOLD -
  • MYPAINT_BRUSH_SETTING_STROKE_DURATION_LOGARITHMIC -
  • MYPAINT_BRUSH_SETTING_STROKE_HOLDTIME -
  • MYPAINT_BRUSH_SETTING_CUSTOM_INPUT -
  • MYPAINT_BRUSH_SETTING_CUSTOM_INPUT_SLOWNESS -
  • MYPAINT_BRUSH_SETTING_ELLIPTICAL_DAB_RATIO -
  • MYPAINT_BRUSH_SETTING_ELLIPTICAL_DAB_ANGLE -
  • MYPAINT_BRUSH_SETTING_DIRECTION_FILTER -
  • MYPAINT_BRUSH_SETTING_LOCK_ALPHA -
  • MYPAINT_BRUSH_SETTING_COLORIZE -
  • MYPAINT_BRUSH_SETTING_SNAP_TO_PIXEL -
  • MYPAINT_BRUSH_SETTING_PRESSURE_GAIN_LOG -
  • MYPAINT_BRUSH_SETTING_GRIDMAP_SCALE -
  • MYPAINT_BRUSH_SETTING_GRIDMAP_SCALE_X -
  • MYPAINT_BRUSH_SETTING_GRIDMAP_SCALE_Y -
  • MYPAINT_BRUSH_SETTING_SMUDGE_LENGTH_LOG -
  • MYPAINT_BRUSH_SETTING_SMUDGE_BUCKET -
  • MYPAINT_BRUSH_SETTING_SMUDGE_TRANSPARENCY -
  • MYPAINT_BRUSH_SETTING_OFFSET_Y -
  • MYPAINT_BRUSH_SETTING_OFFSET_X -
  • MYPAINT_BRUSH_SETTING_OFFSET_ANGLE -
  • MYPAINT_BRUSH_SETTING_OFFSET_ANGLE_ASC -
  • MYPAINT_BRUSH_SETTING_OFFSET_ANGLE_VIEW -
  • MYPAINT_BRUSH_SETTING_OFFSET_ANGLE_2 -
  • MYPAINT_BRUSH_SETTING_OFFSET_ANGLE_2_ASC -
  • MYPAINT_BRUSH_SETTING_OFFSET_ANGLE_2_VIEW -
  • MYPAINT_BRUSH_SETTING_OFFSET_ANGLE_ADJ -
  • MYPAINT_BRUSH_SETTING_OFFSET_MULTIPLIER -
  • MYPAINT_BRUSH_SETTING_POSTERIZE -
  • MYPAINT_BRUSH_SETTING_POSTERIZE_NUM -
  • MYPAINT_BRUSH_SETTING_PAINT_MODE -
  • MYPAINT_BRUSH_SETTINGS_COUNT -
MyPaintBrushState enum

Values:

  • MYPAINT_BRUSH_STATE_X -
  • MYPAINT_BRUSH_STATE_Y -
  • MYPAINT_BRUSH_STATE_PRESSURE -
  • MYPAINT_BRUSH_STATE_PARTIAL_DABS -
  • MYPAINT_BRUSH_STATE_ACTUAL_RADIUS -
  • MYPAINT_BRUSH_STATE_SMUDGE_RA -
  • MYPAINT_BRUSH_STATE_SMUDGE_GA -
  • MYPAINT_BRUSH_STATE_SMUDGE_BA -
  • MYPAINT_BRUSH_STATE_SMUDGE_A -
  • MYPAINT_BRUSH_STATE_LAST_GETCOLOR_R -
  • MYPAINT_BRUSH_STATE_LAST_GETCOLOR_G -
  • MYPAINT_BRUSH_STATE_LAST_GETCOLOR_B -
  • MYPAINT_BRUSH_STATE_LAST_GETCOLOR_A -
  • MYPAINT_BRUSH_STATE_LAST_GETCOLOR_RECENTNESS -
  • MYPAINT_BRUSH_STATE_ACTUAL_X -
  • MYPAINT_BRUSH_STATE_ACTUAL_Y -
  • MYPAINT_BRUSH_STATE_NORM_DX_SLOW -
  • MYPAINT_BRUSH_STATE_NORM_DY_SLOW -
  • MYPAINT_BRUSH_STATE_NORM_SPEED1_SLOW -
  • MYPAINT_BRUSH_STATE_NORM_SPEED2_SLOW -
  • MYPAINT_BRUSH_STATE_STROKE -
  • MYPAINT_BRUSH_STATE_STROKE_STARTED -
  • MYPAINT_BRUSH_STATE_CUSTOM_INPUT -
  • MYPAINT_BRUSH_STATE_RNG_SEED -
  • MYPAINT_BRUSH_STATE_ACTUAL_ELLIPTICAL_DAB_RATIO -
  • MYPAINT_BRUSH_STATE_ACTUAL_ELLIPTICAL_DAB_ANGLE -
  • MYPAINT_BRUSH_STATE_DIRECTION_DX -
  • MYPAINT_BRUSH_STATE_DIRECTION_DY -
  • MYPAINT_BRUSH_STATE_DECLINATION -
  • MYPAINT_BRUSH_STATE_ASCENSION -
  • MYPAINT_BRUSH_STATE_VIEWZOOM -
  • MYPAINT_BRUSH_STATE_VIEWROTATION -
  • MYPAINT_BRUSH_STATE_DIRECTION_ANGLE_DX -
  • MYPAINT_BRUSH_STATE_DIRECTION_ANGLE_DY -
  • MYPAINT_BRUSH_STATE_ATTACK_ANGLE -
  • MYPAINT_BRUSH_STATE_FLIP -
  • MYPAINT_BRUSH_STATE_GRIDMAP_X -
  • MYPAINT_BRUSH_STATE_GRIDMAP_Y -
  • MYPAINT_BRUSH_STATE_DECLINATIONX -
  • MYPAINT_BRUSH_STATE_DECLINATIONY -
  • MYPAINT_BRUSH_STATE_DABS_PER_BASIC_RADIUS -
  • MYPAINT_BRUSH_STATE_DABS_PER_ACTUAL_RADIUS -
  • MYPAINT_BRUSH_STATE_DABS_PER_SECOND -
  • MYPAINT_BRUSH_STATE_BARREL_ROTATION -
  • MYPAINT_BRUSH_STATES_COUNT -
file mypaint-brush-settings.h
#include “mypaint-config.h”#include “mypaint-glib-compat.h”#include “mypaint-brush-settings-gen.h”
Functions
const MyPaintBrushSettingInfo * mypaint_brush_setting_info(MyPaintBrushSetting id)
const gchar * mypaint_brush_setting_info_get_name(const MyPaintBrushSettingInfo * self)
const gchar * mypaint_brush_setting_info_get_tooltip(const MyPaintBrushSettingInfo * self)
MyPaintBrushSetting mypaint_brush_setting_from_cname(const char * cname)
const MyPaintBrushInputInfo * mypaint_brush_input_info(MyPaintBrushInput id)
const gchar * mypaint_brush_input_info_get_name(const MyPaintBrushInputInfo * self)
const gchar * mypaint_brush_input_info_get_tooltip(const MyPaintBrushInputInfo * self)
MyPaintBrushInput mypaint_brush_input_from_cname(const char * cname)
file glib/mypaint-brush.h
#include <glib-object.h>
Defines
MYPAINT_TYPE_BRUSH
MYPAINT_VALUE_HOLDS_BRUSH(value)
MYPAINT_TYPE_SURFACE
MYPAINT_VALUE_HOLDS_SURFACE(value)
MYPAINT_TYPE_FIXED_TILED_SURFACE
MYPAINT_VALUE_HOLDS_FIXED_TILED_SURFACE(value)
MYPAINT_TYPE_RECTANGLE
MYPAINT_VALUE_HOLDS_RECTANGLE(value)
Functions
GType mypaint_brush_get_type(void)
GType mypaint_surface_get_type(void)
GType mypaint_fixed_tiled_surface_get_type(void)
GType mypaint_rectangle_get_type(void)
file mypaint-brush.h
#include “mypaint-config.h”#include “mypaint-surface.h”#include “mypaint-brush-settings.h”
Typedefs
typedef typedefG_BEGIN_DECLS struct MyPaintBrush MyPaintBrush
Functions
MyPaintBrush * mypaint_brush_new(void)
MyPaintBrush * mypaint_brush_new_with_buckets(int num_smudge_buckets)
void mypaint_brush_unref(MyPaintBrush * self)
void mypaint_brush_ref(MyPaintBrush * self)
void mypaint_brush_reset(MyPaintBrush * self)
void mypaint_brush_new_stroke(MyPaintBrush * self)
int mypaint_brush_stroke_to(MyPaintBrush * self, MyPaintSurface * surface, float x, float y, float pressure, float xtilt, float ytilt, double dtime)
int mypaint_brush_stroke_to_2(MyPaintBrush * self, MyPaintSurface2 * surface, float x, float y, float pressure, float xtilt, float ytilt, double dtime, float viewzoom, float viewrotation, float barrel_rotation)
void mypaint_brush_set_base_value(MyPaintBrush * self, MyPaintBrushSetting id, float value)
float mypaint_brush_get_base_value(MyPaintBrush * self, MyPaintBrushSetting id)
gboolean mypaint_brush_is_constant(MyPaintBrush * self, MyPaintBrushSetting id)
int mypaint_brush_get_inputs_used_n(MyPaintBrush * self, MyPaintBrushSetting id)
void mypaint_brush_set_mapping_n(MyPaintBrush * self, MyPaintBrushSetting id, MyPaintBrushInput input, int n)
int mypaint_brush_get_mapping_n(MyPaintBrush * self, MyPaintBrushSetting id, MyPaintBrushInput input)
void mypaint_brush_set_mapping_point(MyPaintBrush * self, MyPaintBrushSetting id, MyPaintBrushInput input, int index, float x, float y)
void mypaint_brush_get_mapping_point(MyPaintBrush * self, MyPaintBrushSetting id, MyPaintBrushInput input, int index, float * x, float * y)
float mypaint_brush_get_state(MyPaintBrush * self, MyPaintBrushState i)
void mypaint_brush_set_state(MyPaintBrush * self, MyPaintBrushState i, float value)
double mypaint_brush_get_total_stroke_painting_time(MyPaintBrush * self)
void mypaint_brush_set_print_inputs(MyPaintBrush * self, gboolean enabled)
void mypaint_brush_from_defaults(MyPaintBrush * self)
gboolean mypaint_brush_from_string(MyPaintBrush * self, const char * string)
file mypaint-config.h
Defines
MYPAINT_TILE_SIZE
MYPAINT_MAX_THREADS
MYPAINT_MAX_MIPMAP_LEVEL
file mypaint-fixed-tiled-surface.h
#include “mypaint-config.h”#include “mypaint-glib-compat.h”#include “mypaint-tiled-surface.h”
Typedefs
typedef typedefG_BEGIN_DECLS struct MyPaintFixedTiledSurface MyPaintFixedTiledSurface

MyPaintFixedTiledSurface:

Simple MyPaintTiledSurface subclass that implements a fixed sized MyPaintSurface. Only intended for testing and trivial use-cases, and to serve as an example of how to implement a tiled surface subclass.

Functions
MyPaintFixedTiledSurface * mypaint_fixed_tiled_surface_new(int width, int height)
int mypaint_fixed_tiled_surface_get_width(MyPaintFixedTiledSurface * self)
int mypaint_fixed_tiled_surface_get_height(MyPaintFixedTiledSurface * self)
MyPaintSurface * mypaint_fixed_tiled_surface_interface(MyPaintFixedTiledSurface * self)
file mypaint-gegl-glib.h
#include “mypaint-config.h”#include <glib-object.h>
Defines
MYPAINT_GEGL_TYPE_TILED_SURFACE
MYPAINT_GEGL_VALUE_HOLDS_TILED_SURFACE(value)
Functions
GType mypaint_gegl_tiled_surface_get_type(void)
file mypaint-gegl-surface.h
#include <gegl.h>#include “mypaint-config.h”#include “glib/mypaint-gegl-glib.h”#include “mypaint-tiled-surface.h”
Typedefs
typedef typedefG_BEGIN_DECLS struct MyPaintGeglTiledSurface MyPaintGeglTiledSurface
Functions
GeglBuffer * mypaint_gegl_tiled_surface_get_buffer(MyPaintGeglTiledSurface * self)
void mypaint_gegl_tiled_surface_set_buffer(MyPaintGeglTiledSurface * self, GeglBuffer * buffer)
MyPaintSurface * mypaint_gegl_tiled_surface_interface(MyPaintGeglTiledSurface * self)
MyPaintGeglTiledSurface * mypaint_gegl_tiled_surface_new(void)
file mypaint-glib-compat.h
#include “mypaint-config.h”
Defines
G_BEGIN_DECLS
G_END_DECLS
FALSE
TRUE
Typedefs
typedef void * gpointer
typedef char gchar
typedef int gint
typedef gint gboolean
typedef unsigned short guint16
file mypaint-mapping.h
#include “mypaint-config.h”#include “mypaint-glib-compat.h”
Typedefs
typedef typedefG_BEGIN_DECLS struct MyPaintMapping MyPaintMapping
Functions
MyPaintMapping * mypaint_mapping_new(int inputs_)
void mypaint_mapping_free(MyPaintMapping * self)
float mypaint_mapping_get_base_value(MyPaintMapping * self)
void mypaint_mapping_set_base_value(MyPaintMapping * self, float value)
void mypaint_mapping_set_n(MyPaintMapping * self, int input, int n)
int mypaint_mapping_get_n(MyPaintMapping * self, int input)
void mypaint_mapping_set_point(MyPaintMapping * self, int input, int index, float x, float y)
void mypaint_mapping_get_point(MyPaintMapping * self, int input, int index, float * x, float * y)
gboolean mypaint_mapping_is_constant(MyPaintMapping * self)
int mypaint_mapping_get_inputs_used_n(MyPaintMapping * self)
float mypaint_mapping_calculate(MyPaintMapping * self, float * data)
float mypaint_mapping_calculate_single_input(MyPaintMapping * self, float input)
file mypaint-matrix.h
Functions
MyPaintTransform mypaint_transform_unit()
MyPaintTransform mypaint_transform_rotate_cw(const MyPaintTransform transform, const float angle_radians)
MyPaintTransform mypaint_transform_rotate_ccw(const MyPaintTransform transform, const float angle_radians)
MyPaintTransform mypaint_transform_reflect(const MyPaintTransform transform, const float angle_radians)
MyPaintTransform mypaint_transform_translate(const MyPaintTransform transform, const float x, const float y)
void mypaint_transform_point(const MyPaintTransform *const t, float x, float y, float * x_out, float * y_out)
file mypaint-rectangle.h
#include “mypaint-config.h”#include “mypaint-glib-compat.h”
Functions
void mypaint_rectangle_expand_to_include_point(MyPaintRectangle * r, int x, int y)
void mypaint_rectangle_expand_to_include_rect(MyPaintRectangle * r, MyPaintRectangle * other)
MyPaintRectangle * mypaint_rectangle_copy(MyPaintRectangle * self)
file mypaint-surface.h
#include “mypaint-config.h”#include “mypaint-rectangle.h”
Typedefs
typedef typedefG_BEGIN_DECLS struct MyPaintSurface MyPaintSurface
typedef void(* MyPaintSurfaceGetColorFunction)(MyPaintSurface *self, float x, float y, float radius, float *color_r, float *color_g, float *color_b, float *color_a)
typedef int(* MyPaintSurfaceDrawDabFunction)(MyPaintSurface *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)
typedef void(* MyPaintSurfaceDestroyFunction)(MyPaintSurface *self)
typedef void(* MyPaintSurfaceSavePngFunction)(MyPaintSurface *self, const char *path, int x, int y, int width, int height)
typedef void(* MyPaintSurfaceBeginAtomicFunction)(MyPaintSurface *self)
typedef void(* MyPaintSurfaceEndAtomicFunction)(MyPaintSurface *self, MyPaintRectangle *roi)
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)
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)
typedef void(* MyPaintSurfaceEndAtomicFunction2)(MyPaintSurface2 *self, MyPaintRectangles *roi)
Functions
int mypaint_surface_draw_dab(MyPaintSurface * 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)

mypaint_surface_draw_dab:

Draw a dab onto the surface.

void mypaint_surface_get_color(MyPaintSurface * self, float x, float y, float radius, float * color_r, float * color_g, float * color_b, float * color_a)
float mypaint_surface_get_alpha(MyPaintSurface * self, float x, float y, float radius)
void mypaint_surface_save_png(MyPaintSurface * self, const char * path, int x, int y, int width, int height)
void mypaint_surface_begin_atomic(MyPaintSurface * self)
void mypaint_surface_end_atomic(MyPaintSurface * self, MyPaintRectangle * roi)
void mypaint_surface_init(MyPaintSurface * self)
void mypaint_surface_ref(MyPaintSurface * self)
void mypaint_surface_unref(MyPaintSurface * self)
MyPaintSurface * mypaint_surface2_to_surface(MyPaintSurface2 * self)
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)
void mypaint_surface2_end_atomic(MyPaintSurface2 * self, MyPaintRectangles * roi)
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)

mypaint_surface_draw_dab_2:

Draw a dab onto the surface, with support for posterize/pigment

file mypaint-symmetry.h
#include “mypaint-matrix.h”#include “mypaint-glib-compat.h”
Enums
MyPaintSymmetryType enum

MyPaintSymmetryType: Enumeration of different kinds of symmetry

Prefix = ‘MYPAINT_SYMMETRY_TYPE_’ VERTICAL: reflection across the y-axis HORIZONTAL: reflection across the x-axis VERTHORZ: reflection across x-axis and y-axis, special case of SNOWFLAKE ROTATIONAL: rotational symmetry by N symmetry lines around a point SNOWFLAKE: rotational symmetry w. reflection across the N symmetry lines

Values:

  • MYPAINT_SYMMETRY_TYPE_VERTICAL -
  • MYPAINT_SYMMETRY_TYPE_HORIZONTAL -
  • MYPAINT_SYMMETRY_TYPE_VERTHORZ -
  • MYPAINT_SYMMETRY_TYPE_ROTATIONAL -
  • MYPAINT_SYMMETRY_TYPE_SNOWFLAKE -
  • MYPAINT_SYMMETRY_TYPES_COUNT -
Functions
void mypaint_update_symmetry_state(MyPaintSymmetryData *const symmetry_data)
MyPaintSymmetryData mypaint_default_symmetry_data()
void mypaint_symmetry_data_destroy(MyPaintSymmetryData *)
void mypaint_symmetry_set_pending(MyPaintSymmetryData * data, gboolean active, float center_x, float center_y, float symmetry_angle, MyPaintSymmetryType symmetry_type, int rot_symmetry_lines)
file mypaint-test-surface.h
#include “mypaint-surface.h”#include “mypaint-glib-compat.h”
Functions
int mypaint_test_surface_run(int argc, char ** argv, MyPaintTestsSurfaceFactory surface_factory, gchar * title, gpointer user_data)
Variables
G_BEGIN_DECLS typedef MyPaintSurface *(* MyPaintTestsSurfaceFactory)(gpointer user_data)
file mypaint-tiled-surface.h
#include <stdint.h>#include “mypaint-surface.h”#include “mypaint-symmetry.h”#include “mypaint-config.h”
Typedefs
typedef typedefG_BEGIN_DECLS struct MyPaintTiledSurface MyPaintTiledSurface
typedef void(* MyPaintTileRequestStartFunction)(MyPaintTiledSurface *self, MyPaintTileRequest *request)
typedef void(* MyPaintTileRequestEndFunction)(MyPaintTiledSurface *self, MyPaintTileRequest *request)
typedef void(* MyPaintTileRequestStartFunction2)(MyPaintTiledSurface2 *self, MyPaintTileRequest *request)
typedef void(* MyPaintTileRequestEndFunction2)(MyPaintTiledSurface2 *self, MyPaintTileRequest *request)
Functions
void mypaint_tile_request_init(MyPaintTileRequest * data, int level, int tx, int ty, gboolean readonly)
void mypaint_tiled_surface_init(MyPaintTiledSurface * self, MyPaintTileRequestStartFunction tile_request_start, MyPaintTileRequestEndFunction tile_request_end)
void mypaint_tiled_surface_destroy(MyPaintTiledSurface * self)
void mypaint_tiled_surface_set_symmetry_state(MyPaintTiledSurface * self, gboolean active, float center_x)
float mypaint_tiled_surface_get_alpha(MyPaintTiledSurface * self, float x, float y, float radius)
void mypaint_tiled_surface_tile_request_start(MyPaintTiledSurface * self, MyPaintTileRequest * request)
void mypaint_tiled_surface_tile_request_end(MyPaintTiledSurface * self, MyPaintTileRequest * request)
void mypaint_tiled_surface_begin_atomic(MyPaintTiledSurface * self)
void mypaint_tiled_surface_end_atomic(MyPaintTiledSurface * self, MyPaintRectangle * roi)
void mypaint_tiled_surface2_init(MyPaintTiledSurface2 * self, MyPaintTileRequestStartFunction2 tile_request_start, MyPaintTileRequestEndFunction2 tile_request_end)
void mypaint_tiled_surface2_begin_atomic(MyPaintTiledSurface2 * self)
void mypaint_tiled_surface2_end_atomic(MyPaintTiledSurface2 * self, MyPaintRectangles * roi)
void mypaint_tiled_surface2_tile_request_start(MyPaintTiledSurface2 * self, MyPaintTileRequest * request)
void mypaint_tiled_surface2_tile_request_end(MyPaintTiledSurface2 * self, MyPaintTileRequest * request)
void mypaint_tiled_surface2_destroy(MyPaintTiledSurface2 * self)
void mypaint_tiled_surface2_set_symmetry_state(MyPaintTiledSurface2 * self, gboolean active, float center_x, float center_y, float symmetry_angle, MyPaintSymmetryType symmetry_type, int rot_symmetry_lines)
file mypaint-utils-stroke-player.h
#include “mypaint-brush.h”#include “mypaint-surface.h”
Typedefs
typedef struct MyPaintUtilsStrokePlayer MyPaintUtilsStrokePlayer
Functions
MyPaintUtilsStrokePlayer * mypaint_utils_stroke_player_new(void)
void mypaint_utils_stroke_player_free(MyPaintUtilsStrokePlayer * self)
void mypaint_utils_stroke_player_set_brush(MyPaintUtilsStrokePlayer * self, MyPaintBrush * brush)
void mypaint_utils_stroke_player_set_surface(MyPaintUtilsStrokePlayer * self, MyPaintSurface * surface)
void mypaint_utils_stroke_player_set_source_data(MyPaintUtilsStrokePlayer * self, const char * data)
gboolean mypaint_utils_stroke_player_iterate(MyPaintUtilsStrokePlayer * self)
void mypaint_utils_stroke_player_reset(MyPaintUtilsStrokePlayer * self)
void mypaint_utils_stroke_player_run_sync(MyPaintUtilsStrokePlayer * self)
void mypaint_utils_stroke_player_set_transactions_on_stroke_to(MyPaintUtilsStrokePlayer * self, gboolean value)
void mypaint_utils_stroke_player_set_scale(MyPaintUtilsStrokePlayer * self, float scale)
dir gegl
dir glib
dir tests

Indices and tables

Table Of Contents

This Page