WO2012051771A1 - 一种图像拷贝的方法和装置 - Google Patents

一种图像拷贝的方法和装置 Download PDF

Info

Publication number
WO2012051771A1
WO2012051771A1 PCT/CN2010/080027 CN2010080027W WO2012051771A1 WO 2012051771 A1 WO2012051771 A1 WO 2012051771A1 CN 2010080027 W CN2010080027 W CN 2010080027W WO 2012051771 A1 WO2012051771 A1 WO 2012051771A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
bytes
copied
copy
destination address
Prior art date
Application number
PCT/CN2010/080027
Other languages
English (en)
French (fr)
Inventor
肖建华
余剑飞
方科颖
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Priority to EP10858559.7A priority Critical patent/EP2530640B1/en
Priority to US13/577,444 priority patent/US8693042B2/en
Publication of WO2012051771A1 publication Critical patent/WO2012051771A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/60Memory management

Definitions

  • the present invention relates to image processing techniques, and more particularly to a method and apparatus for image copying. Background technique
  • the operation of copying image pixels from the source address to the destination address is frequently used in image processing, including: image copying, splicing and splitting, etc., if specific image rotation, scaling, ashing, transparency, etc. are added in the implementation step, As long as the optimization is slightly modified, it can be used in most image processing.
  • a typical image copy application scenario is as follows: For example, when the user needs to obtain the weather condition, the mobile terminal accesses the Internet to enter an application for querying the weather condition, and a certain cache of the application (which can be abstracted as the source image data storage unit) Preserving the image data indicating the weather condition, that is, the source image, storing the source image from the first pixel data in the upper left corner to the liquid crystal display (LCD, Liquid Crystal Display) refresh data buffer (the destination image data storage unit); Some necessary indicators, icons, ie, the image to be copied (copy image data storage) need to be stored in a suitable position in the destination image data storage unit. As shown in Fig. 1, the image a is shown in the figure "Start Line 1".
  • the location begins to be stored, the starting position of image b is the position shown in "Start Line 2", and the starting line position of the source image is marked as "Source Line Start” as shown.
  • the copy image and the source image are recombined and stitched (image processing unit) into a destination image (image display portion) that is finally displayed on the screen of the mobile terminal.
  • the above application scenario is to combine the source image and the image to be copied into a destination image, that is, the target image is obtained after the image is to be superimposed (ie, copied) to the source image.
  • the target image may require a certain degree of deformation or widening depending on the scale.
  • the image copying process is as shown in FIG. 2, including: Step 201, the image copy starts.
  • Step 202 determining whether the width of the source image, the destination image, and the image to be copied are all integer multiples of 4 bytes, and determining whether the widths of the source image, the destination image, and the image to be copied are consistent, and if not, proceeding to step 203; If yes, proceed to step 206.
  • Step 203 Call the C library function memcpyO to copy a row of pixel data of the image to be copied to the destination address. After the pixel is copied, proceed to step 204.
  • Step 204 Start copying the next row of pixel data of the image to be copied (i.e., moving the source address down by one row with respect to step 203) to the corresponding destination address (moving the destination address down by one row with respect to step 203).
  • Step 205 Determine whether all the row pixel data of the image to be copied is copied, and if not, return to step 203; if yes, the image copy is completed.
  • Step 206 If the source address, the destination address, and the width of the image to be copied are all multiples of 4 bytes, first determine whether the width of the image to be copied is 32 bytes, and if yes, perform step 209: determine the image to be copied again. Whether the height is 16 lines, if yes, go to step 210, call the C library function memcpy() 16 times, copy one line of pixel data each time, that is, 32 bytes, until the copy is completed; if the height is not 16 lines, return to the step 203.
  • step 207 determines whether the width of the source image and the destination image are the same. If yes, the plurality of lines of the image to be copied are taken as one line, and step 203 is performed; if not, directly Go back to step 203.
  • the above conventional image copying method is to call the C library function memcpyO-line pixel and copy the pixel in a row for any image that needs to be copied.
  • Such image processing is very time consuming and takes up the central processing unit (CPU). Resources.
  • the main object of the present invention is to provide an image copying method and apparatus capable of saving image processing time and occupied CPU resources.
  • the technical solution of the present invention is implemented as follows:
  • the invention provides a method for copying an image, the method comprising:
  • the image to be copied is copied to the destination address in units of one line of pixel data
  • the image to be copied is copied to the destination address according to the number of bytes according to the size of the image to be copied, including:
  • the method further includes:
  • the 2 bytes of the lowest bit of the source image are loaded into the register.
  • the image to be copied is copied to the destination address according to the number of bytes, including:
  • the image to be copied is copied to the destination address according to the number of bytes, including:
  • the present invention also provides an apparatus for copying an image, the apparatus comprising: an analysis module and a copy module; wherein: The analyzing module is configured to analyze an image to be copied, obtain an analysis result, and notify the copy module;
  • the copying module is configured to copy, according to the analysis result of the image to be copied, the image to be copied to the destination address in a row of pixel data when the width of the image to be copied is 1 pixel;
  • the image to be copied is copied to the destination address in the number of bytes according to the size of the image to be copied.
  • the image copying method of the present invention combines the characteristics of specific image resource data to classify the image, which greatly speeds up the image copying speed and is widely used in image processing, which can effectively alleviate the problem of slow image updating and greatly improve the user experience.
  • FIG. 1 is a typical image copy application scenario in the prior art
  • Figure 3 is an image copying process of the present invention
  • FIG. 5 is a schematic structural diagram of an image copying apparatus of the present invention. detailed description
  • the technical solutions of the present invention are further elaborated below in conjunction with the accompanying drawings and specific embodiments.
  • the core idea of the image copy of the present invention is to analyze the image to be copied, and use different copy methods for images of different attributes, as shown in FIG. 3, including:
  • Step 301 When the width of the image to be copied is 1 pixel, the image to be copied is copied to the destination address in units of one line of pixel data.
  • Step 302 When the width of the image to be copied is not one pixel, the image to be copied is copied to the destination address according to the number of bytes according to the size of the image to be copied.
  • the image copying method of the present invention is illustrated by a specific embodiment. As shown in FIG. 4, the method includes:
  • Step 401 the image copy begins.
  • Step 402 Determine whether the width of the image to be copied is 1 pixel (32 bytes), that is, whether the image to be copied is a single column image, and if yes, execute step 403; otherwise, execute step 405.
  • Steps 403-404 when the width of the image to be copied is 1 pixel, each line of the image to be copied (ie, 1 pixel and 32 bytes) is copied to the destination address until the pixels of all the lines of the image to be copied are copied. The image copy is complete.
  • Step 405 When the width of the image to be copied is not one pixel, it is determined whether the widths of the source image, the destination image, and the image to be copied are the same. If yes, go to step 406; otherwise, go to step 409.
  • Step 406 When the widths of the three are the same, it is determined whether the image to be copied is less than 512 bytes, and if yes, go to step 409; if the image to be copied is greater than or equal to 512 bytes, step 407 is performed.
  • Steps 407 ⁇ 408 each time 512 bytes of the image to be copied are copied to the destination address (multiple lines of the image to be copied are copied as one line, and the number of bytes of the multiline as one line is 512 bytes) until the image to be copied is smaller than 512 bytes. At this time, if the remaining bytes are less than 512 and 0, the image copy is completed. If the remaining bytes are less than 512 and not 0, the process proceeds to step 409.
  • Steps 409 ⁇ 410 determining whether the destination address is an integer multiple of 4 bytes, and if not, copying the first 2 bytes of the source image to the destination address, so that the destination address is an integer multiple of 4 bytes, and the transfer is performed. Step 411. If the destination address is an integer multiple of 4 bytes, it proceeds directly to step 411.
  • Step 411 Determine whether the source address is an integer multiple of 4 bytes.
  • the source address may be an integer multiple of 4 bytes, or may not be an integer multiple of 4 bytes.
  • the source address since the first 2 bytes of the source image are copied to the destination address in step 410, the source address may not be 4 An integer multiple of the byte, therefore, it is judged here, if the source address is an integer multiple of 4 bytes, then execute Step 423; If no, go to step 412.
  • image to be copied is smaller than 8 bytes and larger than 4 bytes, copy 4 bytes of the image to be copied to the destination address, and then judge whether the remaining image to be copied is equal to 2 bytes; if the image to be copied is less than 4 bytes, Directly determine whether the remaining image to be copied is equal to 2 bytes; it should be noted here that when the image to be copied is less than 4 bytes, the remaining image to be copied is 2 bytes or 0 bytes;
  • the remaining image to be copied is equal to 2 bytes, the 2 bytes are copied to the destination image address, and the image copy ends; otherwise, the remaining image to be copied is equal to 0 bytes, that is, the copy is completed.
  • the image to be copied is smaller than 8 bytes and larger than 4 bytes, copy 4 bytes of the image to be copied to the destination address, and then judge whether the remaining image to be copied is equal to 2 bytes; if the image to be copied is less than 4 bytes, It is directly judged whether the remaining image to be copied is equal to 2 bytes. It should be noted here that when the image to be copied is less than 4 bytes, the remaining image to be copied is 2 bytes or 0 bytes.
  • the remaining image to be copied is equal to 2 bytes, the 2 bytes are copied to the destination address, and the image copy ends; otherwise, the remaining image to be copied is equal to 0 bytes, that is, the copy is completed.
  • the present invention further provides an apparatus for copying an image, as shown in FIG. 5, comprising: an analysis module 10 and a copy module 20; wherein:
  • the analysis module 10 is configured to analyze the image to be copied, obtain the analysis result, and notify the copy module 20;
  • the copying module 20 is configured to copy the image to be copied to the destination address in units of one row of pixel data according to the analysis result of the image to be copied by the analysis module 10, when the width of the image to be copied is 1 pixel; When it is not 1 pixel, the image to be copied is copied to the destination address in the number of bytes according to the size of the image to be copied.

