};
float out_data[4 * size];
- EffectChainTester tester(NULL, 1, size);
+ EffectChainTester tester(nullptr, 1, size);
tester.add_input(data, FORMAT_RGBA_POSTMULTIPLIED_ALPHA, COLORSPACE_sRGB, GAMMA_sRGB);
tester.run(out_data, GL_RGBA, COLORSPACE_sRGB, GAMMA_LINEAR);
};
float out_data[4 * width * height];
- EffectChainTester tester(NULL, width, height);
+ EffectChainTester tester(nullptr, width, height);
ImageFormat format;
format.color_space = COLORSPACE_sRGB;
};
float out_data[width * height];
- EffectChainTester tester(NULL, width, height);
+ EffectChainTester tester(nullptr, width, height);
ImageFormat format;
format.color_space = COLORSPACE_sRGB;
glBufferData(GL_PIXEL_UNPACK_BUFFER_ARB, width * height * sizeof(float), data, GL_STREAM_DRAW);
glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, 0);
- EffectChainTester tester(NULL, width, height);
+ EffectChainTester tester(nullptr, width, height);
ImageFormat format;
format.color_space = COLORSPACE_sRGB;
};
float out_data[4 * size];
- EffectChainTester tester(NULL, 1, size, FORMAT_RGB, COLORSPACE_sRGB, GAMMA_LINEAR);
+ EffectChainTester tester(nullptr, 1, size, FORMAT_RGB, COLORSPACE_sRGB, GAMMA_LINEAR);
ImageFormat format;
format.color_space = COLORSPACE_sRGB;
expect_equal(expected_data, out_data, 4, size);
}
+TEST(FlatInput, NoData) {
+ const int width = 2;
+ const int height = 4;
+
+ float out_data[width * height];
+
+ EffectChainTester tester(nullptr, width, height);
+
+ ImageFormat format;
+ format.color_space = COLORSPACE_sRGB;
+ format.gamma_curve = GAMMA_LINEAR;
+
+ FlatInput *input = new FlatInput(format, FORMAT_GRAYSCALE, GL_FLOAT, width, height);
+ tester.get_chain()->add_input(input);
+
+ tester.run(out_data, GL_RED, COLORSPACE_sRGB, GAMMA_LINEAR);
+
+ // Don't care what the output was, just that it does not crash.
+}
+
} // namespace movit