GadgetSeed
0.9.6
|
グラフィックライブラリ [詳解]
データ構造 | |
struct | st_rect |
矩形 [詳解] | |
struct | st_position |
位置 [詳解] | |
struct | st_surface |
面 [詳解] | |
struct | st_box |
長(正)方形 [詳解] | |
struct | st_bitmap |
ビットマップグラフィックデータ [詳解] | |
struct | st_graphics_context |
[TODO] 複数グラフィックデバイスに対応したい [詳解] | |
マクロ定義 | |
#define | MAX_FRAMEBUF 2 |
最大フレームバッファ数 [詳解] | |
#define | RGB16(r, g, b) (unsigned int)(((b) >> 3) | (((g) >> 2) << 5) | (((r) >> 3) << 11)) |
#define | RGB24(r, g, b) (unsigned int)((b) | ((g) << 8) | ((r) << 16)) |
#define | RGB24_TO_R(c) (unsigned char)(((c) >> 16) & 0xff) |
#define | RGB24_TO_G(c) (unsigned char)(((c) >> 8) & 0xff) |
#define | RGB24_TO_B(c) (unsigned char)(((c) >> 0) & 0xff) |
#define | RGB32(r, g, b) (unsigned int)(0xff000000 | (b) | ((g) << 8) | ((r) << 16)) |
#define | RGB32_TO_R(c) (unsigned char)(((c) >> 16) & 0xff) |
#define | RGB32_TO_G(c) (unsigned char)(((c) >> 8) & 0xff) |
#define | RGB32_TO_B(c) (unsigned char)(((c) >> 0) & 0xff) |
#define | RGB RGB16 |
#define | GRP_DRAWMODE_NORMAL 0 |
Draw the foreground with fore color. Draw the background with back color. | |
#define | GRP_DRAWMODE_REVERSE 1 |
Draw the foreground with back color. Draw the background with fore color. | |
#define | GRP_DRAWMODE_FOREONLY 2 |
Draw the foreground with back color. No draw the background. | |
型定義 | |
typedef unsigned short | PIXEL_DATA |
$gsc グラフィックデバイスは24ビットカラー [詳解] | |
関数 | |
int | register_graphics_dev (struct st_device *dev) |
グラフィックライブラリにデバイスを登録する [詳解] | |
int | init_graphics (char *devname) |
グラフィックスライブラリを初期化する [詳解] | |
int | get_frame_num (void) |
フレームバッファ数を取得する [詳解] | |
int | set_display_frame (int fnum) |
表示するフレームバッファ番号を設定する [詳解] | |
int | get_display_frame (void) |
表示しているフレームバッファ番号を取得する [詳解] | |
int | set_draw_frame (int fnum) |
描画するフレームバッファ番号を設定する [詳解] | |
int | get_draw_frame (void) |
描画するフレームバッファ番号を取得する [詳解] | |
void | get_screen_info (short *width, short *height) |
スクリーンのサイズ情報を取得する [詳解] | |
void | clear_screen (void) |
画面を全て0で描画する | |
void | set_forecolor (unsigned int color) |
描画の色を設定する [詳解] | |
unsigned int | get_forecolor (void) |
描画の色を取得する [詳解] | |
void | set_backcolor (unsigned int color) |
描画の背景色を設定する [詳解] | |
unsigned int | get_backcolor (void) |
描画の背景色を取得する [詳解] | |
void | set_draw_mode (unsigned char mode) |
描画モードを設定する [詳解] | |
unsigned char | get_draw_mode (void) |
描画モードを取得する [詳解] | |
void | and_rect (struct st_rect *a, struct st_rect *s1, struct st_rect *s2) |
2つの矩形のアンドを求める [詳解] | |
short | empty_rect (struct st_rect *r) |
矩形が0か調べる [詳解] | |
void | correct_rect (struct st_rect *rect) |
矩形を修正する [詳解] | |
void | clear_clip_rect (void) |
クリッピングエリアを無効にする | |
void | set_clip_rect (struct st_rect *rect) |
クリッピングエリアを矩形で指定する [詳解] | |
void | set_clip_box (struct st_box *box) |
クリッピングエリアを四角形で指定する [詳解] | |
void | get_clip_rect (struct st_rect *rect) |
クリッピングエリアを矩形で取得する [詳解] | |
void | draw_point (short x, short y) |
点を描画する [詳解] | |
void | draw_h_line (short x, short y, short width) |
水平線を描画する [詳解] | |
void | draw_v_line (short x, short y, short height) |
垂直線を描画する [詳解] | |
void | draw_line (short x, short y, short xe, short ye) |
直線を描画する [詳解] | |
void | draw_rect (struct st_rect *rect) |
矩形を描画する [詳解] | |
void | draw_fill_rect (struct st_rect *rect) |
塗りつぶした矩形を描画する [詳解] | |
void | draw_bitdata (short px, short py, short width, short height, unsigned char *data, short dw) |
ビットデータを描画する [詳解] | |
void | draw_enlarged_bitdata (short px, short py, short width, short height, unsigned char *data, short dw, int rate) |
拡大したビットデータを描画する [詳解] | |
void | draw_bitmap (short px, short py, struct st_bitmap *bitmap) |
ビットマップデータを描画する [詳解] | |
void | draw_enlarged_bitmap (short px, short py, struct st_bitmap *bitmap, int rate) |
拡大したビットマップデータを描画する [詳解] | |
void | draw_circle (short x0, short y0, short r) |
円を描画する [詳解] | |
void | draw_fill_circle (short x0, short y0, short r) |
塗りつぶした円を描画する [詳解] | |
void | draw_ellipse (short xc, short yc, short rx, short ry) |
楕円を描画する [詳解] | |
void | draw_fill_ellipse (short xc, short yc, short rx, short ry) |
塗りつぶした楕円を描画する [詳解] | |
void | draw_box (struct st_box *box) |
四角を描画する [詳解] | |
void | draw_round_box (struct st_box *box, short r) |
角の丸い四角を描画する [詳解] | |
void | draw_fill_box (struct st_box *box) |
塗りつぶした四角を描画する [詳解] | |
void | draw_round_fill_box (struct st_box *box, short r) |
塗りつぶした角の丸い四角を描画する [詳解] | |
void | draw_vertex4_region (short x0, short y0, short x1, short y1, short x2, short y2, short x3, short y3) |
塗りつぶした4頂点の領域を描画する [詳解] | |
void | draw_round_rect (struct st_rect *rect, short r) |
角の丸い矩形を描画する [詳解] | |
void | draw_round_fill_rect (struct st_rect *rect, short r) |
角の丸い塗りつぶした矩形を描画する [詳解] | |
void | draw_quarter_circle (short x0, short y0, short r, char q) |
1/4の円を描画する [詳解] | |
void | draw_sector (short x, short y, short er, short ir, char q) |
扇形を描画する [詳解] | |
int | is_point_in_rect (short x, short y, struct st_rect *rect) |
座標が矩形の内部か調べる [詳解] | |
int | is_point_in_box (short x, short y, struct st_box *box) |
座標が四角の内部か調べる [詳解] | |
void | box2rect (struct st_rect *rect, struct st_box *box) |
box -> rect 変換 [詳解] | |
void | draw_image (short px, short py, short width, short height, void *image, short dw) |
イメージデータを描画する [詳解] | |
void | scroll_rect_v (struct st_rect *rect, short pixcel) |
矩形範囲を縦方向にスクロールする [詳解] | |
void | resize_image (void *dst_image, short dwidth, short dheight, void *src_image, short swidth, short sheight) |
イメージデータのサイズを変更する [詳解] | |
#define MAX_FRAMEBUF 2 |
typedef unsigned short PIXEL_DATA |
2つの矩形のアンドを求める
[out] | a | 2つの矩形のアンド矩形 |
[in] | s1 | 矩形1 |
[in] | s2 | 矩形2 |
graphics_op.c の 24 行目に定義があります。
参照先 st_rect::bottom, st_rect::left, st_rect::right, st_rect::top.
参照元 draw_bitdata(), draw_enlarged_bitdata(), draw_fill_rect(), draw_image(), draw_rect(), draw_round_fill_rect().
box -> rect 変換
[out] | rect | 矩形 |
[in] | box | 四角 |
graphics_op.c の 162 行目に定義があります。
参照先 st_rect::bottom, st_surface::height, st_rect::left, st_box::pos, st_rect::right, st_box::sur, st_rect::top, st_surface::width, st_position::x, st_position::y.
参照元 draw_box(), draw_fill_box(), draw_round_box(), draw_round_fill_box(), set_clip_box().
void correct_rect | ( | struct st_rect * | rect | ) |
矩形を修正する
[in,out] | rect | 矩形 |
graphics_op.c の 88 行目に定義があります。
参照先 st_rect::bottom, st_rect::left, st_rect::right, st_rect::top.
void draw_bitdata | ( | short | px, |
short | py, | ||
short | width, | ||
short | height, | ||
unsigned char * | data, | ||
short | dw | ||
) |
ビットデータを描画する
[in] | px | 描画開始X座標 |
[in] | py | 描画開始Y座標 |
[in] | width | 描画幅 |
[in] | height | 描画高さ |
[in] | data | ビットデータポインタ |
[in] | dw | ビットデータ幅 |
graphics.c の 1041 行目に定義があります。
参照先 and_rect(), st_rect::bottom, st_rect::left, st_rect::right, st_rect::top.
参照元 draw_bitmap().
void draw_bitmap | ( | short | px, |
short | py, | ||
struct st_bitmap * | bitmap | ||
) |
ビットマップデータを描画する
[in] | px | 描画X座標 |
[in] | py | 描画Y座標 |
[in] | bitmap | ビットマップデータ |
graphics.c の 1146 行目に定義があります。
参照先 st_bitmap::data, draw_bitdata(), st_bitmap::height, st_bitmap::width.
void draw_box | ( | struct st_box * | box | ) |
void draw_circle | ( | short | x0, |
short | y0, | ||
short | r | ||
) |
円を描画する
[in] | x0 | 円の中心X座標 |
[in] | y0 | 円の中心Y座標 |
[in] | r | 円の半径 |
graphics.c の 1173 行目に定義があります。
参照先 draw_point().
void draw_ellipse | ( | short | xc, |
short | yc, | ||
short | rx, | ||
short | ry | ||
) |
楕円を描画する
[in] | xc | 楕円の中心X座標 |
[in] | yc | 楕円の中心Y座標 |
[in] | rx | 縦の半径 |
[in] | ry | 横の半径 |
graphics.c の 1283 行目に定義があります。
参照先 draw_point().
void draw_enlarged_bitdata | ( | short | px, |
short | py, | ||
short | width, | ||
short | height, | ||
unsigned char * | data, | ||
short | dw, | ||
int | rate | ||
) |
拡大したビットデータを描画する
[in] | px | 描画開始X座標 |
[in] | py | 描画開始Y座標 |
[in] | width | 描画幅 |
[in] | height | 描画高さ |
[in] | data | ビットデータポインタ |
[in] | dw | ビットデータ幅 |
[in] | rate | 拡大率 |
graphics.c の 1086 行目に定義があります。
参照先 and_rect(), st_rect::bottom, st_rect::left, st_rect::right, st_rect::top.
void draw_enlarged_bitmap | ( | short | px, |
short | py, | ||
struct st_bitmap * | bitmap, | ||
int | rate | ||
) |
拡大したビットマップデータを描画する
[in] | px | 描画X座標 |
[in] | py | 描画Y座標 |
[in] | bitmap | ビットマップデータ |
[in] | rate | 拡大率 |
graphics.c の 1160 行目に定義があります。
参照先 st_bitmap::data, draw_enlarged_bitdata(), st_bitmap::height, st_bitmap::width.
void draw_fill_box | ( | struct st_box * | box | ) |
void draw_fill_circle | ( | short | x0, |
short | y0, | ||
short | r | ||
) |
塗りつぶした円を描画する
[in] | x0 | 円の中心X座標 |
[in] | y0 | 円の中心Y座標 |
[in] | r | 円の半径 |
graphics.c の 1253 行目に定義があります。
参照先 draw_h_line().
void draw_fill_ellipse | ( | short | xc, |
short | yc, | ||
short | rx, | ||
short | ry | ||
) |
塗りつぶした楕円を描画する
[in] | xc | 楕円の中心X座標 |
[in] | yc | 楕円の中心Y座標 |
[in] | rx | 縦の半径 |
[in] | ry | 横の半径 |
graphics.c の 1335 行目に定義があります。
参照先 draw_h_line(), IOCMD_VIDEO_SCROLL, ioctl_device().
void draw_fill_rect | ( | struct st_rect * | rect | ) |
塗りつぶした矩形を描画する
[in] | rect | 矩形 |
graphics.c の 821 行目に定義があります。
参照先 and_rect().
参照元 draw_fill_box().
void draw_h_line | ( | short | x, |
short | y, | ||
short | width | ||
) |
水平線を描画する
[in] | x | 水平線のX座標 |
[in] | y | 水平線上のY座標 |
[in] | width | 水平線の長さ |
graphics.c の 477 行目に定義があります。
参照元 draw_fill_circle(), draw_fill_ellipse(), draw_round_fill_rect().
void draw_image | ( | short | px, |
short | py, | ||
short | width, | ||
short | height, | ||
void * | image, | ||
short | dw | ||
) |
イメージデータを描画する
[in] | px | 描画X座標 |
[in] | py | 描画Y座標 |
[in] | width | 描画幅 |
[in] | height | 描画高さ |
[in] | image | イメージデータポインタ |
[in] | dw | イメージデータ幅 |
graphics.c の 1840 行目に定義があります。
参照先 and_rect(), st_rect::bottom, st_rect::left, st_rect::right, st_rect::top.
void draw_line | ( | short | x, |
short | y, | ||
short | xe, | ||
short | ye | ||
) |
直線を描画する
[in] | x | 直線描画開始X座標 |
[in] | y | 直線描画開始Y座標 |
[in] | xe | 直線描画終了X座標 |
[in] | ye | 直線描画終了Y座標 |
graphics.c の 664 行目に定義があります。
void draw_point | ( | short | x, |
short | y | ||
) |
点を描画する
[in] | x | 点のX座標 |
[in] | y | 点のY座標 |
graphics.c の 447 行目に定義があります。
参照元 draw_circle(), draw_ellipse(), draw_quarter_circle().
void draw_quarter_circle | ( | short | x0, |
short | y0, | ||
short | r, | ||
char | q | ||
) |
1/4の円を描画する
[in] | x0 | 円の中心X座標 |
[in] | y0 | 円の中心Y座標 |
[in] | r | 円の半径 |
[in] | q | 象限(0:第1象限 〜 3:4象限) |
graphics.c の 1207 行目に定義があります。
参照先 draw_point().
参照元 draw_round_rect().
void draw_rect | ( | struct st_rect * | rect | ) |
矩形を描画する
[in] | rect | 矩形 |
graphics.c の 694 行目に定義があります。
参照先 and_rect().
参照元 draw_box().
void draw_round_box | ( | struct st_box * | box, |
short | r | ||
) |
角の丸い四角を描画する
[in] | box | 四角 |
[in] | r | 角丸の半径 |
graphics.c の 1406 行目に定義があります。
参照先 box2rect(), draw_round_rect().
void draw_round_fill_box | ( | struct st_box * | box, |
short | r | ||
) |
塗りつぶした角の丸い四角を描画する
[in] | box | 四角 |
[in] | r | 角丸の半径 |
graphics.c の 1421 行目に定義があります。
参照先 box2rect(), draw_round_fill_rect().
void draw_round_fill_rect | ( | struct st_rect * | rect, |
short | r | ||
) |
角の丸い塗りつぶした矩形を描画する
[in] | rect | 矩形 |
[in] | r | 角丸の半径 |
graphics.c の 838 行目に定義があります。
参照先 and_rect(), st_rect::bottom, draw_h_line(), st_rect::left, st_rect::right, st_rect::top.
void draw_round_rect | ( | struct st_rect * | rect, |
short | r | ||
) |
角の丸い矩形を描画する
[in] | rect | 矩形 |
[in] | r | 角丸の半径 |
graphics.c の 748 行目に定義があります。
参照先 st_rect::bottom, draw_quarter_circle(), st_rect::left, st_rect::right, st_rect::top.
参照元 draw_round_box().
void draw_sector | ( | short | x, |
short | y, | ||
short | er, | ||
short | ir, | ||
char | q | ||
) |
扇形を描画する
[in] | x | 中心のX座標 |
[in] | y | 中心のY座標 |
[in] | er | 外径 |
[in] | ir | 内径 |
[in] | q | 象限(0:第1象限 〜 3:4象限) |
graphics.c の 1732 行目に定義があります。
void draw_v_line | ( | short | x, |
short | y, | ||
short | height | ||
) |
void draw_vertex4_region | ( | short | x0, |
short | y0, | ||
short | x1, | ||
short | y1, | ||
short | x2, | ||
short | y2, | ||
short | x3, | ||
short | y3 | ||
) |
塗りつぶした4頂点の領域を描画する
[in] | x0 | 頂点0のX座標 |
[in] | y0 | 頂点0のY座標 |
[in] | x1 | 頂点1のX座標 |
[in] | y1 | 頂点1のY座標 |
[in] | x2 | 頂点2のX座標 |
[in] | y2 | 頂点2のY座標 |
[in] | x3 | 頂点3のX座標 |
[in] | y3 | 頂点3のY座標 |
graphics.c の 1510 行目に定義があります。
short empty_rect | ( | struct st_rect * | rect | ) |
矩形が0か調べる
rect | 矩形 |
graphics_op.c の 70 行目に定義があります。
参照先 st_rect::bottom, st_rect::left, st_rect::right, st_rect::top.
unsigned int get_backcolor | ( | void | ) |
void get_clip_rect | ( | struct st_rect * | rect | ) |
int get_display_frame | ( | void | ) |
表示しているフレームバッファ番号を取得する
graphics.c の 214 行目に定義があります。
参照先 IOCMD_VIDEO_GETDISPFRAME, ioctl_device().
int get_draw_frame | ( | void | ) |
描画するフレームバッファ番号を取得する
graphics.c の 246 行目に定義があります。
参照先 IOCMD_VIDEO_GETDRAWFRAME, ioctl_device().
unsigned char get_draw_mode | ( | void | ) |
unsigned int get_forecolor | ( | void | ) |
int get_frame_num | ( | void | ) |
void get_screen_info | ( | short * | width, |
short * | height | ||
) |
int init_graphics | ( | char * | devname | ) |
グラフィックスライブラリを初期化する
[in] | devname | グラフィックスデバイス名 |
graphics.c の 305 行目に定義があります。
参照先 open_device().
int is_point_in_box | ( | short | x, |
short | y, | ||
struct st_box * | box | ||
) |
座標が四角の内部か調べる
[in] | x | 座標X |
[in] | y | 座標Y |
[in] | box | 四角 |
graphics_op.c の 144 行目に定義があります。
参照先 st_rect::bottom, st_surface::height, is_point_in_rect(), st_rect::left, st_box::pos, st_rect::right, st_box::sur, st_rect::top, st_surface::width, st_position::x, st_position::y.
int is_point_in_rect | ( | short | x, |
short | y, | ||
struct st_rect * | rect | ||
) |
座標が矩形の内部か調べる
[in] | x | 座標X |
[in] | y | 座標Y |
[in] | rect | 矩形 |
graphics_op.c の 114 行目に定義があります。
参照先 st_rect::bottom, st_rect::right.
参照元 is_point_in_box().
int register_graphics_dev | ( | struct st_device * | dev | ) |
グラフィックライブラリにデバイスを登録する
[in] | dev | グラフィックデバイス |
graphics.c の 148 行目に定義があります。
参照先 st_device::info.
void resize_image | ( | void * | dst_image, |
short | dwidth, | ||
short | dheight, | ||
void * | src_image, | ||
short | swidth, | ||
short | sheight | ||
) |
イメージデータのサイズを変更する
[out] | dst_image | リサイズ後イメージデータ |
[in] | dwidth | リサイズ後イメージデータ幅 |
[in] | dwidth | リサイズ後イメージデータ高さ |
[in] | srctimage | リサイズ前イメージデータ |
[in] | dwidth | リサイズ前イメージデータ幅 |
[in] | dwidth | リサイズ前イメージデータ高さ |
graphics_op.c の 180 行目に定義があります。
void scroll_rect_v | ( | struct st_rect * | rect, |
short | pixel | ||
) |
矩形範囲を縦方向にスクロールする
[in] | rect | スクロール範囲矩形 |
[in] | pixel | スクロールドット数 |
graphics.c の 1882 行目に定義があります。
参照先 st_rect::bottom, st_rect::left, st_rect::right, st_rect::top.
void set_backcolor | ( | unsigned int | color | ) |
void set_clip_box | ( | struct st_box * | box | ) |
クリッピングエリアを四角形で指定する
[in] | box | クリッピングエリア四角形 |
graphics.c の 279 行目に定義があります。
参照先 box2rect(), set_clip_rect().
void set_clip_rect | ( | struct st_rect * | rect | ) |
int set_display_frame | ( | int | fnum | ) |
表示するフレームバッファ番号を設定する
[in] | fnum | 表示するフレームバッファ番号 |
graphics.c の 204 行目に定義があります。
参照先 IOCMD_VIDEO_SETDISPFRAME, ioctl_device().
int set_draw_frame | ( | int | fnum | ) |
描画するフレームバッファ番号を設定する
[in] | fnum | 描画するフレームバッファ番号 |
graphics.c の 236 行目に定義があります。
参照先 IOCMD_VIDEO_SETDRAWFRAME, ioctl_device().
void set_draw_mode | ( | unsigned char | mode | ) |
void set_forecolor | ( | unsigned int | color | ) |