2009/06/10 16:37

Twip과 Pixel


For the podcast "This Week in Photography" (TWiP) see This Week in Photography

A twip (abbreviating "twentieth of a point", "twentieth of an inch point"[citation needed], or "twentieth of an Imperial point"[citation needed]) is a typographical measurement, defined as 1/20 of a typographical point. One twip is 1/1440 inch or 17.639 µm when derived from the PostScript point at 72 to the inch, and 1/1445.4 inch or 17.573 µm based on the printer's point at 72.27 to the inch.

Twips are the default unit of measurement in Visual Basic (version 6 and earlier, prior to VB.NET). Converting between twips and screen pixels is achieved using functions such as TwipsPerPixelX and TwipsPerPixelY.

Twips are a commonly used unit with Symbian OS bitmap images and are also used internally in SWF format. They are also used in Rich Text Format from Microsoft for platform-independent exchange and they are the base length unit in Open Office.

Flash internally calculates anything that uses pixels with twips (or 1/20 of a pixel). Sprites, movie clips and any other object on the stage are positioned with twips. If you trace the position of a sprite, for example, you'll notice that it is always in multiples of 0.05 (which is the decimal equivalent of 1/20).

from wikipedia

Twip
- 화면 독립적인 단위(screen-independent unit). 모든 화면출력장치에서 화면 요소의 비율을 동일하게 한다.
- 1 twip은 1인치(inch)의 1/1440
- 1 twip = 1/20 inch

Pixel
- 화면 종속적인 단위(screen-dependent unit)
- 'picture element'의 약자
-  1 pixel은 화면에 표시되는 가장 작은 그래픽 측정 단위임.
- 1 pixel = 1/72 inch
- 1 pixel = 20 twips

form www.solarview.net

이올린에 북마크하기(0) 이올린에 추천하기(0)
크리에이티브 커먼즈 라이선스
Creative Commons License
Trackback 0 Comment 2
  1. 지돌스타 2009/06/16 10:09 address edit & del reply

    때론 이런 개념이 필요할때가 있겠군요. Flash의 ScaleMode처럼요...

    • 버터백통 2009/06/17 13:35 address edit & del

      와우~ 스타님 안녕하세요~
      요즘 바빠서 제 블로그 방문조차 힘드네요~
      왜이리 정신없는지~ㅎㅎㅎ
      스타님 댓글이 힘이됩니다~

2009/05/25 11:35

정말...그렇습니다.


정치엔 관심도 없고 무슨일이 돌아가는지 관심 가져보면 화만나는 현실에
애써 외면하며 관심조차 갖지를 않았던 한국의 정치 세계....
그러나 한국을 통치하셨던 분의 가슴 아픈 서거 소식을 접하고 오보인줄 알았습니다..
토요일 오전에 소식을 접하고 아무렇지 않은 재방송 프로와 거리들
한동안 아니겠지,...오보겠지란 마음으로 라디오를 돌리다가
서거에 대한 사연을 받는 프로를 듣고는 멍한 하늘을 바라보며
정의와 현실은 참으로 냉혹하구나 란 생각이 듭니다..

영화나 소설등 이야기 속에서는 늘 승리하고 기쁨을 주는 인물들...
그러나 현실에서는  돈과 권력의 횡포앞에 약하기 그지 없으며
심한 상처를 받는 분을 보고 어쩜 이 사회 속 모순에서 동질감을 찾아서 인지
한없이 멍했습니다...

과거 말도 많았고 완벽하지 않지만 한 인간으로서 5천만의 국민을 통치하신 분
그러나 무엇인가 획을 그으신분..100% 완벽한 신이나 성인군자는 아니더라도
다른 이들에 비해 비교적 깨끗한 삶과 의지로 살아가려 했었던
그분.. 노무현 전 대통령님을 오래토록 기억하고자 합니다.

삼가 고인의 명복을 빕니다...

크리에이티브 커먼즈 라이선스
Creative Commons License
Trackback 0 Comment 0
2009/05/02 14:07

재귀함수(Recursive)


* 재귀 함수
  - 자기자신을 다시 호출하는 형태의 함수
  - 알고리즘 등에 유용하게 이용

 * 재귀 함수의 탈출 조건
  - 무한 재귀 호출을 피하기 위해서 필요
  - 자료구조와 알고리즘이 필요
  

 * 재귀 함수 디자인 사례
  - 팩토리얼(factorial) 계산을 위한 알고리즘
  예) n! = n*[(n-1)*(n-2)*(n-3)....*2*1] -> n! = n* (n-1)!
       f(n) = n이 1이상인 경우 : n*f(n-1);
       n이 0인 경우  : 1
  
  int f(int n)
  {
   if(n==0) rteturn1;
   else return n*f(n-1);
  }


예2)
 Recursive함수에 스스로 호출하는 명령문이 있으므로  loop되어 계속 출력된다.
 따라서 메모리는 가득차게되고(stack over flow) 자동으로 종료시킨다.

 //탈출의 예시
void Recursive(int n)
{
 printf("RecursiveRun! \n");
 if(n == 1) return;
 Recursive(n-1);
}

int f(int n)
{
 if(n==0) return 1;
 else return n*f(n-1);
}

int main(void)
{
 int a=3;
 int val;
 int result;

 //탈출 테스트
 Recursive(a);
 
 //팩토리얼 디자인
 printf("정수 입력 :");
 scanf("%d" , &val);
 if( val<0 )
 {
  printf("please input 0 over number. \n");
  return 1;
 }

 result =f(val); //factorial계산
 printf("%d!의 계산 결과 : %d \n", val , result );
 return 0;
}


 참고) 프로세스를 이해하기 위해서는 "컴퓨터구조"와 "운영체제"를 익혀야 한다.

이올린에 북마크하기(0) 이올린에 추천하기(0)
크리에이티브 커먼즈 라이선스
Creative Commons License
Trackback 0 Comment 2
  1. 2009/05/02 18:54 address edit & del reply

    비밀댓글 입니다

    • 버터백통 2009/05/03 11:05 address edit & del

      ㅎㅎㅎ 이뻐~
      줄창 Recurive라고 썼네~