LMMS
Loading...
Searching...
No Matches
lice_line.cpp File Reference
#include "lice.h"
#include "lice_combine.h"
#include "lice_extended.h"
#include <math.h>
#include <stdio.h>
#include "lice_bezier.h"

Classes

class  __LICE_LineClassSimple< COMBFUNC >
class  __LICE_LineClass< COMBFUNC >
class  _LICE_Fill< COMBFUNC >
class  _LICE_FillFast< COMBFUNC >

Macros

#define WDL_NO_DEFINE_MINMAX
#define IGNORE_SCALING(mode)
#define DO_AA_GAMMA_CORRECT   0
#define DOPIX(pout, r, g, b, a, ia)
#define __LICE__ACTION(COMBFUNC)
#define __LICE__ACTION(COMBFUNC)
#define __LICE__ACTION(COMBFUNC)
#define __LICE__ACTION(COMBFUNC)
#define __LICE__ACTION(COMBFUNC)
#define __LICE__ACTION(COMBFUNC)
#define __LICE__ACTION(COMBFUNC)
#define __LICE_SC_BEZ
#define DOPIX(pout, r, g, b, a, ia)
#define __LICE__ACTION(COMBFUNC)
#define _X(i)
#define _Y(i)
#define __LICE__ACTION(COMBFUNC)

Enumerations

enum  {
  eOK = 0 , eXLo = 1 , eXHi = 2 , eYLo = 4 ,
  eYHi = 8
}

Functions

template<class T>
void SWAP (T &a, T &b)
static int OffscreenTest (int x, int y, int nX, int nY)
static bool ClipLine (int *pX1, int *pY1, int *pX2, int *pY2, int nX, int nY)
template<class T>
static int OffscreenFTest (T x, T y, T w, T h)
template<class T>
static bool ClipFLine (T *x1, T *y1, T *x2, T *y2, int w, int h)
static void LICE_DiagLineFAST (LICE_pixel *px, int span, int n, int xstep, int ystep, LICE_pixel color, bool aa)
static void LICE_DottedVertLineFAST (LICE_IBitmap *dest, int x, int y1, int y2, LICE_pixel color)
static void GetAAPxWeight (int err, int alpha, int *wt, int *iwt)
static void GetAAPxWeightFAST (int err, int *wt, int *iwt)
void LICE_Line (LICE_IBitmap *dest, int x1, int y1, int x2, int y2, LICE_pixel color, float alpha, int mode, bool aa)
void LICE_FLine (LICE_IBitmap *dest, float x1, float y1, float x2, float y2, LICE_pixel color, float alpha, int mode, bool aa)
void LICE_DashedLine (LICE_IBitmap *dest, int x1, int y1, int x2, int y2, int pxon, int pxoff, LICE_pixel color, float alpha, int mode, bool aa)
bool LICE_ClipLine (int *pX1, int *pY1, int *pX2, int *pY2, int xLo, int yLo, int xHi, int yHi)
bool LICE_ClipFLine (float *px1, float *py1, float *px2, float *py2, float xlo, float ylo, float xhi, float yhi)
static void DoBezierFillSegment (LICE_IBitmap *dest, int x1, int y1, int x2, int y2, int yfill, LICE_pixel color, float alpha, int mode)
static void DoBezierFillSegmentX (LICE_IBitmap *dest, int x1, int y1, int x2, int y2, int xfill, LICE_pixel color, float alpha, int mode)
void LICE_DrawQBezier (LICE_IBitmap *dest, double xstart, double ystart, double xctl, double yctl, double xend, double yend, LICE_pixel color, float alpha, int mode, bool aa, double tol)
int LICE_CBezPrep (int dest_w, double xstart, double ystart, double xctl1, double yctl1, double xctl2, double yctl2, double xend, double yend, double tol, bool xbasis, double *ax, double *bx, double *cx, double *dx, double *ay, double *by, double *cy, double *dy, double *xlo, double *xhi, double *ylo, double *yhi, double *tlo, double *thi)
void LICE_DrawCBezier (LICE_IBitmap *dest, double xstart, double ystart, double xctl1, double yctl1, double xctl2, double yctl2, double xend, double yend, LICE_pixel color, float alpha, int mode, bool aa, double tol)
void LICE_DrawThickCBezier (LICE_IBitmap *dest, double xstart, double ystart, double xctl1, double yctl1, double xctl2, double yctl2, double xend, double yend, LICE_pixel color, float alpha, int mode, int wid, double tol)
void LICE_FillCBezier (LICE_IBitmap *dest, double xstart, double ystart, double xctl1, double yctl1, double xctl2, double yctl2, double xend, double yend, int yfill, LICE_pixel color, float alpha, int mode, double tol)
void LICE_FillCBezierX (LICE_IBitmap *dest, double xstart, double ystart, double xctl1, double yctl1, double xctl2, double yctl2, double xend, double yend, int xfill, LICE_pixel color, float alpha, int mode, double tol)
void LICE_DrawRect (LICE_IBitmap *dest, int x, int y, int w, int h, LICE_pixel color, float alpha, int mode)
void LICE_BorderedRect (LICE_IBitmap *dest, int x, int y, int w, int h, LICE_pixel bgcolor, LICE_pixel fgcolor, float alpha, int mode)
static double FindXOnSegment (int x1, int y1, int x2, int y2, int ty)
void LICE_FillTrapezoidF (LICE_IBitmap *dest, double fx1a, double fx1b, int y1, double fx2a, double fx2b, int y2, LICE_pixel color, float alpha, int mode)
void LICE_FillTrapezoid (LICE_IBitmap *dest, int x1a, int x1b, int y1, int x2a, int x2b, int y2, LICE_pixel color, float alpha, int mode)
static int _ysort (const void *a, const void *b)
static int FindNextEdgeVertex (int *xy, int a, int n, int dir)
void LICE_FillConvexPolygon (LICE_IBitmap *dest, const int *x, const int *y, int npoints, LICE_pixel color, float alpha, int mode)
void LICE_FillTriangle (LICE_IBitmap *dest, int x1, int y1, int x2, int y2, int x3, int y3, LICE_pixel color, float alpha, int mode)
void LICE_ThickFLine (LICE_IBitmap *dest, double x1, double y1, double x2, double y2, LICE_pixel color, float alpha, int mode, int wid)

