Stores image data into different TextureFormats to use it for Textures.
It supports basic converting functions and a low level api to edit pixels.

Constructor

@:value({ color : 0, format : TextureFormat.RGBA })new(width:Int, height:Int, format:TextureFormat = TextureFormat.RGBA, color:Color = 0, ?bytes:Bytes)

Creates a new TextureDataImpl instance.

Parameters:

width

horizontal size

height

vertical size

format

the used TextureFormat (RGBA by default)

color

background color

bytes

to create from existing Bytes data

Variables

@:value(TextureFormat.RGBA)format:TextureFormat = TextureFormat.RGBA

the used TextureFormat

width:Int

horizontal image size

height:Int

vertical image size

bytes:Bytes

represents the bytes data of an image

Methods

@:value({ color : 0 })clear(color:Color = 0):Void

Fills the entire texturedata with a color.

Parameters:

color

a Color value

@:value({ alpha : 0.0, blue : 0.0, green : 0.0, red : 0.0 })clearFloat(red:Float = 0.0, green:Float = 0.0, blue:Float = 0.0, alpha:Float = 0.0):Void

Fills the entire texturedata with a color if using float TextureFormat.

Parameters:

red

value (0.0 to 1.0) for red color channel

green

value (0.0 to 1.0) for green color channel

blue

value (0.0 to 1.0) for blue color channel

alpha

value (0.0 to 1.0) for alpha channel

clone():TextureDataImpl

Creates a new texturedata and copies all data into it.

toRGBA():TextureData

Converts and returns a new created texturedata into RGBA integer TextureFormat.
The alpha value will be 255 (opaque) if the source texturedata have no alpha channel.

toRGB():TextureData

Converts and returns a new created texturedata into RGB integer TextureFormat.
If the source format is of type ALPHA, the alpha value will be converted into the red colorchannel.

toRG():TextureData

Converts and returns a new created texturedata into RG integer TextureFormat.
If the source format is of type ALPHA, the alpha value will be converted into the red colorchannel.

toR():TextureData

Converts and returns a new created texturedata into R integer TextureFormat.
If the source format is of type ALPHA, the alpha value will be converted into the red colorchannel.

toLuminanceAlpha():TextureData

Converts and returns a new created texturedata into LUMINANCE_ALPHA integer TextureFormat.
The alpha value will be 255 (opaque) if the source texturedata have no alpha channel.

toLuminance():TextureData

Converts and returns a new created texturedata into LUMINANCE integer TextureFormat.
If the source format is of type ALPHA, the alpha value will be used for luminance.

toAlpha():TextureData

Converts and returns a new created texturedata into ALPHA integer TextureFormat.
If the source have no alpha channel it will convert the red color channel into alpha.

toFloatRGBA():TextureData

Converts and returns a new created texturedata into FLOAT_RGBA TextureFormat.
The alpha value will be 1.0 (opaque) if the source texturedata have no alpha channel.

toFloatRGB():TextureData

Converts and returns a new created texturedata into FLOAT_RGB TextureFormat.
If the source format is of type ALPHA, the alpha value will be converted into the red colorchannel.

toFloatRG():TextureData

Converts and returns a new created texturedata into FLOAT_RG TextureFormat.
If the source format is of type ALPHA, the alpha value will be converted into the red colorchannel.

toFloatR():TextureData

Converts and returns a new created texturedata into FLOAT_R TextureFormat.
If the source format is of type ALPHA, the alpha value will be converted into the red colorchannel.

setColor(x:Int, y:Int, color:Color):Void

Sets the Color of a pixel for integer TextureFormats.

Parameters:

x

horizontal position

y

vertical position

color

color value

inlinesetColor_RGBA(x:Int, y:Int, color:Color):Void

Sets the Color of a pixel optimized for the RGBA TextureFormat.

Parameters:

x

horizontal position

y

vertical position

color

color value

inlineset_RGBA(x:Int, y:Int, red:Int, green:Int, blue:Int, alpha:Int):Void

Sets the colorchannels of a pixel optimized for the RGBA TextureFormat.

Parameters:

x

horizontal position

y

vertical position

red

value from 0 to 255

green

value from 0 to 255

blue

value from 0 to 255

alpha

value from 0 (full transparent) to 255 (opaque)

inlineset_RGB(x:Int, y:Int, red:Int, green:Int, blue:Int):Void

Sets the colorchannels of a pixel optimized for the RGB TextureFormat.

Parameters:

x

horizontal position

y

vertical position

red

value from 0 to 255

green

value from 0 to 255

blue

value from 0 to 255

inlineset_RG(x:Int, y:Int, red:Int, green:Int):Void

