Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ cginews(3X) — NEWS-os 4.2.1R

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

fb(4)

mouse(4)

CGINEWS(3X)  —  NEWS-OS Programmer’s Manual

名称

cginews − NEWS の CGIライブラリ

形式

#include <cgi.h> ccfile.c ... −lcginews −lm
lint file.c ... −lcginews −lm

解説

CGI (Computer Graphics Interface) は、ISO (国際標準化機構) によって 標準化が進められているグラフィックスデバイスインターフェースです。 ISO のグラフィックスの規格で言えば、 GKS (Graphical Kernel System)、GKS-3D、 および PHIGS (Programmer’s Hierarchical Interactive Graphics System) が、 API (Application Program Interface) になっています。 API は、アプリケーションプログラムと グラフィックスシステム間のインターフェースです。 また、VDI (Visual Device Interface) は、 グラフィックスシステムとグラフィックスデバイス間のインターフェースです。

CGI では、グラフィックスデバイスまたはグラフィックスデバイスドライバが、 デバイスから独立に記述できるように、 抽象的な機能が定められています。 CGI は、200 種類以上の機能を指定しており、 次のように分類されます。

(1) 制御およびネゴシエーション機能
(a) 仮想デバイス管理機能。 アプリケーションとデバイスが通信のセッションを 開始/終了ができるようにします。 また仮想デバイス上のグラフィックスイメージを管理します。 (b) ネゴシエーション機能。 グラフィックスアプリケーションシステムがデバイスに問い合わせて その機能を把握し、適切なモードの動作を選択できるようにします。 仮想デバイス管理機能。 (c) 座標空間制御機能。 座標情報 (画面上の図形の配置) の伝送のためのプロトコルの確立、 およびクリッピングの管理のための機能です。 (d) エラー管理機能。 CGI プロトコルを使用してのパラメータ伝送のレベルと その下位の両レベルでのエラーの検出が含まれます。 (e) その他の制御要素。 外部要素および外部プロトコルを含みます。

(2) 出力および属性機能
(a) 図形基本機能。 画像の視覚的な構成要素を記述します。 (b) 属性機能。 図形基本機能の見え方を記述します。 (c) 制御要素。 他の関数の動作モードを規定し、デバイスの動作の様相を制御します。 (d) 質問 (出力および属性機能用)。 CGI のユーザが、デバイスがどのような機能を持つかを判定できるようにします。 (e) 問い合わせ機能 (出力および属性機能用)。 CGI のユーザが、CGI 状態リストに収められている現在の値に関する情報を 得られるようにします。

(3) 入力機能
6 種の入力クラス (CHOICE、LOCATOR、STROKE、STRING、VALUATOR、PICK) と 4 つのモードの操作 (REQUEST、SAMPLE、EVENT、ECHO REQUEST) があります。

(4) セグメント機能
セグメントを作成、修正、操作するための機能が指定されています。

(5) ラスタオペレーション操作機能
ラスタオペレーションのための機能が指定されています。CGI のユーザは、 ビットマップの描画を選択してビットマップを表示すること、 ビットマップを作成/削除すること、 また、BITBLT 操作によってビットマップの内容を変更することができます。

CGI の機能区分によって、 これらの機能は、CGIMIN および INPUT CGIMIN と呼ばれる 最低限必要とされる機能のセットと次のオプションセットに分割されます。

出力
セット可能なバンドルオプションセット
閉図形オプションセット

セグメント
セグメンテートオプションセット

入力
サンプルオプションセット
イベントオプションセット
リモートエコーオプションセット
エコーオプションセット
エコー出力オプションセット

ラスタ
ラスタオプションセット

この NEWS バージョンは、 セグメントおよびイベント、閉図形オプションセット以外の 上記のオプションセットをすべてサポートしていますが、 完全ではありません。

機能

CGI CONTROL 仮想デバイス管理機能
CGI_Initialize()CGI を初期設定する
CGI_Reset_To_Defaults()属性とモードをリセットする
CGI_Terminate()CGI のセッションを終了する
CGI_Clear_View_Surface(soft,hard)画面をクリアする
CGI_Background_Colour(colour)バックグラウンドカラーをセットする
 
