Articles Archive
Director Forums
Director Wiki
Job Board
Search
 
 Director Online WikiMain Page | About | Help | FAQ | Special pages | Log in | Printable version | Disclaimers

Image

From Director Online Wiki

Table of contents

Description

Properties

paletteRef

symbol like #systemWin, #rainbow etc..
Documented in DIR MX04 for bitmap cast members only.
Image objects do not offer the #palette property, use #paletteRef instead.

Methods

copyPixels()
floodFill()
Description

see: http://www.macromedia.com/devnet/mx/director/articles/imaging_lingo_06.html (http://www.macromedia.com/devnet/mx/director/articles/imaging_lingo_06.html)

Gamma Correction

a global handler to gamma-correct an image is here:

on imgGammaCorrect(afGamma, aImg)
  --@returns img newImage
  --@params  float gamma, image
  --@descr   returns a new, gamma corrected image. does not change orig image
  --@author  based on Joachim Baur (medienwerkstatt)
  --@xmp     member(1).image = imgGammaCorrect( 0.9, member(1).image )
   
  invGamma = 1/float(afGamma)
  reScale  = 255/power(255,invGamma)
  
  h        = aImg.height -1  
  w        = aImg.width  -1  
  tImg     = image(w+1, h+1,aImg.depth)
  
  repeat with y = 0 to h    
    repeat with x = 0 to w   
      
      origRGB           = aImg.getPixel(x,y)      
      origRGB.colorType = #rgb
      
      corrRed   = integer(power(origRGB.red,  invGamma)*reScale)      
      corrGreen = integer(power(origRGB.green,invGamma)*reScale)      
      corrBlue  = integer(power(origRGB.blue, invGamma)*reScale)
      
      tImg.setPixel(x,y,rgb(corrRed, corrGreen, corrBlue))
      
    end repeat    
  end repeat
  
  return tImg
end imgGammaCorrect

see: medienwerkstatt (http://www.medien-werkstatt.com/joa/gamma/gamma_e.htm)

Bugs

Retrieved from "http://www.director-online.com/dougwiki/index.php/Image"

This page has been accessed 1967 times. This page was last modified 14:50, 7 Mar 2007.