Description

一种图像拷贝的方法和装置 技术领域
本发明涉及图像处理技术, 特别是指一种图像拷贝的方法和装置。 背景技术
图像像素从源地址拷贝到目的地址的操作在图像处理中是经常运用 的, 包括: 图像拷贝、 拼接拆分等, 如果实施步骤中加入具体的图像旋转、 缩放、 灰化、 透明等算法时, 只要稍加改动优化, 即可以用于大部分的图 像处理中。
如图 1 所示为典型的图像拷贝应用场景: 例如用户需要获取天气情况 时, 通过移动终端上网进入查询天气情况的应用, 该应用的某个緩存(可 以抽象为源图像数据存贮部)会保存示意天气情况的图片数据、 即源图像, 将源图像从左上角的第一个像素数据开始存储到液晶显示器(LCD, Liquid Crystal Display )刷新数据緩存(目的图像数据存贮部); 同时, 一些必要的 指示条、 图标, 即要拷贝图像(拷贝图像数据存贮部) 需要保存在目的图 像数据存贮部的合适位置上, 如图 1中, 图像 a在图示 "开始行 1" 所示的 位置上开始存放, 图像 b的起始行为 "开始行 2" 所示位置, 而源图像起始 行位置如图所示标为 "源图始行"。 要拷贝图像与源图像重新组合拼接(图 像处理部)成的就是最终让客户看到的在移动终端屏幕上显示的目的图像 (图像显示部) 了。
上述应用场景是将源图像与要拷贝图像合成一个目的图像, 也就是说, 将要拷贝图像叠加 (也就是拷贝)到源图像后就得到了目的图像。 但是目 的图像会需要根据比例有一定的拉升或者加宽之类的变形。 该应用场景中, 图像的拷贝流程如图 2所示, 包括: 步骤 201 , 图像拷贝开始。
步骤 202, 判断源图像、 目的图像和要拷贝图像的宽度是否都为 4字节 的整数倍、 以及判断源图像、 目的图像和要拷贝图像三者的宽度是否一致, 如果否, 进入步骤 203; 如果是, 进入步骤 206。
步骤 203 , 调用 C库函数 memcpyO将要拷贝图像的一行像素数据拷贝 到目的地址, 该行像素拷贝完后, 进行步骤 204。
步骤 204, 开始拷贝要拷贝图像的下一行像素数据(即相对于步骤 203 将源地址往下移一行)到对应的目的地址(相对于步骤 203将目的地址往 下移一行)。
步骤 205 , 判断要拷贝图像的所有行像素数据是否拷贝完, 如果否, 返 回步骤 203; 如果是, 则图像拷贝完成。
步骤 206, 如果源地址、 目的地址以及要拷贝图像的宽度都为 4字节的 倍数, 则先判断要拷贝图像的宽度是否为 32字节, 如果是, 执行步骤 209: 再判断要拷贝图像的高度是否为 16行, 如果是, 进入步骤 210, 调用 C库 函数 memcpy()16次, 每次拷贝一行像素数据、 即 32字节, 直到拷贝完成; 如果高度是不为 16行, 则返回步骤 203。
如果要要拷贝图像的宽度不为 32字节, 则进入步骤 207, 判断源图像 和目的图像的宽度是否一样, 如果是, 则将要拷贝图像的多行作为一行, 执行步骤 203; 如果否, 直接返回步骤 203。
上述传统的图像拷贝方法是对任何需要拷贝的图像, 调用 C 库函数 memcpyO—行像素、 一行像素地进行拷贝, 这样的图像处理是非常耗时, 且占中央处理器 (CPU, Central Processing Unit ) 资源的。 发明内容
有鉴于此, 本发明的主要目的在于提供一种图像拷贝方法和装置, 能 够节省图像处理的时间和占用的 CPU资源。 为了实现上述目的, 本发明的技术方案是这样实现的:
本发明提供了一种图像拷贝的方法, 该方法包括:
要拷贝图像的宽度为 1 个像素时, 以一行像素数据为单位将要拷贝图 像拷贝到目的地址;
要拷贝图像的宽度不为 1 个像素时, 根据要拷贝图像的大小, 按照字 节数将要拷贝图像拷贝到目的地址。
进一步地, 要拷贝图像的宽度不为 1 个像素时, 根据要拷贝图像的大 小, 按照字节数将要拷贝图像拷贝到目的地址, 包括:
当源图像、 目的图像和要拷贝图像的宽度都一致、 且要拷贝图像大于 等于 512字节时, 每次将要拷贝图像的 512字节拷贝到目的地址。
进一步地, 当源图像、 目的图像和要拷贝图像的宽度不一致时, 或者 当源图像、 目的图像和要拷贝图像的宽度都一致、 且要拷贝图像小于 512 字节时, 该方法还包括:
目的地址不为 4字节的整数倍时, 将源图像最低位的 2字节拷贝到目 的地址;
源地址不为 4字节的整数倍时, 将源图像最低位的 2字节装载到寄存 器。
进一步地, 将源图像最低位的 2字节装载到寄存器后, 根据要拷贝图 像的大小, 按照字节数将要拷贝图像拷贝到目的地址, 包括:
要拷贝图像大于等于 18字节时, 每次将要拷贝图像的 16字节拷贝到 目的地址, 直到剩余要拷贝图像小于 16字节, 并判断剩余要拷贝图像是否 小于 8字节; 要拷贝图像小于 18字节时, 直接判断要拷贝图像是否小于 8 字节;
要拷贝图像小于 16字节大于 8字节时, 将要拷贝图像的 8字节拷贝到 目的地址, 并判断剩余要拷贝图像是否小于 4字节; 要拷贝图像小于 8字 节时, 直接判断要拷贝图像是否小于 4字节;
要拷贝图像小于 8字节大于 4字节时, 将要拷贝图像的 4字节拷贝到 目的地址, 并判断剩余要拷贝图像是否等于 2字节; 要拷贝图像小于 4字 节时, 直接判断要拷贝图像是否等于 2字节;
要拷贝图像等于 2字节时, 将要拷贝图像的 2字节拷贝到目的地址, 完成图像拷贝; 否则, 剩余要拷贝图像等于 0字节, 完成图像拷贝。
进一步地, 目的地址为 4字节的整数倍、 且源地址也为 4字节的整数 倍时, 根据要拷贝图像的大小, 按照字节数将要拷贝图像拷贝到目的地址, 包括:
要拷贝图像大于等于 32字节时, 每次将要拷贝图像的 32字节拷贝到 目的地址, 直到剩余要拷贝图像小于 16字节; 要拷贝图像小于 32字节时, 直接判断要拷贝图像是否小于 16字节;
要拷贝图像小于 32字节大于 16字节时, 将要拷贝图像的 16字节拷贝 到目的地址, 并判断剩余要拷贝图像是否小于 8字节; 要拷贝图像小于 16 字节时, 直接判断要拷贝图像是否小于 8字节;
要拷贝图像小于 16字节大于 8字节时, 将要拷贝图像的 8字节拷贝到 目的地址, 并判断剩余要拷贝图像是否小于 4字节; 要拷贝图像小于 8字 节时, 直接判断要拷贝图像是否小于 4字节;
要拷贝图像小于 8字节大于 4字节时, 将要拷贝图像的 4字节拷贝到 目的地址, 并判断剩余要拷贝图像是否等于 2字节; 要拷贝图像小于 4字 节时, 直接判断要拷贝图像是否等于 2字节;
要拷贝图像等于 2字节时, 将要拷贝图像的 2字节拷贝到目的地址, 完成图像拷贝; 否则, 剩余要拷贝图像等于 0字节, 完成图像拷贝。
本发明还提供了一种图像拷贝的装置, 该装置包括: 分析模块和拷贝 模块; 其中: 所述分析模块, 用于对要拷贝图像进行分析, 得到分析结果并告知所 述拷贝模块;
所述拷贝模块, 用于依据所述分析模块对要拷贝图像的分析结果, 当要拷贝图像的宽度为 1 个像素时, 以一行像素数据为单位将要拷贝 图像拷贝到目的地址;
当要拷贝图像的宽度不为 1 个像素时, 根据要拷贝图像的大小, 按照 字节数将要拷贝图像拷贝到目的地址。
本发明的图像拷贝方法, 结合具体图像资源数据特点, 对图像进行分 类处理, 大大加快了图像拷贝速度, 广泛运用到图像处理中, 可以有效地 緩解图像更新緩慢问题, 极大提高用户体验感受。 附图说明
图 1为现有技术中典型的图像拷贝应用场景;
图 2为现有技术中的图像拷贝流程;
图 3为本发明的图像拷贝流程;
图 4为本发明一实施例的图像拷贝流程;
图 5为本发明的图像拷贝装置结构示意图。 具体实施方式
下面结合附图和具体实施例对本发明的技术方案进一步详细阐述。 本发明图像拷贝的核心思想是, 对要拷贝的图像进行分析, 对不同属 性的图像釆用不同的拷贝方法, 如图 3所示, 包括:
步骤 301 ,要拷贝图像的宽度为 1个像素时, 以一行像素数据为单位将 要拷贝图像拷贝到目的地址。
步骤 302,要拷贝图像的宽度不为 1个像素时,根据要拷贝图像的大小, 按照字节数将要拷贝图像拷贝到目的地址。 下面通过具体的实施例来说明本发明的图像拷贝方法, 如图 4所示, 包括:
步骤 401 , 图像拷贝开始。
步骤 402, 判断要拷贝图像的宽度是否为 1个像素(32字节)、 即要拷 贝图像是否为单柱图, 如果是, 则执行步骤 403; 否则, 执行步骤 405。
步骤 403~404,要拷贝图像的宽度为 1个像素时,每次将要拷贝图像的 一行(即 1个像素 32字节)拷贝到目的地址, 直到将要拷贝图像的所有行 的像素拷贝完, 则图像拷贝完成。
步骤 405 , 要拷贝图像的宽度不是 1个像素时, 判断源图像、 目的图像 和要拷贝图像三者的宽度是否一致, 如果是, 执行步骤 406; 否则, 执行步 骤 409。
步骤 406, 当上述三者的宽度一致时, 判断要拷贝图像是否小于 512字 节, 如果是, 转入步骤 409; 如果要拷贝图像大于或等于 512字节, 则执行 步骤 407。
步骤 407~408 ,每次将要拷贝图像的 512字节拷贝到目的地址(即将要 拷贝图像的多行作为一行进行拷贝, 多行作为一行的字节数为 512字节 ), 直到要拷贝图像小于 512字节, 此时, 如果剩余字节小于 512且为 0, 则图 像拷贝完成, 如果剩余字节小于 512且不为 0, 则转入步骤 409。
步骤 409~410, 判断目的地址是否为 4字节的整数倍, 如果否, 则将源 图像最前面的 2字节拷贝到目的地址, 这样目的地址就为 4字节的整数倍 了, 转入步骤 411。如果目的地址是 4字节的整数倍, 则直接进入步骤 411。
步骤 411 , 判断源地址是否为 4字节的整数倍。 源地址有可能是 4字节 的整数倍、 也有可能不是 4字节的整数倍; 另外, 由于步骤 410中将源图 像最前面的 2字节拷贝到了目的地址, 这也可能导致源地址不是 4字节的 整数倍, 因此, 这里要进行判断, 如果源地址是 4字节的整数倍, 则执行 步骤 423; 如果否, 执行步骤 412。
步骤 412~422, 目的地址为 4字节的整数倍、 源地址不是 4字节的整数 倍时, 将源图像的最前面 2字节装载到寄存器, 这样, 源地址也是 4字节 的整数倍了。
接着开始拷贝图像, 每次拷贝 16字节, 判断要拷贝图像是否小于 18 字节, 如果否, 则每次将要拷贝图像的 16字节拷贝到目的地址, 直到要拷 贝图像剩余的字节小于 16, 此时判断要拷贝图像剩余的字节是否小于 8字 节; 如果是, 则直接判断要拷贝图像是否小于 8字节;
如果要拷贝图像小于 16字节大于 8字节, 则将要拷贝图像的 8字节拷 贝到目的地址, 然后, 判断要拷贝图像是否小于 4字节; 如果要拷贝图像 小于 8字节, 则直接判断要拷贝图像是否小于 4字节;
如果要拷贝图像小于 8字节大于 4字节, 则将要拷贝图像的 4字节拷 贝到目的地址, 然后, 判断剩余的要拷贝图像是否等于 2字节; 如果要拷 贝图像小于 4字节, 则直接判断剩余的要拷贝图像是否等于 2字节; 这里 需要指出的是, 当要拷贝图像小于 4字节时, 则剩余的要拷贝图像为 2字 节或 0字节;
如果剩余的要拷贝图像等于 2字节, 则将该 2字节拷贝到目的图像地 址, 图像拷贝结束; 否则, 剩余的要拷贝图像等于 0字节、 即拷贝完成。
步骤 423~433 , 源地址和目的地址都为 4字节的整数倍时,判断要拷贝 图像是否小于 32字节, 如果是, 直接判断要拷贝图像是否小于 16字节; 如果否, 则每次将要拷贝图像的 32字节拷贝到目的地址, 直到要拷贝图像 小于 16字节;
要拷贝图像小于 32字节大于 16字节时, 将要拷贝图像的 16字节拷贝 到目的地址, 然后判断剩余的要拷贝图像是否小于 8字节; 当要拷贝图像 小于 16字节时, 判断剩余的要拷贝图像是否小于 8字节; 如果要拷贝图像小于 16字节大于 8字节, 则将要拷贝图像的 8字节拷 贝到目的地址, 然后, 判断要拷贝图像是否小于 4字节; 如果要拷贝图像 小于 8字节, 则直接判断要拷贝图像是否小于 4字节;
如果要拷贝图像小于 8字节大于 4字节, 则将要拷贝图像的 4字节拷 贝到目的地址, 然后, 判断剩余的要拷贝图像是否等于 2字节; 如果要拷 贝图像小于 4字节, 则直接判断剩余的要拷贝图像是否等于 2字节。 这里 需要指出的是, 当要拷贝图像小于 4字节时, 则剩余的要拷贝图像为 2字 节或 0字节。
如果剩余的要拷贝图像等于 2字节, 则将该 2字节拷贝到目的地址, 图像拷贝结束; 否则, 剩余的要拷贝图像等于 0字节、 即拷贝完成。
为了实现上述方法, 本发明还提供了一种图像拷贝的装置, 如图 5 所 示, 包括: 分析模块 10和拷贝模块 20; 其中:
分析模块 10, 用于对要拷贝图像进行分析, 得到分析结果并告知拷贝 模块 20;
拷贝模块 20, 用于依据分析模块 10对要拷贝图像的分析结果, 当要拷 贝图像的宽度为 1 个像素时, 以一行像素数据为单位将要拷贝图像拷贝到 目的地址; 当要拷贝图像的宽度不为 1个像素时, 根据要拷贝图像的大小, 按照字节数将要拷贝图像拷贝到目的地址。
以上所述, 仅为本发明的较佳实施例而已, 并非用于限定本发明的保 护范围。

