Image scaling and rotating in C/C++

前端 未结 10 1615
情深已故
情深已故 2020-11-29 07:55

What is the best way to scale a 2D image array? For instance, suppose I have an image of 1024 x 2048 bytes, with each byte being a pixel. Each pixel is a grayscale level fro

10条回答
  •  春和景丽
    2020-11-29 08:20

    point scaling(point p,float sx,float sy) {
        point s;
    
        int c[1][3];
        int a[1][3]={p.x,p.y,1};
        int b[3][3]={sx,0,0,0,sy,0,0,0,1};
    
        multmat(a,b,c);
    
        s.x=c[0][0];
        s.y=c[0][1];
    
        return s;
    }
    

提交回复
热议问题