Skip to main content

FilterProcVideo

Struct FilterProcVideo 

Source
pub struct FilterProcVideo<U: FilterUserdata> {
    pub scene: SceneInfo,
    pub object: ObjectInfo,
    pub video_object: VideoObjectInfo,
    pub param: ObjectImageParam,
    pub userdata: FilterUserdataHandle<U>,
    /* private fields */
}
Available on crate feature filter only.
Expand description

画像フィルタ処理のための構造体。

Fields§

§scene: SceneInfo

シーン情報。

§object: ObjectInfo

オブジェクト情報。

§video_object: VideoObjectInfo

画像フィルタ特有のオブジェクト情報。

§param: ObjectImageParam

オブジェクトの画像パラメータ。 crate::filter::FilterPlugin::proc_video の終了時や Self::draw_image などの呼び出し前に反映されます。

§userdata: FilterUserdataHandle<U>

エフェクト毎に保持されるユーザーデータ。

Implementations§

Source§

impl<U: FilterUserdata> FilterProcVideo<U>

Source

pub fn set_filter_config_data_size( &self, data: &mut VariableLengthFilterConfigDataHandle, size: usize, ) -> FilterProcResult<()>

可変長の汎用データ項目のサイズを変更する。

データのread/writeガードが存在する場合は失敗します。

Source

pub fn get_image_data<T>(&mut self, buffer: &mut [T]) -> usize
where T: Copy + FromBytes + Immutable,

現在の画像のデータを取得する。 RGBA32bit で取得されます。

§Panics

buffer をバイト列に変換した際の長さが width * height * 4 と一致しない場合、パニックします。 例えばu8 の場合、buffer の長さは width * height * 4 と一致する必要があり、 RgbaPixel の場合、buffer の長さは width * height と一致する必要があります。

Source

pub fn set_image_data<T: IntoBytes + Immutable>( &mut self, data: &[T], width: u32, height: u32, )

現在の画像のデータを設定する。

§Panics

data をバイト列に変換した際の長さが width * height * 4 と一致しない場合、パニックします。

Source

pub fn get_image_texture2d(&mut self) -> Option<ID3D11Texture2D>

現在のオブジェクトの画像データのポインタをID3D11Texture2Dのポインタとして取得する。

§Warning

Self::set_image_data によって現在の画像が変更されるかフィルタ処理の終了まで有効です。

Source

pub fn get_framebuffer_texture2d(&mut self) -> Option<ID3D11Texture2D>

現在のフレームバッファの画像データのポインタをID3D11Texture2Dのポインタとして取得する。

§Warning

フィルタ処理の終了まで有効です。

Source

pub fn read_section(&mut self) -> &ReadSection

読み取り専用の編集セクション。

Source

pub fn get_output_image_param( &mut self, object: Option<ObjectHandle>, offset: f64, ) -> FilterProcResult<ObjectImageParam>

指定オブジェクト、または現在のオブジェクトの画像出力項目のパラメータを取得する。

§Arguments
  • object:取得するオブジェクト。None の場合は現在のオブジェクト。
  • offset:取得する時間のオフセット。
Source

pub fn get_image_object( &mut self, layer: u32, offset: f64, ) -> Option<ObjectHandle>

指定のレイヤーにある画像オブジェクトを取得する。

Source

pub fn draw_image( &mut self, resource: &ImageResource, param: DrawImageParam, ) -> FilterProcResult<()>

指定の画像リソースをフレームバッファに描画する。

§Arguments
Source

pub fn draw_poly( &mut self, vertices: &VertexList, resource: Option<&ImageResource>, ) -> FilterProcResult<()>

指定の頂点リストをフレームバッファに描画する。

§Arguments
Source

pub fn set_default_anchor(&mut self, width: u32, height: u32)

標準のアンカー枠を設定する。

通常は自動で設定されます。 Self::draw_image などで手動で描画する場合に使います。 この関数を呼び出すとこれ以降の描画処理後のフィルタ処理が中断されます。

Source

pub fn set_blend_mode(&mut self, mode: BlendMode)

描画時の合成モードを設定する。

Source

pub fn set_material_shine(&mut self, shininess: f32)

描画時の光沢度を設定する。 カメラ制御の光源設定が有効の時に利用されます。

Source

pub fn set_sampler_mode(&mut self, mode: SamplerMode)

描画時のサンプラーを設定する。

Source

pub fn set_culling_state(&mut self, culling: bool)

描画時に裏面を非表示にするかを設定する。

Source

pub fn set_billboard_mode(&mut self, mode: BillboardMode)

描画時にカメラに向けるかどうかを設定する。

Source

pub fn create_image_resource<T: IntoBytes + Immutable>( &mut self, resource: &ImageResource, data: &[T], width: u32, height: u32, ) -> FilterProcResult<()>

画像リソースを作成する。 VRAMへデータを書き込みます。

§Note
  • 既に同名の画像リソースが存在する場合、上書きされます。
§Arguments
§Panics

data をバイト列に変換した際の長さが width * height * 4 と一致しない場合、パニックします。

Source

pub fn get_image_resource_texture2d( &mut self, resource: &ImageResource, ) -> FilterProcResult<*mut c_void>

指定の画像リソースのD3D画像リソースのポインタを取得する。

§Arguments
Source

