Pixel Width
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7

Thread: Pixel Width

  1. #1
    Join Date
    Sep 2008
    Posts
    19

    Pixel Width

    Hi guys,


    I needed pixel widths that are smaller than 1.0 which is the default in opengl. I have tried higher pixel widths using for e.g. glPointSize(10.0) and it works just fine but as soon as I try to set it to something smaller than 1.0 it doesn't seem to have any effect on it. The pixel widths seem the same. I have also tried glDisable(GL_POINT_SMOOTH) to turn off anti-aliasing but it still doesnt have any effect. I particularly wanted the pixel width of 0.25

    Your help would be greatly appreciated.

    THanks.

  2. #2
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Fairfax, VA
    Posts
    10,888

    Re: Pixel Width

    It doesn't make sense to have pixel width < 1. By definition a pixel can have only one color, you can't partially color it. At best you could color it with 1/4th the intensity, but you can do that with glColor3d anyway.

    http://www.cs.rutgers.edu/~decarlo/4...pointsize.html
    Last edited by Lindley; February 25th, 2009 at 04:50 PM.

  3. #3
    Join Date
    Sep 2008
    Posts
    19

    Re: Pixel Width

    The application that I am developing connects upto a piece of hardware and captures 250 frames per second and i need to fit in 10 seconds worth of information in a 500x500 screen at any particular time and each frame must be represented by a single pixel which turns out that the pixel width should be 0.25 for the information to fit into the screen.

  4. #4
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Fairfax, VA
    Posts
    10,888

    Re: Pixel Width

    Well, that's obviously not going to work. I mean, an entire frame reduced to a quarter of a pixel? Not exactly going to be any usable information there.

    You might look into video summarization algorithms (reducing many frames to a few with the most pertinent details), so that you can show all the relevant information without overloading the user.

    EDIT: By my math, 2500 frames in 250000 pixels gives you 100 pixels per frame. Sounds like a 10x10 block for each frame to me. The above suggestion stands, though.

  5. #5
    Join Date
    Sep 2008
    Posts
    19

    Re: Pixel Width

    My apologies for not explaining the problem more clearly. The frames that I am capturing aren't from a camera or any sort of image information. They are from a microphone that captures sound amplitude so when i said frame, what i really meant was that the frame contains a 'time stamp' and an 'amplitude value' and hence each frame just needs to be a pixel to represent the information I am trying to represent. But i worked my way around that problem but thanks a lot for your feedback, it's always good to get professional advice since I do not deal with graphics at all.

    Another question I had was that I am using calculates the color of each pixel according to the data value that it is representing and I have 255 different data values (i.e. 0-255) now 1/255 gives me 0.003 and such a variation between the pixels is not noticeable at all. I wanted to use a color scheme called a hot plot which varies the color from red being the lowest to white being the highest. I have tried searching the internet for any website that gives me the RGB values for a particular color scheme i.e. all i want to know is how the RGB values vary as we move from one end of the spectrum of the color scheme to the other end.

  6. #6
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Fairfax, VA
    Posts
    10,888

    Re: Pixel Width

    That I may be able to help with. Odds are there's a "color space" corresponding to this "hot plot" which you can use to choose a color, and then mathematically transform that color into RGB.

    I know the HSV color space is somewhat similar; I've used that myself a few times to generate a wide range of colors by linearly varying H and keeping S and V constant. Probably not exactly what you want though.

  7. #7
    Join Date
    Sep 2008
    Posts
    19

    Re: Pixel Width

    Turns out that matlab uses all these color schemes and allows you to dump the entire color scheme from one end of the spectrum to the other in terms of it's RGB values. This was a good find.

    thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center