'Twip'에 해당되는 글 2건

  1. 2009.06.10 Twip과 Pixel 4
  2. 2008.08.30 매트릭스(행렬) 1
Computing2009. 6. 10. 16:37

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

Posted by 버터백통

앞서 비트맵관련 매트릭스를 사용하여 필요한 값을 변환하여 색상을 변환하였지만 크기나 위치, 기울기를 조절할 때도 3*3 매트릭스를 이용할 수 있다. 매트릭스를 이용하면 좀 더 세밀한 편집작업이 가능해지면 편집툴과 같은 조절툴을 만들 수 있고 무엇보다 연산시 Twip의 오차를 줄일 수 있다.

* Matrix
매트릭스는 우리말로는 행렬이다. 국어지만 정말 쉽게 말을 지은거 같다. 말 그대로 행을 열에 곱하고 값을 더한 값이 결과 값인 것이다.

* Twip
Twip이란 1픽셀의 값을 20Twips이라는 단위로 사용하는데 이동시 소수점의 값을 모니터에서 표현할 수 없어진다.
이러한 과정이 쌓이다 보면 1픽셀 이상의 거리오차를 발생할 수 있다.
mc.x += 1.5 -> 1,2,3.. (X)          mc.x += 1.5 -> 1,3,4,6... (O)

[ Matrix 적용 메서드 ]
• BitmapData object 의 draw() method
• Graphics object 의 beginBitmapFill() method, beginGradientFill() method, or lineGradientStyle() method
 

사용자 삽입 이미지








[ 속성 ]
• matrix.a = 0 : 1행 1열의 값으로서, 가로크기 (%단위)
• matrix.b = 0 : 1행 2열의 값으로서, 세로기울기%단위)
• matrix.c = 0 : 2행 1열의 값으로서, 가로기울기(%단위)
• matrix.d = 0  : 2행 2열의 값으로서, 세로크기 (%단위)
• matrix.tx = 0 : 수평으로 이동 startX (px단위)
• matrix.ty = 0 : 수직으로 이동 startY (px단위)

[ 변형(affine transformations) 주요 메서드나 성분 ]
• matrix.scale( 1 , 1 ) : 크기
사용자 삽입 이미지
사용자 삽입 이미지








• matrix.rotate( 0 ) : 회전
사용자 삽입 이미지
사용자 삽입 이미지








• skew : 기울기
사용자 삽입 이미지
사용자 삽입 이미지








• matrix.translate( 0, 0 ); : translate(startX, startY)
사용자 삽입 이미지
사용자 삽입 이미지








• matrix.invert(); : 사용된 행렬의 조절값을 반대로 적용한다..(크기 0.5 -> 1.5  회전 90 -> -90 )

위의 성분처럼 3*3 매트릭스를 사용하여 크기나 회전, 이동 등을 할 수 있다. 단 일반 x,y...등 속성을 중복하여 사용할 때는 매트릭스의 값을 갱신시켜야 서로가 원활하게 반영된다.


[위 무비는 senocular라이브러리를 사용하였다]


Posted by 버터백통