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

Classes

class  _LICE_Template_Blit0< COMBFUNC >
class  _LICE_Template_Blit1< COMBFUNC >
class  _LICE_Template_Blit2< COMBFUNC >
class  _LICE_Template_Blit3
class  _LICE_Template_Blit4
class  LICE_TransformBlit_class< T >
class  LICE_TransformBlitAlpha_class< T >
class  GlyphDrawImpl< COMBFUNC >

Macros

#define __LICE_CPP_IMPLEMENTED__
#define WDL_NO_DEFINE_MINMAX
#define IGNORE_SCALING(mode)
#define DO_RECT_SC(mode)
#define __LICE__ACTION(COMBFUNC)
#define __LICE__ACTION(COMBFUNC)
#define __LICE__ACTION(COMBFUNC)
#define DOPIX(pout, r, g, b, a, ia)
#define DOPIX(pout, r, g, b, a, ia)
#define DOPIX(pout, r, g, b, a, ia)
#define DOPIX(pout, r, g, b, a, ia)
#define TOFIX(a)
#define __LICE__ACTION(comb)
#define __LICE__ACTION(comb)
#define __LICE__ACTION(comb)
#define __LICE__ACTION(comb)
#define __LICE__ACTION(comb)
#define __LICE__ACTION(comb)
#define __LICE__ACTION(comb)
#define __LICE__ACTION(comb)
#define __LICE__ACTION(comb)
#define __LICE__ACTION(COMBFUNC)
#define __LICE__ACTION(COMBFUNC)
#define __LICE__ACTION(COMBFUNC)
#define __LICE__ACTION(COMBFUNC)

Functions

LICE_pixel LICE_CombinePixels (LICE_pixel dest, LICE_pixel src, float alpha, int mode)
void LICE_CombinePixels2 (LICE_pixel *destptr, int r, int g, int b, int a, int ia, int mode)
void LICE_CombinePixels2Clamp (LICE_pixel *destptr, int r, int g, int b, int a, int ia, int mode)
void LICE_Copy (LICE_IBitmap *dest, LICE_IBitmap *src)
void LICE_GradRect (LICE_IBitmap *dest, int dstx, int dsty, int dstw, int dsth, float ir, float ig, float ib, float ia, float drdx, float dgdx, float dbdx, float dadx, float drdy, float dgdy, float dbdy, float dady, int mode)
static void LICE_BlitInt (LICE_IBitmap *dest, LICE_IBitmap *src, int dstx, int dsty, const RECT *srcrect, float alpha, int mode, bool allowSc)
void LICE_Blit (LICE_IBitmap *dest, LICE_IBitmap *src, int dstx, int dsty, const RECT *srcrect, float alpha, int mode)
void LICE_Blit (LICE_IBitmap *dest, LICE_IBitmap *src, int dstx, int dsty, int srcx, int srcy, int srcw, int srch, float alpha, int mode)
void LICE_Blur (LICE_IBitmap *dest, LICE_IBitmap *src, int dstx, int dsty, int srcx, int srcy, int srcw, int srch)
void LICE_ScaledBlit (LICE_IBitmap *dest, LICE_IBitmap *src, int dstx, int dsty, int dstw, int dsth, float srcx, float srcy, float srcw, float srch, float alpha, int mode)
void LICE_DeltaBlit (LICE_IBitmap *dest, LICE_IBitmap *src, int dstx, int dsty, int dstw, int dsth, float srcx, float srcy, float srcw, float srch, double dsdx, double dtdx, double dsdy, double dtdy, double dsdxdy, double dtdxdy, bool cliptosourcerect, float alpha, int mode)
void LICE_DeltaBlitAlpha (LICE_IBitmap *dest, LICE_IBitmap *src, int dstx, int dsty, int dstw, int dsth, float srcx, float srcy, float srcw, float srch, double dsdx, double dtdx, double dsdy, double dtdy, double dsdxdy, double dtdxdy, bool cliptosourcerect, float alpha, int mode, double dadx, double dady, double dadxdy)
void LICE_RotatedBlit (LICE_IBitmap *dest, LICE_IBitmap *src, int dstx, int dsty, int dstw, int dsth, float srcx, float srcy, float srcw, float srch, float angle, bool cliptosourcerect, float alpha, int mode, float rotxcent, float rotycent)
void LICE_Clear (LICE_IBitmap *dest, LICE_pixel color)
void LICE_MultiplyAddRect (LICE_IBitmap *dest, int x, int y, int w, int h, float rsc, float gsc, float bsc, float asc, float radd, float gadd, float badd, float aadd)
void LICE_ProcessRect (LICE_IBitmap *dest, int x, int y, int w, int h, void(*procFunc)(LICE_pixel *p, void *parm), void *parm)
void LICE_FillRect (LICE_IBitmap *dest, int x, int y, int w, int h, LICE_pixel color, float alpha, int mode)
void LICE_ClearRect (LICE_IBitmap *dest, int x, int y, int w, int h, LICE_pixel mask, LICE_pixel orbits)
LICE_pixel LICE_GetPixel (LICE_IBitmap *bm, int x, int y)
void LICE_PutPixel (LICE_IBitmap *bm, int x, int y, LICE_pixel color, float alpha, int mode)
void LICE_TransformBlit (LICE_IBitmap *dest, LICE_IBitmap *src, int dstx, int dsty, int dstw, int dsth, const float *srcpoints, int div_w, int div_h, float alpha, int mode)
void LICE_TransformBlit2 (LICE_IBitmap *dest, LICE_IBitmap *src, int dstx, int dsty, int dstw, int dsth, const double *srcpoints, int div_w, int div_h, float alpha, int mode)
void LICE_TransformBlit2Alpha (LICE_IBitmap *dest, LICE_IBitmap *src, int dstx, int dsty, int dstw, int dsth, const double *srcpoints, int div_w, int div_h, int mode)
void LICE_SetAlphaFromColorMask (LICE_IBitmap *dest, LICE_pixel color)
void LICE_SimpleFill (LICE_IBitmap *dest, int x, int y, LICE_pixel newcolor, LICE_pixel comparemask, LICE_pixel keepmask)
void LICE_DrawGlyphEx (LICE_IBitmap *dest, int x, int y, LICE_pixel color, const LICE_pixel_chan *alphas, int glyph_w, int glyph_span, int glyph_h, float alpha, int mode)
void LICE_DrawGlyph (LICE_IBitmap *dest, int x, int y, LICE_pixel color, const LICE_pixel_chan *alphas, int glyph_w, int glyph_h, float alpha, int mode)
void LICE_DrawMonoGlyph (LICE_IBitmap *dest, int x, int y, LICE_pixel color, const unsigned char *alphabits, int glyph_w, int glyph_span, int glyph_h, float alpha, int mode)
void LICE_HalveBlitAA (LICE_IBitmap *dest, LICE_IBitmap *src)
int LICE_BitmapCmp (LICE_IBitmap *a, LICE_IBitmap *b, int *coordsOut)
int LICE_BitmapCmpEx (LICE_IBitmap *a, LICE_IBitmap *b, LICE_pixel mask, int *coordsOut)

Variables

_LICE_ImageLoader_recLICE_ImageLoader_list
unsigned short _LICE_RGB2HSV_invtab [256]

Macro Definition Documentation

◆ __LICE__ACTION [1/16]

#define __LICE__ACTION ( comb)
Value:
comb::doPix((LICE_pixel_chan *)px, LICE_GETR(color),LICE_GETG(color),LICE_GETB(color),LICE_GETA(color), ia)
#define LICE_GETG(v)
Definition lice.h:59
#define LICE_GETA(v)
Definition lice.h:61
#define LICE_GETB(v)
Definition lice.h:58
#define LICE_GETR(v)
Definition lice.h:60
unsigned char LICE_pixel_chan
Definition lice.h:55

◆ __LICE__ACTION [2/16]

#define __LICE__ACTION ( comb)
Value:
uint8_t sp
Definition Spc_Cpu.h:145
static void solidBlit(LICE_pixel_chan *dest, int w, int h, int ir, int ig, int ib, int ia, int dest_span)
Definition lice.cpp:315
UINT_D64 w
Definition inflate.c:942
unsigned int LICE_pixel
Definition lice.h:54
uch * p
Definition crypt.c:594
uch h[RAND_HEAD_LEN]
Definition crypt.c:459

◆ __LICE__ACTION [3/16]

#define __LICE__ACTION ( comb)
Value:
blitfunc = comb::doPix;

◆ __LICE__ACTION [4/16]

#define __LICE__ACTION ( comb)
Value:
blitfunc = comb::doPix;

◆ __LICE__ACTION [5/16]

#define __LICE__ACTION ( comb)
Value:
blitfunc = comb::doPix;

◆ __LICE__ACTION [6/16]

