Skip to content

armgit / raea

Public Imported from GitHub
0

Render Anything Engine: tell your AI what to make. Videos, motion graphics, 3D and games as React and TypeScript, rendered on your own GPU. Rust + Bevy, macOS, Linux and Windows.

4.1 KB
Raw Blame
// Generated by tools/gen.sh from Blender's own API (tools/dump.py). Don't edit: regenerate.
import type * as H from "../../types";
import type * as M from "../../mathutils";
import type * as R from "../rna";
import type * as E from "../enums";
import type * as P from "../py";

/**
 * This module provides access to Blender's image manipulation API.
 *
 * It provides access to image buffers outside of Blender's
 * :class:`bpy.types.Image` data-block context.
 */
export interface Api {
  /**
   * Detect the image file type from a buffer.
   * @returns The detected file type, or None if unrecognized.
   * @param buffer A buffer containing image data.
   */
  file_type_from_buffer(buffer: H.In<H.Bytes>): H.Ptr<P.imbuf_types.ImBufFileType>;
  /**
   * Detect the image file type from a buffer.
   * @returns The detected file type, or None if unrecognized.
   * @param buffer A buffer containing image data.
   */
  file_type_from_buffer(kw: {
    /** A buffer containing image data. */
    buffer: H.In<H.Bytes>;
  }): H.Ptr<P.imbuf_types.ImBufFileType>;
  /** = mappingproxy({'NONE': <ImBufFileType: id='NONE'>, 'PNG': <ImBufFileType: id='PNG'>, 'TGA': <ImBufFileType: id='TGA'>, 'JPEG': <ImBufFileType: id='JPEG'>, 'BMP': <ImBufFileType: id='BMP'>, 'OPEN_EXR': */
  readonly file_types: H.Ref<any>;
  /**
   * Load an image from a file.
   * @returns The newly loaded image.
   * @param filepath The filepath of the image.
   */
  load(filepath: H.In<string | H.Bytes>): H.Ptr<P.imbuf_types.ImBuf>;
  /**
   * Load an image from a file.
   * @returns The newly loaded image.
   * @param filepath The filepath of the image.
   */
  load(kw: {
    /** The filepath of the image. */
    filepath: H.In<string | H.Bytes>;
  }): H.Ptr<P.imbuf_types.ImBuf>;
  /**
   * Load an image from a buffer.
   * @returns The newly loaded image.
   * @param buffer A buffer containing the image data.
   */
  load_from_buffer(buffer: H.In<H.Bytes>): H.Ptr<P.imbuf_types.ImBuf>;
  /**
   * Load an image from a buffer.
   * @returns The newly loaded image.
   * @param buffer A buffer containing the image data.
   */
  load_from_buffer(kw: {
    /** A buffer containing the image data. */
    buffer: H.In<H.Bytes>;
  }): H.Ptr<P.imbuf_types.ImBuf>;
  /**
   * Create a new image.
   * @returns The newly created image.
   * @param size The size of the image in pixels.
   */
  "new"(size: H.In<readonly [number, number]>, kw?: {
    /** Number of bits per pixel. */
    planes?: H.In<8 | 16 | 24 | 32>;
    /** The buffer type. */
    buffer_type?: H.In<"BYTE" | "FLOAT">;
  }): H.Ptr<P.imbuf_types.ImBuf>;
  /**
   * Create a new image.
   * @returns The newly created image.
   * @param size The size of the image in pixels.
   */
  "new"(kw: {
    /** The size of the image in pixels. */
    size: H.In<readonly [number, number]>;
    /** Number of bits per pixel. */
    planes?: H.In<8 | 16 | 24 | 32>;
    /** The buffer type. */
    buffer_type?: H.In<"BYTE" | "FLOAT">;
  }): H.Ptr<P.imbuf_types.ImBuf>;
  readonly types: P.imbuf_types.Api;
  /**
   * Write an image.
   * @param image The image to write.
   */
  write(image: P.imbuf_types.ImBuf, kw?: {
    /** Optional filepath of the image (fallback to the image's file path). */
    filepath?: H.In<string | H.Bytes | null>;
  }): any;
  /**
   * Write an image.
   * @param image The image to write.
   */
  write(kw: {
    /** The image to write. */
    image: P.imbuf_types.ImBuf;
    /** Optional filepath of the image (fallback to the image's file path). */
    filepath?: H.In<string | H.Bytes | null>;
  }): any;
  /**
   * Write an image to a file-like object.
   * @param image The image to write.
   * @param file A writable file-like object (e.g. :class:`io.BytesIO`).
   */
  write_to_buffer(image: P.imbuf_types.ImBuf, file: any): any;
  /**
   * Write an image to a file-like object.
   * @param image The image to write.
   * @param file A writable file-like object (e.g. :class:`io.BytesIO`).
   */
  write_to_buffer(kw: {
    /** The image to write. */
    image: P.imbuf_types.ImBuf;
    /** A writable file-like object (e.g. :class:`io.BytesIO`). */
    file: any;
  }): any;
}