MCPcopy Create free account
hub / github.com/creatale/node-dv / pixFromSource

Function pixFromSource

src/image.cc:36–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34Nan::Persistent<FunctionTemplate> Image::constructor_template;
35
36PIX *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
55PIX *pixInRange(PIX *pixs, l_int32 val1l, l_int32 val2l, l_int32 val3l, l_int32 val1u, l_int32 val2u, l_int32 val3u)
56{

Callers 1

NAN_METHODFunction · 0.85

Calls 2

pixCreateNoInitFunction · 0.85
composeRGBPixelFunction · 0.50

Tested by

no test coverage detected