/*
 * Copyright © 2015 <code@io7m.com> http://io7m.com
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
 * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

package com.io7m.jcanephora.texture_loader.core;

import java.io.IOException;
import java.io.InputStream;

/**
 * The type of texture data providers.
 *
 * A texture data provider synchronously loads images from streams.
 */

public interface JCGLTLTextureDataProviderType
{
  /**
   * Load an image from the given stream.
   *
   * @param is The stream
   *
   * @return Texture data
   *
   * @throws IOException On I/O or decoding errors
   */

  JCGLTLTextureDataType loadFromStream(
    InputStream is)
    throws IOException;
}

/*
 * Copyright © 2015 <code@io7m.com> http://io7m.com
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
 * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

package com.io7m.jcanephora.texture_loader.core;

import net.jcip.annotations.ThreadSafe;

import java.io.IOException;
import java.io.InputStream;

/**
 * <p>The type of texture data providers.</p>
 *
 * <p>A texture data provider synchronously loads images from streams.</p>
 *
 * <p>Implementations are required to be thread-safe in the sense that they must
 * be able to accept loading requests from arbitrary threads.</p>
 */

@ThreadSafe
public interface JCGLTLTextureDataProviderType
{
  /**
   * Load an image from the given stream.
   *
   * @param is The stream
   *
   * @return Texture data
   *
   * @throws IOException On I/O or decoding errors
   */

  JCGLTLTextureDataType loadFromStream(
    InputStream is)
    throws IOException;
}

Clarify thread safety