|
GadgetSeed
0.9.6
|
グラフィックス描画 [詳解]
#include "graphics.h"#include "device.h"#include "device/video_ioctl.h"#include "tkprintf.h"#include "tprintf.h"#include "dtprintf.h"#include <limits.h>
マクロ定義 | |
| #define | LEFT 1 |
| #define | RIGHT 2 |
| #define | TOP 4 |
| #define | BOTTOM 8 |
| #define | TOP_MAX SHRT_MAX |
| #define | LEFT_MAX SHRT_MAX |
| #define | RIGHT_MIN SHRT_MIN |
| #define | BOTTOM_MIN SHRT_MIN |
関数 | |
| int | register_graphics_dev (struct st_device *dev) |
| グラフィックライブラリにデバイスを登録する [詳解] | |
| int | set_display_frame (int fnum) |
| 表示するフレームバッファ番号を設定する [詳解] | |
| int | get_display_frame (void) |
| 表示しているフレームバッファ番号を取得する [詳解] | |
| int | get_frame_num (void) |
| フレームバッファ数を取得する [詳解] | |
| int | set_draw_frame (int fnum) |
| 描画するフレームバッファ番号を設定する [詳解] | |
| int | get_draw_frame (void) |
| 描画するフレームバッファ番号を取得する [詳解] | |
| 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) |
| クリッピングエリアを矩形で取得する [詳解] | |
| int | init_graphics (char *devname) |
| グラフィックスライブラリを初期化する [詳解] | |
| void | get_screen_info (short *width, short *height) |
| スクリーンのサイズ情報を取得する [詳解] | |
| void | clear_screen (void) |
| 画面を全て0で描画する | |
| static void | prepare_color (void) |
| 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) |
| 描画モードを取得する [詳解] | |
| static void | _draw_point (short x, short y) |
| void | draw_point (short x, short y) |
| 点を描画する [詳解] | |
| static void | _draw_h_line (short x, short y, short xe) |
| void | draw_h_line (short x, short y, short width) |
| 水平線を描画する [詳解] | |
| static void | _draw_v_line (short x, short y, short ye) |
| void | draw_v_line (short x, short y, short height) |
| 垂直線を描画する [詳解] | |
| static short | calc_seq_code (short x, short y) |
| static short | calc_clipped_point (short code, short x0, short y0, short x1, short y1, short *x, short *y) |
| static short | clipping (short *x0, short *y0, short *x1, short *y1) |
| static void | line (short x0, short y0, short x1, short y1) |
| void | draw_line (short x, short y, short xe, short ye) |
| 直線を描画する [詳解] | |
| void | draw_rect (struct st_rect *rect) |
| 矩形を描画する [詳解] | |
| void | draw_round_rect (struct st_rect *rect, short r) |
| 角の丸い矩形を描画する [詳解] | |
| static void | _draw_fill_rect (struct st_rect *rect) |
| void | draw_fill_rect (struct st_rect *rect) |
| 塗りつぶした矩形を描画する [詳解] | |
| void | draw_round_fill_rect (struct st_rect *rect, short r) |
| 角の丸い塗りつぶした矩形を描画する [詳解] | |
| static void | draw_bits (short x, short y, short width, short height, short offset, unsigned char *data, short dw) |
| static void | draw_enlarged_bits (short x, short y, short width, short height, short offset, unsigned char *data, short dw, int rate, short dox, short doy) |
| 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_quarter_circle (short x0, short y0, short r, char q) |
| 1/4の円を描画する [詳解] | |
| 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_round_fill_box (struct st_box *box, short r) |
| 塗りつぶした角の丸い四角を描画する [詳解] | |
| void | draw_fill_box (struct st_box *box) |
| 塗りつぶした四角を描画する [詳解] | |
| static void | set_region_pos (short x0, short y0, short x1, short y1, int lr) |
| void | draw_vertex4_region (short x0, short y0, short x1, short y1, short x2, short y2, short x3, short y3) |
| 塗りつぶした4頂点の領域を描画する [詳解] | |
| static void | set_arc (short x, short y, short r, char q, unsigned char lr) |
| void | draw_sector (short x, short y, short er, short ir, char q) |
| 扇形を描画する [詳解] | |
| static void | _draw_data (short x, short y, short width, short height, short offset, void *data, short dw) |
| void | draw_image (short px, short py, short width, short height, void *image, short dw) |
| イメージデータを描画する [詳解] | |
| void | scroll_rect_v (struct st_rect *rect, short pixel) |
| 矩形範囲を縦方向にスクロールする [詳解] | |
変数 | |
| static struct st_device * | fb_dev |
| static short | gdev_type |
| static short | screen_width |
| static short | screen_height |
| static unsigned short | color_depth |
| static unsigned int | screen_mem_size |
| static unsigned short | frame_num |
| static unsigned int | fore_color |
| static unsigned int | back_color |
| static unsigned char | pen_mode |
| static struct st_rect | i_clip_rect |
| static struct st_rect | clip_rect |
| static short | region_pos [2][GSC_GRAPHICS_DISPLAY_HEIGHT] |
| static unsigned int | graph_copy_buf [GSC_GRAPHICS_DISPLAY_WIDTH] |
| 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 行目に定義があります。
| 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 register_graphics_dev | ( | struct st_device * | dev | ) |
グラフィックライブラリにデバイスを登録する
| [in] | dev | グラフィックデバイス |
graphics.c の 148 行目に定義があります。
参照先 st_device::info.
| 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 | ) |