CGI CONTROL 座標制御機能
CGI_VDC_Extent(first,second)VDC の EXTENT (VDC 範囲) を定義する
CGI_Device_Viewport(first,second)デバイスのビューポートを定義する
CGI_Device_Viewport_Specification_Units(units)
CGI_Device_Viewport_Specification_Mapping(isotropy,horizontal,vertical)
CGI_Clip_Rectangle(first,second)クリップ矩形をセットする
CGI_Clip_Indicator(indicator)クリッピングモードを指定する
 
CGI CONTROL エラー機能
CGI_Inquire_Supported_Error_Capabilities(depth)
エラースタックサイズを問い合わせる
CGI_Inquire_Error_Status(depth,oldest,lost)
エラー状態を問い合わせる
CGI_Pop_Error_Stack(num,returned,reports)
エラースタックを pop する
CGI_Empty_Error_stack()エラースタックから全レポートを除去する
 
CGI CONTROL その他の制御関数
CGI_Message(action,text)メッセージを表示する
CGI_Application_Data(ident,data)プライベートデータをセット/取り出しする
CGI_Escape(ident,record)非標準機能を利用する
CGI_Inquire_Escape(ident,record,output_record) 非標準情報を問い合わせる
 
CGI CONTROL 質問機能
CGI_Inquire_Device_Physical_Coordinate_System(bottom,top,width,height)
デバイスの座標系を問い合わせる
 
CGI CONTROL 現在状態問い合わせ機能
CGI_Inquire_VDC_Extent(first,second)
CGI_Inquire_Device_Viewport(units,first,second)
CGI_Inquire_Device_Viewport_Specification_Units(units)
CGI_Inquire_Device_Viewport_Specification_Mapping(isotropy,horizontal,
  vertical)
CGI_Inquire_Clip_Rectangle(first,second)
CGI_Inquire_Clip_Indicator(indicator)
 
CGI INPUT 入力機能
CGI_Initialize_Input_Device(class,deviceIndex)
CGI_Release_Input_Device(class,deviceIndex) 入力動作を終了する
CGI_Set_Acknowledgement_State(class,deviceIndex,ackState)
Ack をオン/オフにセットする
CGI_Set_Current_Value(class,deviceIndex,value)
CGI_Set_Echo_Data(class,deviceIndex,echoType,promptType,ackType,
  echoAreaFirst,echoAreaSecond,echoDataRecord)
CGI_Set_Echo_State(class,deviceIndex,echoState)
エコーをオン/オフにセットする
CGI_Set_Input_Device_Data(class,deviceIndex,deviceDataRecord)
データを更新する
CGI_Set_Prompt_State(class,deviceIndex,promptState)
プロンプトをオン/オフにセットする
CGI_Request(class,deviceIndex,timeout,reqStatus,validStatus,
  trigger,value)
データを要求する
CGI_Sample(class,deviceIndex,value,validityStatus)
現在の値を取り出す
CGI_Initialize_Echo_Request(class,deviceIndex,timeout)
CGI_Echo_Request(class,deviceIndex,reqStatus,validStatus,
  trigger,value)
 
CGI INPUT 質問関数
CGI_Inquire_Input_Capabilities(error,numChoiceDev,numLocatorDev,
  numPickDev,numStringDev,numStrokeDev,numValuatorDev,numTriggers)
仮想デバイスの記述を問い合わせる
CGI_Inquire_Capabilities(class,deviceIndex,error,echoTypes,promptTypes,
  acknowledgementTypes,inputMaxima)
論理デバイスの記述を問い合わせる
 CGI INPUT 問い合わせ
CGI_Inquire_Input_Device_State_List(class,deviceIndex,error,deviceState,
  deviceDataRecord,promptState,promptType,ackState,ackType,
  echoState,echoType,echoAreaFirst,echoAreaSecond,echoDataRecord,
  associatedTriggers)
論理デバイスの状態リストを問い合わせる
CGI_Inquire_Input_Device_State(class,deviceIndex,error,deviceState)
CGI_Inquire_Input_Device_Data(class,deviceIndex,error,deviceDataRecord)
CGI_Inquire_Prompt_State(class,deviceIndex,error,promptState)
CGI_Inquire_Acknowledgement_State(class,deviceIndex,error,ackState)
CGI_Inquire_Echo_Data(class,deviceIndex,error,ackType,promptType,
  echoType,echoAreaFirst,echoAreaSecond,echoDataRecord)
CGI_Inquire_Echo_State(class,deviceIndex,error,echoState)
CGI_Inquire_Associated_Triggers(class,deviceIndex,error,
  associatedTriggers)
 
CGI OUTPUT 図形基本関数
CGI_Polyline(np,pointList)つながった線分列を描く
CGI_Disjoint_Polyline(np,pointList)つながらない線分列を描く
CGI_Circular_Arc_3_Point(startingPoint,intermediatePoint,endingPoint)
3 点で指定された円弧を描く
CGI_Circular_Arc_Center(center,startVector,endVector,radius)
中心とベクトルで指定された円弧を描く
CGI_Elliptical_Arc(center,firstCDPendp,secondCDPendp,startVector,
  endVector)
楕円孤を描く
CGI_Polymarker(np,pointlist)マークを描く
CGI_Text(point,flag,string)テキストを表示する
CGI_Restricted_Text(extentx,extenty,point,flag,string)
指定された領域内にテキストを表示する
CGI_Append_Text(flag,string)テキストを追加する
CGI_Polygon(np,pointList)多角形を描く
CGI_Polygon_Set(np,fplist)多角形の集合を描く
CGI_Rectangle(point1,point2)長方形を描く
CGI_Circle(center,radius)円を描く
CGI_Circular_Arc_3_Point_Close(startingPoint,intermediatePoint,
  endingPoint,closeType)
3 点で指定された閉円弧または弦を描く
CGI_Circular_Arc_Center_Close(center,startVector,endVector,radius,
  closeType)
中心とベクトルで指定された閉円弧または弦を描く
CGI_Ellipse(center,firstCDPendp,secondCDPendp)
楕円を描く
CGI_Elliptical_Arc_Close(center,firstCDPendp,secondCDPendp,
  startVector,endVector,closeType)
CGI_Cell_Array(pointP,pointQ,pointR,nx,ny,localColourPrecision,
  cellColourSpecifiers)
セル配列を描く
 CGI OUTPUT 属性関数
CGI_Line_Bundle_Index(index)線のバンドルインデックスをセットする
CGI_Line_Type(type)ラインの種類(直線、破線)をセットする
CGI_Line_Width(width)
CGI_Line_Colour(specifier)
CGI_Line_Representation(index,type,width,colour)
線のバンドルテーブルをセットする
CGI_Marker_Bundle_Index(index)マーカのバンドルインデックスをセットする
CGI_Marker_Type(type)マーカの種類(点、十字など)をセットする
CGI_Marker_Size(size)
CGI_Marker_Colour(specifier)
CGI_Marker_Representation(index,type,size,colour)
マーカのバンドルテーブルをセットする
CGI_Text_Bundle_Index(index)文字列のバンドルテーブルをセットする
CGI_Text_Font_Index(index)
CGI_Character_Expansion_Factor(factor)
CGI_Character_Spacing(spacing)
CGI_Text_Colour(specifier)
CGI_Character_Height(height)
CGI_Character_Orientation(upVector,baseVector)
CGI_Text_Path(path)文字列を描く方向パス(アップ、
                  ダウンなど)を指定する
CGI_Text_Alignment(horizontalAlignment,verticalAlignment,
  continuousHorizontalAlignment,continuousVerticalAlignment)
文字列の位置合わせをセットする
CGI_Text_Representation(index,font,prec,spacing,exfactor,colour)
文字列のバンドルテーブルをセットする
CGI_Fill_Bundle_Index(index)
CGI_Interior_Style(style)ぬりつぶしの方法を指定する
CGI_Fill_Colour(specifier)
CGI_Hatch_Index(index)ハッチインデックスをセットする
CGI_Pattern_Index(index)パターンインデックスをセットする
CGI_Fill_Reference_Point(point)
CGI_Pattern_Table(index,nx,ny,localColourPrecision,pattern)
パターンをセットする
CGI_Pattern_Size(heightVector,widthVector)
パターンのサイズを指定する
CGI_Fill_Representation(index,interior,colour,hatch,pattern)
ぬりつぶしのバンドルテーブルをセットする
CGI_Edge_Bundle_Index(index)
CGI_Edge_Type(type)エッジの種類をセットする(線の種類と同じ)
CGI_Edge_Width(width)
CGI_Edge_Colour(specifier)
CGI_Edge_Visibility(flag)エッジの表示をオン/オフする
CGI_Edge_Representation(index,type,width,colour)
エッジのバンドルテーブルをセットする
 