#define __LICE__ACTION ( comb)
Value:
_LICE_Template_Blit2<comb>::scaleBlit(pdest,psrc,dstw,dsth,icurx,icury,idx,idy,clip_r,clip_b,src_span,dest_span,ia,mode&LICE_BLIT_FILTER_MASK)
static void scaleBlit(LICE_pixel_chan *dest, const LICE_pixel_chan *src, int w, int h, int icurx, int icury, int idx, int idy, unsigned int clipright, unsigned int clipbottom, int src_span, int dest_span, int ia, int filtermode)
Definition lice.cpp:478
#define LICE_BLIT_FILTER_MASK
Definition lice.h:325
png_structrp int mode
Definition png.h:1139

◆ __LICE__ACTION [7/16]

#define __LICE__ACTION ( comb)
Value:
_LICE_Template_Blit2<comb>::scaleBlitFilterDown(pdest,psrc,dstw,dsth,icurx,icury,idx,idy,clip_r,clip_b,src_span,dest_span,ia,filter,filt_start,filtsz)
static void scaleBlitFilterDown(LICE_pixel_chan *dest, const LICE_pixel_chan *src, int w, int h, int icurx, int icury, int idx, int idy, int clipright, int clipbottom, int src_span, int dest_span, int ia, const int *filter, int filt_start, int filtsz)
Definition lice.cpp:405

◆ __LICE__ACTION [8/16]

#define __LICE__ACTION ( comb)
Value:
_LICE_Template_Blit2<comb>::blit(pdest,psrc,cpsize,i,src_span,dest_span,ia)
static void blit(LICE_pixel_chan *dest, const LICE_pixel_chan *src, int w, int h, int src_span, int dest_span, int ia)
Definition lice.cpp:379
register unsigned i
Definition inflate.c:1575

◆ __LICE__ACTION [9/16]

#define __LICE__ACTION ( comb)
Value:
_LICE_Template_Blit1<comb>::gradBlit(pdest,dstw,dsth,iir,iig,iib,iia,idrdx,idgdx,idbdx,idadx,idrdy,idgdy,idbdy,idady,dest_span)
static void gradBlit(LICE_pixel_chan *dest, int w, int h, int ir, int ig, int ib, int ia, int drdx, int dgdx, int dbdx, int dadx, int drdy, int dgdy, int dbdy, int dady, int dest_span)
Definition lice.cpp:335

◆ __LICE__ACTION [10/16]

#define __LICE__ACTION ( COMBFUNC)
Value:
GlyphDrawImpl<COMBFUNC>::DrawGlyphMono(srcalpha,destpx, src_w, src_h, color,span,glyph_span,ia)
static void DrawGlyphMono(const unsigned char *srcalpha, LICE_pixel *destpx, int src_w, int src_h, LICE_pixel color, int span, int src_span, int aa)
Definition lice.cpp:2621

◆ __LICE__ACTION [11/16]

#define __LICE__ACTION ( COMBFUNC)
Value:
GlyphDrawImpl<COMBFUNC>::DrawGlyphMonoScale(srcalpha,destpx, src_w, src_h, color,span,glyph_span,ia,__sc)
static void DrawGlyphMonoScale(const unsigned char *srcalpha, LICE_pixel *destpx, int src_w, int src_h, LICE_pixel color, int span, int src_span, int aa, int scale)
Definition lice.cpp:2640

◆ __LICE__ACTION [12/16]

#define __LICE__ACTION ( COMBFUNC)
Value:
GlyphDrawImpl<COMBFUNC>::DrawGlyph(srcalpha,destpx, src_w, src_h, color,span,glyph_span,ia)
static void DrawGlyph(const LICE_pixel_chan *srcalpha, LICE_pixel *destpx, int src_w, int src_h, LICE_pixel color, int span, int src_span, int aa)
Definition lice.cpp:2570

◆ __LICE__ACTION [13/16]

#define __LICE__ACTION ( COMBFUNC)
Value:
GlyphDrawImpl<COMBFUNC>::DrawGlyphScale(srcalpha,destpx, src_w, src_h, color,span,glyph_span,ia,__sc)
static void DrawGlyphScale(const LICE_pixel_chan *srcalpha, LICE_pixel *destpx, int src_w, int src_h, LICE_pixel color, int span, int src_span, int aa, int scale)
Definition lice.cpp:2586

◆ __LICE__ACTION [14/16]

#define __LICE__ACTION ( COMBFUNC)
Value:
COMBFUNC::doPix((LICE_pixel_chan*)destptr,r, g, b, a, ia)
uint8_t a
Definition Spc_Cpu.h:141
int g
Definition inflate.c:1573
int r
Definition crypt.c:458
b
Definition crypt.c:628

◆ __LICE__ACTION [15/16]

#define __LICE__ACTION ( COMBFUNC)
Value:
COMBFUNC::doPix((LICE_pixel_chan*)destptr,r, g, b, a, ia)

