コード例 #1
0
ファイル: Picture.cs プロジェクト: acinep/net7mma-1
        public Picture cropped()
        {
            if (crop == null ||
                (crop.getX() == 0 && crop.getY() == 0 && crop.getWidth() == width && crop.getHeight() == height))
            {
                return(this);
            }
            Picture result = Picture.Create(crop.getWidth(), crop.getHeight(), color);

            for (int plane = 0; plane < color.nComp; plane++)
            {
                if (data[plane] == null)
                {
                    continue;
                }
                cropSub(data[plane], crop.getX() >> color.compWidth[plane], crop.getY() >> color.compHeight[plane],
                        crop.getWidth() >> color.compWidth[plane], crop.getHeight() >> color.compHeight[plane],
                        width >> color.compWidth[plane], result.data[plane]);
            }

            return(result);
        }
コード例 #2
0
ファイル: Picture.cs プロジェクト: acinep/net7mma-1
 public Picture createCompatible()
 {
     return(Picture.Create(width, height, color));
 }