グラフィック用ワールド座標系サポート More...
#include "window.h"
Go to the source code of this file.
Functions | |
void | setWindow (WSGraph vp, double x1, double y1, double x2, double y2) |
void | wSetPixel (WSGraph vp, double x, double y, int cc) |
int | wGetPixel (WSGraph vp, double x, double y) |
void | wLine (WSGraph vp, double x1, double y1, double x2, double y2, int cc) |
void | wMove (double x1, double y1) |
void | wDraw (WSGraph vp, double x1, double y1, int cc) |
void | wMove_Rel (double x1, double y1) |
void | wDraw_Rel (WSGraph vp, double x1, double y1, int cc) |
Variables | |
double | X_Dx |
ワールド座標系の x成分1ドットに対するスクリーン座標系のドット数. | |
double | X_Dy |
ワールド座標系の y成分1ドットに対するスクリーン座標系のドット数. | |
double | X_Wx |
スクリーン座標系の原点に対するワールド座標系の x成分. | |
double | X_Wy |
スクリーン座標系の原点に対するワールド座標系の y成分. | |
double | X_Now = 0.0 |
ペンの現地点の x成分(ワールド座標系) | |
double | Y_Now = 0.0 |
ペンの現地点の y成分(ワールド座標系) |
Definition in file window.c.
void setWindow | ( | WSGraph | vp, | |
double | x1, | |||
double | y1, | |||
double | x2, | |||
double | y2 | |||
) |
void setWindow(WSGraph vp, double x1, double y1, double x2, double y2)
2Dのワールド座標系に表示用の窓(ビューポート)を設定する.
vp | 窓(ビューポート)を割り付ける 2Dグラフィックデータ. | |
x1 | 窓(ビューポート)の一つの角の座標の x成分. | |
y1 | 窓(ビューポート)の一つの角の座標の y成分. | |
x2 | 窓(ビューポート)の(x1,y1)の対角の座標の x成分. | |
y2 | 窓(ビューポート)の(x1,y1)の対角の座標の y成分. |
Definition at line 28 of file window.c.
References Max, Min, X_Dx, X_Dy, X_Wx, X_Wy, Xabs, WSGraph::xs, and WSGraph::ys.
void wDraw | ( | WSGraph | vp, | |
double | x1, | |||
double | y1, | |||
int | cc | |||
) |
void wDraw(WSGraph vp, double x1, double y1, int cc)
ワールド座標系で現地点から指定した地点へ線を引く. 指定した地点が現地点となる.
vp | 操作対象のグラフィックデータ. | |
x1 | 線の終点の x座標(ワールド座標系). | |
y1 | 線の終点の y座標(ワールド座標系). | |
cc | 線の輝度値. |
Definition at line 138 of file window.c.
References wLine(), X_Now, and Y_Now.
00139 { 00140 wLine(vp, X_Now, Y_Now, x1, y1, cc); 00141 00142 X_Now = x1; 00143 Y_Now = y1; 00144 }
void wDraw_Rel | ( | WSGraph | vp, | |
double | x1, | |||
double | y1, | |||
int | cc | |||
) |
void wDraw_Rel(WSGraph vp, double x1, double y1, int cc)
ワールド座標系で現地点を起点として相対的に線を引く. 線の終点が現地点となる.
vp | 操作対象のグラフィックデータ. | |
x1 | 現地点から x方向への移動距離(ワールド座標系). | |
y1 | 現地点から x方向への移動距離(ワールド座標系). | |
cc | 線の輝度値. |
Definition at line 175 of file window.c.
References wLine(), X_Now, and Y_Now.
00176 { 00177 double x2, y2; 00178 00179 x2 = X_Now + x1; 00180 y2 = Y_Now + y1; 00181 00182 wLine(vp, X_Now, Y_Now, x2, y2, cc); 00183 00184 X_Now = x2; 00185 Y_Now = y2; 00186 }
int wGetPixel | ( | WSGraph | vp, | |
double | x, | |||
double | y | |||
) |
int wGetPixel(WSGraph vp, double x, double y)
ワールド座標系に点を打つ.
vp | 操作対象のグラフィックデータ. | |
x | 点の x座標(ワールド座標系). | |
y | 点の y座標(ワールド座標系). |
void wLine | ( | WSGraph | vp, | |
double | x1, | |||
double | y1, | |||
double | x2, | |||
double | y2, | |||
int | cc | |||
) |
void wLine(WSGraph vp, double x1, double y1, double x2, double y2, int cc)
ワールド座標系に線を引く.
vp | 操作対象のグラフィックデータ. | |
x1 | 線の始点の x座標(ワールド座標系). | |
y1 | 線の始点の y座標(ワールド座標系). | |
x2 | 線の終点の x座標(ワールド座標系). | |
y2 | 線の終点の y座標(ワールド座標系). | |
cc | 線の輝度値. |
Definition at line 97 of file window.c.
References line(), X_Dx, X_Dy, X_Wx, and X_Wy.
Referenced by wDraw(), and wDraw_Rel().
00098 { 00099 int i1, j1, i2, j2; 00100 00101 i1 = (int)((x1 - X_Wx)*X_Dx + 0.5); 00102 i2 = (int)((x2 - X_Wx)*X_Dx + 0.5); 00103 j1 = (int)((X_Wy - y1)*X_Dy + 0.5); 00104 j2 = (int)((X_Wy - y2)*X_Dy + 0.5); 00105 00106 line(vp, i1, j1, i2, j2, cc); 00107 }
void wMove | ( | double | x1, | |
double | y1 | |||
) |
void wMove_Rel | ( | double | x1, | |
double | y1 | |||
) |
void wSetPixel | ( | WSGraph | vp, | |
double | x, | |||
double | y, | |||
int | cc | |||
) |
void wSetPixel(WSGraph vp, double x, double y, int cc)
ワールド座標系に点を打つ.
vp | 操作対象のグラフィックデータ. | |
x | 点の x座標(ワールド座標系). | |
y | 点の y座標(ワールド座標系). | |
cc | 点の輝度値. |
double X_Dx |
Definition at line 13 of file window.c.
Referenced by setWindow(), wGetPixel(), wLine(), and wSetPixel().
double X_Dy |
Definition at line 13 of file window.c.
Referenced by setWindow(), wGetPixel(), wLine(), and wSetPixel().
double X_Now = 0.0 |
Definition at line 14 of file window.c.
Referenced by wDraw(), wDraw_Rel(), wMove(), and wMove_Rel().
double X_Wx |
Definition at line 13 of file window.c.
Referenced by setWindow(), wGetPixel(), wLine(), and wSetPixel().
double X_Wy |
Definition at line 13 of file window.c.
Referenced by setWindow(), wGetPixel(), wLine(), and wSetPixel().
double Y_Now = 0.0 |
Definition at line 14 of file window.c.
Referenced by wDraw(), wDraw_Rel(), wMove(), and wMove_Rel().