Macro Definition Documentation

◆ __LICE__ACTION [1/9]

#define __LICE__ACTION ( COMBFUNC)
Value:
__LICE_LineClass<COMBFUNC>::LICE_FLineImplFill(px,n,err,derr,astep,bstep, color, aw, wid, b_pos, b_max)
static void LICE_FLineImplFill(LICE_pixel *px, int n, int err, int derr, int astep, int bstep, LICE_pixel color, int aw, int fill_sz, int b_pos, unsigned int b_max)
Definition lice_line.cpp:524
int n
Definition crypt.c:458

◆ __LICE__ACTION [2/9]

#define __LICE__ACTION ( COMBFUNC)
Value:
_LICE_Fill<COMBFUNC>::FillClippedTrapezoid(wid,span,px,y, x1a, x1b, dxady, dxbdy, a,b, astep,bstep, cr,cg,cb,ca, aw);
uint8_t a
Definition Spc_Cpu.h:141
static void FillClippedTrapezoid(int wid, int span, LICE_pixel *px, int y, int xa, int xb, int da, int db, int a, int b, int astep, int bstep, int cr, int cg, int cb, int ca, int aw)
Definition lice_line.cpp:1480
int y
Definition inflate.c:1588
b
Definition crypt.c:628

◆ __LICE__ACTION [3/9]

#define __LICE__ACTION ( COMBFUNC)
Value:
__LICE_LineClass<COMBFUNC>::DashedLine(dest, x1, y1, x2, y2, pxon, pxoff, color, aw);
static void DashedLine(LICE_IBitmap *dest, int x1, int y1, int x2, int y2, int pxon, int pxoff, LICE_pixel color, int aw)
Definition lice_line.cpp:343

◆ __LICE__ACTION [4/9]

#define __LICE__ACTION ( COMBFUNC)
Value:
__LICE_LineClass<COMBFUNC>::LICE_FLineImpl(px,n,err,derr,astep,bstep, color, aw)
static void LICE_FLineImpl(LICE_pixel *px, int n, int err, int derr, int astep, int bstep, LICE_pixel color, int aw)
Definition lice_line.cpp:475

◆ __LICE__ACTION [5/9]

#define __LICE__ACTION ( COMBFUNC)
Value:
__LICE_LineClass<COMBFUNC>::LICE_LineImpl(px,px2, derr, astep, da, bstep, color, aw, aa)
static void LICE_LineImpl(LICE_pixel *px, LICE_pixel *px2, int derr, int astep, int da, int bstep, LICE_pixel color, int aw, bool aa)
Definition lice_line.cpp:378

◆ __LICE__ACTION [6/9]

#define __LICE__ACTION ( COMBFUNC)
Value:
__LICE_LineClassSimple<COMBFUNC>::LICE_DiagLine(px,span, xdiff, xstep, ystep, color, aw)
static void LICE_DiagLine(LICE_pixel *px, int span, int n, int xstep, int ystep, LICE_pixel color, int aw)
Definition lice_line.cpp:297

◆ __LICE__ACTION [7/9]

