图片未包含“ PIXEL_FORMAT”的定义

时间:2019-11-07 05:24:59

标签: unity3d zxing vuforia zxing.net

我已尝试在此答案here

中为QR码阅读器测试c#代码

我只是将代码复制粘贴到C#脚本中,然后像KDelli所说的那样将其放置在ARCamera预制中,但是我一直遇到这个错误:

  

错误CS0117:“图像”不包含“ PIXEL_FORMAT”的定义

从这两行:

private IEnumerator InitializeCamera() {
    var isFrameFormatSet = CameraDevice.Instance.SetFrameFormat(Image.PIXEL_FORMAT.RGB888, true);
}
private void Update() {
    var cameraFeed = CameraDevice.Instance.GetCameraImage(Image.PIXEL_FORMAT.RGB888);
}

我认为我只是错过了类似using代码/库的内容,或者可能是由于代码太旧而导致出现此错误。

2 个答案:

答案 0 :(得分:1)

@Override protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws ServletException, IOException { final String requestTokenHeader = request.getHeader("Authorization"); String username = null; String jwtToken = null; // JWT Token is in the form "Bearer token". Remove Bearer word and get // only the Token if (requestTokenHeader != null && requestTokenHeader.startsWith("Bearer ")) { jwtToken = requestTokenHeader.substring(7); try { username = jwtTokenUtil.getUsernameFromToken(jwtToken); } catch (IllegalArgumentException e) { System.out.println("Unable to get JWT Token"); } catch (ExpiredJwtException e) { System.out.println("JWT Token has expired"); } } else { logger.warn("JWT Token does not begin with Bearer String"); } // Once we get the token validate it. if (username != null && SecurityContextHolder.getContext().getAuthentication() == null) { UserDetails userDetails = this.jwtUserDetailsService.loadUserByUsername(username); // if token is valid configure Spring Security to manually set // authentication if (jwtTokenUtil.validateToken(jwtToken, userDetails)) { UsernamePasswordAuthenticationToken usernamePasswordAuthenticationToken = new UsernamePasswordAuthenticationToken( userDetails, null, userDetails.getAuthorities()); usernamePasswordAuthenticationToken .setDetails(new WebAuthenticationDetailsSource().buildDetails(request)); // After setting the Authentication in the context, we specify // that the current user is authenticated. So it passes the // Spring Security Configurations successfully. SecurityContextHolder.getContext().setAuthentication(usernamePasswordAuthenticationToken); } } chain.doFilter(request, response); } 已从http://localhost:8080/users/testUser移到JsonNode result = new ObjectMapper().readTree(e.toString()); 。因此,如果要导入Vuforia,则可以使用PIXEL_FORMAT代替Image

有关更多信息,您可以找到最新的API here

答案 1 :(得分:1)

这对我有帮助:

通过将image.PIXEL_FORMAT更改为PIXEL_FORMAT

谢谢