TextureWriteOptions
Description
Section titled “Description”Options to control how raw bytes are uploaded into a texture.
Fields
- origin_x, origin_y, origin_z
- size_width, size_height, size_depth
- bytes_per_row: optional; must be a multiple of 256 when provided
- rows_per_image: optional; defaults to height
Example
Section titled “Example”1 collapsed line
fn main() -> Result<(), Box<dyn std::error::Error>> {use fragmentcolor::TextureWriteOptions;let _opt = TextureWriteOptions::whole().with_bytes_per_row(256).with_rows_per_image(64);2 collapsed lines
Ok(())}import { TextureWriteOptions } from "fragmentcolor";const _opt = TextureWriteOptions.whole().withBytesPerRow(256).withRowsPerImage(64);from fragmentcolor import TextureWriteOptions_opt = TextureWriteOptions.whole().with_bytes_per_row(256).with_rows_per_image(64)// Swift placeholder: bindings WIP// Kotlin placeholder: bindings WIPMethods
Section titled “Methods”TextureWriteOptions::whole()
Section titled “TextureWriteOptions::whole()”Create an options object that targets the entire texture region.
- Origin defaults to (0,0,0)
- Size is inferred from the texture at call time
- bytes_per_row and rows_per_image are inferred if not set
Example
Section titled “Example”1 collapsed line
fn main() -> Result<(), Box<dyn std::error::Error>> {use fragmentcolor::TextureWriteOptions;let _opt = TextureWriteOptions::whole();2 collapsed lines
Ok(())}import { TextureWriteOptions } from "fragmentcolor";const _opt = TextureWriteOptions.whole();from fragmentcolor import TextureWriteOptions_opt = TextureWriteOptions.whole()// Swift placeholder: bindings WIP// Kotlin placeholder: bindings WIPTextureWriteOptions::with_bytes_per_row(bytes)
Section titled “TextureWriteOptions::with_bytes_per_row(bytes)”Set the bytes-per-row for the upload. Must be a multiple of 256.
Example
Section titled “Example”1 collapsed line
fn main() -> Result<(), Box<dyn std::error::Error>> {use fragmentcolor::TextureWriteOptions;let _opt = TextureWriteOptions::whole().with_bytes_per_row(256);2 collapsed lines
Ok(())}import { TextureWriteOptions } from "fragmentcolor";const _opt = TextureWriteOptions.whole().withBytesPerRow(256);from fragmentcolor import TextureWriteOptions_opt = TextureWriteOptions.whole().with_bytes_per_row(256)// Swift placeholder: bindings WIP// Kotlin placeholder: bindings WIPTextureWriteOptions::with_rows_per_image(rows)
Section titled “TextureWriteOptions::with_rows_per_image(rows)”Set the number of rows per image for the upload (usually equals the height).
Example
Section titled “Example”1 collapsed line
fn main() -> Result<(), Box<dyn std::error::Error>> {use fragmentcolor::TextureWriteOptions;let _opt = TextureWriteOptions::whole().with_rows_per_image(64);2 collapsed lines
Ok(())}import { TextureWriteOptions } from "fragmentcolor";const _opt = TextureWriteOptions.whole().withRowsPerImage(64);from fragmentcolor import TextureWriteOptions_opt = TextureWriteOptions.whole().with_rows_per_image(64)// Swift placeholder: bindings WIP// Kotlin placeholder: bindings WIP