100分重谢!哪位大神能解释一下Canvas中的drawvertices方法,各种参数看不懂啊。

jiayangcg 2014-08-27 10:41:07
哪位大神能解释一下Canvas中的drawvertices方法,各种参数看不懂啊。
...全文
506 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
老科达 2014-08-27
  • 打赏
  • 举报
回复
 /**
     * Draw the array of vertices, interpreted as triangles (based on mode). The
     * verts array is required, and specifies the x,y pairs for each vertex. If
     * texs is non-null, then it is used to specify the coordinate in shader
     * coordinates to use at each vertex (the paint must have a shader in this
     * case). If there is no texs array, but there is a color array, then each
     * color is interpolated across its corresponding triangle in a gradient. If
     * both texs and colors arrays are present, then they behave as before, but
     * the resulting color at each pixels is the result of multiplying the
     * colors from the shader and the color-gradient together. The indices array
     * is optional, but if it is present, then it is used to specify the index
     * of each triangle, rather than just walking through the arrays in order.
     *
     * @param mode How to interpret the array of vertices
     * @param vertexCount The number of values in the vertices array (and
     *      corresponding texs and colors arrays if non-null). Each logical
     *      vertex is two values (x, y), vertexCount must be a multiple of 2.
     * @param verts Array of vertices for the mesh
     * @param vertOffset Number of values in the verts to skip before drawing.
     * @param texs May be null. If not null, specifies the coordinates to sample
     *      into the current shader (e.g. bitmap tile or gradient)
     * @param texOffset Number of values in texs to skip before drawing.
     * @param colors May be null. If not null, specifies a color for each
     *      vertex, to be interpolated across the triangle.
     * @param colorOffset Number of values in colors to skip before drawing.
     * @param indices If not null, array of indices to reference into the
     *      vertex (texs, colors) array.
     * @param indexCount number of entries in the indices array (if not null).
     * @param paint Specifies the shader to use if the texs array is non-null. 
     */
这个是顶点绘制法 我稍微扯下吧 VertexMode 顶点类型 比如他是三角形(连续3个顶点)或者 四边形 (连续4个顶点)等等 vertexCount 顶点数 总共有多少个顶点绘制。 verts[] 顶点数组 [0,0,0,1,1,0,...] 前面有xy 3组 如果是类型是三角形 他就构成一个三角形的绘制基元,往后类推。 vertOffset 顶点数据 起始位置 可能全部绘制,也可能只绘制部分顶点。与 vertexCount 配置使用 一般为0 texs[] 纹理数组 就是对图片等进行采样,然后去渲染顶点。(这个比较复杂,需要了解下 比如opengl渲染原理。) texOffset 同上offset 就是偏移量 colors[] 颜色数组 直接用颜色渲染顶点 colorOffset 同上offset 就是偏移量 indices[] 顶点索引 可能只绘制部分顶点 这个就是存放那些顶点的index , 即verts[index] indexOffset 同上offset 就是偏移量 indexCount 绘制多少个索引点。 paint 这个只有 texs[] 不空 必须提供, 提供图片之类东西 采样。 更多的知识 你可以搜索下 图像渲染基础。
jiayangcg 2014-08-27
  • 打赏
  • 举报
回复

void drawVertices(VertexMode mode, int vertexCount, float[] verts, int vertOffset,
            float[] texs, int texOffset, int[] colors, int colorOffset,
            short[] indices, int indexOffset, int indexCount, Paint paint)
内容概要:SSD2828QN4是一款MIPI主桥接芯片,用于连接应用处理器与传统并行LCD接口及支持MIPI从属接口的LCD驱动器。该芯片支持最高每通道1Gbps的串行链路速度,最多可配置4个数据通道,显著减少了信号数量。它支持多种接口模式,包括RGB+SPI组合接口,适用于驱动智能或非智能显示面板,并能通过命令模式和视频模式传输数据。芯片内置时钟和复位模块、外部接口、协议控制单元(PCU)、包处理单元(PPU)、错误校正码/循环冗余校验(ECC/CRC)模块、长包和命令缓冲区、D-PHY控制器、模拟收发器以及内部锁相环(PLL),确保了高效的数据传输和系统稳定性。此外,文档详细描述了芯片的引脚配、寄存器设置、操作模式、电源序列、时序特性等关键参数,为开发者提供了全面的技术指导。 适合人群:具备一定硬件设计基础,从事嵌入式系统开发、显示技术研究的研发人员。 使用场景及目标:①实现应用处理器与MIPI兼容显示屏之间的高速数据传输;②优化显示系统的功耗表现,减少电磁干扰(EMI);③通过灵活配置不同接口模式来适应各种显示设备的需求。 阅读建议:此文档面向具有一定电子工程背景的专业人士,建议读者结合实际项目需求深入理解各章节内容,特别是关于寄存器配置、时序要求等方面的具体说明。对于初次接触此类技术的开发者而言,建议先熟悉基本概念再逐步掌握高级功能的应用方法

80,488

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