Package icyllis.arc3d.granite

# Class SurfaceContext

java.lang.Object
icyllis.arc3d.granite.SurfaceContext

All Implemented Interfaces:
  `AutoCloseable`

public class SurfaceContext extends Object implements AutoCloseable
Helper to orchestrate commands for a particular surface.

The base class assumes the surface is not renderable, so you can only perform simple read and write operations.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected final RecordingContext`
  `mContext`
  `protected final ImageProxyView`
  `mReadView`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `SurfaceContext(@RawPtr RecordingContext context, @RawPtr ImageProxyView readView, int colorType, int alphaType, ColorSpace colorSpace)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `close()`
  Destructs this context.
  `final int`
  `getAlphaType()`
  `final Caps`
  `getCaps()`
  `final int`
  `getColorType()`
  `final @RawPtr RecordingContext`
  `getContext()`
  `protected final RenderTaskManager`
  `getDrawingManager()`
  `final int`
  `getHeight()`
  `final ImageInfo`
  `getImageInfo()`
  `final int`
  `getOrigin()`
  Read view and write view have the same origin.
  `final short`
  `getReadSwizzle()`
  `final @RawPtr ImageProxyView`
  `getReadView()`
  `final int`
  `getWidth()`
  `final boolean`
  `isMipmapped()`

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

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

- ## Field Details

  - ### mContext

    protected final RecordingContext mContext

  - ### mReadView

    protected final ImageProxyView mReadView

- ## Constructor Details

  - ### SurfaceContext

    public SurfaceContext(@RawPtr @RawPtr RecordingContext context, @RawPtr @RawPtr ImageProxyView readView, int colorType, int alphaType, ColorSpace colorSpace)
    Parameters:
      `context` - raw ptr to the context
      `readView` - raw ptr to the read view

- ## Method Details

  - ### getContext

    @RawPtr public final @RawPtr RecordingContext getContext()
    Returns:
      raw ptr to the context

  - ### getReadView

    @RawPtr public final @RawPtr ImageProxyView getReadView()
    Returns:
      raw ptr to the read view

  - ### getImageInfo

    public final ImageInfo getImageInfo()

  - ### getColorType

    public final int getColorType()
    See Also:
      - `ColorInfo.ColorType`

  - ### getAlphaType

    public final int getAlphaType()
    See Also:
      - `ColorInfo.AlphaType`

  - ### getWidth

    public final int getWidth()

  - ### getHeight

    public final int getHeight()

  - ### isMipmapped

    public final boolean isMipmapped()

  - ### getOrigin

    public final int getOrigin()
    Read view and write view have the same origin.
    See Also:
      - `Engine.SurfaceOrigin`

  - ### getReadSwizzle

    public final short getReadSwizzle()
    See Also:
      - `Swizzle`

  - ### getCaps

    public final Caps getCaps()

  - ### getDrawingManager

    protected final RenderTaskManager getDrawingManager()

  - ### close

    public void close()
    Destructs this context.
    Specified by:
      `close` in interface `AutoCloseable`