Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
Rasterisation Project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sr1g19
Rasterisation Project
Commits
9182f085
Commit
9182f085
authored
4 years ago
by
sr1g19
Browse files
Options
Downloads
Patches
Plain Diff
Upload New File
parent
0786bd9e
No related branches found
No related tags found
Loading
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/rendering/rasterize.h
+52
-0
52 additions, 0 deletions
src/rendering/rasterize.h
with
52 additions
and
0 deletions
src/rendering/rasterize.h
0 → 100644
+
52
−
0
View file @
9182f085
#ifndef _RASTERIZE_H
#define _RASTERIZE_H
#include
"3x3matrix.h"
#include
"2x2matrix.h"
#include
"lcd.h"
#include
<math.h>
#include
<avr/pgmspace.h>
#include
"ili934x.h"
#define TRANSPARENTCOLOR 63519
_2x1Matrix
transpose_map
(
_3x3Matrix
m1
,
_3x1Matrix
m2
);
typedef
struct
{
_2x1Matrix
p0
,
p1
,
p2
;
}
tri2d
;
typedef
struct
{
_2x1Matrix
p0
,
p1
,
p2
,
p3
;
//This makes me sad to implement it this way, so please don't use invalid rectangles.
}
rect2d
;
typedef
struct
{
_3x1Matrix
p0
,
p1
,
p2
;
}
tri3d
;
typedef
struct
{
_3x1Matrix
gr
,
anchor
;
}
plane3d
;
rectangle
getXYBound2d
(
tri2d
t
);
rectangle
getXYBound3d
(
tri3d
t
);
void
affineRasterize
(
_2x2Matrix
m
,
PGM_P
imgdata
,
rectangle
imgRegion
,
int16_t
dispX
,
int16_t
dispY
);
void
perspectiveRasterize
(
tri3d
t
,
tri2d
tuv
,
PGM_P
imgdata
,
rectangle
imgRegion
);
void
perspectiveRasterizeComposite
(
tri3d
t
,
tri2d
tuv
,
PGM_P
imgdata
,
rectangle
imgRegion
,
float
composite
);
void
UVMapRasterize
(
tri3d
t0
,
tri2d
t1
);
rectangle
getXYBound2dRect
(
rect2d
t
);
rectangle
getXYBound3d
(
tri3d
t
);
float
triSign
(
_2x1Matrix
p0
,
_2x1Matrix
p1
,
_2x1Matrix
p2
);
plane3d
getPlane
(
tri3d
t
);
float
getZ
(
float
x
,
float
y
,
plane3d
p
);
unsigned
char
inTriangle
(
float
x
,
float
y
,
tri2d
);
tri2d
transpose2dTri
(
tri2d
t
,
_2x2Matrix
m
);
rect2d
transpose2dRect
(
rect2d
t
,
_2x2Matrix
m
);
tri3d
transpose3dTri
(
tri3d
t
,
_3x3Matrix
m
);
tri3d
seperate
(
_3x3Matrix
m
);
_3x3Matrix
combine2d
(
_2x1Matrix
m1
,
_2x1Matrix
m2
,
_2x1Matrix
m3
);
_2x1Matrix
transpose_2x3
(
_3x3Matrix
m1
,
_2x1Matrix
m2
);
uint16_t
maxInt
(
uint16_t
v1
,
uint16_t
v2
);
#endif //_RASTERIZE_H
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment