Beispiel #1
0
        public void CreateBitmap()
        {
            bmp = new Bitmap(x_size, y_size, PixelFormat.Format24bppRgb);

            float scale_tmin, scale_tmax;

            if (RTDPSettings.irImageSettings.irScaleMode == IrImageSettings.IrScale.CameraRange)
            {
                scale_tmin = range_tmin;
                scale_tmax = range_tmax;
            }
            else if (RTDPSettings.irImageSettings.irScaleMode == IrImageSettings.IrScale.DataRange)
            {
                scale_tmin = data_tmin;
                scale_tmax = data_tmax;
            }
            else
            {
                scale_tmin = RTDPSettings.irImageSettings.irScaleMin;
                scale_tmax = RTDPSettings.irImageSettings.irScaleMax;
            }
            IrGradient irGradient = new IrGradient(RTDPSettings.irImageSettings.irGradient, scale_tmin, scale_tmax);

            BitmapData bmp_data = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), ImageLockMode.WriteOnly, PixelFormat.Format24bppRgb);

            unsafe
            {
                byte *rgbptr = (byte *)(bmp_data.Scan0);
                for (int y = 0, i = 0; y < bmp.Height; y++)
                {
                    for (int x = 0; x < bmp.Width; x++, i++)
                    {
                        irGradient.Temp2BGR(fpf_data[i], ref (*rgbptr++), ref (*rgbptr++), ref (*rgbptr++));  // RED
                    }
                    rgbptr += bmp_data.Stride - bmp_data.Width * 3;
                }
            }
            bmp.UnlockBits(bmp_data);
        }
Beispiel #2
0
        public void CreateBitmap()
        {
            bmp = new Bitmap(x_size, y_size, PixelFormat.Format24bppRgb);

            float scale_tmin, scale_tmax;
            if (RTDPSettings.irImageSettings.irScaleMode == IrImageSettings.IrScale.CameraRange)
            {
                scale_tmin = range_tmin;
                scale_tmax = range_tmax;
            }
            else if (RTDPSettings.irImageSettings.irScaleMode == IrImageSettings.IrScale.DataRange)
            {
                scale_tmin = data_tmin;
                scale_tmax = data_tmax;
            }
            else
            {
                scale_tmin = RTDPSettings.irImageSettings.irScaleMin;
                scale_tmax = RTDPSettings.irImageSettings.irScaleMax;
            }
            IrGradient irGradient = new IrGradient(RTDPSettings.irImageSettings.irGradient, scale_tmin, scale_tmax);
            
            BitmapData bmp_data = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), ImageLockMode.WriteOnly, PixelFormat.Format24bppRgb);
            unsafe
            {
                byte*  rgbptr = (byte*)(bmp_data.Scan0);
                for (int y = 0, i = 0; y < bmp.Height; y++)
                {
                    for (int x = 0; x < bmp.Width; x++, i++)
                    {
                        irGradient.Temp2BGR(fpf_data[i], ref (*rgbptr++), ref (*rgbptr++), ref (*rgbptr++));  // RED
                    }
                    rgbptr += bmp_data.Stride - bmp_data.Width * 3;
                }
            }
            bmp.UnlockBits(bmp_data);
        }