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

staticisFloatFormat(format:PixelFormat):Bool

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

bytes:Bytes

read onlydataSize:Int

flags:EnumFlags<Flags>

read onlyheight:Int

offset:Int

read onlywidth:Int

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

convert(target:PixelFormat):Void

dispose():Void

flipY():Void

getPixel(x:Int, y:Int):Int

getPixelF(x:Int, y:Int, ?v:Vector4):Vector4

makeSquare(?copy:Bool):Pixels

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

setPixelF(x:Int, y:Int, v:Vector4):Void

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

toDDS():Bytes

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

toString():String

toVector():Vector<Int>