Sets the colorchannels of a pixel optimized for the RG TextureFormat.

Parameters:

x

horizontal position

y

vertical position

red

value from 0 to 255

green

value from 0 to 255

inlineset_R(x:Int, y:Int, red:Int):Void

Sets the colorchannels of a pixel optimized for the R TextureFormat.

Parameters:

x

horizontal position

y

vertical position

red

value from 0 to 255

inlineset_LUMINANCE_ALPHA(x:Int, y:Int, luminance:Int, alpha:Int):Void

Sets the colorchannels of a pixel optimized for the LUMINANCE_ALPHA TextureFormat.

Parameters:

x

horizontal position

y

vertical position

luminance

value from 0 to 255

alpha

value from 0 (full transparent) to 255 (opaque)

inlineset_LUMINANCE(x:Int, y:Int, luminance:Int):Void

Sets the colorchannels of a pixel optimized for the LUMINANCE TextureFormat.

Parameters:

x

horizontal position

y

vertical position

luminance

value from 0 to 255

inlineset_ALPHA(x:Int, y:Int, alpha:Int):Void

Sets the colorchannels of a pixel optimized for the ALPHA TextureFormat.

Parameters:

x

horizontal position

y

vertical position

alpha

value from 0 (full transparent) to 255 (opaque)

inlinesetRed(x:Int, y:Int, red:Int):Void

Sets the red channel of a pixel optimized for RGBA, RGB, RG or R TextureFormat.

Parameters:

x

horizontal position

y

vertical position

red

value from 0 to 255

inlinesetGreen(x:Int, y:Int, green:Int):Void

Sets the green channel of a pixel optimized for RGBA, RGB orRG TextureFormat.

Parameters:

x

horizontal position

y

vertical position

green

value from 0 to 255

inlinesetBlue(x:Int, y:Int, blue:Int):Void

Sets the blue channel of a pixel optimized for RGBA or RGB TextureFormat.

Parameters:

x

horizontal position

y

vertical position

blue

value from 0 to 255

inlinesetAlpha(x:Int, y:Int, alpha:Int):Void

Sets the alpha channel of a pixel optimized for RGBA, LUMINANCE_ALPHA or ALPHA TextureFormat.

Parameters:

x

horizontal position

y

vertical position

alpha

value from 0 (full transparent) to 255 (opaque)

inlinesetLuminance(x:Int, y:Int, luminance:Int):Void

Sets the luminance of a pixel optimized for RGBA, RGB, RG, R, LUMINANCE or LUMINANCE_ALPHA TextureFormat.

Parameters:

x

horizontal position

y

vertical position

luminance

value from 0 to 255

getColor(x:Int, y:Int):Color

Gets the Color of a pixel for integer TextureFormats.

Parameters:

x

horizontal position

y

vertical position

inlinegetColor_RGBA(x:Int, y:Int):Color

Gets the Color of a pixel optimized for the RGBA TextureFormat.

Parameters:

x

horizontal position

y

vertical position

inlinegetColor_RGB(x:Int, y:Int):Color

Gets the Color of a pixel optimized for the RGB TextureFormat.

Parameters:

x

horizontal position

y

vertical position

@:access(peote.view.Color)inlinegetColor_RG(x:Int, y:Int):Color

Gets the Color of a pixel optimized for the RG TextureFormat.

Parameters:

x

horizontal position

y

vertical position

inlinegetColor_LUMINANCE_ALPHA(x:Int, y:Int):Color

Gets the Color of a pixel optimized for the LUMINANCE_ALPHA TextureFormat.

Parameters:

x

horizontal position

y

vertical position

inlinegetColor_R(x:Int, y:Int):Color

Gets the Color of a pixel optimized for the R TextureFormat.

Parameters:

x

horizontal position

y

vertical position

inlinegetColor_LUMINANCE(x:Int, y:Int):Color

Gets the Color of a pixel optimized for the LUMINANCE TextureFormat.

Parameters:

x

horizontal position

y

vertical position

inlinegetColor_ALPHA(x:Int, y:Int):Color

Gets the Color of a pixel optimized for the ALPHA TextureFormat.

Parameters:

x

horizontal position

y

vertical position

inlineget_R(x:Int, y:Int):Int

Gets the red value as an integer (0-255) of a pixel, optimized for the R TextureFormat.

Parameters:

x

horizontal position

y

vertical position

inlineget_LUMINANCE(x:Int, y:Int):Int

Gets the luminance value as an integer (0-255) of a pixel, optimized for the LUMINANCE TextureFormat.

Parameters:

x

horizontal position

y

vertical position

inlineget_ALPHA(x:Int, y:Int):Int