◆ __LICE__ACTION [16/16]

#define __LICE__ACTION ( COMBFUNC)
Value:
COMBFUNC::doPix((LICE_pixel_chan*)&dest,r, g, b, a, al)

◆ __LICE_CPP_IMPLEMENTED__

#define __LICE_CPP_IMPLEMENTED__

◆ DO_RECT_SC

#define DO_RECT_SC ( mode)
Value:
const int __sc = (int)dest->Extended(LICE_EXT_GET_SCALING,NULL); \
if (__sc>0) { \
if (!IGNORE_SCALING(mode)) { \
__LICE_SC(x); \
__LICE_SC(y); \
__LICE_SCU(w); \
__LICE_SCU(h); \
} \
__LICE_SCU(destbm_w); \
__LICE_SCU(destbm_h); \
}
#define NULL
Definition CarlaBridgeFormat.cpp:30
int y
Definition inflate.c:1588
unsigned x[BMAX+1]
Definition inflate.c:1586
#define IGNORE_SCALING(mode)
Definition lice.cpp:26
#define LICE_EXT_GET_SCALING
Definition lice.h:102
typedef int(UZ_EXP MsgFn)()

◆ DOPIX [1/4]

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

◆ DOPIX [2/4]

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

◆ DOPIX [3/4]

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

◆ DOPIX [4/4]

#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

◆ TOFIX

#define TOFIX ( a)
Value:
((int)((a)*65536.0))

◆ WDL_NO_DEFINE_MINMAX

#define WDL_NO_DEFINE_MINMAX

Function Documentation

◆ LICE_BitmapCmp()

int LICE_BitmapCmp ( LICE_IBitmap * a,
LICE_IBitmap * b,
int * coordsOut )

◆ LICE_BitmapCmpEx()

int LICE_BitmapCmpEx ( LICE_IBitmap * a,
LICE_IBitmap * b,
LICE_pixel mask,
int * coordsOut )

◆ LICE_Blit() [1/2]

void LICE_Blit ( LICE_IBitmap * dest,
LICE_IBitmap * src,
int dstx,
int dsty,
const RECT * srcrect,
float alpha,
int mode )

◆ LICE_Blit() [2/2]

void LICE_Blit ( LICE_IBitmap * dest,
LICE_IBitmap * src,
int dstx,
int dsty,
int srcx,
int srcy,
int srcw,
int srch,
float alpha,
int mode )

◆ LICE_BlitInt()

void LICE_BlitInt ( LICE_IBitmap * dest,
LICE_IBitmap * src,
int dstx,
int dsty,
const RECT * srcrect,
float alpha,
int mode,
bool allowSc )
static

◆ LICE_Blur()

void LICE_Blur ( LICE_IBitmap * dest,
LICE_IBitmap * src,
int dstx,
int dsty,
int srcx,
int srcy,
int srcw,
int srch )

◆ LICE_Clear()

void LICE_Clear ( LICE_IBitmap * dest,
LICE_pixel color )

◆ LICE_ClearRect()

void LICE_ClearRect ( LICE_IBitmap * dest,
int x,
int y,
int w,
int h,
LICE_pixel mask,
LICE_pixel orbits )

◆ LICE_CombinePixels()

LICE_pixel LICE_CombinePixels ( LICE_pixel dest,
LICE_pixel src,
float alpha,
int mode )

◆ LICE_CombinePixels2()

void LICE_CombinePixels2 ( LICE_pixel * destptr,
int r,
int g,
int b,
int a,
int ia,
int mode )

◆ LICE_CombinePixels2Clamp()

void LICE_CombinePixels2Clamp ( LICE_pixel * destptr,
int r,
int g,
int b,
int a,
int ia,
int mode )

◆ LICE_Copy()

void LICE_Copy ( LICE_IBitmap * dest,
LICE_IBitmap * src )

◆ LICE_DeltaBlit()

void LICE_DeltaBlit ( LICE_IBitmap * dest,
LICE_IBitmap * src,
int dstx,
int dsty,
int dstw,
int dsth,
float srcx,
float srcy,
float srcw,
float srch,
double dsdx,
double dtdx,
double dsdy,
double dtdy,
double dsdxdy,
double dtdxdy,
bool cliptosourcerect,
float alpha,
int mode )

◆ LICE_DeltaBlitAlpha()

