Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6327831
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T17:21:01+00:00 2026-05-24T17:21:01+00:00

I cant find the correct way to extract the pixel or channel type from

  • 0

I cant find the correct way to extract the pixel or channel type from an image view. I’m looking to define pod_t below to be ‘unsigned char’ in the case of gray8_view_t. There is no simple ViewType::pixel_t. What is the proper definition of this type in function PixelFoo?

    template<class ViewType> 
    void PixelFoo(ViewType v)
    {
        typedef typename ViewType::x_iterator::value_type::channel_t pod_t;
        pod_t maxVal = channel_traits<pod_t>::max_value();
        pod_t podVal = v(0, 0); //expect error with emptyView
    }
    void PixelBar()
    {
        gray8_view_t emptyView;
        PixelFoo(emptyView);
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T17:21:02+00:00Added an answer on May 24, 2026 at 5:21 pm

    ViewType::value_type should be similar to what you expected to be ViewType::pixel_t.

    Then, for homogeneous pixel types, the channel_type<T>::type from HomogeneousPixelBasedConcept should lead to the type you are looking for:

    template<class ViewType> 
    void PixelFoo(ViewType v)
    {
        typedef typename boost::gil::channel_type<typename ViewType::value_type>::type pod_t;
        pod_t maxVal = channel_traits<pod_t>::max_value();
        pod_t podVal = v(0, 0); //expect error with emptyView
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I cant seem to find a correct way to make a selector, It's supposed
I can't find a correct way to get the environment variable for the appdata
I cant find one way to get this value (comment) into json using javascript.
I cant find the way how to strip the useless section of my string
I'm feeling completely stupid, but I can't find the correct way to build JS.Class
I need some help, i have been searching around and cant find the correct
I'm testing node-orm and I can't find the correct way to export models. Here
I can't seem to find the correct way to take some html being returned
What's the correct way of performing an article search from within a Wordpress plugin?
What is the correct way to find out if a process is running as

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.