Lines Matching defs:depth
63 * the buffer based on width, height, number of colors and depth. The buffer
70 * Multi-color data with a bit depth of 1 are packed in single color bytes, so
116 * @param depth number of bits of a color
122 sanei_pieusb_buffer_create(struct Pieusb_Read_Buffer* buffer, SANE_Int width, SANE_Int height, SANE_Byte color_spec, SANE_Byte depth)
140 buffer->depth = depth;
141 if (depth < 1 || depth > 16) {
142 DBG(DBG_error, "sanei_pieusb_buffer_create(): unsupported depth %d\n", depth);
145 buffer->packing_density = (depth == 1) ? 8 : 1; /* These are all the situations we have */
148 buffer->packet_size_bytes = (buffer->depth * buffer->packing_density + 7) / 8;
225 DBG(DBG_info,"pieusb: Read buffer created: w=%d h=%d ncol=%d depth=%d in file %s\n",
226 buffer->width, buffer->height, buffer->colors, buffer->depth, buffer->buffer_name);
254 buffer->depth = 0;
333 uint8_t mask = ~(0xFF >> buffer->depth); /* byte with depth most significant bits set */
339 * buffer->depth * packing_density <= # bits in packet.
342 /* Take 1st depth bits and store in val */
343 val = (packet[0] & mask) >> (8-buffer->depth);
344 /* Now shift packet bytes depth bits left */
347 packet[m] <<= buffer->depth;
349 /* If there are more bytes, insert 1st depth bits of next byte */
350 packet[m] |= (packet[m+1] >> (8-buffer->depth));
426 uint8_t mask = ~(0xFF >> buffer->depth); /* byte with depth most significant bits set */
437 * buffer->depth * packing_density <= # bits in packet.
440 /* Take 1st depth bits and store in val */
441 val = (packet[0] & mask) >> (8-buffer->depth);
443 /* Now shift packet bytes depth bits left */
446 packet[m] <<= buffer->depth;
449 /* If there are more bytes, insert 1st depth bits of next byte */
450 packet[m] |= (packet[m+1] >> (8-buffer->depth));
605 DBG(DBG_info_buffer," width/height/colors/depth = %d %d %d %d (buffer size %d)\n",
606 buffer->width, buffer->height, buffer->colors, buffer->depth, buffer->image_size_bytes);