Krita Source Code Documentation
Loading...
Searching...
No Matches
MyPaintSurface.cpp File Reference
#include "MyPaintSurface.h"
#include <KoColorConversions.h>
#include <KoColorSpace.h>
#include <KoColorSpaceMaths.h>
#include <QtMath>
#include <kis_algebra_2d.h>
#include <kis_cross_device_color_sampler.h>
#include <kis_image.h>
#include <kis_node.h>
#include <kis_sequential_iterator.h>
#include <kis_selection.h>
#include <qmath.h>
#include <KoCompositeOpRegistry.h>
#include <KoMixColorsOp.h>

Go to the source code of this file.

Functions

static float calculate_r_sample (float x, float y, float aspect_ratio, float sn, float cs)
 
static void closest_point_to_line (float lx, float ly, float px, float py, float *ox, float *oy)
 
void destroy_internal_surface_callback (MyPaintSurface *surface)
 
static float sign_point_in_line (float px, float py, float vx, float vy)
 

Function Documentation

◆ calculate_r_sample()

static float calculate_r_sample ( float x,
float y,
float aspect_ratio,
float sn,
float cs )
inlinestatic

Definition at line 428 of file MyPaintSurface.cpp.

428 {
429
430 const float yyr=(y*cs-x*sn)*aspect_ratio;
431 const float xxr=y*sn+x*cs;
432 const float r = (yyr*yyr + xxr*xxr);
433 return r;
434}

◆ closest_point_to_line()

static void closest_point_to_line ( float lx,
float ly,
float px,
float py,
float * ox,
float * oy )
inlinestatic

Definition at line 443 of file MyPaintSurface.cpp.

443 {
444
445 const float l2 = lx*lx + ly*ly;
446 const float ltp_dot = px*lx + py*ly;
447 const float t = ltp_dot / l2;
448 *ox = lx * t;
449 *oy = ly * t;
450}

◆ destroy_internal_surface_callback()

void destroy_internal_surface_callback ( MyPaintSurface * surface)

◆ sign_point_in_line()

static float sign_point_in_line ( float px,
float py,
float vx,
float vy )
inlinestatic

Definition at line 437 of file MyPaintSurface.cpp.

437 {
438
439 return (px - vx) * (-vy) - (vx) * (py - vy);
440}