Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Image Transformation

Image Transformation

Scheduled Pinned Locked Moved C / C++ / MFC
comdiscussion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    ThatsAlok
    wrote on last edited by
    #1

    Could any body provide me basic algorithms for Fading IN or Fading Out of the Image and other related EFFECT. Thanks

    "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

    cheers, Alok Gupta

    F 1 Reply Last reply
    0
    • T ThatsAlok

      Could any body provide me basic algorithms for Fading IN or Fading Out of the Image and other related EFFECT. Thanks

      "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

      cheers, Alok Gupta

      F Offline
      F Offline
      FlyingTinman
      wrote on last edited by
      #2

      I haven't done such a fade in filter but for a smooth transition--one image fading to another--I'd guess you just need to scale each pixel's R,G & B values in the 'old' image toward the R,G & B values of the corresponding pixels in the new image. e.g if you want to do a full fade from old image to identically sized new image in 10 steps :

      for ( each pixel position in the image(s) ){
      __for (Step = 1; Step<=10; Step++){
      ____IntermediateR = OldR + (NewR-OldR)/10 * Step;
      ____IntermediateG = OldG + (NewG-OldG)/!0 * Step;
      ____IntermediateB = OldB + (NewB-OldB)/10 * Step;
      __}
      }

      (Be sure to use signed types for the RGB values so that the scaling will correctly handle the cases where R, G or B in the old image are larger than the corresponding R, G or B value in the new image.) If you want to fade to (or from) a 'blank' screen just substitute the constant 'blank' RGB values for the new (or old) image pixel position RGB values as required. Steve T

      T 1 Reply Last reply
      0
      • F FlyingTinman

        I haven't done such a fade in filter but for a smooth transition--one image fading to another--I'd guess you just need to scale each pixel's R,G & B values in the 'old' image toward the R,G & B values of the corresponding pixels in the new image. e.g if you want to do a full fade from old image to identically sized new image in 10 steps :

        for ( each pixel position in the image(s) ){
        __for (Step = 1; Step<=10; Step++){
        ____IntermediateR = OldR + (NewR-OldR)/10 * Step;
        ____IntermediateG = OldG + (NewG-OldG)/!0 * Step;
        ____IntermediateB = OldB + (NewB-OldB)/10 * Step;
        __}
        }

        (Be sure to use signed types for the RGB values so that the scaling will correctly handle the cases where R, G or B in the old image are larger than the corresponding R, G or B value in the new image.) If you want to fade to (or from) a 'blank' screen just substitute the constant 'blank' RGB values for the new (or old) image pixel position RGB values as required. Steve T

        T Offline
        T Offline
        ThatsAlok
        wrote on last edited by
        #3

        Thanks I will try it :)

        "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

        cheers, Alok Gupta

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups