Leia View& Android View

Android中的视图类可分为3种:

布局(Layout)类视图容器(View Container)类视图类(例TextView)

1)属性:TextView设置属性

2)焦点:用户移动焦点事件、聚焦

3)监听器:对某个事件进行监听

4)可见性:SetVisibility

你可以通过调用getLeft()和getTop()方法来获取一个view 的位置。前者返回的是left或者X坐标,后者返回的是top或者Y坐标。这些方法返回的位置是相对于该view的父view来说的,比如,getLeft()方法返回了20,这就是说这个view位于他的直接父view左边框的右边20像素的地方

初始化一个layout,可以调用requestLayout()方法,这个方法通常会被view自身调用,在它自己认为不再适合当前的范围的时

Leia SDK

1. 初始化CNSDK

2. 新建布局(layout)

3. 创建布局内容

4. 设置背光

当屏幕捕捉到焦点时,背光开启,人脸识别开启

COM.leia.core

1. public class MatrixUtils

矩阵运算(缩放、平移图片)

MatrixUtils also provides matrix routines needed for pinch-to-zoom and pan gesture support. This includes a helper function to return a matrix for different ScaleTypes.

1) 缩放某个点(getZoomTransform)

2)转换视图(getTranslationTransform)

返回Matrix转换视图的内容

视图变换是将 3D 坐标中的位置转换为图片中坐标位置的变换。

视图变换是一个比较复杂的变换,最好的方式是将它分解为三个简单的变换:

(1)相机变换,将场景变换为以相机为原点的相机空间。

(2)投影变换,将相机空间的可见点投影到 -1 到 1 的 x , y,z 的规范视图体积内。然后只取 x , y 坐标就得到投影( z 坐标用来作深度缓存, z-buffer )。

(3)视口变换,将单位图像矩形映射到像素坐标中的期望矩形

3)getTranslationMatrix  返回Matrix以转换视图

P是Progressive指的是逐行扫描 I是interlace指的是隔行扫描。

逐行优缺点:画面效果肯定是要更好的,但是画面切换的时候会比较突然(一次性画面全变)。

隔行优缺点:省了一半的画面对应的硬件成本能省很多,虽然基本能看吧,但是画面质量肯定是不如逐行的。

4)transformPoint

返回转换后的2D或向量

Returns a 2D point or vector transformed by a matrix.

5) 矩阵转换3*3-4*4

public static float[] FromMatrix​(Matrix matrixIn)
public static Matrix ToMatrix​(float[] matrixIn)

matrix函数的语法是这样  matrix(a, b, c, d, tx, ty)

scale,rotate、translate、skew和matrix

2. 平台初始化参数

public class PlatformInitArgs

3.相机事件

public class SharedCameraSink

释放资源(关闭);通知相机帧数;更改lux值(光照强度);

updateIntrinsics 更新相机内参:

1)相机坐标系转换到像素坐标系中,相机内参的作用

2)从世界坐标系转换到相机坐标系中,相机外参的作用

相机内参一般都是相机出厂就定下来的,可以通过相机标定的方式人为计算出来。

相机外参是旋转矩阵和平移向量构成,这个矩阵决定了相机的位姿。

4. 判断是否有主线程(assert断言)

public static void assertMainThread()

5. 时间

public Timestamp​(long ns, boolean isRealtime)

6. 向量

public Vector2​(float c)
public Vector2i​(int x, int y)
public Vector3​(float x,float y,float z)

7. 枚举日志

显示日志ID、级别、事件ID、内容等

public enum LogLevel
    {
        Trace,
        Debug,
        Information,
        Warning,
        Error,
        Critical,
        None
    }

8. 异常接口

public class NativeError

Package com.leia.headtracking

1. 监听人脸识别追踪

public interface HeadTrackingFrameListener
void onFrame​(@NonNull HeadTrackingFrame frame)


2. 创建人脸识别

public interface HeadTrackingFrameProducer

3. 读取人物特征?

public class CameraCustomCharacteristicReader

4. 头部追踪

public class HeadTrackingFrame

5. 眼部追踪(XY坐标)

public static class HeadTrackingFrame.DetectedEye

6. 脸部追踪

public static class HeadTrackingFrame.DetectedFace

7. 脸部识别

public static class HeadTrackingFrame.Face


8. 移动点(头部)

public static class HeadTrackingFrame.MovingPoint

9. Profiling 性能分析

public static class HeadTrackingFrame.Profiling

10. 脸部原图RawFace

public static class HeadTrackingFrame.RawFace

10. 

public enum FaceDetectorBackend

GPU:叫做图形处理器。图形处理器(英语:Graphics Processing Unit,缩写:GPU),又称显示核心、视觉处理器、显示芯片,是一种专门在个人电脑、工作站、游戏机和一些移动设备(如平板电脑、智能手机等)上做图像和图形相关运算工作

com.leia.headtrackingservice

1. 授权头部跟踪

public static interface PermissionAccessor.Callback

