Static methods

staticalloc(width:Int, height:Int, format:PixelFormat):Pixels

staticcalcDataSize(width:Int, height:Int, format:PixelFormat):Int

staticcalcStride(width:Int, format:PixelFormat):Int

staticgetChannelOffset(format:PixelFormat, channel:Channel):Int

Returns the byte offset for the requested channel (0=R,1=G,2=B,3=A) Returns -1 if the channel is not found

staticinlineswitchBR(v:Int):Int

staticinlineswitchEndian(v:Int):Int

@:value({ isCubeMap : false })statictoDDSLayers(pixels:Array<Pixels>, isCubeMap:Bool = false):Bytes

Build DDS texture bytes from an array of pixels : - can contain a single image - can contain multiple layers (set isCubeMap = true if it's a cubemap) - can contain single or multiple layers with mipmaps (auto detected with diffences in size)

Constructor

@:value({ offset : 0 })new(width:Int, height:Int, bytes:Bytes, format:PixelFormat, offset:Int = 0)

Variables

Methods

blit(x:Int, y:Int, src:Pixels, srcX:Int, srcY:Int, width:Int, height:Int):Void

@:value({ preserveMask : 0 })clear(color:Int, preserveMask:Int = 0):Void

setPixel(x:Int, y:Int, color:Int):Void

sub(x:Int, y:Int, width:Int, height:Int):Pixels

@:value({ level : 9 })toPNG(level:Int = 9):Bytes