• Home
  • Raw
  • Download

Lines Matching full:header

25 static void	print_changes(cups_page_header2_t *header, cups_page_header2_t *expected);
68 cups_page_header2_t header; /* Page header */ in do_ras_file() local
89 while (cupsRasterReadHeader2(ras, &header)) in do_ras_file()
92 data = malloc(header.cupsBytesPerLine); in do_ras_file()
95 header.cupsWidth, header.cupsHeight, header.cupsBitsPerPixel, in do_ras_file()
96 header.HWResolution[0], header.HWResolution[1]); in do_ras_file()
99 for (y = 0; y < header.cupsHeight; y ++) in do_ras_file()
100 if (cupsRasterReadPixels(ras, data, header.cupsBytesPerLine) < in do_ras_file()
101 header.cupsBytesPerLine) in do_ras_file()
104 if (y < header.cupsHeight) in do_ras_file()
131 cups_page_header2_t header, /* Page header */ in do_raster_tests() local
132 expected; /* Expected page header */ in do_raster_tests()
165 memset(&header, 0, sizeof(header)); in do_raster_tests()
166 header.cupsWidth = 256; in do_raster_tests()
167 header.cupsHeight = 256; in do_raster_tests()
168 header.cupsBytesPerLine = 256; in do_raster_tests()
169 header.HWResolution[0] = 64; in do_raster_tests()
170 header.HWResolution[1] = 64; in do_raster_tests()
171 header.PageSize[0] = 288; in do_raster_tests()
172 header.PageSize[1] = 288; in do_raster_tests()
173 header.cupsPageSize[0] = 288.0f; in do_raster_tests()
174 header.cupsPageSize[1] = 288.0f; in do_raster_tests()
176 strlcpy(header.MediaType, "auto", sizeof(header.MediaType)); in do_raster_tests()
180 header.cupsBytesPerLine *= 4; in do_raster_tests()
181 header.cupsColorSpace = CUPS_CSPACE_CMYK; in do_raster_tests()
182 header.cupsColorOrder = CUPS_ORDER_CHUNKED; in do_raster_tests()
183 header.cupsNumColors = 4; in do_raster_tests()
187 header.cupsColorSpace = CUPS_CSPACE_W; in do_raster_tests()
188 header.cupsColorOrder = CUPS_ORDER_CHUNKED; in do_raster_tests()
189 header.cupsNumColors = 1; in do_raster_tests()
194 header.cupsBytesPerLine *= 2; in do_raster_tests()
195 header.cupsBitsPerColor = 16; in do_raster_tests()
196 header.cupsBitsPerPixel = (page & 1) ? 64 : 16; in do_raster_tests()
200 header.cupsBitsPerColor = 8; in do_raster_tests()
201 header.cupsBitsPerPixel = (page & 1) ? 32 : 8; in do_raster_tests()
206 if (cupsRasterWriteHeader2(r, &header)) in do_raster_tests()
219 memset(data, 0, header.cupsBytesPerLine); in do_raster_tests()
221 if (!cupsRasterWritePixels(r, data, header.cupsBytesPerLine)) in do_raster_tests()
231 for (x = 0; x < header.cupsBytesPerLine; x ++) in do_raster_tests()
235 if (!cupsRasterWritePixels(r, data, header.cupsBytesPerLine)) in do_raster_tests()
245 memset(data, 255, header.cupsBytesPerLine); in do_raster_tests()
247 if (!cupsRasterWritePixels(r, data, header.cupsBytesPerLine)) in do_raster_tests()
257 for (x = 0; x < header.cupsBytesPerLine; x ++) in do_raster_tests()
261 if (!cupsRasterWritePixels(r, data, header.cupsBytesPerLine)) in do_raster_tests()
355 if (!cupsRasterReadHeader2(r, &header)) in do_raster_tests()
361 else if (memcmp(&header, &expected, sizeof(header))) in do_raster_tests()
363 puts("FAIL (bad page header)"); in do_raster_tests()
365 print_changes(&header, &expected); in do_raster_tests()
375 if (!cupsRasterReadPixels(r, data, header.cupsBytesPerLine)) in do_raster_tests()
382 if (data[0] != 0 || memcmp(data, data + 1, header.cupsBytesPerLine - 1)) in do_raster_tests()
386 for (x = 0, count = 0; x < header.cupsBytesPerLine && count < 10; x ++) in do_raster_tests()
408 if (!cupsRasterReadPixels(r, data, header.cupsBytesPerLine)) in do_raster_tests()
415 for (x = 0; x < header.cupsBytesPerLine; x ++) in do_raster_tests()
419 if (x < header.cupsBytesPerLine) in do_raster_tests()
423 for (x = 0, count = 0; x < header.cupsBytesPerLine && count < 10; x ++) in do_raster_tests()
445 if (!cupsRasterReadPixels(r, data, header.cupsBytesPerLine)) in do_raster_tests()
452 if (data[0] != 255 || memcmp(data, data + 1, header.cupsBytesPerLine - 1)) in do_raster_tests()
456 for (x = 0, count = 0; x < header.cupsBytesPerLine && count < 10; x ++) in do_raster_tests()
478 if (!cupsRasterReadPixels(r, data, header.cupsBytesPerLine)) in do_raster_tests()
485 for (x = 0; x < header.cupsBytesPerLine; x ++) in do_raster_tests()
489 if (x < header.cupsBytesPerLine) in do_raster_tests()
493 for (x = 0, count = 0; x < header.cupsBytesPerLine && count < 10; x ++) in do_raster_tests()
526 * 'print_changes()' - Print differences in the page header.
531 cups_page_header2_t *header, /* I - Actual page header */ in print_changes() argument
532 cups_page_header2_t *expected) /* I - Expected page header */ in print_changes()
537 if (strcmp(header->MediaClass, expected->MediaClass)) in print_changes()
538 printf(" MediaClass (%s), expected (%s)\n", header->MediaClass, in print_changes()
541 if (strcmp(header->MediaColor, expected->MediaColor)) in print_changes()
542 printf(" MediaColor (%s), expected (%s)\n", header->MediaColor, in print_changes()
545 if (strcmp(header->MediaType, expected->MediaType)) in print_changes()
546 printf(" MediaType (%s), expected (%s)\n", header->MediaType, in print_changes()
549 if (strcmp(header->OutputType, expected->OutputType)) in print_changes()
550 printf(" OutputType (%s), expected (%s)\n", header->OutputType, in print_changes()
553 if (header->AdvanceDistance != expected->AdvanceDistance) in print_changes()
554 printf(" AdvanceDistance %d, expected %d\n", header->AdvanceDistance, in print_changes()
557 if (header->AdvanceMedia != expected->AdvanceMedia) in print_changes()
558 printf(" AdvanceMedia %d, expected %d\n", header->AdvanceMedia, in print_changes()
561 if (header->Collate != expected->Collate) in print_changes()
562 printf(" Collate %d, expected %d\n", header->Collate, in print_changes()
565 if (header->CutMedia != expected->CutMedia) in print_changes()
566 printf(" CutMedia %d, expected %d\n", header->CutMedia, in print_changes()
569 if (header->Duplex != expected->Duplex) in print_changes()
570 printf(" Duplex %d, expected %d\n", header->Duplex, in print_changes()
573 if (header->HWResolution[0] != expected->HWResolution[0] || in print_changes()
574 header->HWResolution[1] != expected->HWResolution[1]) in print_changes()
576 header->HWResolution[0], header->HWResolution[1], in print_changes()
579 if (memcmp(header->ImagingBoundingBox, expected->ImagingBoundingBox, in print_changes()
580 sizeof(header->ImagingBoundingBox))) in print_changes()
582 header->ImagingBoundingBox[0], in print_changes()
583 header->ImagingBoundingBox[1], in print_changes()
584 header->ImagingBoundingBox[2], in print_changes()
585 header->ImagingBoundingBox[3], in print_changes()
591 if (header->InsertSheet != expected->InsertSheet) in print_changes()
592 printf(" InsertSheet %d, expected %d\n", header->InsertSheet, in print_changes()
595 if (header->Jog != expected->Jog) in print_changes()
596 printf(" Jog %d, expected %d\n", header->Jog, in print_changes()
599 if (header->LeadingEdge != expected->LeadingEdge) in print_changes()
600 printf(" LeadingEdge %d, expected %d\n", header->LeadingEdge, in print_changes()
603 if (header->Margins[0] != expected->Margins[0] || in print_changes()
604 header->Margins[1] != expected->Margins[1]) in print_changes()
606 header->Margins[0], header->Margins[1], in print_changes()
609 if (header->ManualFeed != expected->ManualFeed) in print_changes()
610 printf(" ManualFeed %d, expected %d\n", header->ManualFeed, in print_changes()
613 if (header->MediaPosition != expected->MediaPosition) in print_changes()
614 printf(" MediaPosition %d, expected %d\n", header->MediaPosition, in print_changes()
617 if (header->MediaWeight != expected->MediaWeight) in print_changes()
618 printf(" MediaWeight %d, expected %d\n", header->MediaWeight, in print_changes()
621 if (header->MirrorPrint != expected->MirrorPrint) in print_changes()
622 printf(" MirrorPrint %d, expected %d\n", header->MirrorPrint, in print_changes()
625 if (header->NegativePrint != expected->NegativePrint) in print_changes()
626 printf(" NegativePrint %d, expected %d\n", header->NegativePrint, in print_changes()
629 if (header->NumCopies != expected->NumCopies) in print_changes()
630 printf(" NumCopies %d, expected %d\n", header->NumCopies, in print_changes()
633 if (header->Orientation != expected->Orientation) in print_changes()
634 printf(" Orientation %d, expected %d\n", header->Orientation, in print_changes()
637 if (header->OutputFaceUp != expected->OutputFaceUp) in print_changes()
638 printf(" OutputFaceUp %d, expected %d\n", header->OutputFaceUp, in print_changes()
641 if (header->PageSize[0] != expected->PageSize[0] || in print_changes()
642 header->PageSize[1] != expected->PageSize[1]) in print_changes()
644 header->PageSize[0], header->PageSize[1], in print_changes()
647 if (header->Separations != expected->Separations) in print_changes()
648 printf(" Separations %d, expected %d\n", header->Separations, in print_changes()
651 if (header->TraySwitch != expected->TraySwitch) in print_changes()
652 printf(" TraySwitch %d, expected %d\n", header->TraySwitch, in print_changes()
655 if (header->Tumble != expected->Tumble) in print_changes()
656 printf(" Tumble %d, expected %d\n", header->Tumble, in print_changes()
659 if (header->cupsWidth != expected->cupsWidth) in print_changes()
660 printf(" cupsWidth %d, expected %d\n", header->cupsWidth, in print_changes()
663 if (header->cupsHeight != expected->cupsHeight) in print_changes()
664 printf(" cupsHeight %d, expected %d\n", header->cupsHeight, in print_changes()
667 if (header->cupsMediaType != expected->cupsMediaType) in print_changes()
668 printf(" cupsMediaType %d, expected %d\n", header->cupsMediaType, in print_changes()
671 if (header->cupsBitsPerColor != expected->cupsBitsPerColor) in print_changes()
672 printf(" cupsBitsPerColor %d, expected %d\n", header->cupsBitsPerColor, in print_changes()
675 if (header->cupsBitsPerPixel != expected->cupsBitsPerPixel) in print_changes()
676 printf(" cupsBitsPerPixel %d, expected %d\n", header->cupsBitsPerPixel, in print_changes()
679 if (header->cupsBytesPerLine != expected->cupsBytesPerLine) in print_changes()
680 printf(" cupsBytesPerLine %d, expected %d\n", header->cupsBytesPerLine, in print_changes()
683 if (header->cupsColorOrder != expected->cupsColorOrder) in print_changes()
684 printf(" cupsColorOrder %d, expected %d\n", header->cupsColorOrder, in print_changes()
687 if (header->cupsColorSpace != expected->cupsColorSpace) in print_changes()
688 printf(" cupsColorSpace %d, expected %d\n", header->cupsColorSpace, in print_changes()
691 if (header->cupsCompression != expected->cupsCompression) in print_changes()
692 printf(" cupsCompression %d, expected %d\n", header->cupsCompression, in print_changes()
695 if (header->cupsRowCount != expected->cupsRowCount) in print_changes()
696 printf(" cupsRowCount %d, expected %d\n", header->cupsRowCount, in print_changes()
699 if (header->cupsRowFeed != expected->cupsRowFeed) in print_changes()
700 printf(" cupsRowFeed %d, expected %d\n", header->cupsRowFeed, in print_changes()
703 if (header->cupsRowStep != expected->cupsRowStep) in print_changes()
704 printf(" cupsRowStep %d, expected %d\n", header->cupsRowStep, in print_changes()
707 if (header->cupsNumColors != expected->cupsNumColors) in print_changes()
708 printf(" cupsNumColors %d, expected %d\n", header->cupsNumColors, in print_changes()
711 if (fabs(header->cupsBorderlessScalingFactor - expected->cupsBorderlessScalingFactor) > 0.001) in print_changes()
713 header->cupsBorderlessScalingFactor, in print_changes()
716 if (fabs(header->cupsPageSize[0] - expected->cupsPageSize[0]) > 0.001 || in print_changes()
717 fabs(header->cupsPageSize[1] - expected->cupsPageSize[1]) > 0.001) in print_changes()
719 header->cupsPageSize[0], header->cupsPageSize[1], in print_changes()
722 if (fabs(header->cupsImagingBBox[0] - expected->cupsImagingBBox[0]) > 0.001 || in print_changes()
723 fabs(header->cupsImagingBBox[1] - expected->cupsImagingBBox[1]) > 0.001 || in print_changes()
724 fabs(header->cupsImagingBBox[2] - expected->cupsImagingBBox[2]) > 0.001 || in print_changes()
725 fabs(header->cupsImagingBBox[3] - expected->cupsImagingBBox[3]) > 0.001) in print_changes()
727 header->cupsImagingBBox[0], header->cupsImagingBBox[1], in print_changes()
728 header->cupsImagingBBox[2], header->cupsImagingBBox[3], in print_changes()
733 if (header->cupsInteger[i] != expected->cupsInteger[i]) in print_changes()
734 printf(" cupsInteger%d %d, expected %d\n", i, header->cupsInteger[i], in print_changes()
738 if (fabs(header->cupsReal[i] - expected->cupsReal[i]) > 0.001) in print_changes()
739 printf(" cupsReal%d %g, expected %g\n", i, header->cupsReal[i], in print_changes()
743 if (strcmp(header->cupsString[i], expected->cupsString[i])) in print_changes()
745 header->cupsString[i], expected->cupsString[i]); in print_changes()
747 if (strcmp(header->cupsMarkerType, expected->cupsMarkerType)) in print_changes()
748 printf(" cupsMarkerType (%s), expected (%s)\n", header->cupsMarkerType, in print_changes()
751 if (strcmp(header->cupsRenderingIntent, expected->cupsRenderingIntent)) in print_changes()
753 header->cupsRenderingIntent, in print_changes()
756 if (strcmp(header->cupsPageSizeName, expected->cupsPageSizeName)) in print_changes()
758 header->cupsPageSizeName, in print_changes()