Rapid image pixel operations
Provides two APIs: setdibpixelcolor and getdibpixelcolor,
Quickly set and retrieve DIB image pixels to replace the setpixel and getpixel provided by the system.
Setpixel and getpixel are DC-based operations, which are too slow.
// Imagesetpixelfast. cpp: defines the entry point of the console application.// Cheungmine# Include "stdafx. H"# Include # Include
// 24-bit color and 16-bit color conversion macro// By cheungmine# Define rgb888torgb565 (R, G, B) (Word (r)
Image rotation is to convert the New and Old Coordinates and linear interpolation between pixels. Because the coordinate values are converted using multiplication, this article uses addition to replace multiplication to solve the speed problem.
The Code is as follows:
// Function: Image Rotation
// Parameter description: isrc, indicating the original image; idst, indicating the target image; angle, indicating the rotation angle; ncolortype, indicating the fill color of the area outside the bound
Image Rotation Algorithm
Cndg
Image rotation is to convert the New and Old Coordinates and linear interpolation between pixels. Because the coordinate values are converted using multiplication, this article uses addition to replace multiplication to solve the speed problem.
The Code is as follows:
// Function: Image Rotation
// Parameter description: isrc, indicating the original image; idst, indicating the target image; angle, indicating the rotation angle; ncolortype, indicating the fill color
PNG format picture is to support transparent channel, BMP format picture is not transparent channel, so when the PNG format of the picture converted to BMP format, the PNG image for the transparent background needs to be special processing.VC + + HBITMAP is supported transparent color, if HBITMAP is a PNG format picture handle, use Cimage:save or other way to save to the file, the transparent background will turn black.The simplest way to solve this problem is with GDI +, libpng, and so on, usin
complete bilinear interpolation algorithm can be described as follows:(1) The size of the new image is obtained by the original image and scale factor, and a new image is created.(2) A pixel (x, y) of the new image is mapped to the original image (× ', "(3) The X ', y ' rounding is obtained (XX,YY) and the values (XX,YY), (Xx+1,yy), (xx,yy+1), and (xx+1,yy+1) are obtained.(4) Use bilinear interpolation to value the pixel point (x, y) and write back the new image.(5) Repeat step (2) until all pi
PNG format picture is to support transparent channel, BMP format picture is not transparent channel, so when the PNG format of the picture converted to BMP format, the PNG image for the transparent background needs to be special processing.VC + + HBITMAP is supported transparent color, if HBITMAP is a PNG format picture handle, use Cimage:save or other way to save to the file, the transparent background will turn black.The simplest way to solve this problem is with GDI +, libpng, and so on, usin
From: http://hi.baidu.com/gaojinshan/blog/item/4140043de1f07edb9f3d62c1.htmlIdisplay can draw graphics, text, and images,Very commonIdispcanvas is the encapsulation of idisplay, which seems to be not commonly used.Idispcanvas contains idisplay. If necessary, you can create an idispcanvas (canvas) and draw it on it.Rootcontainer contains idispcanvas and draws controls (iwidgets) in the container.Canvaswidget contains idisplay, which is used to draw controls.Canvaswidget is easy to use and is reco
original pixel bit (abpp) from the nitf file ), instead of generating new nitf C8 statistics (abpp, nbpp, histoa: obpp, and SOC: siz: ssiz) from the cropped image ). The default value is false.2. Image Processing
· The image to map correction tool can be completed through Toolbox.
· In the Visual Analysis workflow of Viewshed Analysis workflow, the visible area is green. Invisible or uncertain areas are marked in red.3. User Interface
· The image to
image widthnew= (int) (M_IMPICTURENBSP;. getwidth () *k); heightnew= (int) (M_IMPICTURENBSP;. getheight () *k); //Create new images with the width and height of the new image m_imnewpicture. destroy (); m_imnewpicture. create (WIDTHNEWNBSP;,HEIGHTNEWNBSP;,NBPP); //Gets the number of bytes per line of new and old images intnpitch=m_impicture. getpitch (); intnpitchnew=m_imnewpicture. getpitch (); //get data pointers for new and old images lpb
Contact Us
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.