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. is this code right? [modified]

is this code right? [modified]

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
9 Posts 6 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.
  • G Offline
    G Offline
    gentleguy
    wrote on last edited by
    #1

    dear all i still couldn't find problem from the code below, anyone can help me? thanks a lot. ucGrayImg was defined. ucGrayImg=m_vicGrayImg.ibuff; int *ucGauImgHArray=new int[iHW]; for (iY=0;iY { for (iX=0;iX { int iIndex=iX+iY*iWidth1; if (iX==0) { ucGauImgHArray[iIndex]=ucGrayImg[iX]*mask[1]+ucGrayImg[iX+1]*mask[2]; } else if (iX==iWidth1-1) { ucGauImgHArray[iIndex]=ucGrayImg[iX]*mask[0]+ucGrayImg[iX+1]*mask[1]; } else { ucGauImgHArray[iIndex]=ucGrayImg[iX]*mask[0]+ucGrayImg[iX+1]*mask[1]+ucGrayImg[iX+2]*mask[2]; } } ucGrayImg+=iWidthbyte2; } delete []ucGauImgHArray; here ucGrayImg +=iWidthbyte2 seems problem, but however i don't understand what is problem.thanks

    modified on Thursday, March 13, 2008 12:12 AM

    S I D 3 Replies Last reply
    0
    • G gentleguy

      dear all i still couldn't find problem from the code below, anyone can help me? thanks a lot. ucGrayImg was defined. ucGrayImg=m_vicGrayImg.ibuff; int *ucGauImgHArray=new int[iHW]; for (iY=0;iY { for (iX=0;iX { int iIndex=iX+iY*iWidth1; if (iX==0) { ucGauImgHArray[iIndex]=ucGrayImg[iX]*mask[1]+ucGrayImg[iX+1]*mask[2]; } else if (iX==iWidth1-1) { ucGauImgHArray[iIndex]=ucGrayImg[iX]*mask[0]+ucGrayImg[iX+1]*mask[1]; } else { ucGauImgHArray[iIndex]=ucGrayImg[iX]*mask[0]+ucGrayImg[iX+1]*mask[1]+ucGrayImg[iX+2]*mask[2]; } } ucGrayImg+=iWidthbyte2; } delete []ucGauImgHArray; here ucGrayImg +=iWidthbyte2 seems problem, but however i don't understand what is problem.thanks

      modified on Thursday, March 13, 2008 12:12 AM

      S Offline
      S Offline
      Stephen Hewitt
      wrote on last edited by
      #2

      Please review your post; the for loops aren't displaying properly.

      Steve

      1 Reply Last reply
      0
      • G gentleguy

        dear all i still couldn't find problem from the code below, anyone can help me? thanks a lot. ucGrayImg was defined. ucGrayImg=m_vicGrayImg.ibuff; int *ucGauImgHArray=new int[iHW]; for (iY=0;iY { for (iX=0;iX { int iIndex=iX+iY*iWidth1; if (iX==0) { ucGauImgHArray[iIndex]=ucGrayImg[iX]*mask[1]+ucGrayImg[iX+1]*mask[2]; } else if (iX==iWidth1-1) { ucGauImgHArray[iIndex]=ucGrayImg[iX]*mask[0]+ucGrayImg[iX+1]*mask[1]; } else { ucGauImgHArray[iIndex]=ucGrayImg[iX]*mask[0]+ucGrayImg[iX+1]*mask[1]+ucGrayImg[iX+2]*mask[2]; } } ucGrayImg+=iWidthbyte2; } delete []ucGauImgHArray; here ucGrayImg +=iWidthbyte2 seems problem, but however i don't understand what is problem.thanks

        modified on Thursday, March 13, 2008 12:12 AM

        I Offline
        I Offline
        Iain Clarke Warrior Programmer
        wrote on last edited by
        #3

        To expand on the previous comments - read the "how to post" guideline post, and look at the pre tag Iain.

        Iain Clarke appears because CPallini still cares.

        1 Reply Last reply
        0
        • G gentleguy

          dear all i still couldn't find problem from the code below, anyone can help me? thanks a lot. ucGrayImg was defined. ucGrayImg=m_vicGrayImg.ibuff; int *ucGauImgHArray=new int[iHW]; for (iY=0;iY { for (iX=0;iX { int iIndex=iX+iY*iWidth1; if (iX==0) { ucGauImgHArray[iIndex]=ucGrayImg[iX]*mask[1]+ucGrayImg[iX+1]*mask[2]; } else if (iX==iWidth1-1) { ucGauImgHArray[iIndex]=ucGrayImg[iX]*mask[0]+ucGrayImg[iX+1]*mask[1]; } else { ucGauImgHArray[iIndex]=ucGrayImg[iX]*mask[0]+ucGrayImg[iX+1]*mask[1]+ucGrayImg[iX+2]*mask[2]; } } ucGrayImg+=iWidthbyte2; } delete []ucGauImgHArray; here ucGrayImg +=iWidthbyte2 seems problem, but however i don't understand what is problem.thanks

          modified on Thursday, March 13, 2008 12:12 AM

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          gentleguy wrote:

          i don't understand what is problem.thanks

          And we're supposed to? :doh:

          "Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman

          "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

          J 1 Reply Last reply
          0
          • D David Crow

            gentleguy wrote:

            i don't understand what is problem.thanks

            And we're supposed to? :doh:

            "Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman

            "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

            J Offline
            J Offline
            Justin Perez
            wrote on last edited by
            #5

            Looks like Li Zhiyuan has fooled you guys :)

            I'm going to become rich when I create a device that allows me to punch people in the face over the internet. "If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer

            modified on Wednesday, March 12, 2008 10:03 AM

            D 1 Reply Last reply
            0
            • J Justin Perez

              Looks like Li Zhiyuan has fooled you guys :)

              I'm going to become rich when I create a device that allows me to punch people in the face over the internet. "If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer

              modified on Wednesday, March 12, 2008 10:03 AM

              D Offline
              D Offline
              David Crow
              wrote on last edited by
              #6

              How do you figure? Just because he is posting under a new name does not necessarily mean that any one was "fooled." He received the same lame answer(s) as always.

              "Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman

              "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

              R J 2 Replies Last reply
              0
              • D David Crow

                How do you figure? Just because he is posting under a new name does not necessarily mean that any one was "fooled." He received the same lame answer(s) as always.

                "Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman

                "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

                R Offline
                R Offline
                Rajesh R Subramanian
                wrote on last edited by
                #7

                DavidCrow wrote:

                He received the same lame answer(s) as always.

                :laugh:

                Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP

                1 Reply Last reply
                0
                • D David Crow

                  How do you figure? Just because he is posting under a new name does not necessarily mean that any one was "fooled." He received the same lame answer(s) as always.

                  "Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman

                  "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

                  J Offline
                  J Offline
                  Justin Perez
                  wrote on last edited by
                  #8

                  I was being facetious. Note: I just noticed that when I first posted the message I didn't use the appropriate 'Joke' icon :)

                  I'm going to become rich when I create a device that allows me to punch people in the face over the internet. "If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer

                  G 1 Reply Last reply
                  0
                  • J Justin Perez

                    I was being facetious. Note: I just noticed that when I first posted the message I didn't use the appropriate 'Joke' icon :)

                    I'm going to become rich when I create a device that allows me to punch people in the face over the internet. "If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer

                    G Offline
                    G Offline
                    gentleguy
                    wrote on last edited by
                    #9

                    sorry for that,however i adjust my format of code, they couldn't display completely. so sorry to bring some inconvenience.

                    gentleguy

                    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