• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Gamma Fade using CoreGraphics?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Gamma Fade using CoreGraphics?


  • Subject: Re: Gamma Fade using CoreGraphics?
  • From: Stéphane Sudre <email@hidden>
  • Date: Fri, 13 Jul 2001 16:48:00 +0200

#import <Cocoa/Cocoa.h>
#include <ApplicationServices/ApplicationServices.h>

int main(int argc, const char *argv[])
{
CGDisplayCount tmaxDisplayCount=100;
CGDirectDisplayID tDisplayTable[100];
CGDisplayCount i;
CGGammaValue gamma;
CGDisplayErr err;
CGDisplayCount displayCount_;
CGDisplayCount j;
float index;
float currentIND;
float step;
float speed=-0.001;
int iterattionNumber=5;
CGGetActiveDisplayList(tmaxDisplayCount,tDisplayTable,&displayCount_);

currentIND=1.0;

while ((iterattionNumber--))
{

// If you want to see a 1960's TV, set tDisplayTable[j] to tDisplayTable[0] on 2 displays set-up

for(index=currentIND;index>=(1-currentIND);index+=speed) // Fade in/out
{
gamma = index;

for (j=0;j<displayCount_;j++)
{
err = CGSetDisplayTransferByFormula(tDisplayTable[j],0, gamma, 1.0,0,gamma, 1.0,0, gamma, 1.0);
gamma=1-index;
}
}

currentIND=1-currentIND;
speed=-speed;

for(index=currentIND;index>=(1-currentIND);index+=speed) // Fade out/in
{
gamma = index;

for (j=0;j<displayCount_;j++)
{
err = CGSetDisplayTransferByFormula(tDisplayTable[j],0, gamma, 1.0,0,gamma, 1.0,0, gamma, 1.0);
gamma=1-index;
}
}

currentIND=1-currentIND;
speed=-speed;
}

// Restores ALL displays
CGDisplayRestoreColorSyncSettings();

return 0;
}


References: 
 >Gamma Fade using CoreGraphics? (From: Hisaoki Nishida <email@hidden>)

  • Prev by Date: ScreenSaver Contest Update & User Choice Info
  • Next by Date: Saving TIFF
  • Previous by thread: Gamma Fade using CoreGraphics?
  • Next by thread: security framework and access()
  • Index(es):
    • Date
    • Thread