Object Hierarchy | 関連する C++クラス:Image
v2.0
このクラスは、メモリ内のイメージの表現に読み取りアクセスを行います。
膨大な数のイメージファイルについて、Softimage ではメモリ内のデータを非圧縮の 8 ビット RGBA
で表します。これは、オリジナルファイルにアルファ情報が含まれていない場合でも同様です。データのフォーマットは、Image.NumChannelsおよびImage.ChannelSizeによって決まります。
' The script demonstrates the relationship between the Image, ImageClip and Source
' objects
Option Explicit
' ----------------------------------------------------------------
' create a new image clip
' ----------------------------------------------------------------
newscene , false
dim oImageClip
set oImageClip = CreateImageClip( _
"$SI_HOME\Data\XSI_SAMPLES\Pictures\jio.jpg", _
"MyImage" )
logmessage "image familes->" & oImageClip.families
' ----------------------------------------------------------------
' get startframe, endframe, xdimension and ydimension parameters
' ----------------------------------------------------------------
if typename(oImageClip) <> "Nothing" then
'Use the source to get image information
dim oImageSource : set oImageSource = oImageClip.Source
logmessage "startframe->" & oImageSource.FrameStart.Value
logmessage "endframe->" & oImageSource.FrameEnd.Value
logmessage "xdimension ->" & oImageSource.XRes.Value
logmessage "ydimension ->" & oImageSource.YRes.Value
'Read bottom left pixel
dim oImage : set oImage = oImageClip.GetImage
dim oPixel : set oPixel = oImage.GetPixel( 0, 0 )
logmessage "The pixel color is:"
logmessage "R: " & oPixel.Red
logmessage "G: " & oPixel.Green
logmessage "B: " & oPixel.Blue
logmessage "A: " & oPixel.Alpha
logmessage "xdimension (method2) ->" & oImage.ResX
logmessage "ydimension (method2)->" & oImage.ResY
logmessage "Channels ->" & oImage.NumChannels
logmessage "Channel Size (bytes) ->" & oImage.ChannelSize
end if
' ----------------------------------------------------------------
' Demonstrate how to find all image clips in the scene
' ----------------------------------------------------------------
logmessage "All image clips in Scene:"
dim oImageClips : set oImageClips = Project_GetImageClips()
for each oImageClip in oImageClips
logmessage "Image Clip->" &oImageClip
next
' ----------------------------------------------------------------
' Return collection of project image clips
' ----------------------------------------------------------------
function Project_GetImageClips()
dim oCol : set oCol = enumelements( "Clips.Image" )
set Project_GetImageClips = sifilter( oCol, "Image Clips", ,siSearchFamilies )
end function
|