cPy.cImage module#
- class cImage[source]#
Bases:
objectMain class for handling raster images.Provides functionality for creating, loading, manipulating, and querying
image data. Supports various pixel formats, mipmapping, and compression operations.Designed to be compatible with OpenGL texture uploads.- static CalcImageSize(Format: any, Width: int, Height: int, Depth: int, MipMapCount: int) int[source]#
- Calculates total size in bytes for an image with given parameters.
- MipMapsAll: int = 127#
- Default max count of mipmaps
- Copy(Pixels: any, Format: any, Width: int, Height: int, Depth: int, MipMapCount: int)[source]#
- Copies data from a raw buffer.
- Set(Pixels: any, Format: any, Width: int, Height: int, Depth: int, MipMapCount: int)[source]#
- Sets the image to point to existing memory (or adopts it).
- Create(Format: any, Width: int, Height: int, Depth: int, MipMapCount: int)[source]#
- Allocates memory for a new image.
- RemoveChannels(KeepCh0: bool, KeepCh1: bool = True, KeepCh2: bool = True, KeepCh3: bool = True) bool[source]#
- ToNormalMap(Format: any, Z: float = 1.0, OldAlpha: bool = False) bool[source]#
- “OldAlpha” works only if(Rgba8 == m_Format && Rgba8 == Format)
- CreateMipMaps(MipMapCount: int) bool[source]#
- Generates mipmaps for the image. Not supported for compressed formats.
- Resize(Width: int, Height: int) bool[source]#
- Resizes the image using resampling. Plain formats only.