日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

starling教程-纹理(Texture)

發布時間:2025/3/21 编程问答 22 豆豆
生活随笔 收集整理的這篇文章主要介紹了 starling教程-纹理(Texture) 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

texture是被創建來填充Image對象的,Texture和Image的關系就好像是本地的BitmapData和Bitmap的關系一樣。Texture類包含如下的apis:

?? base : The Stage3D texture object the texture is based on.?
?? dispose : Disposes the underlying texture data.?
?? empty : Returns a Texture object out of dimensions (width and height).?
?? frame : The texture frame (see class description).?
?? fromBitmap : Returns a Texture object out of a Bitmap object. This Bitmap object can be embedded or loaded?
dynamically.?
?? fromBitmapData : Returns a Texture object out of a BitmapData object.?
?? fromAtfData : Allows the use of a compressed texture using the ATF (Adobe Texture Format). Compressed?
textures allows you to save a lot of memory especially on constrained environments like mobile devices.?
?? fromTexture : Allows the use of a texture and returns a new texture.?
?? height : The height of the texture in pixels.?
?? mipmapping : Indicates if the texture contains mip maps.?
?? premultipliedAlpha : Indicates if the alpha values are premultiplied into the RGB values.?
?? repeat : Indicates if the texture should repeat like a wallpaper or stretch the outermost pixels.?
?? width : The width of the texture in pixels.

你的紋理可以使用不同的圖片格式,下面是它支持的文件格式列表:

?? PNG : As alpha channel is often required, PNG is one of the most common file format used for textures.?
?? JPEG : The classic JPEG format can also be used. Remember that on the GPU the image will be decompressed,?
so using JPEG will not limit the memory usage and you will not be able to use transparency in your textures.?
?? JPEG-XR : JPEG XR (abbr. for JPEG extended range[4]) is a still-image compression standard and file format?
for continuous tone photographic images, based on technology originally developed and patented by Microsoft?
under the name HD Photo (formerly Windows Media Photo). It supports both lossy and lossless compression,?
and is the preferred image format for Ecma-388 Open XML Paper Specification documents.?
?? ATF : Adobe Texture Format. This is the best file format for the best compression. ATF files are primarily a?
file container to store lossy texture data. It achieves its lossy compression through to the use of two common?
techniques: JPEG-XR1 compression and block based compression. JPEG-XR compression provide a?
competitive method to save storage space and network bandwidth. Block based compression provides a way to?
reduce texture memory usage on the client, at a fixed ratio of 1:8 compared to RGBA textures. ATF supports?
three types of block based compression: DXT12, ETC13 and PVRTC4.

下面讓我們來更深入的了解一下紋理的概念,并揭開gpu處理圖片的本質-mip映射(什么是mip映射呢?看鏈接http://zhidao.baidu.com/question/14496010)。mip映射是一個很重要并且容易弄懂的概念。將一個texture縮小成不同的版本就是mipmap。

轉載于:https://www.cnblogs.com/klh5211314/p/3158696.html

總結

以上是生活随笔為你收集整理的starling教程-纹理(Texture)的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。