Image Grid Splitter

1 개요

소스 이미지를 설정한 격자 영역 크기로 분할합니다.
분할 방향을 지정할 수 있으며, 소스 이미지가 격자 크기로 나누어 떨어지지 않는 경우 나머지 영역을 설정한 Blank Color로 채웁니다.

2 알고리즘 상세 설명

Source Image Destination Image
Source Image Source ImageLeft Top(0) Source ImageRight Top(1)
Source ImageLeft Bottom(2) Source ImageRight Bottom(3)
Fig. Image Grid Splitter(Split Direction - Left Top to Right, Split Size - Width 430, Height 430)

원본 이미지(사이즈 860 x 860)를 설정한 격자(사이즈 430 x 430)으로 분할한 결과입니다.
Destination Image는 총 네 장이며, 설정한 방향 순서에 맞춰 분할됩니다.

3 파라미터 설정 및 사용 방법

4 예제 코드

CFLImage fliSourceImage;
CFLImage fliDestinationImage;

CImageGridSplitter imageGridSplitter;

imageGridSplitter.SetSourceImage(fliSourceImage);
imageGridSplitter.SetDestinationImage(fliDestinationImage);

imageGridSplitter.SetSplitDirection(ESplitDirection_LeftTopToRight);
imageGridSplitter.SetSplitDirection(100, 100);
imageGridSplitter.Execute();
CFLImage fliSourceImage = new CFLImage();
CFLImage fliDestinationImage = new CFLImage();

CImageGridSplitter imageGridSplitter = new CImageGridSplitter();

imageGridSplitter.SetSourceImage(ref fliSourceImage);
imageGridSplitter.SetDestinationImage(ref fliDestinationImage);

imageGridSplitter.SetSplitDirection(ESplitDirection.LeftTopToRight);
imageGridSplitter.SetSplitDirection(100, 100);

imageGridSplitter.Execute();
fliSourceImage = CFLImage()
fliDestinationImage = CFLImage()

imageGridSplitter = CImageGridSplitter()

imageGridSplitter.SetSourceImage(fliSourceImage)
imageGridSplitter.SetDestinationImage(fliDestinationImage)

imageGridSplitter.SetSplitDirection(ESplitDirection.LeftTopToRight)
imageGridSplitter.SetSplitDirection(100, 100)

imageGridSplitter.Execute()

5 관련 알고리즘

CCrop, CPaste CRegionExtractor