#include "JpegDecoder.h"
#include
#include
#include
using namespace JpegCodec;
static cv::Mat ConvertToMat(unsigned char *data, int rows, int cols)
{
cv::Mat img(rows, cols, CV_8UC3); // create a new matrix
for (int i = 0; i < rows * cols * 3; i++)
{
img.data[i] = data[i];
}
return img;
}
void ShowImage(unsigned char *data, int rows, int cols)
{
cv::Mat img = ConvertToMat(data, rows, cols);
cv::imshow("Bitmap", img);
cv::waitKey();
}
void Rotate(Matrix &dst, Matrix &src, int angle)
{
double theta = angle * 3.141592 / 180.0;
float c = cos(theta);
float s = sin(theta);
/* 计算中点坐标 */
int h = (src.rows + 1) / 2;
int w