zoukankan      html  css  js  c++  java
  • tile_images_offset的简单使用

    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    date:2018.07.26

     1 void TileImagesOffset(const HObject &Images, HObject *TiledImage, 
     2             const HTuple &OffsetRow, const HTuple &OffsetCol, 
     3             const HTuple &Row1, const HTuple &Col1, const HTuple &Row2, const HTuple &Col2, 
     4             const HTuple &Width, const HTuple &Height);
     5 
     6 HImage HImage::TileImagesOffset(const HTuple &OffsetRow, const HTuple &OffsetCol, 
     7                   const HTuple &Row1, const HTuple &Col1, const HTuple &Row2, const HTuple &Col2, 
     8                   Hlong Width, Hlong Height)const;
     9 
    10 HImage HImage::TileImagesOffset(Hlong OffsetRow, Hlong OffsetCol, 
    11                   Hlong Row1, Hlong Col1, Hlong Row2, Hlong Col2, 
    12                   Hlong Width, Hlong Height)const;  

    后两种形式为类的常量成员函数(把默认的常量指针this转换为常指针常量)。

    官方文档给出了说明:输入参数Images(可以是单张图像或concat_obj的n张图像)必须具有相同的通道数,至于说每个图像的size则不要求一致;输出参数TiledImage拥有和Images一样的channels;它的size完全由输入参数width & height决定。输入图像的左上点在输出图像的位置由offsetRow & offsetCol决定;另外,可以把输入图像crop为原始图像的一小块来作为输出图像的一部分,需要设置row1, col1 & row2, col2来实现(-1表示不切割原始图像);当然,这些参数要与n的个数保持一致的。

    反正官方也有demo和说明,比我自己翻译的强多了。

    这里记录一下使用的tips:

    >. 输入单张图像,实现图像切割or添加黑边(也就是说可以用来归一化一组图像的size)

    。。。

  • 相关阅读:
    Android 通过ViewFlipper实现广告轮播功能并可以通过手势滑动进行广告切换
    [C#][DevPress]自定义数据分页控件
    [C#][SQLLITE]一个数据分页技巧
    [C#]用SharpZipLib压缩多个文件
    [C#][DevPress]省市县乡嵌套查询
    [C#][DevPress]事件委托的使用
    [C#]Excel操作类
    [C#][DevPress]手动添加控件中的子控件或者结构
    [C#]XML操作类
    [C#]把DataTable转换成泛型实体List
  • 原文地址:https://www.cnblogs.com/xiawuhao2013/p/9372929.html
Copyright © 2011-2022 走看看