pub fn get_image_resource_size( &mut self, resource: &ImageResource, ) -> FilterProcResult<(u32, u32)>

指定の画像リソースのサイズを取得する。

§Arguments
Source

pub fn copy_image_resource( &mut self, src_resource: &ImageResource, dst_resource: &ImageResource, ) -> FilterProcResult<()>

Source

pub fn clear_image_resource( &mut self, resource: &ImageResource, color: RgbaPixel, ) -> FilterProcResult<()>

画像リソースをクリアする。

§Arguments
Source

pub fn get_image_resource_data( &mut self, resource: &ImageResource, buffer: &mut [u8], width: u32, height: u32, pitch: u32, format: OutputImageResourcePixelFormat, ) -> FilterProcResult<()>

画像リソースから指定フォーマットの画像データを取得する。

buffer は少なくとも pitch * height バイト必要です。

§Arguments
Source

pub fn set_image_resource_data<T: IntoBytes + Immutable>( &mut self, resource: &ImageResource, data: &[T], width: u32, height: u32, pitch: u32, format: InputImageResourcePixelFormat, ) -> FilterProcResult<()>

画像リソースに指定フォーマットの画像データを設定する。

data をバイト列に変換した長さは少なくとも pitch * height バイト必要です。

§Arguments
Source

pub fn draw_image_to_resource( &mut self, src_resource: &ImageResource, dst_resource: &ImageResource, param: DrawImageParam, ) -> FilterProcResult<()>

指定の画像リソースを描画先の画像リソースに描画する。

§Arguments
Source

pub fn draw_poly_to_resource( &mut self, dst_resource: &ImageResource, vertices: &VertexList, src_resource: Option<&ImageResource>, ) -> FilterProcResult<()>

指定の頂点リストのポリゴンを描画先の画像リソースに描画する。

§Arguments
Source

pub fn exec_pixelshader<T: Copy>( &mut self, cso_file: &str, target: &ImageResource, resources: &[ImageResource], constant: T, blend_state: &ID3D11BlendState, sampler_state: &ID3D11SamplerState, ) -> FilterProcResult<()>

ピクセルシェーダーを実行する。

シェーダー側とメモリレイアウトを合わせるため、constant を構造体で渡す場合は #[repr(C)] を推奨します。

§Arguments
Source

pub fn exec_pixelshader_data<T: Copy>( &mut self, data: &[u8], target: &ImageResource, resources: &[ImageResource], constant: T, blend_state: &ID3D11BlendState, sampler_state: &ID3D11SamplerState, ) -> FilterProcResult<()>

メモリ上のコンパイル済みピクセルシェーダーを実行する。

シェーダー側とメモリレイアウトを合わせるため、constant を構造体で渡す場合は #[repr(C)] を推奨します。

§Arguments
Source

pub fn exec_computeshader<T: Copy>( &mut self, cso_file: &str, targets: &[ImageResource], resources: &[ImageResource], constant: T, count: [u32; 3], sampler_state: &ID3D11SamplerState, ) -> FilterProcResult<()>

コンピュートシェーダーを実行する。

シェーダー側とメモリレイアウトを合わせるため、constant を構造体で渡す場合は #[repr(C)] を推奨します。

§Arguments
Source

pub fn exec_computeshader_data<T: Copy>( &mut self, data: &[u8], targets: &[ImageResource], resources: &[ImageResource], constant: T, count: [u32; 3], sampler_state: &ID3D11SamplerState, ) -> FilterProcResult<()>

メモリ上のコンパイル済みコンピュートシェーダーを実行する。

シェーダー側とメモリレイアウトを合わせるため、constant を構造体で渡す場合は #[repr(C)] を推奨します。

§Arguments
Source

pub fn release_image_resource( &mut self, resource: &ImageResource, ) -> FilterProcResult<()>

画像リソースを解放する。

§Arguments
Source

pub fn exec_effect<'a, C, K, V>( &mut self, effect_name: &str, param: C, resource: &ImageResource, ) -> FilterProcResult<()>
where C: IntoIterator<Item = (&'a K, &'a V)>, K: AsRef<str> + 'a, V: AsRef<str> + 'a,

指定のエフェクトを実行する。

フィルタ効果、入力項目のエフェクトが実行できます。

§Arguments
  • effect_name:実行するエフェクトの名前。
  • param:エフェクトのパラメーター。Key・Valueはどちらもエイリアスと同様のフォーマットで指定します。
  • resource:処理対象の画像リソース。利用できる種類は ImageResource::ObjectImageResource::Resource
Source

pub fn get_blend_state( &mut self, mode: BlendStateMode, ) -> Option<ID3D11BlendState>

定義済みのD3Dの出力ブレンドのリソースのポインタを取得する。

Source

pub fn get_sampler_state( &mut self, mode: SamplerMode, ) -> Option<ID3D11SamplerState>

定義済みのD3Dのサンプラーのリソースのポインタを取得する。

Source

pub fn prevent_post_effect(&mut self)

フィルタ処理後の処理を中断する。

Self::draw_polySelf::draw_image などを呼び出した後に使います。

Trait Implementations§

Source§

impl<U: Debug + FilterUserdata> Debug for FilterProcVideo<U>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<U: FilterUserdata> Send for FilterProcVideo<U>

Source§

impl<U: FilterUserdata> Sync for FilterProcVideo<U>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more