Class ImageShader

java.lang.Object
icyllis.arc3d.core.RefCnt
icyllis.arc3d.sketch.shaders.ImageShader
All Implemented Interfaces:
RefCounted, Shader

public final class ImageShader extends RefCnt implements Shader
  • Field Details

  • Method Details

    • make

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

      @SharedPtr public static @Nullable @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
    • isOpaque

      public boolean isOpaque()
      Description copied from interface: Shader
      Returns true if the shader is guaranteed to produce only opaque colors, subject to the Paint using the shader to apply an opaque alpha value. Subclasses should override this to allow some optimizations.
      Specified by:
      isOpaque in interface Shader
    • getImage

      @RawPtr public @RawPtr Image getImage()
    • getSampling

      public SamplingOptions getSampling()
    • getTileModeX

      public int getTileModeX()
    • getTileModeY

      public int getTileModeY()
    • getSubset

      public Rect2fc getSubset()
    • isTriviallyCounted

      public boolean isTriviallyCounted()
      Description copied from interface: Shader
      A return value of true means that its ref/unref is unnecessary, for example, they are just no op. So callers can perform some optimizations. Subclass can override this method to indicate that an instance is trivially counted. For the same instance, the return value of this method must remain unchanged.
      Specified by:
      isTriviallyCounted in interface Shader
    • makeCubicMatrix

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

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