#define __LICE__ACTION ( COMBFUNC)
Value:
__LICE_LineClassSimple<COMBFUNC>::LICE_DiagLineAA(px,span, xdiff, xstep, ystep, color, aw)
static void LICE_DiagLineAA(LICE_pixel *px, int span, int n, int xstep, int ystep, LICE_pixel color, int aw)
Definition lice_line.cpp:307

◆ __LICE__ACTION [8/9]

#define __LICE__ACTION ( COMBFUNC)
Value:
static void LICE_VertLine(LICE_pixel *px, int span, int len, int color, int aw)
Definition lice_line.cpp:277

◆ __LICE__ACTION [9/9]

#define __LICE__ACTION ( COMBFUNC)
Value:
static void LICE_HorizLine(LICE_pixel *px, int n, LICE_pixel color, int aw)
Definition lice_line.cpp:287

◆ __LICE_SC_BEZ

#define __LICE_SC_BEZ
Value:
__LICE_SC(destbm_w); \
if (!IGNORE_SCALING(mode)) { \
__LICE_SC(xstart); \
__LICE_SC(ystart); \
__LICE_SC(xctl1); \
__LICE_SC(yctl1); \
__LICE_SC(xctl2); \
__LICE_SC(yctl2); \
__LICE_SC(xend); \
__LICE_SC(yend); \
}
#define IGNORE_SCALING(mode)
Definition lice.cpp:26
#define __LICE_SC(x)
Definition lice_combine.h:823
png_structrp int mode
Definition png.h:1139

◆ _X

#define _X ( i)
Value:
xy[2*(i)]
register unsigned i
Definition inflate.c:1575

◆ _Y

#define _Y ( i)
Value:
xy[2*(i)+1]

◆ DO_AA_GAMMA_CORRECT

#define DO_AA_GAMMA_CORRECT   0

◆ DOPIX [1/2]

#define DOPIX ( pout,
r,
g,
b,
a,
ia )
Value:
COMBFUNC::doPix(pout,r,g,b,a,ia);
int g
Definition inflate.c:1573
int r
Definition crypt.c:458

◆ DOPIX [2/2]

#define DOPIX ( pout,
r,
g,
b,
a,
ia )
Value:
COMBFUNC::doPix(pout,r,g,b,a,ia);

◆ IGNORE_SCALING

#define IGNORE_SCALING ( mode)
Value:
#define LICE_BLIT_IGNORE_SCALING
Definition lice.h:328

◆ WDL_NO_DEFINE_MINMAX

#define WDL_NO_DEFINE_MINMAX

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
eOK 
eXLo 
eXHi 
eYLo 
eYHi 

Function Documentation

◆ _ysort()

int _ysort ( const void * a,
const void * b )
static

◆ ClipFLine()

template<class T>
bool ClipFLine ( T * x1,
T * y1,
T * x2,
T * y2,
int w,
int h )
static

◆ ClipLine()

bool ClipLine ( int * pX1,
int * pY1,
int * pX2,
int * pY2,
int nX,
int nY )
static

◆ DoBezierFillSegment()

void DoBezierFillSegment ( LICE_IBitmap * dest,
int x1,
int y1,
int x2,
int y2,
int yfill,
LICE_pixel color,
float alpha,
int mode )
static

◆ DoBezierFillSegmentX()

void DoBezierFillSegmentX ( LICE_IBitmap * dest,
int x1,
int y1,
int x2,
int y2,
int xfill,
LICE_pixel color,
float alpha,
int mode )
static

◆ FindNextEdgeVertex()

int FindNextEdgeVertex ( int * xy,
int a,
int n,
int dir )
static

◆ FindXOnSegment()

double FindXOnSegment ( int x1,
int y1,
int x2,
int y2,
int ty )
static

◆ GetAAPxWeight()

void GetAAPxWeight ( int err,
int alpha,
int * wt,
int * iwt )
static

◆ GetAAPxWeightFAST()

void GetAAPxWeightFAST ( int err,
int * wt,
int * iwt )
static

◆ LICE_BorderedRect()

void LICE_BorderedRect ( LICE_IBitmap * dest,
int x,
int y,
int w,
int h,
LICE_pixel bgcolor,
LICE_pixel fgcolor,
float alpha,
int mode )

◆ LICE_CBezPrep()

int LICE_CBezPrep ( int dest_w,
double xstart,
double ystart,
double xctl1,
double yctl1,
double xctl2,
double yctl2,
double xend,
double yend,
double tol,
bool xbasis,
double * ax,
double * bx,
double * cx,
double * dx,
double * ay,
double * by,
double * cy,
double * dy,
double * xlo,
double * xhi,
double * ylo,
double * yhi,
double * tlo,
double * thi )

