GSDP:GAM100/CProcessing/imageData()

From Inside
< GSDP:GAM100‎ | CProcessing
Revision as of 10:55, 24 June 2019 by >Zachary.logsdon (New page: {{GSDP:GAM100API.css}} = imageData() = == Description == Returns the pixel data array of a PImage if it was created with the CP_IMAGE_STORE_PIXEL_DATA s...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

imageData()

Description

Returns the pixel data array of a PImage if it was created with the CP_IMAGE_STORE_PIXEL_DATA set by * setImageFlags()

Parameters

imageCreateTint(PImage img)

  • img - (PImage) The image to extract the pixel data from.

Example

PImage justin_face;
PImage tinted_justin_face;
int x_size, y_size;

void init()
{
  setImageFlags(CP_IMAGE_STORE_PIXEL_DATA);
  justin_face = loadImage("./Assets/justin1.png");
  tinted_justin_face = imageCreateTint(justin_face, color(255, 0, 0, 255));
  x_size = imageWidth(justin_face);
  y_size = imageHeight(justin_face);
}

float rotation = 0;
void update()
{
  background(color(255, 255, 255, 255));
  imageRotated(tinted_justin_face, mouseX, mouseY, 100, 150, 255, rotation);
  rotation++;
}

Related

Personal tools
Namespaces

Variants
Actions
Navigation
NameSpaces:>
Tools
Dynamic:>