Lines Matching refs:image
87 // Counts amount of colors in the image, up to 257. If transparent_counts_as_one
91 const unsigned char* image, unsigned w, unsigned h,
95 unsigned index = ColorIndex(&image[i * 4]);
96 if (transparent_counts_as_one && image[i * 4 + 3] == 0) index = 0;
103 void LossyOptimizeTransparent(lodepng::State* inputstate, unsigned char* image,
109 if (image[i * 4 + 3] > 0 && image[i * 4 + 3] < 255) {
115 CountColors(&count, image, w, h, true);
124 if (image[i * 4 + 3] == 0) {
127 // existing in the input image palette is used.
128 r = image[i * 4 + 0];
129 g = image[i * 4 + 1];
130 b = image[i * 4 + 2];
137 if (image[i * 4 + 3] == 0) {
138 image[i * 4 + 0] = r;
139 image[i * 4 + 1] = g;
140 image[i * 4 + 2] = b;
145 r = image[i * 4 + 0];
146 g = image[i * 4 + 1];
147 b = image[i * 4 + 2];
152 // If there are now less colors, update palette of input image to match this.
154 CountColors(&count, image, w, h, false);
177 const std::vector<unsigned char>& image, unsigned w, unsigned h,
239 error = lodepng::encode(*out, image, w, h, state);
261 error = lodepng::encode(out2, image, w, h, state);
277 unsigned AutoChooseFilterStrategy(const std::vector<unsigned char>& image,
296 unsigned error = TryOptimize(image, w, h, inputstate, bit16, origfile,
361 std::vector<unsigned char> image;
365 error = lodepng::decode(image, w, h, inputstate, origpng);
374 bool bit16 = false; // Using 16-bit per channel raw image
377 image.clear();
378 error = lodepng::decode(image, w, h, origpng, LCT_RGBA, 16);
385 LossyOptimizeTransparent(&inputstate, &image[0], w, h);
389 error = AutoChooseFilterStrategy(image, w, h, inputstate, bit16,
404 error = TryOptimize(image, w, h, inputstate, bit16, origpng,