Package icyllis.arc3d.core.shaders

# Class ImageShader

java.lang.Object
icyllis.arc3d.core.RefCnt
icyllis.arc3d.core.shaders.ImageShader

All Implemented Interfaces:
  `RefCounted`, `Shader`

public final class ImageShader extends RefCnt implements Shader

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `final @SharedPtr Image`
  `mImage`
  `final SamplingOptions`
  `mSampling`
  `final Rect2f`
  `mSubset`
  `final int`
  `mTileModeX`
  `final int`
  `mTileModeY`

  ### Fields inherited from interface icyllis.arc3d.core.shaders.Shader

  `TILE_MODE_CLAMP, TILE_MODE_DECAL, TILE_MODE_MIRROR, TILE_MODE_REPEAT`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected void`
  `deallocate()`
  Override this method to invoke de-allocation of the underlying resource.
  `@RawPtr Image`
  `getImage()`
  `SamplingOptions`
  `getSampling()`
  `Rect2fc`
  `getSubset()`
  `int`
  `getTileModeX()`
  `int`
  `getTileModeY()`
  `static @SharedPtr Shader`
  `make(@SharedPtr Image image, int tileModeX, int tileModeY, SamplingOptions sampling, Matrixc localMatrix)`
  `static float[]`
  `makeCubicMatrix(float B, float C)`
  Create a 4x4 row major matrix for Mitchell–Netravali filters.
  `static @SharedPtr Shader`
  `makeSubset(@SharedPtr Image image, Rect2fc subset, int tileModeX, int tileModeY, SamplingOptions sampling, Matrixc localMatrix)`
  `static Rect2f`
  `preparePaintForDrawImageRect(@RawPtr Image image, SamplingOptions sampling, Rect2fc src, Rect2fc dst, boolean strictSubset, Paint paint)`

  ### Methods inherited from class icyllis.arc3d.core.RefCnt

  `create, create, getRefCnt, getRefCntAcquire, getRefCntVolatile, move, move, ref, unique, unref`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface icyllis.arc3d.core.RefCounted

  `ref, unref`

  ### Methods inherited from interface icyllis.arc3d.core.shaders.Shader

  `isOpaque, makeWithLocalMatrix`

- ## Field Details

  - ### mImage

    @SharedPtr public final @SharedPtr Image mImage

  - ### mSampling

    public final SamplingOptions mSampling

  - ### mTileModeX

    public final int mTileModeX

  - ### mTileModeY

    public final int mTileModeY

  - ### mSubset

    public final Rect2f mSubset

- ## Method Details

  - ### make

    @Nullable @SharedPtr public static @SharedPtr Shader make(@SharedPtr @SharedPtr Image image, int tileModeX, int tileModeY, SamplingOptions sampling, @Nullable Matrixc localMatrix)

  - ### makeSubset

    @Nullable @SharedPtr public static @SharedPtr Shader makeSubset(@SharedPtr @SharedPtr Image image, Rect2fc subset, int tileModeX, int tileModeY, SamplingOptions sampling, @Nullable Matrixc localMatrix)

  - ### deallocate

    protected void deallocate()
    Description copied from class: `RefCnt`
    Override this method to invoke de-allocation of the underlying resource.
    Specified by:
      `deallocate` in class `RefCnt`

  - ### getImage

    @RawPtr public @RawPtr Image getImage()

  - ### getSampling

    public SamplingOptions getSampling()

  - ### getTileModeX

    public int getTileModeX()

  - ### getTileModeY

    public int getTileModeY()

  - ### getSubset

    public Rect2fc getSubset()

  - ### makeCubicMatrix

    public static float[] makeCubicMatrix(float B, float C)
    Create a 4x4 row major matrix for Mitchell–Netravali filters.

  - ### preparePaintForDrawImageRect

    @Nonnull public static Rect2f preparePaintForDrawImageRect(@RawPtr @RawPtr Image image, SamplingOptions sampling, Rect2fc src, Rect2fc dst, boolean strictSubset, Paint paint)