예제 #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));
 }