void LICE_DeltaBlitAlpha ( LICE_IBitmap * dest,
LICE_IBitmap * src,
int dstx,
int dsty,
int dstw,
int dsth,
float srcx,
float srcy,
float srcw,
float srch,
double dsdx,
double dtdx,
double dsdy,
double dtdy,
double dsdxdy,
double dtdxdy,
bool cliptosourcerect,
float alpha,
int mode,
double dadx,
double dady,
double dadxdy )

◆ LICE_DrawGlyph()

void LICE_DrawGlyph ( LICE_IBitmap * dest,
int x,
int y,
LICE_pixel color,
const LICE_pixel_chan * alphas,
int glyph_w,
int glyph_h,
float alpha,
int mode )

◆ LICE_DrawGlyphEx()

void LICE_DrawGlyphEx ( LICE_IBitmap * dest,
int x,
int y,
LICE_pixel color,
const LICE_pixel_chan * alphas,
int glyph_w,
int glyph_span,
int glyph_h,
float alpha,
int mode )

◆ LICE_DrawMonoGlyph()

void LICE_DrawMonoGlyph ( LICE_IBitmap * dest,
int x,
int y,
LICE_pixel color,
const unsigned char * alphabits,
int glyph_w,
int glyph_span,
int glyph_h,
float alpha,
int mode )

◆ LICE_FillRect()

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

◆ LICE_GetPixel()

LICE_pixel LICE_GetPixel ( LICE_IBitmap * bm,
int x,
int y )

◆ LICE_GradRect()

void LICE_GradRect ( LICE_IBitmap * dest,
int dstx,
int dsty,
int dstw,
int dsth,
float ir,
float ig,
float ib,
float ia,
float drdx,
float dgdx,
float dbdx,
float dadx,
float drdy,
float dgdy,
float dbdy,
float dady,
int mode )

◆ LICE_HalveBlitAA()

void LICE_HalveBlitAA ( LICE_IBitmap * dest,
LICE_IBitmap * src )

◆ LICE_MultiplyAddRect()

void LICE_MultiplyAddRect ( LICE_IBitmap * dest,
int x,
int y,
int w,
int h,
float rsc,
float gsc,
float bsc,
float asc,
float radd,
float gadd,
float badd,
float aadd )

◆ LICE_ProcessRect()

void LICE_ProcessRect ( LICE_IBitmap * dest,
int x,
int y,
int w,
int h,
void(* procFunc )(LICE_pixel *p, void *parm),
void * parm )

◆ LICE_PutPixel()

void LICE_PutPixel ( LICE_IBitmap * bm,
int x,
int y,
LICE_pixel color,
float alpha,
int mode )

◆ LICE_RotatedBlit()

void LICE_RotatedBlit ( LICE_IBitmap * dest,
LICE_IBitmap * src,
int dstx,
int dsty,
int dstw,
int dsth,
float srcx,
float srcy,
float srcw,
float srch,
float angle,
bool cliptosourcerect,
float alpha,
int mode,
float rotxcent,
float rotycent )

◆ LICE_ScaledBlit()

void LICE_ScaledBlit ( LICE_IBitmap * dest,
LICE_IBitmap * src,
int dstx,
int dsty,
int dstw,
int dsth,
float srcx,
float srcy,
float srcw,
float srch,
float alpha,
int mode )

◆ LICE_SetAlphaFromColorMask()

void LICE_SetAlphaFromColorMask ( LICE_IBitmap * dest,
LICE_pixel color )

◆ LICE_SimpleFill()

void LICE_SimpleFill ( LICE_IBitmap * dest,
int x,
int y,
LICE_pixel newcolor,
LICE_pixel comparemask,
LICE_pixel keepmask )

◆ LICE_TransformBlit()

void LICE_TransformBlit ( LICE_IBitmap * dest,
LICE_IBitmap * src,
int dstx,
int dsty,
int dstw,
int dsth,
const float * srcpoints,
int div_w,
int div_h,
float alpha,
int mode )

◆ LICE_TransformBlit2()

void LICE_TransformBlit2 ( LICE_IBitmap * dest,
LICE_IBitmap * src,
int dstx,
int dsty,
int dstw,
int dsth,
const double * srcpoints,
int div_w,
int div_h,
float alpha,
int mode )

◆ LICE_TransformBlit2Alpha()

void LICE_TransformBlit2Alpha ( LICE_IBitmap * dest,
LICE_IBitmap * src,
int dstx,
int dsty,
int dstw,
int dsth,
const double * srcpoints,
int div_w,
int div_h,
int mode )

Variable Documentation

◆ _LICE_RGB2HSV_invtab

unsigned short _LICE_RGB2HSV_invtab[256]

◆ LICE_ImageLoader_list

_LICE_ImageLoader_rec* LICE_ImageLoader_list