标签: post-processing

如何绕过 GL_MAX_TEXTURE_SIZE 进行图像处理

我正在开发一个依赖于 OpenGL ES 2.0 的图像处理程序,因此它可以部署在多种设备上。在许多情况下,人们会使用小图像,这不会绕过纹理限制,但对于每个方向都有数千像素的较大图像,它可能无法在多个设备上渲染。

我的第一个想法是将图像分割成更小的方块并单独渲染每个方块,这适用于简单的程序,但对于需要基于相邻像素值(例如卷积或扭曲效果)进行渲染的任务,这还不够。

Photoshop 如何通过在其应用程序中添加 OpenGL 支持来实现许多效果,从而保持其 300,000 x 300,000 尺寸功能?

对大于 GL_MAX_TEXTURE_SIZE 的图像执行后处理任务的最有效方法是什么?

在发送图像进行处理之前仅渲染到可视区域并重新缩放图像以进行缩放?但这需要我重新处理图像以进行简单的放大/缩小和平移图像。我发现这种方法的唯一问题是无法将图像导出为全质量图像,因此这种方法在用户尝试保存其工作之前一直有效。

opengl-es glsl post-processing

5
推荐指数
1
解决办法
642
查看次数

如何对 HTML 进行后处理以向 Ruby 中的所有链接添加“目标空白”?

如何对 HTML 进行后处理以向 Ruby 中的所有链接添加“目标空白”?

我目前正在使用 Rinku (gem) 自动链接文本,效果很好。

但是,我正在对 HTML 进行后期处理,并且有些链接已经是链接,因此未使用 Rinku 进行处理。

我怎样才能将目标空白属性添加到那些?

应用控制器.rb

def text_renderer text
  AutoHTML.new(text).render
end
Run Code Online (Sandbox Code Playgroud)

auto_html.rb

class AutoHTML
  include ActionView::Helpers

  def initialize text
    @text = text
  end

  def render
    text = prepare @text
    text = auto_link(text)
    text.html_safe
  end

  private

  def prepare text
    if text.nil? || text.empty?
      ""
    else
      text
    end
  end

  def auto_link text
    Rinku.auto_link(text, :all, 'target="_blank"')
  end
end
Run Code Online (Sandbox Code Playgroud)

html ruby ruby-on-rails post-processing

5
推荐指数
1
解决办法
839
查看次数

Spring的上下文命名空间如何工作?

例如,如果我在application-context.xml中声明:

<context:annotation-config/>
Run Code Online (Sandbox Code Playgroud)

我从官方文件中读到:

在隐式注册后处理器包括AutowiredAnnotationBeanPostProcessor,CommonAnnotationBeanPostProcessor会,PersistenceAnnotationBeanPostProcessor,以及上述RequiredAnnotationBeanPostProcessor.

但我想知道Spring是如何工作的,我认为这个1-liner被转换为文档中提到的后处理器的几个bean定义.

但是,我的问题是,哪个Spring组件/类实现了"从1-liner到多个bean定义的转换"功能?

java spring xml-namespaces post-processing applicationcontext

4
推荐指数
1
解决办法
2805
查看次数

如何在jmeter中获得常规提取表达式中的最后一个匹配?

我想在Jmeter中提取正则表达式的最后一次出现.我使用Regular Extractor表达式执行此操作,但我无法获得最后一次出现.