◆ LICE_ClipFLine()

bool LICE_ClipFLine ( float * px1,
float * py1,
float * px2,
float * py2,
float xlo,
float ylo,
float xhi,
float yhi )

◆ LICE_ClipLine()

bool LICE_ClipLine ( int * pX1,
int * pY1,
int * pX2,
int * pY2,
int xLo,
int yLo,
int xHi,
int yHi )

◆ LICE_DashedLine()

void LICE_DashedLine ( LICE_IBitmap * dest,
int x1,
int y1,
int x2,
int y2,
int pxon,
int pxoff,
LICE_pixel color,
float alpha,
int mode,
bool aa )

◆ LICE_DiagLineFAST()

void LICE_DiagLineFAST ( LICE_pixel * px,
int span,
int n,
int xstep,
int ystep,
LICE_pixel color,
bool aa )
inlinestatic

◆ LICE_DottedVertLineFAST()

void LICE_DottedVertLineFAST ( LICE_IBitmap * dest,
int x,
int y1,
int y2,
LICE_pixel color )
inlinestatic

◆ LICE_DrawCBezier()

void LICE_DrawCBezier ( LICE_IBitmap * dest,
double xstart,
double ystart,
double xctl1,
double yctl1,
double xctl2,
double yctl2,
double xend,
double yend,
LICE_pixel color,
float alpha,
int mode,
bool aa,
double tol )

◆ LICE_DrawQBezier()

void LICE_DrawQBezier ( LICE_IBitmap * dest,
double xstart,
double ystart,
double xctl,
double yctl,
double xend,
double yend,
LICE_pixel color,
float alpha,
int mode,
bool aa,
double tol )

◆ LICE_DrawRect()

void LICE_DrawRect ( LICE_IBitmap * dest,
int x,
int y,
int w,
int h,
LICE_pixel color,
float alpha,
int mode )

◆ LICE_DrawThickCBezier()

void LICE_DrawThickCBezier ( LICE_IBitmap * dest,
double xstart,
double ystart,
double xctl1,
double yctl1,
double xctl2,
double yctl2,
double xend,
double yend,
LICE_pixel color,
float alpha,
int mode,
int wid,
double tol )

◆ LICE_FillCBezier()

void LICE_FillCBezier ( LICE_IBitmap * dest,
double xstart,
double ystart,
double xctl1,
double yctl1,
double xctl2,
double yctl2,
double xend,
double yend,
int yfill,
LICE_pixel color,
float alpha,
int mode,
double tol )

◆ LICE_FillCBezierX()

void LICE_FillCBezierX ( LICE_IBitmap * dest,
double xstart,
double ystart,
double xctl1,
double yctl1,
double xctl2,
double yctl2,
double xend,
double yend,
int xfill,
LICE_pixel color,
float alpha,
int mode,
double tol )

◆ LICE_FillConvexPolygon()

void LICE_FillConvexPolygon ( LICE_IBitmap * dest,
const int * x,
const int * y,
int npoints,
LICE_pixel color,
float alpha,
int mode )

◆ LICE_FillTrapezoid()

void LICE_FillTrapezoid ( LICE_IBitmap * dest,
int x1a,
int x1b,
int y1,
int x2a,
int x2b,
int y2,
LICE_pixel color,
float alpha,
int mode )

◆ LICE_FillTrapezoidF()

void LICE_FillTrapezoidF ( LICE_IBitmap * dest,
double fx1a,
double fx1b,
int y1,
double fx2a,
double fx2b,
int y2,
LICE_pixel color,
float alpha,
int mode )

◆ LICE_FillTriangle()

void LICE_FillTriangle ( LICE_IBitmap * dest,
int x1,
int y1,
int x2,
int y2,
int x3,
int y3,
LICE_pixel color,
float alpha,
int mode )

◆ LICE_FLine()

void LICE_FLine ( LICE_IBitmap * dest,
float x1,
float y1,
float x2,
float y2,
LICE_pixel color,
float alpha,
int mode,
bool aa )

◆ LICE_Line()

void LICE_Line ( LICE_IBitmap * dest,
int x1,
int y1,
int x2,
int y2,
LICE_pixel color,
float alpha,
int mode,
bool aa )

◆ LICE_ThickFLine()

void LICE_ThickFLine ( LICE_IBitmap * dest,
double x1,
double y1,
double x2,
double y2,
LICE_pixel color,
float alpha,
int mode,
int wid )

◆ OffscreenFTest()

template<class T>
int OffscreenFTest ( T x,
T y,
T w,
T h )
static

◆ OffscreenTest()

int OffscreenTest ( int x,
int y,
int nX,
int nY )
static

◆ SWAP()

template<class T>
void SWAP ( T & a,
T & b )
inline