RSX Code Reference
    Preparing search index...

    Class PixelUtil

    Utility methods for converting and managing pixel data and formats.

    Index
    • Parameters

      • OptionalisInternalConstructor: boolean

      Returns PixelUtil

    • Converts pixels from one format to another. Provided pixel data objects must have previously allocated buffers of adequate size and their sizes must match.

      Parameters

      Returns AsyncOp<PixelData>

    • Converts color temperature in Kelvins into an RGB color.

      Parameters

      • temperature: number

      Returns Color

    • Converts a cubemap into a cylindrical panoramic map.

      Parameters

      • faceData: PixelData[]

        Pixels for each individual face of the cubemap, in order as specified by CubemapFace enum.

      • output: PixelData

        Pre-allocated 2D buffer to receive the cylindrical panoramic map. It is suggested the buffer's width is twice the height.

      Returns void

    • Creates a grayscale pixel data from the given source image, using the given channel.

      Parameters

      • source: PixelData

        The source image to create the grayscale from.

      • channel: EnumValue<ChannelMask>

        The pixel channel to retrieve the pixel data information from.

      Returns PixelData

      The pixel data that represents a grayscale information image from the given source.

    • Creates a grayscale pixel data from the given source image, using the given channel.

      Parameters

      Returns void

      The pixel data that represents a grayscale information image from the given source.

    • Returns the size of a single compressed block, in bytes. Returns pixel size if the format is not block compressed.

      Parameters

      Returns number

    • Returns the maximum number of mip maps that can be generated until we reach the minimum size possible. This does not count the base level.

      Parameters

      Returns number

    • Returns the size of the memory region required to hold pixels of the provided size and format.

      Parameters

      • width: number
      • height: number
      • depth: number
      • format: EnumValue<PixelFormat>
      • OptionalfaceCount: number
      • OptionalmipCount: number

      Returns number

    • Calculates row and depth pitch for a texture surface of the specified size and format. For most formats row pitch will equal the number of bytes required for storing "width" pixels, and slice pitch will equal the number of bytes required for storing "width*height" pixels. But some texture formats (especially compressed ones) might require extra padding. Input width/height/depth values are in pixels, while output pitch values are in bytes.

      Parameters

      Returns Vector2

    • Finds a PixelFormat value that has a given name.

      Parameters

      • name: string

        Name of PixelFormat to search for.

      Returns EnumValue<PixelFormat>

      PixelFormat that matches given name or PixelFormat::Unknown if not found.

    • Calculates the size of a mip level of a texture with the provided size.

      Parameters

      • width: number
      • height: number
      • depth: number
      • mipLevel: number

      Returns Vector3

    • Returns true if the pixel data in the format can be directly accessed and read. This is generally not true for compressed formats.

      Parameters

      Returns boolean

    • Creates a grayscale pixel data from the given source image, using the given channel.

      Parameters

      Returns boolean

      The pixel data that represents a grayscale information image from the given source.

    • Converts pixel data in linear space to one in sRGB space. Only converts the RGB components.

      Parameters

      Returns void

    • Scales the input texture so it matches the size of the output texture. The operation will be performed asynchonously on the GPU.

      Parameters

      Returns void

    • Converts pixel data in sRGB space to one in linear space. Only converts the RGB components.

      Parameters

      Returns void