# cee::Image

class `Image` : public RefCountedObject

  Stores an RGBA image with 8 bits per pixel.

  All pixel values are packed with no alignment.

  Public Functions

  `Image`()

    Constructs an empty image.

  `Image`(const Image &other)

    Constructs an image by copying from another image.

  Image &`operator=`(const Image &other)

    Assigns other to this image and returns a reference to this image.

  unsigned int `width`() const

    Returns the width of image in pixels.

  unsigned int `height`() const

    Returns the height of image in pixels.

  unsigned int `byteCount`() const

    Returns the total number of bytes occupied by this image.

    Always 4*width*height

  bool `hasTransparentPixels`() const

    Returns true if the image has any (semi-)transparent pixels (a != 255)

  void `getAsRgb`(unsigned char rgbDataBuffer[], size_t bufferSizeInBytes) const

    Gets the RGB pixel data of this image object.

    Each color component is 8 bits.

    The RGB pixel values of this image object will be written into the rgbDataBuffer

    The rgbDataBuffer needs to be preallocated to the size bufferSizeInBytes. bufferSizeInBytes must be at least the size of the actual image data.

  void `setFromRgb`(const unsigned char rgbData[], unsigned int width, unsigned int height)

    Sets the pixel data of this image object from an array of RGB unsigned byte values.

    The image will be reallocated to accommodate the specified width and height.

  void `getAsRgba`(unsigned char rgbaDataBuffer[], size_t bufferSizeInBytes) const

    Gets the pixel data as an array of RGBA values.

    Each color component is 8 bits.

    The rgbaDataBuffer needs to be preallocated to the size bufferSizeInBytes. If bufferSizeInBytes is smaller than the size of the actual image data, only the first bufferSizeInBytes number of bytes will be copied.

  void `setFromRgba`(const unsigned char rgbaData[], unsigned int width, unsigned int height)

    Sets the image data from an array of RGBA values.

  void `clear`()

    Clears all image bits and sets width and height to zero.

  unsigned int `version`() const

    Returns the version of the texture. The version is increased whenever the texture is changed.

  const unsigned char *`rawPointer`() const

    Returns a raw pointer to the RGBA pixel array.

Conversation saved
HOOPSY BETA

### Hello! I'm HOOPSY

Your multilingual generative AI assistant for documentation. Ask me anything about HOOPS Envision for Desktop in your own language, or choose a sample question below to start a conversation:

What is HOOPS Envision for Desktop?
What are the latest release notes for HOOPS Envision for Desktop?
How do I start evaluating HOOPS Envision for Desktop?
How do I write my first sample application?
How can I get assistance?

HOOPSY may store conversations according to OpenAI's policy. Responses may not always be accurate.

HOOPSY is thinking...