Mercurial > hg > orthanc
comparison OrthancServer/Sources/OrthancRestApi/OrthancRestResources.cpp @ 5338:78c59b02b121
accept parameters are now provided to HttpContentNegociation::IHandler::Handle()
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 28 Jun 2023 08:29:43 +0200 |
parents | 8686476e9d12 |
children | 92ebf6a10cb5 |
comparison
equal
deleted
inserted
replaced
5337:b376abae664a | 5338:78c59b02b121 |
---|---|
637 explicit EncodePng(ImageToEncode& image) : image_(image) | 637 explicit EncodePng(ImageToEncode& image) : image_(image) |
638 { | 638 { |
639 } | 639 } |
640 | 640 |
641 virtual void Handle(const std::string& type, | 641 virtual void Handle(const std::string& type, |
642 const std::string& subtype) ORTHANC_OVERRIDE | 642 const std::string& subtype, |
643 const HttpContentNegociation::Dictionary& parameters) ORTHANC_OVERRIDE | |
643 { | 644 { |
644 assert(type == "image"); | 645 assert(type == "image"); |
645 assert(subtype == "png"); | 646 assert(subtype == "png"); |
646 image_.EncodeUsingPng(); | 647 image_.EncodeUsingPng(); |
647 } | 648 } |
656 explicit EncodePam(ImageToEncode& image) : image_(image) | 657 explicit EncodePam(ImageToEncode& image) : image_(image) |
657 { | 658 { |
658 } | 659 } |
659 | 660 |
660 virtual void Handle(const std::string& type, | 661 virtual void Handle(const std::string& type, |
661 const std::string& subtype) ORTHANC_OVERRIDE | 662 const std::string& subtype, |
663 const HttpContentNegociation::Dictionary& parameters) ORTHANC_OVERRIDE | |
662 { | 664 { |
663 assert(type == "image"); | 665 assert(type == "image"); |
664 assert(subtype == "x-portable-arbitrarymap"); | 666 assert(subtype == "x-portable-arbitrarymap"); |
665 image_.EncodeUsingPam(); | 667 image_.EncodeUsingPam(); |
666 } | 668 } |
696 "Bad quality for a JPEG encoding (must be a number between 0 and 100): " + v); | 698 "Bad quality for a JPEG encoding (must be a number between 0 and 100): " + v); |
697 } | 699 } |
698 } | 700 } |
699 | 701 |
700 virtual void Handle(const std::string& type, | 702 virtual void Handle(const std::string& type, |
701 const std::string& subtype) ORTHANC_OVERRIDE | 703 const std::string& subtype, |
704 const HttpContentNegociation::Dictionary& parameters) ORTHANC_OVERRIDE | |
702 { | 705 { |
703 assert(type == "image"); | 706 assert(type == "image"); |
704 assert(subtype == "jpeg"); | 707 assert(subtype == "jpeg"); |
705 image_.EncodeUsingJpeg(quality_); | 708 image_.EncodeUsingJpeg(quality_); |
706 } | 709 } |