Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: OpenGL RGB to HSV homework (coded with C)

  1. #1
    Newbie Newbie
    Join Date
    Jan 2014
    Posts
    1

    OpenGL RGB to HSV homework (coded with C)

    Hi guys and happy new year!
    This is my first time here and I'm kind of in an emergency situation with some homeworks I had to do for a few weeks already. I must work on a picture with the ".bmp" format and using only C code and standard libraries of Linux + OpenGL, Glu & Glut.

    The homeworks is about modifying a picture but by "windows" of little squares made of 3x3 or 4x4 or 6x6 or even 10x10 pixels, I'd start with an RGB conversion to the HSV and then I'd have to manage to analyze only the top left corner's square of 6x6 pixel (for instance) of the picture and change some pixel's positions and disposition according to their luminosity or their contrast... And then do the same thing with the next square, each pixel must be used only once of course, and repeat this until the whole picture has been modified...

    Here's my problem, I know how to convert RGB to HSV, and I feel like it'd be easy to changes the positions of pixels according to luminosity etc but I have absolutely no clue of how I must proceed to analyze the picture square by square, I mean how do I "cut" what I'm working on in the 4x4 first pixel then the 4x4 next one etc...

    If anyone could lend me a hand here, I'd greatly appreciate it !

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Jan 2012
    Location
    Australia
    Posts
    1,106
    Rule number 1 - we don't do people's homework; we respond to specific questions.

    You question on converting RGB to HSV you can look at http://en.literateprograms.org/RGB_t...ersion_%28C%29 or just google "RGB to HSV".

Posting Permissions

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