我试过这个:

  • 正则表达式:"var1":( [^"] +),"var2"
  • 模板:1美元
  • 匹配号:-1
  • 默认值:expression_matchNr

然后在我的脚本中我使用了$ {expression}变量

我已经测试了expression_matchNr,但它给了我匹配的数量.

我应该在" 匹配号码 "中加入什么?

提前致谢

regex jmeter post-processing

4
推荐指数
1
解决办法
2540
查看次数

是否可以使用汇总来仅处理 css?

我知道 Rollup 用于捆绑 .js 文件。但是是否可以仅使用它来处理 css?(css、scss、less 等)。我的意思是,如果我的 src 文件夹(入口文件夹)中有一个名为 index.css 的文件,并且我希望汇总在 dist 文件夹(输出文件夹)中处理它,如 index.css(但已处理,例如如果有一个导入的 .sass 文件或 css 变量)。我怎样才能做到这一点?

示例rollup.config.js

import { uglify } from 'rollup-plugin-uglify'
import babel from 'rollup-plugin-babel'
import resolve from 'rollup-plugin-node-resolve';
import postcss from 'rollup-plugin-postcss'

const config = [
  {
    input: 'src/styles/index.scss',
    output: {
      file: 'dist/style.css',
      name: "style",
    },
    plugins: [
      postcss({
        plugins: []
      })
    ]
  },
];

export default config
Run Code Online (Sandbox Code Playgroud)

src/index.css

@import 'other';

h1 {
  color: green;
}
Run Code Online (Sandbox Code Playgroud)

源代码/其他.css

h2 {
  color: red;
}
Run Code Online (Sandbox Code Playgroud)

并且在 …

css rollup sass post-processing rollupjs

4
推荐指数
1
解决办法
5080
查看次数

如何阻止EffectComposer破坏我的透明背景?

我想要一个透明背景的threejs帆布.我正在创建一个这样的渲染器:

# coffeescript
r = new THREE.WebGLRenderer alpha: true
Run Code Online (Sandbox Code Playgroud)

当我打电话时r.render(),它按预期工作,对象出现在透明背景上.但是,当我尝试使用EffectComposer添加后处理时,如下所示:

cmp = new THREE.EffectComposer r
cmp.addPass new THREE.RenderPass scene, camera

effect = new THREE.FilmPass 0.9, 2, 2048, true
effect.renderToScreen = true
cmp.addPass effect

cmp.render 3
Run Code Online (Sandbox Code Playgroud)

新的结果是场景按预期渲染(对象正确应用了影片效果),除了背景不再是所需的透明...而是黑色和不透明.为什么?如何防止后期处理篡改我的透明背景?

3d render post-processing webgl three.js

3
推荐指数
1
解决办法
1370
查看次数

Spring Boot会为另一个项目抛出带有maven依赖关系的ClassNotFoundException

我有Spring Boot项目,EnvironmentPostProcessor实现简单:

package com.example.demo;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.env.EnvironmentPostProcessor;
import org.springframework.core.env.ConfigurableEnvironment;

public class DevProfilerResolverEnvironmentPostProcessor implements EnvironmentPostProcessor {

        @Override
        public void postProcessEnvironment(ConfigurableEnvironment configurableEnvironment, SpringApplication springApplication) {
            if (configurableEnvironment.getActiveProfiles().length == 0) {
                if (System.getenv().get("OS").contains("Windows")) {
                    configurableEnvironment.addActiveProfile("DEV");
                }
            }
        }
    }
Run Code Online (Sandbox Code Playgroud)

另外,我将这个课程注册到sprig.factories:

org.springframework.boot.env.EnvironmentPostProcessor = com.example.demo.DevProfilerResolverEnvironmentPostProcessor
Run Code Online (Sandbox Code Playgroud)

现在结构看起来像:

在此输入图像描述

来自pom文件的片段:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
    http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.example</groupId>
    <artifactId>demo</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>demo</name>
    <description>Demo project for Spring Boot</description>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.5.4.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
Run Code Online (Sandbox Code Playgroud)

我和Maven一起执行:

mvn安装 …

java post-processing maven spring-profiles spring-boot

3
推荐指数
1
解决办法
1174
查看次数

用Effect Composer处理Three.js的图像处理

看一下这里的例子:http://threejs.org/examples/#webgl_postprocessing

我很好奇是否有办法在原始数据集的副本上执行此后处理业务.换句话说,我想在一个容器中显示我的场景的原始渲染,然后想在另一个容器中显示后处理的场景.这是怎么做到的?

谢谢!

javascript post-processing webgl three.js

2
推荐指数
1
解决办法
7789
查看次数

HLSL:高斯模糊效果

我正在尝试使用后处理实现高斯模糊。我有两个渲染通道;第一个通道渲染场景,第二个通道用于效果。

这是我的像素着色器代码:

const float offset[] = {
    0.0, 1.0, 2.0, 3.0, 4.0
    };
    const float weight[] = {
      0.2270270270, 0.1945945946, 0.1216216216,
      0.0540540541, 0.0162162162
    };
    ppColour = SceneTexture.Sample(PointSample, ppIn.UV) * weight[0];
    float3 FragmentColor = float3(0.0f, 0.0f, 0.0f);

    for (int i = 1; i < 5; i++) {
        // Horizontal-pass
        FragmentColor +=
            SceneTexture.Sample(PointSample, ppIn.UV + float2(0.0f, offset[i]))*weight[i] +
            SceneTexture.Sample(PointSample, ppIn.UV - float2(0.0f, offset[i]))*weight[i];      
            // Vertical-pass
        FragmentColor +=
            SceneTexture.Sample(PointSample, ppIn.UV + float2(offset[i], 0.0f))*weight[i] +
            SceneTexture.Sample(PointSample, ppIn.UV - float2(offset[i], 0.0f))*weight[i];
        }
ppColour += FragmentColor; …
Run Code Online (Sandbox Code Playgroud)

directx hlsl post-processing pixel-shader

2
推荐指数
1
解决办法
2万
查看次数

在后处理中启用 Unity3D xCode 项目的功能

我有一个 Unity3D iOS 项目,我在其中使用游戏中心和应用内购买(通过第三方插件),但是当我将 Unity3D 项目构建到 xCode 中时,在功能部分中,游戏中心和应用内购买被禁用。我需要在 PostProcessBuild 方法中启用它们。我尝试通过以下代码使用 xCodeApi:

   string projPath = PBXProject.GetPBXProjectPath(pathToBuiltProject);
   PBXProject proj = new PBXProject();

   proj.ReadFromString(File.ReadAllText(projPath));
   string target = proj.TargetGuidByName("Unity-iPhone");

   proj.AddCapability (target, PBXCapabilityType.GameCenter);
   proj.AddCapability (target, PBXCapabilityType.InAppPurchase);

   File.WriteAllText(projPath, proj.ToString());
Run Code Online (Sandbox Code Playgroud)

但是在此之后 xCode 无法打开创建的项目(它只是立即崩溃)。如何添加这两个功能而不在 xCode 中手动设置它们?

xcode unity-game-engine post-processing ios

2
推荐指数
2
解决办法
8783
查看次数