TextureData
Inheritance: java.lang.Object, com.aspose.threed.A3DObject
public class TextureData extends A3DObject
此类包含纹理的原始数据和格式定义。
构造函数
方法
| 方法 | 描述 |
|---|---|
| equals(Object arg0) | |
| findProperty(String propertyName) | 查找属性。 |
| fromFile(String fileName) | 从文件加载纹理 |
| fromStream(Stream stream) | 从流加载纹理 |
| getBytesPerPixel() | 像素的字节数 |
| getClass() | |
| getData() | 像素数据的原始字节 |
| getHeight() | 垂直像素数量 |
| getName() | 获取名称。 |
| getPixelFormat() | 像素的格式 |
| getProperties() | 获取所有属性的集合。 |
| getProperty(String property) | 获取指定属性的值 |
| getStride() | 扫描行的字节数。 |
| getWidth() | 水平像素数量 |
| hashCode() | |
| mapPixels(PixelMapMode mapMode) | 映射所有像素以进行读/写 |
| mapPixels(PixelMapMode mapMode, PixelFormat format) | 以给定像素格式映射所有像素以进行读/写 |
| mapPixels(Rect rect, PixelMapMode mapMode, PixelFormat format) | 映射由矩形指定的像素,以给定像素格式进行读取/写入 |
| notify() | |
| notifyAll() | |
| removeProperty(Property property) | 移除动态属性。 |
| removeProperty(String property) | 移除通过名称标识的指定属性 |
| save(Stream stream, String format) | 将纹理数据保存为指定的图像格式 |
| save(String fileName) | 将纹理数据保存到图像文件 |
| save(String fileName, String format) | 将纹理数据保存到图像文件 |
| setName(String value) | 设置名称。 |
| setProperty(String property, Object value) | 设置指定属性的值 |
| toString() | |
| transformPixelFormat(PixelFormat pixelFormat) | 将像素布局转换为新的像素格式。 |
| wait() | |
| wait(long arg0) | |
| wait(long arg0, int arg1) |
TextureData(int width, int height, int stride, int bytesPerPixel, PixelFormat pixelFormat, byte[] data)
public TextureData(int width, int height, int stride, int bytesPerPixel, PixelFormat pixelFormat, byte[] data)
TextureData 的构造函数
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| 宽度 | int | |
| 高度 | int | |
| 步幅 | int | |
| 每像素字节数 | int | |
| pixelFormat | PixelFormat | |
| 数据 | byte[] |
TextureData(int width, int height, PixelFormat pixelFormat)
public TextureData(int width, int height, PixelFormat pixelFormat)
构造一个新的 TextureData 并分配像素数据。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| 宽度 | int | |
| 高度 | int | |
| pixelFormat | PixelFormat |
TextureData()
public TextureData()
TextureData 的构造函数
equals(Object arg0)
public boolean equals(Object arg0)
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| arg0 | java.lang.Object |
Returns: 布尔
findProperty(String propertyName)
public Property findProperty(String propertyName)
查找属性。它可以是动态属性(由 CreateDynamicProperty/SetProperty 创建)或本机属性(通过其名称标识)
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| propertyName | java.lang.String | 属性名称。 |
Returns: Property - The property.
fromFile(String fileName)
public static TextureData fromFile(String fileName)
从文件加载纹理
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| 文件名 | java.lang.String |
Returns: TextureData
fromStream(Stream stream)
public static TextureData fromStream(Stream stream)
从流加载纹理
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| stream | Stream |
Returns: TextureData
getBytesPerPixel()
public int getBytesPerPixel()
像素的字节数
Returns: int - 像素的字节数
getClass()
public final native Class<?> getClass()
Returns: java.lang.Class
getData()
public byte[] getData()
像素数据的原始字节
Returns: byte[] - 像素数据的原始字节
getHeight()
public int getHeight()
垂直像素数量
Returns: int - 垂直像素数量
getName()
public String getName()
获取名称。
Returns: java.lang.String - 名称。
getPixelFormat()
public PixelFormat getPixelFormat()
像素的格式
Returns: PixelFormat - The pixel’s format
getProperties()
public PropertyCollection getProperties()
获取所有属性的集合。
Returns: PropertyCollection - the collection of all properties.
getProperty(String property)
public Object getProperty(String property)
获取指定属性的值
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| 属性 | java.lang.String | 属性名称 |
Returns: java.lang.Object - 找到的属性的值
getStride()
public int getStride()
扫描行的字节数。
Returns: int - 扫描行的字节数。
getWidth()
public int getWidth()
水平像素数量
Returns: int - 水平像素数量
hashCode()
public native int hashCode()
Returns: int
mapPixels(PixelMapMode mapMode)
public PixelMapping mapPixels(PixelMapMode mapMode)
映射所有像素以进行读/写
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| mapMode | PixelMapMode | 映射模式 |
Returns: PixelMapping
mapPixels(PixelMapMode mapMode, PixelFormat format)
public PixelMapping mapPixels(PixelMapMode mapMode, PixelFormat format)
以给定像素格式映射所有像素以进行读/写
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| mapMode | PixelMapMode | 映射模式 |
| format | PixelFormat | 像素格式 |
Returns: PixelMapping
mapPixels(Rect rect, PixelMapMode mapMode, PixelFormat format)
public PixelMapping mapPixels(Rect rect, PixelMapMode mapMode, PixelFormat format)
映射由矩形指定的像素,以给定像素格式进行读取/写入
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| rect | Rect | 要访问的像素区域 |
| mapMode | PixelMapMode | 映射模式 |
| format | PixelFormat | 像素格式 |
Returns: PixelMapping - Returns a mapping object, it should be disposed when no longer needed.
notify()
public final native void notify()
notifyAll()
public final native void notifyAll()
removeProperty(Property property)
public boolean removeProperty(Property property)
移除动态属性。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| property | Property | 要删除哪个属性 |
Returns: boolean - 如果属性成功删除则为 true
removeProperty(String property)
public boolean removeProperty(String property)
移除通过名称标识的指定属性
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| 属性 | java.lang.String | 要删除哪个属性 |
Returns: boolean - 如果属性成功删除则为 true
save(Stream stream, String format)
public void save(Stream stream, String format)
将纹理数据保存为指定的图像格式
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| stream | Stream | 保存图像的流 |
| 格式 | java.lang.String | 图像格式,通常为文件扩展名 |
save(String fileName)
public void save(String fileName)
将纹理数据保存到图像文件
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| 文件名 | java.lang.String | 图像将被保存的文件名。 |
save(String fileName, String format)
public void save(String fileName, String format)
将纹理数据保存到图像文件
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| 文件名 | java.lang.String | 图像将被保存的文件名。 |
| 格式 | java.lang.String | 输出文件的图像格式。 |
setName(String value)
public void setName(String value)
设置名称。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| 值 | java.lang.String | 新值 |
setProperty(String property, Object value)
public void setProperty(String property, Object value)
设置指定属性的值
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| 属性 | java.lang.String | 属性名称 |
| 值 | java.lang.Object | 属性的值 |
toString()
public String toString()
Returns: java.lang.String
transformPixelFormat(PixelFormat pixelFormat)
public void transformPixelFormat(PixelFormat pixelFormat)
将像素布局转换为新的像素格式。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| pixelFormat | PixelFormat | 目标像素格式 |
wait()
public final void wait()
wait(long arg0)
public final void wait(long arg0)
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| arg0 | long |
wait(long arg0, int arg1)
public final void wait(long arg0, int arg1)
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| arg0 | long | |
| arg1 | int |