Claims

权利要求书
1、 一种图像拷贝的方法, 其特征在于, 该方法包括:
要拷贝图像的宽度为 1 个像素时, 以一行像素数据为单位将要拷贝图 像拷贝到目的地址;
要拷贝图像的宽度不为 1 个像素时, 根据要拷贝图像的大小, 按照字 节数将要拷贝图像拷贝到目的地址。
2、 根据权利要求 1所述图像拷贝的方法, 其特征在于, 要拷贝图像的 宽度不为 1 个像素时, 根据要拷贝图像的大小, 按照字节数将要拷贝图像 拷贝到目的地址, 包括:
当源图像、 目的图像和要拷贝图像的宽度都一致、 且要拷贝图像大于 等于 512字节时, 每次将要拷贝图像的 512字节拷贝到目的地址。
3、 根据权利要求 2所述图像拷贝的方法, 其特征在于, 当源图像、 目 的图像和要拷贝图像的宽度不一致时, 或者当源图像、 目的图像和要拷贝 图像的宽度都一致、 且要拷贝图像小于 512字节时, 该方法还包括:
目的地址不为 4字节的整数倍时, 将源图像最低位的 2字节拷贝到目 的地址;
源地址不为 4字节的整数倍时, 将源图像最低位的 2字节装载到寄存 器后, 根据要拷贝图像的大小, 按照字节数将要拷贝图像拷贝到目的地址。
4、 根据权利要求 3所述图像拷贝的方法, 其特征在于, 将源图像最低 位的 2字节装载到寄存器后, 根据要拷贝图像的大小, 按照字节数将要拷 贝图像拷贝到目的地址, 包括:
要拷贝图像大于等于 18字节时, 每次将要拷贝图像的 16字节拷贝到 目的地址, 直到剩余要拷贝图像小于 16字节, 并判断剩余要拷贝图像是否 小于 8字节; 要拷贝图像小于 18字节时, 直接判断要拷贝图像是否小于 8 字节; 要拷贝图像小于 16字节大于 8字节时, 将要拷贝图像的 8字节拷贝到 目的地址, 并判断剩余要拷贝图像是否小于 4字节; 要拷贝图像小于 8字 节时, 直接判断要拷贝图像是否小于 4字节;
要拷贝图像小于 8字节大于 4字节时, 将要拷贝图像的 4字节拷贝到 目的地址, 并判断剩余要拷贝图像是否等于 2字节; 要拷贝图像小于 4字 节时, 直接判断要拷贝图像是否等于 2字节;
要拷贝图像等于 2字节时, 将要拷贝图像的 2字节拷贝到目的地址, 完成图像拷贝; 否则, 剩余要拷贝图像等于 0字节, 完成图像拷贝。
5、 根据权利要求 3所述图像拷贝的方法, 其特征在于, 目的地址为 4 字节的整数倍、 且源地址也为 4字节的整数倍时, 根据要拷贝图像的大小, 按照字节数将要拷贝图像拷贝到目的地址, 包括:
要拷贝图像大于等于 32字节时, 每次将要拷贝图像的 32字节拷贝到 目的地址, 直到剩余要拷贝图像小于 16字节; 要拷贝图像小于 32字节时, 直接判断要拷贝图像是否小于 16字节;
要拷贝图像小于 32字节大于 16字节时, 将要拷贝图像的 16字节拷贝 到目的地址, 并判断剩余要拷贝图像是否小于 8字节; 要拷贝图像小于 16 字节时, 直接判断要拷贝图像是否小于 8字节;
要拷贝图像小于 16字节大于 8字节时, 将要拷贝图像的 8字节拷贝到 目的地址, 并判断剩余要拷贝图像是否小于 4字节; 要拷贝图像小于 8字 节时, 直接判断要拷贝图像是否小于 4字节;
要拷贝图像小于 8字节大于 4字节时, 将要拷贝图像的 4字节拷贝到 目的地址, 并判断剩余要拷贝图像是否等于 2字节; 要拷贝图像小于 4字 节时, 直接判断要拷贝图像是否等于 2字节;
要拷贝图像等于 2字节时, 将要拷贝图像的 2字节拷贝到目的地址, 完成图像拷贝; 否则, 剩余要拷贝图像等于 0字节, 完成图像拷贝。
6、 一种图像拷贝的装置, 其特征在于, 该装置包括: 分析模块和拷贝 模块; 其中:
所述分析模块, 用于对要拷贝图像进行分析, 得到分析结果并告知所 述拷贝模块;
所述拷贝模块, 用于依据所述分析模块对要拷贝图像的分析结果, 当要拷贝图像的宽度为 1 个像素时, 以一行像素数据为单位将要拷贝 图像拷贝到目的地址;
当要拷贝图像的宽度不为 1 个像素时, 根据要拷贝图像的大小, 按照 字节数将要拷贝图像拷贝到目的地址。
PCT/CN2010/080027 2010-10-20 2010-12-20 一种图像拷贝的方法和装置 WO2012051771A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP10858559.7A EP2530640B1 (en) 2010-10-20 2010-12-20 Image copying method and device
US13/577,444 US8693042B2 (en) 2010-10-20 2010-12-20 Image copying method and device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN2010105143592A CN101996390B (zh) 2010-10-20 2010-10-20 一种图像拷贝的方法和装置
CN201010514359.2 2010-10-20

