#include <iostream>
#include <cstdlib>
#include <ctime>
#include <cmath>
#include <cstring>
#include <vector>
#include <algorithm>
using namespace std;
const int maxX = 1080, maxY = 1920, maxP = 100;
int num[maxX][maxY];
const double eps = 1e-6, Pi = 4 * atan(1);
struct Point {
double x, y;
Point(double x = 0, double y = 0) : x(x), y(y) {
}
};
double operator * (Point a, Point b) {
return a.x * b.x + a.y * b.y;
}
Point operator - (Point a, Point b) {
return Point(a.x - b.x, a.y - b.y);
}
double operator ^ (Point a, Point b) {
return a.x * b.y - a.y * b.x;
}
double mod(Point a) {
return sqrt(a * a * 1.0);
}
double theta(Point a, Point b) {
double csin = (a ^ b) / mod(a) / mod(b);
double ccos = (a * b) / mod(a) / mod(b);
return atan2(csin, ccos);
}
const int val[5][5] = {
18, 73, 116, 73, 18,
73, 293, 464, 293, 73,
116, 464, 735, 464, 116,
扫瞄线填充算法 AND 高斯抗锯齿算法
最新推荐文章于 2024-01-23 20:18:20 发布
这篇博客介绍了两种图形处理算法:扫瞄线填充算法和高斯抗锯齿算法。扫瞄线算法用于高效地填充图形内部,而高斯抗锯齿则用于平滑图像边缘,减少像素级的不连续性。通过示例代码,展示了如何在C++中实现这两种算法,并生成输出文件。
摘要由CSDN通过智能技术生成