Gets the alpha value as an integer (0-255) of a pixel, optimized for the ALPHA TextureFormat.

Parameters:

x

horizontal position

y

vertical position

inlinegetRed(x:Int, y:Int):Int

Gets the red value as an integer (0-255) of a pixel for integer TextureFormats.

Parameters:

x

horizontal position

y

vertical position

inlinegetGreen(x:Int, y:Int):Int

Gets the green value as an integer (0-255) of a pixel for integer TextureFormats.

Parameters:

x

horizontal position

y

vertical position

inlinegetBlue(x:Int, y:Int):Int

Gets the blue value as an integer (0-255) of a pixel for integer TextureFormats.

Parameters:

x

horizontal position

y

vertical position

inlinegetAlpha(x:Int, y:Int):Int

Gets the alpha value as an integer (0-255) of a pixel for integer TextureFormats.

Parameters:

x

horizontal position

y

vertical position

inlinegetLuminance(x:Int, y:Int):Int

Gets the luminance value as an integer (0-255) of a pixel for integer TextureFormats.

Parameters:

x

horizontal position

y

vertical position

@:value({ alpha : 0.0 })inlinesetFloat(x:Int, y:Int, red:Float, green:Float, blue:Float, alpha:Float = 0.0):Void

Sets the colors as float values for the float TextureFormats.

Parameters:

x

horizontal position

y

vertical position

red

value from 0.0 to 1.0

green

value from 0.0 to 1.0

blue

value from 0.0 to 1.0

alpha

value from 0.0 (full transparent) to 1.0 (opaque)

inlinesetFloat_RGBA(x:Int, y:Int, red:Float, green:Float, blue:Float, alpha:Float):Void

Sets the colors as float values of a pixel, optimized for the FLOAT_RGBA TextureFormat.

Parameters:

x

horizontal position

y

vertical position

red

value from 0.0 to 1.0

green

value from 0.0 to 1.0

blue

value from 0.0 to 1.0

alpha

value from 0.0 (full transparent) to 1.0 (opaque)

inlinesetFloat_RGB(x:Int, y:Int, red:Float, green:Float, blue:Float):Void

Sets the colors as float values of a pixel, optimized for the FLOAT_RGB TextureFormat.

Parameters:

x

horizontal position

y

vertical position

red

value from 0.0 to 1.0

green

value from 0.0 to 1.0

blue

value from 0.0 to 1.0

inlinesetFloat_RG(x:Int, y:Int, red:Float, green:Float):Void

Sets the colors as float values of a pixel, optimized for the FLOAT_RG TextureFormat.

Parameters:

x

horizontal position

y

vertical position

red

value from 0.0 to 1.0

green

value from 0.0 to 1.0

inlinesetFloat_R(x:Int, y:Int, red:Float):Void

Sets the colors as float values of a pixel, optimized for the FLOAT_R TextureFormat.

Parameters:

x

horizontal position

y

vertical position

red

value from 0.0 to 1.0

inlinesetFloatRed(x:Int, y:Int, red:Float):Void

Sets the red color channel of a pixel for the float TextureFormats.

Parameters:

x

horizontal position

y

vertical position

red

value from 0.0 to 1.0

inlinesetFloatGreen(x:Int, y:Int, green:Float):Void

Sets the green color channel of a pixel for the float TextureFormats.

Parameters:

x

horizontal position

y

vertical position

green

value from 0.0 to 1.0

inlinesetFloatBlue(x:Int, y:Int, blue:Float):Void

Sets the blue color channel of a pixel for the float TextureFormats.

Parameters:

x

horizontal position

y

vertical position

blue

value from 0.0 to 1.0

inlinesetFloatAlpha(x:Int, y:Int, alpha:Float):Void

Sets the alpha channel of a pixel for the float TextureFormats.

Parameters:

x

horizontal position

y

vertical position

alpha

value from 0.0 (full transparent) to 1.0 (opaque)

inlinegetFloatRed(x:Int, y:Int):Float

Gets the red color channel of a pixel for the float TextureFormats.

Parameters:

x

horizontal position

y

vertical position

inlinegetFloatGreen(x:Int, y:Int):Float

Gets the green color channel of a pixel for the float TextureFormats.

Parameters:

x

horizontal position

y

vertical position

inlinegetFloatBlue(x:Int, y:Int):Float

Gets the blue color channel of a pixel for the float TextureFormats.

Parameters:

x

horizontal position

y

vertical position

inlinegetFloatAlpha(x:Int, y:Int):Float

Gets the alpha channel of a pixel for the float TextureFormats.

Parameters:

x

horizontal position

y

vertical position