Thread: using libfg library

  1. #1
    Registered User
    Join Date
    Jan 2009
    Posts
    1

    using libfg library

    Hello, I downloaded the libfg library which is a high-level library for interfacing with video4linux and capturing frames from video devices. Are the statements "FRAMEGRABBER* fg = NULL" and "FRAME* fr = NULL" declaring pointers?? I am confused why the asterisk is not on the opposite side. Furthermore, is FRAMEGRABBER a function name, and fg a variable?

    Code:
    #define TV_ABC 64.250f   
        
    void test()   
    {   
      FRAMEGRABBER* fg = NULL;   
      FRAME* fr = NULL;   
        
      // Open the default device   
        
      fg = fg_open( NULL );   
        
      // Capture from our VCR   
        
      fg_set_source( fg, FG_SOURCE_COMPOSITE );   
        
      // Take a snap   
        
      fr = fg_grab( fg );   
      frame_save( fr, “vcr.pgm” );   
        
      // Now get ABC TV   
        
      fg_set_source( fg, FG_SOURCE_TV );   
      fg_set_tuner( fg, TV_ABC );   
        
      // Take a snap   
        
      fg_grab_frame( fg, frame );   
      frame_save( fr, “ABC.pgm” );   
        
      frame_release( fr );   
      fg_close( fg );   
    }

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Quote Originally Posted by samz07
    Are the statements "FRAMEGRABBER* fg = NULL" and "FRAME* fr = NULL" declaring pointers?? I am confused why the asterisk is not on the opposite side.
    Yes, and read: Is ``int* p;'' right or is ``int *p;'' right?

    Quote Originally Posted by samz07
    Furthermore, is FRAMEGRABBER a function name, and fg a variable?
    With the given information I would say that FRAMEGRABBER is a type name and fg is a variable name.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. What's an import library?
    By chiefmonkey in forum C++ Programming
    Replies: 1
    Last Post: 06-19-2009, 05:00 PM
  2. Property Set Library (PSL) - Announcement
    By vultur_gryphus in forum Projects and Job Recruitment
    Replies: 0
    Last Post: 05-29-2008, 06:04 AM
  3. Makefile for a library
    By sirmoreno in forum Linux Programming
    Replies: 5
    Last Post: 06-04-2006, 04:52 AM
  4. very weird .h problem
    By royuco77 in forum C++ Programming
    Replies: 1
    Last Post: 09-11-2005, 07:55 AM
  5. better c string functions
    By samps005 in forum C Programming
    Replies: 8
    Last Post: 11-04-2003, 01:28 PM