Publications (1)

Publication Number Publication Date
WO2012051771A1 true WO2012051771A1 (zh) 2012-04-26

Family

ID=43786515

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2010/080027 WO2012051771A1 (zh) 2010-10-20 2010-12-20 一种图像拷贝的方法和装置

Country Status (4)

Country Link
US (1) US8693042B2 (zh)
EP (1) EP2530640B1 (zh)
CN (1) CN101996390B (zh)
WO (1) WO2012051771A1 (zh)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103473057A (zh) * 2013-09-10 2013-12-25 江苏中科梦兰电子科技有限公司 一种memcpy函数的优化方法
CN111047501B (zh) * 2019-11-18 2023-06-13 中国航空工业集团公司西安航空计算技术研究所 一种基于OpenGL拷贝命令的GPU拷贝缓冲区的实现方法
CN110942418B (zh) * 2019-11-18 2023-06-13 中国航空工业集团公司西安航空计算技术研究所 一种基于glCopyPixels的GPU像素复制方法

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101707055A (zh) * 2009-10-30 2010-05-12 深圳创维数字技术股份有限公司 一种数字电视机顶盒窗口图像处理方法和系统

Family Cites Families (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09307747A (ja) * 1996-05-14 1997-11-28 Matsushita Graphic Commun Syst Inc 解像度変換装置
US6618161B1 (en) * 1998-10-26 2003-09-09 Hewlett-Packard Development Company, Lp. Printer system and method of reproducing an image
US6304345B1 (en) * 1998-12-14 2001-10-16 Eastman Kodak Company Auto resoration of a print
US6433888B1 (en) * 1998-12-14 2002-08-13 Eastman Kodak Company Auto restoration of a print
JP3976927B2 (ja) * 1999-01-25 2007-09-19 キヤノン株式会社 バス制御装置
JP4109875B2 (ja) * 2002-02-22 2008-07-02 キヤノン株式会社 画像符号化装置、画像符号化方法、プログラム、記憶媒体
US7221356B2 (en) * 2004-02-26 2007-05-22 Microsoft Corporation Data input device and method for detecting an off-surface condition by a laser speckle size characteristic
CN100395811C (zh) * 2005-03-29 2008-06-18 威盛电子股份有限公司 可编程的图像大小转换方法及装置
CN1710946A (zh) * 2005-07-08 2005-12-21 杭州海康威视数字技术有限公司 一种在数字图像上叠加字符的方法
US7663639B2 (en) * 2005-07-15 2010-02-16 Microsoft Corporation Methods and systems for providing texture tiling and mirroring
US7876977B2 (en) * 2006-02-15 2011-01-25 Conexant Systems, Inc. Image processor and method of image rotation
US8581933B2 (en) * 2007-09-04 2013-11-12 Lg Electronics Inc. System and method for displaying a rotated image in a display device
US8027539B2 (en) * 2008-01-11 2011-09-27 Sharp Laboratories Of America, Inc. Method and apparatus for determining an orientation of a document including Korean characters
JP2009194450A (ja) * 2008-02-12 2009-08-27 Seiko Epson Corp 画像処理装置、画像処理方法、並びにコンピュータプログラム
US20110234636A1 (en) * 2010-03-24 2011-09-29 Dsp Group Ltd. Method and integrated circuit for image manipulation

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101707055A (zh) * 2009-10-30 2010-05-12 深圳创维数字技术股份有限公司 一种数字电视机顶盒窗口图像处理方法和系统

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
LIU YASHU ET AL.: "The Technology And Implement of BMP Image Division And Storage", COMPUTER PROGRAMMING SKILLS & MAINTENANCE, no. 17, 2009, pages 62 - 66 *

Also Published As

Publication number Publication date
US20120307311A1 (en) 2012-12-06
EP2530640B1 (en) 2016-02-17
CN101996390A (zh) 2011-03-30
CN101996390B (zh) 2013-11-06
US8693042B2 (en) 2014-04-08
EP2530640A4 (en) 2014-04-16
EP2530640A1 (en) 2012-12-05

Similar Documents

Publication Publication Date Title
US8922575B2 (en) Tile cache
US9367641B2 (en) Predictive web page rendering using a scroll vector
CN104834637B (zh) 网页图片展示方法及装置
TWI671647B (zh) 計算頁面首屏描繪時長的方法、裝置及電子設備
WO2015143905A1 (zh) 图片加载装置及方法
US20110126113A1 (en) Displaying content on multiple web pages
WO2019201076A1 (zh) 一种涉密文件添加水印的方法、装置、介质及系统
JP2015503152A (ja) ウェブページのレンダリング時間の測定
WO2018054170A1 (zh) 浏览器资源预拉取方法、终端及存储介质
US10643580B2 (en) Method and device for switching playing mode of a mobile terminal, storage medium and program
WO2017202175A1 (zh) 一种视频压缩方法、装置及电子设备
US10467790B2 (en) On-demand image spriting
WO2014161357A1 (zh) 浏览器资源显示方法和装置、计算机可读存储介质
US8860735B2 (en) Aligning script animations with display refresh
WO2012051771A1 (zh) 一种图像拷贝的方法和装置
JP2015535634A (ja) 実行パイプラインバブルを低減するためにサブルーチンリターンのための分岐ターゲット命令キャッシュ(btic)エントリを確立すること、ならびに関連するシステム、方法、およびコンピュータ可読媒体
WO2023207563A1 (zh) 一种图像渲染方法及装置、存储介质
US9035972B2 (en) Intelligent axis labels
CN111460342B (zh) 页面的渲染展示方法、装置、电子设备及计算机存储介质
WO2022257973A1 (zh) 页面显示方法及装置、设备、存储介质
WO2018201993A1 (zh) 图像绘制方法、终端及存储介质
WO2019114044A1 (zh) 图像处理方法、装置、电子设备及计算机可读存储介质
US20060082580A1 (en) Method and apparatus for triggering frame updates
WO2019104981A1 (zh) 数据访问方法、电子装置及可读存储介质
US20190163762A1 (en) Reflow of user interface elements

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 10858559

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 13577444

Country of ref document: US

WWE Wipo information: entry into national phase

Ref document number: 2010858559

Country of ref document: EP

NENP Non-entry into the national phase

Ref country code: DE