Re: [Fwd: Re: How to clear/replace filter list in File Chooser?] segmentation with Glib::RefPtr<Pixbuf>



with these change does it work:
pixbuff_hist = Gdk::Pixbuf::create(COLORSPACE_RGB, false, 8, bit,
histogram_max);	// initialize pixbuffer 
	guint8 *pixel2, *pixels2 = pixbuff_hist -> get_pixels();	// point to pixel
data of pixbuffer 
	int channels2 = pixbuff_hist->get_n_channels();
	int linelength2 = pixbuff_hist->get_rowstride();
	for ( int i=0; i<bit; i++)	// loop for writing into the pixbuffer 
	{
		while (true)
		{
			for (int j=histogram_max-histogram[i]; j<=histogram_max; j++)
			{
				pixel2 = pixels2 + i*channels2 +j*linelength2;
				pixel2[0] = 255;
				pixel2[1] = 255;
				pixel2[2] = 255;
				break;
			}
			for ( int k=0; k<=histogram_max-histogram[i]+1; k++)
			{
				pixel2 = pixels2 + i*channels2 +k*linelength2;
				pixel2[0] = 0;
				pixel2[1] = 0;
				pixel2[2] = 0;
				break;
			}
			break;
		}
	}
But could somebody tell me, why it behaves that strange? 
-- 
View this message in context: http://www.nabble.com/segmentation-with-Glib%3A%3ARefPtr%3CPixbuf%3E-tf3335281.html#a9276840
Sent from the Gtkmm mailing list archive at Nabble.com.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]