// Copyright (c) 2010-2014 SharpDX - Alexandre Mutel // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. namespace SharpDX.Direct3D9 { public partial class BaseTexture { /// /// Filters mipmap levels of a texture. /// /// The source level. /// The filter. /// /// A object describing the result of the operation. /// /// HRESULT D3DXFilterTexture([In] IDirect3DBaseTexture9* pBaseTexture,[In, Buffer] const PALETTEENTRY* pPalette,[In] unsigned int SrcLevel,[In] D3DX_FILTER Filter) public void FilterTexture(int sourceLevel, Filter filter) { D3DX9.FilterTexture(this, null, sourceLevel, filter); } /// /// Filters mipmap levels of a texture. /// /// The source level. /// The filter. /// The palette. /// /// A object describing the result of the operation. /// /// HRESULT D3DXFilterTexture([In] IDirect3DBaseTexture9* pBaseTexture,[In, Buffer] const PALETTEENTRY* pPalette,[In] unsigned int SrcLevel,[In] D3DX_FILTER Filter) public void FilterTexture(int sourceLevel, Filter filter, PaletteEntry[] palette) { D3DX9.FilterTexture(this, palette, sourceLevel, filter); } /// /// Saves a texture to a file. /// /// The texture. /// Name of the file. /// The format. /// /// A object describing the result of the operation. /// /// HRESULT D3DXSaveTextureToFileW([In] const wchar_t* pDestFile,[In] D3DXIMAGE_FILEFORMAT DestFormat,[In] IDirect3DBaseTexture9* pSrcTexture,[In, Buffer] const PALETTEENTRY* pSrcPalette) public static void ToFile(BaseTexture texture, string fileName, ImageFileFormat format) { D3DX9.SaveTextureToFileW(fileName, format, texture, null); } /// /// Saves a texture to a file. /// /// The texture. /// Name of the file. /// The format. /// The palette. /// A object describing the result of the operation. /// HRESULT D3DXSaveTextureToFileW([In] const wchar_t* pDestFile,[In] D3DXIMAGE_FILEFORMAT DestFormat,[In] IDirect3DBaseTexture9* pSrcTexture,[In, Buffer] const PALETTEENTRY* pSrcPalette) public static void ToFile(BaseTexture texture, string fileName, ImageFileFormat format, PaletteEntry[] palette) { D3DX9.SaveTextureToFileW(fileName, format, texture, palette); } /// /// Saves a texture to a stream. /// /// The texture. /// The format. /// A containing the saved texture. /// HRESULT D3DXSaveTextureToFileInMemory([Out] ID3DXBuffer** ppDestBuf,[In] D3DXIMAGE_FILEFORMAT DestFormat,[In] IDirect3DBaseTexture9* pSrcTexture,[In, Buffer] const PALETTEENTRY* pSrcPalette) public static DataStream ToStream(BaseTexture texture, ImageFileFormat format) { return new DataStream(D3DX9.SaveTextureToFileInMemory(format, texture, null )); } /// /// Saves a texture to a stream. /// /// The texture. /// The format. /// The palette. /// A containing the saved texture. /// HRESULT D3DXSaveTextureToFileInMemory([Out] ID3DXBuffer** ppDestBuf,[In] D3DXIMAGE_FILEFORMAT DestFormat,[In] IDirect3DBaseTexture9* pSrcTexture,[In, Buffer] const PALETTEENTRY* pSrcPalette) public static DataStream ToStream(BaseTexture texture, ImageFileFormat format, PaletteEntry[] palette) { return new DataStream(D3DX9.SaveTextureToFileInMemory(format, texture, palette)); } /// /// Gets or sets the level of details. /// /// /// The level of details. /// /// unsigned int IDirect3DBaseTexture9::GetLOD() /// unsigned int IDirect3DBaseTexture9::SetLOD([In] unsigned int LODNew) public int LevelOfDetails { get { return GetLOD(); } set { SetLOD(value); } } } }