| 34 | Nan::Persistent<FunctionTemplate> Image::constructor_template; |
| 35 | |
| 36 | PIX *pixFromSource(uint8_t *pixSource, int32_t width, int32_t height, int32_t depth, int32_t targetDepth) |
| 37 | { |
| 38 | // Create PIX and copy pixels from source. |
| 39 | PIX *pix = pixCreateNoInit(width, height, targetDepth); |
| 40 | uint32_t *line = pix->data; |
| 41 | for (uint32_t y = 0; y < pix->h; ++y) { |
| 42 | for (uint32_t x = 0; x < pix->w; ++x) { |
| 43 | if (pix->d == 8) { |
| 44 | SET_DATA_BYTE(line, x, pixSource[0]); |
| 45 | } else { |
| 46 | composeRGBPixel(pixSource[0], pixSource[1], pixSource[2], &line[x]); |
| 47 | } |
| 48 | pixSource += depth / 8; |
| 49 | } |
| 50 | line += pix->wpl; |
| 51 | } |
| 52 | return pix; |
| 53 | } |
| 54 | |
| 55 | PIX *pixInRange(PIX *pixs, l_int32 val1l, l_int32 val2l, l_int32 val3l, l_int32 val1u, l_int32 val2u, l_int32 val3u) |
| 56 | { |
no test coverage detected