2. 许可

public class Permission

3. 同意许可存储器

public class PermissionAccessor

Package com.leia.sdk

1. 确认对话框

public static interface ConfirmationDialog.ResponseListener

2. 调用Leia SDK

public static interface LeiaSDK.Delegate

fatal error 程序错误; tracking frame脸部跟踪框架开启/结束

3. 配置调用

public final class BuildConfig

4. Config

public class Config

5. 提示框

public class ConfirmationDialog

头部app中提示;客户端中提示

6. 脸部跟踪是否获得允许(若没授权提示框出现)

public class FaceTrackingHelper

7. 调用Leia SDK 接口

public class LeiaSDK

委托(Delegate) 是存有对某个方法的引用的一种引用类型变量。引用可在运行时被改变。

toggle() 切换

8. 初始化Leia配置

public static class LeiaSDK.InitArgs

9. 图像处理

public static class LeiaSDK.ML    

ML组件进行图像处理 :合成多视角图片;单声道到立体声转换器

 Bitmap:

10. 人脸跟踪进程回调

public enum FaceTrackingRuntime

Package com.leia.sdk.graphics

1. 进入或退出单视图时调用

public interface InterlacerSingleViewModeListener

交错扫瞄(隔行扫瞄, Interlaced), 就是一个画面分成两次送出, 先送奇数线的画面后, 再送偶数线,显示时再将它们合成完整画面.

非交错扫瞄(逐行扫瞄, Porgressive), 就是每次都送完整的画面, 不需要奇偶画面重新组合.所以在非交错式显示的萤幕上观看时, 交错画面要把它重组回来, 这个动作叫做 "去交错" (Deinterlaced)

2. 界面文字准备后返回

public interface SurfaceTextureReadyCallback

3. 视图角度

public class ConvergedPerspectiveViewInfo

4. GL内容(3D图形渲染)

public class GLContextTracker

GLContextTracker is a utility class to track GL context validity.

拓展: 如何在Android中实现一个全景图控件(二) - 知乎 (zhihu.com)

EGL 是 OpenGL ES 渲染 API 和本地窗口系统(native platform window system)之间的一个中间接口层,EGL作为OpenGL ES与显示设备的桥梁,让OpenGL ES绘制的内容能够在呈现当前设备上。它主要由系统制造商实现。

5. 隔行扫描 Interlacer

public class Interlacer

6. 渲染目标

public class RenderTarget

在3D计算机图形领域,渲染目标是现代图形处理单元(GPU)的一个特征,它允许将3D场景渲染到中间存储缓冲区或渲染目标纹理(RTT),而不是帧缓冲区或后缓冲区。然后可以通过像素着色器操纵此RTT ,以便在显示最终图像之前将其他效果应用于最终图像
渲染目标是一个缓冲

Linux系统通过Framebuffer(帧缓冲)驱动程序控制LCD。显示设备也被称为帧缓冲设备。Frame表示帧,buffer表示缓冲。这就是说,Framebuffer是一块内存,里面存放着一帧图像,每帧图像包含每个像素颜色值。BPP,像素深度,指存储每个像素所用的位数,通常值为16,24,或32。

Package com.leia.sdk.internal

public class DebugActivity

Android View

Package com.leia.sdk.video

1. 视频播放

public interface MonoVideoMLCallback

SurfaceView 与 TextureView 详解 - 知乎 (zhihu.com)

播放视频或者渲染其他的动画的时候,有两个 View 组件可供选择,SurfaceView 和 TextureView,GLSurfaceView 是 SurfaceView 的子类,在 SurfaceView 基础上封装了 EGL 环境管理以及 Render 线程,专用于 3D 游戏开发的视图,这里归类到 SurfaceView 中。

2. 视频图片处理

public interface MonoVideoMLMethods

Package com.leia.sdk.views

1. GL Binding

public abstract class InputGLBinding

拓展:

OpenGL Context(渲染上下文)及状态值查询_qopenglcontext-CSDN博客

2. glBindTexture 函数支持创建绑定到纹理目标的命名纹理

public static class InputGLBinding.Texture

3. 导入视图

public class InputViewsAsset

4. BitmapHolder

public static class InputViewsAsset.BitmapHolder

Manages Bitmap lifetime and strict access between the main and render threads.

5. 输入视图

public abstract static class InputViewsAsset.Impl

6. Rect act

public class InterlacedRenderer(3D图片已经绘制)

10. 隔行扫描图片确认精确位置

public class InterlacedSurfaceView

拓展: InterlacedSurfaceView interlaces InputViewsAsset for Leia Display. Since interlacing depends on the precise location on the screen of the image, we need to keep the InterlacedSurfaceView up-to-date with its position and size. Currently, the rendering of InterlacedSurfaceView and its presentation on the screen is asynchronous. So animating position and size generally not supported.

11. CPVM人脸识别

public class InterlacedSurfaceViewConfig

3D屏幕特性的值

  • 17
    点赞
  • 25
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值