CN101630501B - Method and system for displaying image - Google Patents

Method and system for displaying image Download PDF

Info

Publication number
CN101630501B
CN101630501B CN2008101416057A CN200810141605A CN101630501B CN 101630501 B CN101630501 B CN 101630501B CN 2008101416057 A CN2008101416057 A CN 2008101416057A CN 200810141605 A CN200810141605 A CN 200810141605A CN 101630501 B CN101630501 B CN 101630501B
Authority
CN
China
Prior art keywords
pixel
display device
physical display
source images
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN2008101416057A
Other languages
Chinese (zh)
Other versions
CN101630501A (en
Inventor
周运武
刘志评
周君亮
袁华隆
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Haining Yanguan Industrial Investment Co Ltd
Original Assignee
BYD Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by BYD Co Ltd filed Critical BYD Co Ltd
Priority to CN2008101416057A priority Critical patent/CN101630501B/en
Publication of CN101630501A publication Critical patent/CN101630501A/en
Application granted granted Critical
Publication of CN101630501B publication Critical patent/CN101630501B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Controls And Circuits For Display Device (AREA)

Abstract

The invention is applicable to the field of image processing and provides a method and a system for displaying an image. The method comprises the following steps of: calculating a coordinate value of a mapped pixel point of a pixel point in a source image on a physical display device according to the coordinate value of the pixel point in the source image; calculating the position of the pixel point in the source image in a video memory of the physical display device according to the coordinate value of the mapped pixel point of the pixel point in the source image on the physical display device, the color depth value and the resolution of the physical display device, and storing the pixel point in the source image at the position of the pixel point in the video memory of the physical display device; and displaying the pixel point stored in the video memory of the physical display device. The method and the system can change the physical display device of a different resolution or a different color space by only modifying a corresponding interface of the image displaying method, have a relatively good transportability and reduce maintenance difficulties.

Description

A kind of method for displaying image and system
Technical field
The invention belongs to image processing field,, relate in particular to a kind of method for displaying image and system.
Background technology
Show the field at image, existing method for displaying image generally adopts two-tier system, i.e. source image layer and physics display layer.When being shown to source images on the physical display device, existing method for displaying image is that source images directly is presented on the physical display device.In this method for displaying image, owing to directly be presented at source images in the physical display device, cause when replacing has the physical display device in different resolution or different colours space, need the redesign method for displaying image, thereby make method for displaying image portable poor, maintenance difficulties is big, makes troubles to the developer.
Summary of the invention
The purpose of the embodiment of the invention is to provide a kind of method for displaying image, and it is portable poor to be intended to solve existing method for displaying image, the problem that maintenance difficulties is big.
The embodiment of the invention is achieved in that a kind of method for displaying image, and described method comprises the steps:
Obtain the coordinate figure of the initial display pixel point of source images, calculate described initial display pixel point and map to coordinate figure on the physical display device;
Obtain the coordinate figure of next pixel in the source images, calculate described pixel and map to coordinate figure on the physical display device, circulation is carried out, and all pixels mappings finish in source images;
Map to coordinate figure on the physical display device according to the pixel in the described source images, and the color depth value and the resolution of physical display device, calculate the position of pixel in the video memory of physical display device in the source images, and the pixel in the described source images is stored to the position of described pixel in the video memory of physical display device;
The pixel of storing in the video memory with physical display device is presented on the physical display device.
Another purpose of the embodiment of the invention is to provide a kind of image display system, and described system comprises:
The pixel mapping unit, obtain the coordinate figure of the initial display pixel point of source images, calculate described initial display pixel point and map to coordinate figure on the physical display device, obtain the coordinate figure of next pixel in the source images, calculate described pixel and map to coordinate figure on the physical display device, circulation is carried out, and all pixel mappings finish in source images;
The video memory position calculation unit, be used for the coordinate figure that calculates according to described pixel mapping unit, and the resolution of physical display device and color depth value, calculate the position of each pixel in the video memory of physical display device in the source images, and the color value of each pixel in the described source images is stored to position in the described corresponding video memory that calculates;
Image-display units is used for the pixel that the video memory of physical display device is stored is presented at physical display device.
In embodiments of the present invention, be mapped to coordinate figure on the physical display device by calculating pixel in the source images, and according to the color depth value of this coordinate figure and physical display device and the position of pixel in the video memory of physical display device of resolution calculating source images, thereby when replacing has the physical display device in different resolution or different colours space, only the corresponding interface gets final product in the needs modification logical process layer, better portable, reduced the difficulty of safeguarding.
Description of drawings
Fig. 1 is the realization flow figure of the method for displaying image that provides of the embodiment of the invention;
Fig. 2 is the realization flow figure that each pixel maps to the coordinate figure on the physical display device in the calculating source images that provides of the embodiment of the invention;
Fig. 3 is the realization flow figure that the initial display pixel point of the calculating source images that provides of the embodiment of the invention maps to the coordinate figure on the physical display device;
Fig. 4 is the rectangular coordinate synoptic diagram of the initial source images that provides of the embodiment of the invention;
Fig. 5 is the rectangular coordinate synoptic diagram of setting the viewing area of source images in initial first image that the embodiment of the invention provides;
Fig. 6 to Fig. 9 is that the initial display pixel point of the source images that provides of the embodiment of the invention maps to the synoptic diagram in the physical display device;
Figure 10 is the realization flow figure of the position of each pixel in the video memory of physical display device in the calculating source images that provides of the embodiment of the invention;
Figure 11 be the embodiment of the invention provide the pixel in the source images is carried out precision conversion, obtain the realization flow figure of the new color value of this pixel;
Figure 12 is the synoptic diagram that the component value to the color value of pixel that the embodiment of the invention provides carries out the precision conversion;
Figure 13 is the configuration diagram of the image display system that provides of the embodiment of the invention;
Figure 14 is the composition structural drawing of the image display system that provides of the embodiment of the invention.
Embodiment
In order to make purpose of the present invention, technical scheme and advantage clearer,, the present invention is further elaborated below in conjunction with drawings and Examples.Should be appreciated that specific embodiment described herein only in order to explanation the present invention, and be not used in qualification the present invention.
In embodiments of the present invention, the one logical process layer that is independent of source image layer and physical display device layer is set between existing source image layer and physical display device layer, calculate pixel in source images by this logical process layer and be mapped to coordinate figure on the physical display device, and according to this coordinate figure, and the position of pixel in the video memory of physical display device of the color depth value of physical display device and resolution calculating source images, thereby when replacing has the physical display device in different resolution or different colours space, only the corresponding interface gets final product in the needs modification logical process layer, better portable, reduced the difficulty of safeguarding.
Fig. 1 shows the realization flow of the method for displaying image that the embodiment of the invention provides, and details are as follows:
In step S101, the pixel in the calculating source images maps to the coordinate figure on the physical display device.
In step S102, color depth value and resolution according to this coordinate figure and physical display device, calculate the position of pixel in the video memory of physical display device in the source images, and the pixel in the source images is stored to the position in the video memory of physical display device.
In step S103, on physical display device, show the pixel of storing in the video memory.
Fig. 2 shows pixel in the calculating source images that the embodiment of the invention provides and maps to coordinate figure on the physical display device, and the pixel in the source images is presented at the realization flow of the position of the coordinate figure correspondence on the physical display device that calculates, details are as follows:
In step S201, obtain the coordinate figure of the initial display pixel point of source images, and the initial display pixel point of calculating source images maps to the coordinate figure on the physical display device;
In step S202, judge whether pixel in the source images shines upon to finish, if then the pixel mapping finishes, otherwise, execution in step S203;
In step S203, obtain the coordinate figure of next pixel in the source images, and calculate this pixel and map to coordinate figure on the physical display device;
In step S204, judge that pixel maps to the indication range whether coordinate figure on the physical display device exceeds physical display device, if, execution in step S202 then, otherwise execution in step S205.
In step S205, the pixel in the source images is presented at the position of the coordinate figure correspondence that maps to physical display device, continue execution in step S204.
, can calculate all pixels in the source images and map to coordinate on the physical display device to step S205 by above-mentioned steps S201.
Fig. 3 shows the coordinate figure of the initial display pixel point that obtains source images that the embodiment of the invention provides, and the initial display pixel point that calculates source images maps to the realization flow of the coordinate figure on the physical display device, and details are as follows:
In step S301, obtain the coordinate figure (X of initial display pixel point in the source images 0, Y 0).
During the coordinate figure of the initial display pixel point in obtaining source images, can obtain the coordinate figure (X of initial display pixel point the source images from source image layer 0, Y 0).Coordinate figure (the X of this initial display pixel point 0, Y 0) do not exceed the scope of initial source images.The rectangular coordinate of promptly supposing initial source images as shown in Figure 4, the scope of the source images that this is initial is from pixel (X 00, Y 00) to pixel (X n, Y n), and X 00≤ X n, Y 00≤ Y n, the coordinate figure (X of the initial display pixel point that then obtains 0, Y 0) need satisfy following condition: X 00≤ X 0≤ X n, Y 00≤ Y 0≤ Y n
In step S302, set the viewing area of source images according to the coordinate figure of the initial display pixel point in the source images.
In embodiments of the present invention, when setting the viewing area of source images, to be arranged in the initial display pixel point of source images lower right (is the horizontal ordinate that the horizontal ordinate of source images pixel is greater than or equal to initial pixel, and the ordinate of pixel is greater than or equal to the ordinate of initial pixel) the zone formed of all pixels be set at the viewing area of source images, its effect is as shown in Figure 5.The coordinate figure of promptly supposing pixel is (X p, Y p), then satisfy X 0≤ X p≤ X n, Y 0≤ Y p≤ Y nAll pixel (X p, Y p) zone of forming is the viewing area of source images.
In step S303, whether the length (L_p) of judging the viewing area of source images greater than the length (L_s) of physical display device, and whether the width of the viewing area of source images (W_p) is greater than the width (W_s) of physical display device.
If L_p≤L_s, and W_p≤W_s, when promptly the length of the viewing area of source images and width all are less than or equal to the length of physical display device and width, execution in step S304; If L_p>L_s, and W_p≤W_s, promptly the length of the viewing area of source images is greater than the length of physical display device, and the width of the viewing area of source images is when being less than or equal to the width of physical display device, execution in step S305; If L_p≤L_s, and W_p>W_s, promptly the length of the viewing area of source images is less than or equal to the length of physical display device, and the width of the viewing area of source images is during greater than the width of physical display device, execution in step S306; If L_p>L_s, and W_p>W_s, when promptly the length of the viewing area of source images and width are all greater than the length of physical display device and width, execution in step S307.
In step S304, with initial display pixel point (X in the source images 0, Y 0) map to the position (X central placed in the middle of physical display device s, Y s), make source images may be displayed on the middle position of physical display device, wherein X s=(L_s-L_p)/2, Y s=(W_s_W_p)/2.Initial display pixel point (X with source images 0, Y 0) map to the position (X central placed in the middle of physical display device s, Y s) effect as shown in Figure 6.
In step S305, with initial display pixel point (X in the source images 0, Y 0) map to the vertical center position (X of physical display device s, Y s), source images can be shown on the physical display device vertical direction, wherein X simultaneously between two parties in the horizontal direction alignment of physical display device s=0, Y s=(W_s-W_p)/2.With initial display pixel point (X in the source images 0, Y 0) map to vertical center position, the left side (X of physical display device s, Y s) effect as shown in Figure 7.
In step S306, with initial display pixel point (X in the source images 0, Y 0) map to the horizontal center position (X of physical display device s, Y s), source images can be shown on the physical display device horizontal direction, wherein X simultaneously between two parties in the vertical direction alignment of physical display device s=(L_s-L_p)/2, Y s=0.With initial display pixel point (X in the source images 0, Y 0) map to the horizontal center position (X of physical display device s, Y s) effect as shown in Figure 8.
In step S307, with initial display pixel point (X in the source images 0, Y 0) map to the origin position (X of physical display device s, Y s), make that initial display pixel point aligns with the initial point of physical display device in the source images, wherein X s=0, Y s=0.With initial display pixel point (X in the source images 0, Y 0) map to the origin position (X of physical display device s, Y s) effect as shown in Figure 9.
Can calculate the initial display pixel point (X of source images to step S307 through above-mentioned steps S301 0, Y 0) map to the coordinate figure (X of physical display device s, Y s).Be appreciated that and calculating the initial display pixel point (X of source images 0, Y 0) map to the coordinate figure (X of physical display device s, Y s) after, obtain the initial display pixel point (X of source images again 0, Y 0) next pixel (X 0, Y 1), and with this pixel (X 0, Y 1) map to the coordinate figure (X of physical display device s, Y s) next coordinate figure (X s, Y S+1), according to said method, can calculate the arbitrary pixel (X in the viewing area of source images p, Y p) map to the coordinate figure (X of physical display device d, Y d).
The pixel according in the source images that Figure 10 shows the embodiment of the invention to be provided maps to the coordinate figure on the physical display device, and the color depth value and the resolution of physical display device, the concrete steps of calculating the position of pixel in the video memory of physical display device in the source images are as follows:
In step S1001, physical display device is carried out initialization.
In embodiments of the present invention, when physical display device is carried out initialization, need carry out initialization to the order modes of depositing of pixel in the hardware logic of physical display device and the video memory.After physical display device is carried out initialization, obtain the order modes of depositing of pixel in the base address (pBase) of color depth value (P2_bpp) that physical display device supports, video memory and the video memory.
The depositing order modes and can be LBLP (Little Endian Byte of pixel in the video memory wherein, LittleEndian Pixel order) pattern, BBBP (Big Endian Byte, Big Endian Pixel order) pattern, perhaps LBBP (Little Endian Byte, Big Endian Pixel order) pattern.
In step S1002, whether the color depth value (P1_bpp) of judging source images is consistent with the color depth value (P2_bpp) that physical display device is supported, if inconsistent, execution in step S1003 then, otherwise execution in step S1004.
In step S1003, the color value of the pixel in the source images is carried out the precision conversion, obtain the new color value of this pixel.
In step S1004, (Xd Yd), and the color depth value and the resolution of physical display device, calculates the position of pixel in the video memory of physical display device in the source images to map to the coordinate figure of physical display device according to the pixel in the source images.
In embodiments of the present invention, if the color depth value that physical display device is supported less than 8BPP, as when being 1BPP, 2BPP or 4BPP, the step of then calculating the position of pixel in the video memory of physical display device in the source images is specially:
The byte location of pixel in the video memory of physical display device in A, the calculating source images is unit with the byte, and wherein computing formula is as follows:
PByte=pBase+ (Y d* screen_width+X d) * P2_bpp/8, wherein pBase is the base address of video memory, (X d, Y d) map to the coordinate figure of physical display device for the pixel in the source images, screen_width*screen_height is the resolution of physical display device, wherein screen_width is the shared number of pixels of physical display device lastrow, and screen_height is the shared number of pixels of physical display device previous column.P2_bpp is the color depth value that physical display device is supported.
B, the side-play amount poffset of pixel in a byte of calculating;
In embodiments of the present invention, can adopt following dual mode to calculate side-play amount poffset, a kind of mode is by corresponding to pixel in the byte and the corresponding tables between the side-play amount under every kind of pattern in the direct inquiry physical display device; Another kind is by following computing formula, calculates the side-play amount poffset of a pixel in a byte:
poffset=((Yd*screen_width+Xd)&((1<<(3-index))-1))<<index;
Wherein when the color depth value of physical display device is 1BPP, index=0 then; When the color depth value of physical display device is 2BPP, index=1 then; When the color depth value of physical display device is 4BPP, index=2 then;
C, according to the order modes of depositing of pixel in the video memory of physical display device, regulate side-play amount poffset.
When adopting the LBLP pattern,, therefore, do not need side-play amount poffset is regulated because LBLP is the pixel storage mode of physical display device acquiescence;
When adopting the BBBP pattern, adopt following adjusting formula, poffset regulates to side-play amount:
poffset=(((Y d*screen_width+X d)&((unsigned?int)((unsigned?int)1<<(3-index))-1))<<index)^((unsigned?int)((unsigned?int)7<<index)&7);
Wherein when the color depth value of physical display device is 1BPP, index=0 then; When the color depth value of physical display device is 2BPP, index=1 then; When the color depth value of physical display device is 4BPP, index=2 then.
When adopting the LBBP pattern, adopt following adjusting formula, poffset regulates to side-play amount:
poffset=(((Yd*screen_width+Xd)&((unsigned?int)((unsigned?int)1<<(3-index))-1))<<index)^((unsigned?int)((unsigned?int)7<<index)&7);
Wherein when the color depth value of physical display device is 1BPP, index=0 then; When the color depth value of physical display device is 2BPP, index=1 then; When the color depth value of physical display device is 4BPP, index=2 then.
D, determine the position pAdd=pByte+poffset of pixel in the video memory of physical display device in the source images according to the position pByte and the offset calculated poffset of the pixel in the source images that calculates in the video memory of physical display device.
In embodiments of the present invention, during position pAdd in the video memory of pixel in physical display device in calculating source images, the computing formula of employing is pAdd=pBase+ (Y d* screen_width+X d) * P2_bpp, the pAdd that wherein calculates is unit with the position.
In embodiments of the present invention, because the video memory of physical display device is when storage pixel is put, according to bytes store, therefore, what need to calculate be that the pAdd of unit is converted to the byte with the position is the pAdd (being called pByte) of unit, wherein pByte=pBase+ (Yd*screen_width+Xd) * P2_bpp/8.
If the color depth value of physical display device support is equal to, or greater than 8BPP, as when being 8BPP, 16BPP or 24BPP, no matter which kind of pixel memory module the video memory in the physical display device adopts, all adopt following computing formula: pAdd=pBase+ (Yd*screen_width+Xd) * P2_bpp/8, calculate the position of pixel in the video memory of physical display device in the source images.The color value to the pixel in the source images that Figure 11 shows the embodiment of the invention to be provided carries out the precision conversion, obtains the realization flow of the new color value of this pixel, and details are as follows:
In step S1101, obtain each component value of the color value of the pixel in the source images.
In embodiments of the present invention, the color value of supposing the pixel of source images is RGB_value, and the largest component value of the component of hypothesis RGB_value correspondence is respectively R_Max_value, G_Max_value and B_Max_value, and then each component value R_Src_value, G_Src_value and the B_Src_value of this pixel color value that obtains according to the maximal value of the component of the color value of the pixel in the source images and color value correspondence are respectively:
R_Src_value=(RGB_value>>(G1_bits+B1_bits))&?R_Max_value;
G_Src_value=(RGB_value>>B1_bits)&?G_Max_value;
B_Src_value=RGB_value?&?B_Max_value。
Wherein G1_bits, B1_bits are respectively the components R of the color value (RGB_value) of the pixel of source images, the figure place of G.
In step S1102, adopt the precision conversion formula that component value R_Src_value, G_Src_value and the B_Src_value of the color value of each pixel of source images are carried out the precision conversion respectively.
See also Figure 12, the synoptic diagram that the component value to the color value of the pixel in the source images that provides for the embodiment of the invention carries out the precision conversion.The precision conversion formula that the embodiment of the invention adopts is P_Src_value/P_Src_max=P_Obj_value/P_Obj_max, wherein P_Src_value and P_Src_max are respectively the component value and the largest component value of color value of the pixel of source images, and P_Obj_value and P_Obj_max are respectively the component value and the largest component value of the color value of the image slices vegetarian refreshments that physical display device supports.
As follows to components R _ Src_value, the G_Src_value of the color value of each pixel of source images and detailed process that B_Src_value carries out the precision conversion respectively: the component value of the color value of the image slices vegetarian refreshments after suppose to change by precision is respectively R_Obj_value, G_Obj_value and B_Obj_value, and the largest component value of the color value of the pixel of hypothesis physical display device support is R_Max_Obj_value, G_Max_Obj_value and B_Max_Obj_value, then
R_Obj_value=(R_Src_value/R_Max_value)*R_Max_Obj_value;
G_Obj_value=(G_Src_value/G_Max_value)*G_Max_Obj_value;
B_Obj_value=(B_Src_value/B_Max_value)*B_Max_Obj_value。
In step S1103, adopt displacement operation the component value of the color value of the pixel that is converted to be spliced into again the new color value of this pixel.Its detailed process is as follows:
The spliced again color value of component value of supposing the color value of pixel is RGB_New_value, then
RGB_New_value=(unsigned?short)(((unsigned?short)R_Obj_value
<<(G_bits+B_bits))
|((unsigned?short)G_Obj_value<<B_bits)
|(unsigned?short)B_Obj_value)。(wherein G_bits is the shared figure place of component G of the color value of physical display device, and B_bits is the shared figure place of component B of color value of the pixel of physical display device)
To step S1103, can carry out the precision conversion by above-mentioned steps S1101, obtain the new color value RGB_New_value of this pixel the pixel in the source images.
At this moment, pixel in the source images is being stored in the process of the position in the video memory that calculates, when the color depth value of supporting when the color depth value of source images and physical display device is consistent, the color value of the pixel of source images is stored to calculates the position of this pixel in the video memory of physical display device; When the color depth value of the color depth value of source images and physical display device support is inconsistent, then the color value of the pixel in the source images is carried out the new color value of the pixel that precision is converted to, be stored to and calculate the position of this pixel in the video memory of physical display device.
In embodiments of the present invention, when the color depth value of supporting when the color depth value and the physical display device of the pixel in the source images is inconsistent, by the pixel in the source images being carried out the precision conversion, make the pixel in the source images on physical display device, show the phenomenon that distortion can not occur, thereby when replacing has the physical display device of different colours depth value or resolution, by pixel being carried out the precision conversion, and modification realizes the corresponding interface of the program of said method, can realize source images is presented on the physical display device after the replacing, portable good, be convenient to later maintenance.
Figure 13 shows the framework of the image display system that the embodiment of the invention provides, and according to the function of image display system, this image display system is divided into three layers, is respectively source image layer, logical abstraction layer and physics display layer.The logical abstraction layer progressively is mapped to coordinate figure on the physical display device with the pixel of the source images in the source image layer, and according to this coordinate figure of physical display device, and the position of each pixel in the video memory of physical display device in the color depth value of physical display device and the resolution calculating source images, and each pixel of source images is stored in the position of this pixel in the video memory of physical display device, the physics display layer is presented at the pixel of depositing in its video memory on the physical display device.
Figure 14 shows the structure of the image display system that the framework according to image display system shown in Figure 13 obtains, and for convenience of explanation, only shows the part relevant with the embodiment of the invention.
Pixel mapping unit 1 is according to the coordinate figure (X of the pixel in the source images p, Y p) calculate pixel in the source images and map to coordinate figure (X on the physical display device d, Y d).Wherein image display area setting module 11 is determined the viewing area of source images according to the initial display pixel point of user's setting.Pixel coordinate acquisition module 12 obtains the coordinate figure (X of each pixel in the viewing area of source images p, Y p).Pixel coordinate mapping block 13 is according to the coordinate figure (X of each pixel in the viewing area of source images p, Y p), each pixel maps to the coordinate figure (X on the physical display device in the viewing area of calculating source images d, Y d).
Pixel coordinate acquisition module 12 at first obtains the coordinate figure (X of initial pixel in the viewing area of source images 0, Y 0), whether the length (L_p) that pixel coordinate mapping block 13 is judged the viewing area of source images greater than the length (L_s) of physical display device, and whether the width of the viewing area of source images (W_p) is greater than the width (W_s) of physical display device.
As L_p≤L_s, during and W_p≤W_s, pixel coordinate mapping block 13 maps to initial pixel in the source images position (X central placed in the middle of physical display device s, Y s), make source images may be displayed on the middle position of physical display device, wherein X s=(L_s-L_p)/2, Y s=(W_s-W_p)/2;
As L_p>L_s, during and W_p≤W_s, pixel coordinate mapping block 13 maps to initial pixel in the source images vertical center starting point (X of physical display device s, Y s), source images can be alignd, wherein X in the horizontal direction of physical display device s=0, Y s=(W_s-W_p)/2;
As L_p≤L_s, during and W_p>W_s, pixel coordinate mapping block 13 maps to initial pixel in the source images horizontal center starting point (X of physical display device s, Y s), source images can be alignd, wherein X in the vertical direction of physical display device s=(L_s-L_p)/2, Y s=0;
As L_p>L_s, during and W_p>W_s, pixel coordinate mapping block 13 maps to initial pixel in the source images initial point (X of physical display device s, Y s), the initial display pixel point of source images is alignd, wherein X with the initial point of physical display device s=0, Y s=0.
After the initial display pixel point of the viewing area that calculates source images mapped to the coordinate figure of physical display device, pixel coordinate acquisition module 12 obtained the coordinate figure (X of next pixel of initial pixel in the viewing area of source images 0, Y 1), pixel coordinate mapping block 13 is with this pixel (X 0, Y 1) map to (X of physical display device s, Y s) the coordinate figure (X of next pixel s, Y S+1), the rest may be inferred, can be with the arbitrary pixel (X in the viewing area of source images p, Y p) map to the coordinate figure (X of physical display device d, Y d).
Each pixel maps to the coordinate figure of physical display device in the source images that video memory position calculation unit 2 obtains according to pixel mapping unit 1, and the resolution of physical display device and color depth value, calculate the position of each pixel in the video memory of physical display device in the source images.Wherein the order modes of depositing of pixel is carried out initialization in the hardware logic of 21 pairs of physical display device of initialization module and the video memory, obtains the order modes of depositing of pixel in base address pBase, BPP pattern and the video memory of bit wide pixel_width_bytes, video memory of single pixel.The depositing order modes and can be LBLP pattern (LittleEndian Byte of pixel in the video memory wherein, Little Endian Pixel order), BBBP pattern (Big Endian Byte, Big EndianPixel order), perhaps LBBP pattern (Little Endian Byte, Big Endian Pixel order).
Whether the color depth value that color depth value judge module 22 is judged source images is consistent with the color depth value that physical display device is supported, if not, then the pixel in 23 pairs of source images of precision modular converter carries out the precision conversion, obtains the new color value of this pixel.Wherein color value acquisition module 231 obtains each component value R_Src_value, G_Src_value and B_Src_value of the color value of each pixel in the source images, and its detailed process does not repeat them here as mentioned above.Component value precision modular converter 232 adopts the precision conversion formula that component value R_Src_value, G_Src_value and the B_Src_value of the color value of each pixel of source images are carried out the precision conversion respectively.In embodiments of the present invention, the precision conversion formula that adopts is P_Src_value/P_Src_max=P_Obj_value/P_Obj_max, wherein P_Src_value and P_Src_max are respectively the component value and the largest component value of the color value of source image pixels point, and P_Obj_value and P_Obj_max are respectively the component value and the largest component value of the color value of the pixel that physical display device supports.Wherein the detailed process of component value precision conversion does not repeat them here as mentioned above.Component value concatenation module 233 adopts displacement operations that the component value of the color value of the pixel that is converted to is spliced into the new color value of this pixel again, and its detailed process does not repeat them here as mentioned above.
Each pixel in the source images viewing area that video memory position computation module 24 obtains according to pixel mapping unit 1 is mapped in the coordinate figure (Xd of physical display device, Yd), and the resolution of physical display device and color depth value are calculated the deposit position of this pixel in the video memory of physical display device, its detailed process does not repeat them here as mentioned above.
The color value of the source images that pixel memory module 25 obtains precision modular converter 23 or original color value of source images are deposited the relevant position in the video memory of the physical display device that calculates to video memory position computation module 24.
The pixel of storing in the video memory of image-display units 3 with physical display device is presented on the physical display device.
In embodiments of the present invention, by a logical process layer that is independent of source image layer and physical display device layer is set between existing source image layer and physical display device layer, by this logical process layer the pixel in the source images progressively is mapped to coordinate on the physical display device, and according to the coordinate of physical display device, the color depth value of this pixel and the resolution of physical display device are calculated the position of source images in the video memory of physical display device, thereby when the resolution that changes source images and chrominance space or replacing physical display device, only need to revise the corresponding interface of corresponding program in the logical process layer, source images can be presented on the physical display device, better portable, increased the dirigibility of program development, also reduce simultaneously the cycle of software secondary development, simplified the maintenance work of software.
The above only is preferred embodiment of the present invention, not in order to restriction the present invention, all any modifications of being done within the spirit and principles in the present invention, is equal to and replaces and improvement etc., all should be included within protection scope of the present invention.

Claims (13)

1. a method for displaying image is characterized in that, described method comprises the steps:
Obtain the coordinate figure of the initial display pixel point of source images, calculate described initial display pixel point and map to coordinate figure on the physical display device;
Obtain the coordinate figure of next pixel in the source images, calculate described pixel and map to coordinate figure on the physical display device, circulation is carried out, and all pixels mappings finish in source images;
Map to coordinate figure on the physical display device according to the pixel in the described source images, and the color depth value and the resolution of physical display device, obtain the position of pixel in the video memory of physical display device in the source images, and the pixel in the described source images is stored to the position of described pixel in the video memory of physical display device;
The pixel of storing in the video memory with physical display device is presented on the physical display device.
2. the method for claim 1 is characterized in that, the described coordinate figure that obtains the initial display pixel point of source images calculates the step that described initial display pixel point maps to the coordinate figure on the physical display device and is specially:
Obtain the coordinate figure (X of initial display pixel point in the source images 0, Y 0);
Coordinate figure (X according to described initial display pixel point 0, Y 0) set the viewing area of source images;
Calculate the coordinate figure (X of initial display pixel point in the described source images according to the viewing area of described source images 0, Y 0) map to the coordinate figure on the physical display device.
3. method as claimed in claim 2 is characterized in that, described step is calculated the coordinate figure (X of initial display pixel point in the described source images according to the viewing area of described source images 0, Y 0) coordinate figure that maps on the physical display device is specially:
Whether length L _ the s of viewing area that judges source images greater than the length L _ p of physical display device, and whether width W _ the s of the viewing area of source images is greater than the width W _ p of physical display device;
As L_p≤L_s, during and W_p≤W_s, with the initial display pixel point (X of described source images 0, Y 0) map to the position (X central placed in the middle of physical display device s, Y s), X wherein s=(L_s-L_p)/2, Y s=(W_s-W_p)/2;
As L_p>L_s, during and W_p≤W_s, with the initial display pixel point (X of described source images 0, Y 0) map to the vertical center position (X of physical display device s, Y s), X wherein s=0, Y s=(W_s-W_p)/2;
As L_p≤L_s, during and W_p>W_s, with the initial display pixel point (X of described source images 0, Y 0) map to the horizontal center position (X of physical display device s, Y s), X wherein s=(L_s-L_p)/2, Y s=0;
As L_p>L_s, during and W_p>W_s, with the initial display pixel point (X of described source images 0, Y 0) map to the initial point (X of physical display device s, Y s), X wherein s=0, Y s=0.
4. the method for claim 1, it is characterized in that, described step maps to coordinate figure on the physical display device according to the pixel in the described source images, and the color depth value and the resolution of physical display device, obtain the position of pixel in the video memory of physical display device in the source images, and the pixel in the described source images is stored to the position of described pixel in the video memory of physical display device is specially:
Physical display device is carried out initialization;
Whether the color depth value of judging source images is consistent with the color depth value that physical display device is supported, if it is inconsistent, obtain each component value of the color value of the pixel in the source images, adopt formula P_Src_value/P_Src_max=P_Obj_value/P_Obj_max that described component value is carried out the precision conversion respectively, described each component value after the precision conversion is spliced into again the new color value of described pixel, wherein P_Src_value and P_Src_max are respectively the component value and the largest component value of color value of the pixel of source images, and P_Obj_value and P_Obj_max are respectively the component value and the largest component value of the color value of the image slices vegetarian refreshments that physical display device supports;
Be mapped in the coordinate figure of physical display device according to the pixel in the source images, and the resolution of physical display device and color depth value are calculated the position of described pixel in the video memory of physical display device;
The color value of the pixel of source images is deposited to the position of described pixel in the video memory of physical display device.
5. method as claimed in claim 4 is characterized in that, when the color depth value of physical display device was equal to, or greater than 8BPP, the video memory position calculation mode of employing was:
pAdd=pBase+(Y d*screen_width+X d)*P2_bpp/8,
Wherein, pBase is the base address of video memory, (X d, Y d) for the pixel in the source images maps to the coordinate figure of physical display device, screen_width is the shared number of pixels of physical display device lastrow, P2_bpp is the color depth value that physical display device is supported.
6. method as claimed in claim 4, it is characterized in that, pixel deposits the pattern that mode that order modes is stored in the low address place for the low level byte with the X and Y coordinates of pixel is deposited pixel in the described video memory, the mode that is stored in the low address place with the high-order byte of the X and Y coordinates of pixel is deposited the pattern of pixel, and perhaps the high-order byte that is stored in the Y coordinate of low address place, pixel with the low level byte of the X coordinate of pixel is stored in the pattern of depositing pixel of the mode at low address place.
7. method as claimed in claim 5, it is characterized in that, when the color depth value of physical display device during less than 8BPP, describedly be mapped in the coordinate figure of physical display device, and the step that the resolution of physical display device and color depth value are calculated the position of described pixel in the video memory of physical display device is specially according to the pixel in the source images:
Calculate the byte location pByte of pixel in the video memory of physical display device in the source images;
Calculate the side-play amount poffset of pixel in a byte;
The order modes of depositing according to pixel in the video memory is regulated described side-play amount poffset;
According to described byte location pByte and the side-play amount poffset after regulating determine the position pAdd=pByte+poffset of pixel in the video memory of physical display device in the source images.
8. method as claimed in claim 7, it is characterized in that, the mode of calculating the side-play amount poffset of pixel in a byte is for corresponding to a pixel in the byte and the corresponding tables between the side-play amount poffset under every kind of pattern in by direct inquiry physical display device, perhaps for adopting the side-play amount poffset of pixel in a byte of formula calculating.
9. method as claimed in claim 7 is characterized in that, the described order modes of depositing according to pixel in the video memory is regulated the step of described side-play amount poffset and is specially:
When the depositing mode that order modes is stored in the low address place for the low level byte with the X and Y coordinates of pixel and deposit the pattern of pixel of pixel in the video memory, do not regulate described side-play amount poffset;
When pixel in the video memory deposit mode that order modes is stored in the low address place for the high-order byte with the X and Y coordinates of pixel deposit the pattern of pixel or be stored in the high-order byte that the low level byte of the X coordinate of pixel is stored in the Y coordinate of low address place, pixel the low address place mode deposit the pattern of pixel the time, adopt formula poffset=(((Y d* screen_width+X d) ﹠amp; ((unsigned int) ((unsigned int) 1<<(3-index))-1))<<index) ^ ((unsigned int) ((unsigned int) 7<<index) ﹠amp; 7) described side-play amount poffset is regulated;
Wherein, when the color depth value of physical display device is 1BPP, index=0; When the color depth value of physical display device is 2BPP, index=1; When the color depth value of physical display device is 4BPP, index=2, (Xd Yd) maps to the coordinate figure of physical display device for the pixel in the source images, screen_width is the shared number of pixels of physical display device lastrow.
10. an image display system is characterized in that, described system comprises:
The pixel mapping unit, be used to obtain the coordinate figure of the initial display pixel point of source images, calculate described initial display pixel point and map to coordinate figure on the physical display device, obtain the coordinate figure of next pixel in the source images, calculate described pixel and map to coordinate figure on the physical display device, circulation is carried out, and all pixel mappings finish in source images;
The video memory position calculation unit, be used for the coordinate figure that calculates according to described pixel mapping unit, and the resolution of physical display device and color depth value, calculate the position of each pixel in the video memory of physical display device in the source images, and the color value of each pixel in the described source images is stored to position in the described corresponding video memory that calculates;
Image-display units is used for the pixel that the video memory of physical display device is stored is presented at physical display device.
11. system as claimed in claim 10 is characterized in that, described pixel mapping unit comprises:
The image display area setting module, the initial display pixel point that is used for setting according to the user is determined the viewing area of source images;
The pixel coordinate acquisition module is used for obtaining the coordinate figure of each pixel of viewing area of described source images;
The pixel coordinate mapping block is used for the coordinate figure according to each pixel of viewing area of source images, and each pixel maps to the coordinate figure on the physical display device in the viewing area of calculating source images.
12. system as claimed in claim 10 is characterized in that, described video memory position calculation unit comprises:
Initialization module is used for physical display device is carried out initialization;
Color depth value judge module, whether the color depth value that is used to judge source images is consistent with the color depth value that physical display device is supported;
The precision modular converter, be used for when the judged result of described color depth value judge module for not the time, obtain each component value of the color value of the pixel in the source images, adopt formula P_Src_value/P_Src_max=P_Obj_value/P_Obj_max that described component value is carried out the precision conversion respectively, described each component value after the precision conversion is spliced into again the new color value of described pixel, wherein P_Src_value and P_Src_max are respectively the component value and the largest component value of color value of the pixel of source images, and P_Obj_value and P_Obj_max are respectively the component value and the largest component value of the color value of the image slices vegetarian refreshments that physical display device supports;
The video memory position computation module is used for being mapped in according to the pixel of source images the coordinate figure of physical display device, and the resolution of physical display device and color depth value are calculated the position of described pixel in the video memory of physical display device;
The pixel memory module is used for the color value of source images or original color value of source images are deposited to the position of described pixel at the video memory of physical display device.
13. system as claimed in claim 12 is characterized in that, described precision modular converter comprises:
The color value acquisition module is used for obtaining each component value of color value of the pixel of source images;
Component value precision modular converter is used for described component value is carried out the precision conversion respectively;
The component value concatenation module is used for described each component value after precision conversion is spliced into again the new color value of described pixel.
CN2008101416057A 2008-07-14 2008-07-14 Method and system for displaying image Expired - Fee Related CN101630501B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2008101416057A CN101630501B (en) 2008-07-14 2008-07-14 Method and system for displaying image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2008101416057A CN101630501B (en) 2008-07-14 2008-07-14 Method and system for displaying image

Publications (2)

Publication Number Publication Date
CN101630501A CN101630501A (en) 2010-01-20
CN101630501B true CN101630501B (en) 2011-11-16

Family

ID=41575585

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2008101416057A Expired - Fee Related CN101630501B (en) 2008-07-14 2008-07-14 Method and system for displaying image

Country Status (1)

Country Link
CN (1) CN101630501B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101963980A (en) * 2010-09-27 2011-02-02 苏州阔地网络科技有限公司 Method for realizing whiteboard synchronization after picture centering under different resolutions on webpage
CN102279723A (en) * 2011-08-24 2011-12-14 百度在线网络技术(北京)有限公司 System and method for realizing split-screen display
CN104200459A (en) * 2014-08-04 2014-12-10 联想(北京)有限公司 Information processing method and electronic device
CN111833788B (en) * 2019-04-19 2023-08-04 北京小米移动软件有限公司 Screen dimming method and device, terminal and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5245701A (en) * 1990-10-10 1993-09-14 Fuji Xerox Co., Ltd. Method and system for processing image data based on pixel characteristics
US5349372A (en) * 1993-07-16 1994-09-20 Pellucid Inc. Video subsystems utilizing asymmetrical column interleaving
CN1249604A (en) * 1998-08-03 2000-04-05 松下电器产业株式会社 Image input device and method
EP1241658A2 (en) * 2001-03-13 2002-09-18 Sony Corporation Display device and display method
CN1452132A (en) * 2002-04-15 2003-10-29 松下电器产业株式会社 Graph describing device
CN1783203A (en) * 2004-12-03 2006-06-07 深圳迈瑞生物医疗电子股份有限公司 Hardware acceleration display horizontal line section device and method
CN101030365A (en) * 2007-04-10 2007-09-05 北京中星微电子有限公司 Digital image storage displaying method and device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5245701A (en) * 1990-10-10 1993-09-14 Fuji Xerox Co., Ltd. Method and system for processing image data based on pixel characteristics
US5349372A (en) * 1993-07-16 1994-09-20 Pellucid Inc. Video subsystems utilizing asymmetrical column interleaving
CN1249604A (en) * 1998-08-03 2000-04-05 松下电器产业株式会社 Image input device and method
EP1241658A2 (en) * 2001-03-13 2002-09-18 Sony Corporation Display device and display method
CN1452132A (en) * 2002-04-15 2003-10-29 松下电器产业株式会社 Graph describing device
CN1783203A (en) * 2004-12-03 2006-06-07 深圳迈瑞生物医疗电子股份有限公司 Hardware acceleration display horizontal line section device and method
CN101030365A (en) * 2007-04-10 2007-09-05 北京中星微电子有限公司 Digital image storage displaying method and device

Also Published As

Publication number Publication date
CN101630501A (en) 2010-01-20

Similar Documents

Publication Publication Date Title
US7262776B1 (en) Incremental updating of animated displays using copy-on-write semantics
US6911984B2 (en) Desktop compositor using copy-on-write semantics
CN106293160B (en) Method and device for switching mouse pointers among multiple displays
US8352879B2 (en) Method for swapping display contents between multiple screens
US9269122B2 (en) First and second software stacks and discrete and integrated graphics processing units
CN103680470B (en) The method for displaying image that large-size screen monitors control and system
CN106293195B (en) Display device with touch sensor
US8013804B2 (en) System and method for graphics remapping in hypervisor
CN100543830C (en) The drive unit of liquid crystal display device and method
CN101630501B (en) Method and system for displaying image
CN106095157A (en) Touch screen display device
CN101778226B (en) High-definition image sawtooth-prevention method, device and digital television receiving terminal
US10475394B2 (en) Driving method and driving device for liquid crystal display, and liquid crystal display
CN104346125A (en) On-screen area display method and device
CN103247068A (en) Rendering method and device
CN101420534A (en) Multiple image display method and apparatus
CN105094289A (en) Method, device, and system for realizing graphical user interface
CN103294473A (en) Virtual surface compaction
KR102190106B1 (en) Apparatus for compensating image data of display device
CN103853510A (en) Multi-screen projection display control system and method of handheld electronic device
WO2019212129A1 (en) Virtual exhibition space providing method for efficient data management
CN101668144A (en) Method for realizing semitransparent effect of image layer on video layer, device and set top box
CN111752504B (en) Multi-screen display method and system for electronic equipment, electronic equipment and computer readable medium
CN103399720B (en) A kind of data processing method and a kind of electronic equipment
CN101488332A (en) Screen display accelerated mixing system and method based on WinCE system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20200106

Address after: 314411 Jianshe East Road, Guodian, Yanguan Town, Haining City, Jiaxing City, Zhejiang Province

Patentee after: Haining Yanguan Industrial Investment Co., Ltd

Address before: 518118 Pingshan Road, Pingshan Town, Shenzhen, Guangdong, No. 3001, No.

Patentee before: Biyadi Co., Ltd.

TR01 Transfer of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20111116

Termination date: 20200714

CF01 Termination of patent right due to non-payment of annual fee