CGI OUTPUT 出力および属性制御関数
CGI_Colour_Selection_Mode(mode)カラーモード(インデックス、ダイレクト)を指定する
CGI_Colour_Value_Extent(min,max)カラーの値の範囲を指定する
CGI_Auxiliary_Colour(colour)補助のカラーをセットする
CGI_Transparency(trans)透過をオン/オフする
CGI_Colour_Table(startingIndex,ncolour,colourlist)
カラーテーブルをセットする
CGI_Line_Width_Specification_Mode(mode)
CGI_Edge_Width_Specification_Mode(mode)
CGI_Marker_Size_Specification_Mode(mode)
CGI_Aspect_Source_Flags(ASF_type,ASFvalue)
アスペクトソースフラグをセットする
CGI_Font_List(nname,fontnamelist)
フォントをセットする
 
CGI OUTPUT 問い合わせ関数
CGI_Inquire_Aspect_Source_Flag(type,value)
CGI_Inquire_Line_Bundle_Representation(index,type,widthSpecMode,width,
  colourSelectionMode,colour)
線のバンドルテーブルのエントリを
問い合わせる
CGI_Inquire_Line_Indices(size,nentry,rentry,definedIndices)
定義済み線のバンドルインデックスを
問い合わせる
CGI_Inquire_Line_Individual_Attributes(type,widthSpecMode,width,
  colourSelectionMode,colour,index)
CGI_Inquire_Marker_Bundle_Representation(index,type,sizeSpecMode,size,
  colourSelectionMode,colour)
マーカのバンドルテーブルのエントリを
問い合わせる
CGI_Inquire_Marker_Indices(size,nentry,rentry,definedIndices)
定義済みマーカのバンドルインデックスを
問い合わせる
CGI_Inquire_Marker_Individual_Attributes(type,sizeSpecMode,size,
  colourSelectionMode,colour,index)
CGI_Inquire_Fill_Bundle_Representation(index,interior,
  colourSelectionMode,colour,hatch,pattern)
ぬりつぶしのバンドルテーブルのエントリを
問い合わせる
CGI_Inquire_Fill_Indices(size,nentry,rentry,definedIndices)
定義済みぬりつぶしのバンドル
インデックスを問い合わせる
CGI_Inquire_Fill_Individual_Attributes(interior,colourSelectionMode,
  colour,hatch,pattern,refpoint,patternsize,index)
CGI_Inquire_Pattern_Indices(size,nenty,rentry,definedIndices)
定義済みパターンインデックスを
問い合わせる
CGI_Inquire_Pattern_Table(index,row,column,colourSelectionMode,
  localColourPrecision,colourlist)
パターンを問い合わせる
CGI_Inquire_Edge_Bundle_Representation(index,type,widthSpecMode,width,
  colourSelectionMode,colour)
エッジのバンドルテーブルのエントリを
問い合わせる
CGI_Inquire_Edge_Indices(size,nentry,rentry,definedIndices)
定義済みエッジインデックスを
問い合わせる
CGI_Inquire_Edge_Individual_Attributes(visibility,type,widthSpecMode,
  width,colourSelectionMode,colour,index)
CGI_Inquire_Text_Bundle_Representation(index,font,precision,exfactor,
  spacing,colourSelectionMode,colour)
文字列のバンドルテーブルのエントリを
問い合わせる
CGI_Inquire_Text_Indices(size,nentry,rentry,definedIndices)
定義済み文字列インデックスを
問い合わせる
CGI_Inquire_Text_Individual_Attributes(charset,altcharset,index,font,
  precision,exfactor,spacing,colourSelectionMode,colour,charheight,
  upVector,baseVector,path,hor_align,ver_align,cont_hor_align,
  cont_ver_align)
CGI_Inquire_Colour_Table(index,nentry,rentry,value)
CGI_Inquire_Specification_Modes(lineWidthSpec,edgeWidthSpec,
  markerSizeSpec)
サイズ指定モードを問い合わせる
CGI_Inquire_Colour_Selection_Mode(colourSelectionMode)
カラー選択モードを問い合わせる
CGI_Inquire_Auxiliary_Colour_And_Transparency(trans,colourMode,auxColor)
 
CGI OUTPUT 質問関数
CGI_Inquire_Supported_Colour(nsimulcolour,navailcolour,colourtblsupport,
  background,overwrite,monochrome)
CGI_Inquire_Closed_Figure_Support(nvert,edgeAttrChange)
 
CGI ECHO OUTPUT OPTION SET セット機能
CGI_Set_Echo_Output_Data(inputClass,echoIndex,currentValue,ackType,
  promptType,echoType,echoAreaFirst,echoAreaSecond,echoDataRecord)
