2016-09-20 12 views
0

Cimg을 배우려고하지만 문서가 매우 모호합니다. 드로잉 기능을 사용하고 있는데 선을 그립니다. functoon 선언은 매우 간단합니다 :CIMG를 사용하여 CIMG를 사용하여 라인 패턴을 설정

x0 X-coordinate of the starting line point. 
y0 Y-coordinate of the starting line point. 
x1 X-coordinate of the ending line point. 
y1 Y-coordinate of the ending line point. 
color Pointer to spectrum() consecutive values of type T, defining the drawing color. 
opacity Drawing opacity. 
**pattern An integer whose bits describe the line pattern.** 
init_hatch Tells if a reinitialization of the hash state must be done. 

내 질문이 패턴입니다

CImg<T>& draw_line ( const int x0, 
     const int y0, 
     const int x1, 
     const int y1, 
     const tc *const  color, 
     const float  opacity = 1, 
     const unsigned int  pattern = ~0U, 
     const bool  init_hatch = true 
    ) 

, 나는 정수 라인의 종류를 나타내는 문서에서 찾을 수 없어. 이제 패턴을 조작하는 사람이 있습니까?

나는 같은 질문을 가지고 사람을 위해 여기에 게시, 개발자의

답변

1

하나는 전자 메일을 통해 나에게이 질문을 응답 미리 감사합니다.

패턴은 부호없는 int의 비트가 설정되는 방식에 따라 달라집니다. 부호없는 정수는 투명 (비트가 0으로 설정 됨) 또는 불투명 (비트가 으로 1) 될 수있는 32 픽셀 (즉, 32 비트)의 패턴으로보아야합니다. 예를 들어, 모든 비트가 1로 설정된 패턴은 완전히 불투명하고 은 패턴 값 0xFFFFFFFF에 해당합니다. 8 픽셀이 투명하고 8 픽셀이 불투명 한 패턴 은 0xFF00FF00 패턴에 해당합니다. 0xCCCCCCCC와 같은 패턴은 1 픽셀 투명하고 1 픽셀 불투명, 등을 의미합니다.