CGI_Set_Echo_Output_State(inputClass,echoIndex,echoState)
CGI_Set_Prompt_Output_State(inputClass,echoIndex,promptState)
CGI_Set_Acknowledgement_Output_State(inputClass,echoIndex,ackState)
CGI_Update_Echo_Output(inputClass,echoIndex,newValue)
 
CGI ECHO OUTPUT OPTION SET 問い合わせ機能
CGI_Inquire_Echo_Output_Capabilities(maxEchoes,echoTypesSupported,
  promptTypesSupported,ackTypesSupported,maxStringLength,maxStrokePoints)
CGI_Inquire_Echo_Output_State_List(inputClass,echoIndex,currentValue,
  echoState,echoType,promptState,promptType,ackState,ackType,
  echoAreaFirst,echoAreaSecond,echoDataRecord)
 
CGI RASTER OPTION SET ラスタ出力機能
CGI_Pixel_Array(org_p,xcnt,ycnt,vxcnt1,vxcnt2,vycnt1,vycnt2,
  col_prec,colours)
ピクセル配列を表示する
 
CGI RASTER OPTION SET ラスタ属性機能
CGI_Mapped_Bitmap_Foreground_Colour(colour)
 
CGI RASTER OPTION SET ラスタ制御機能
CGI_Create_Bitmap(ext_p1,ext_p2,type,bm_idx)
CGI_Delete_Bitmap(bm_idx)
CGI_Select_Drawing_Bitmap(bm_idx)
CGI_Display_Bitmap(bm_idx)
CGI_Two_Operand_Bitblt(src_bm_idx,src_p,dest_p,xoff,yoff)
CGI_Tile_Two_Operand_Bitblt(pat_bm_idx,pat_p1,pat_p2,dest_p1,dest_p2)
CGI_Drawing_Mode(draw_mode)ラスタオペレーション機能をセットする
 
CGI RASTER OPTION SET ラスタ質問機能
CGI_Inquire_Displayable_Bitmaps(nbm)
CGI_Inquire_Bitmap_Formats(bm_fmts)
CGI_Inquire_Preferred_Bitblt_Pattern_Size(ext_x,ext_y)
CGI_Inquire_Supported_Drawing_Mode(transp,draw_mode,stat)
 
CGI RASTER OPTION SET ラスタ問い合わせ機能
CGI_Inquire_Current_Drawing_Mode(draw_mode)
CGI_Inquire_Drawing_Bitmap(bm_idx)
CGI_Inquire_Display_Bitmap(bm_idx)
CGI_Inquire_Mapped_Bitmap_Foreground_Colour(colour)
CGI_Inquire_Pixel_Aray(org_p,xcnt,ycnt,vxcnt1,vxcnt2,vycnt1,vycnt2,
  col_prec,colours)

インプリメンテーション

NEWS 上における CGI の現在のバージョンは、C 言語プログラム インターフェースをサポートするライブラリ関数を提供し、 デバイスドライバ (fb(4)、 mouse(4)) を使用して NEWS の グラッフィックスリソースにアクセスしています。

CGI のライブラリ関数の名前は、 抽象機能名 (CGI の規格書で指定されている) で使用されているワードを結合し、 ‘CGI_’をその前に付けた形になっています。 たとえば、抽象機能

CIRCULAR ARC CENTER CLOSE

は、

CGI_Circular_Arc_Center_Close

になります。 C の関数名の一覧およびパラメタインターフェースについては、 ‘CGI 関数リファレンスマニュアル’を 参照してください。

制限事項

NEWS における CGI の現バーションには、次の制限があります。
  CGI_Pattern_Size() を用いて指定されるパターン領域、 およびセル配列領域は、長方形でなければなりません。
  文字列機能は、いずれの制御キャラクタも受け入れません。
  入力クラス VALUATOR、STROKE、および PICK は、サポートされていません。

関連ファイル

/usr/sony/demo/cgi/CGI のデモプログラムのディレクトリ
/usr/sony/doc/cgi/   CGI のドキュメントのディレクトリ

関連事項

fb(4)フレームバッファ(ビットマップディスプレイ)ドライバ
mouse(4)マウスドライバ

"CGI − Computer Graphics Interfacing Techniques",
2nd Initial Draft, November 1985,
ISO TC97/SC21/WG2 N536

NEWS-OSRelease 4.2.1R

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026